org.fuin.kickstart4j
Class RemoteFile

java.lang.Object
  extended by org.fuin.kickstart4j.RemoteFile

public final class RemoteFile
extends java.lang.Object

Remote file.


Constructor Summary
RemoteFile(java.lang.String srcFileUrlStr, java.lang.String destPath, java.lang.String destFilename, boolean errorIfNotFound)
          Constructor with all arguments.
RemoteFile(java.net.URL srcFileUrl, java.lang.String destPath, java.lang.String destFilename, boolean errorIfNotFound)
          Constructor with all arguments.
RemoteFile(java.net.URL srcFileUrl, java.lang.String destPath, java.lang.String destFilename, boolean errorIfNotFound, java.lang.String md5Hash, long length)
          Constructor with all arguments.
 
Method Summary
 java.lang.String getDestFilename()
          Returns the filename at the destination.
 java.lang.String getDestPath()
          Returns the (relative) path at the destination.
 java.lang.String getDestSlashPath()
          Returns the (relative) path at the destination.
 long getLength()
          Returns the size of the file.
 java.lang.String getMd5Hash()
          Returns the MD5 hash of the file.
 java.net.URL getSrcFileUrl()
          Returns the URL of the remote file.
 boolean isErrorIfNotFound()
          Returns if the copy process will be aborted when this file was not found at the srcFileUrl.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFile

public RemoteFile(java.lang.String srcFileUrlStr,
                  java.lang.String destPath,
                  java.lang.String destFilename,
                  boolean errorIfNotFound)
           throws java.net.MalformedURLException
Constructor with all arguments.

Parameters:
srcFileUrlStr - URL of the remote file as String.
destPath - The (relative) path at the destination location.
destFilename - The filename at the destination location (without path).
errorIfNotFound - The copy process will be aborted when this file was not found at the srcFileUrl.
Throws:
java.net.MalformedURLException - The srcFileUrl cannot be converted into an URL.

RemoteFile

public RemoteFile(java.net.URL srcFileUrl,
                  java.lang.String destPath,
                  java.lang.String destFilename,
                  boolean errorIfNotFound)
Constructor with all arguments.

Parameters:
srcFileUrl - URL of the remote file.
destPath - The (relative) path at the destination.
destFilename - The filename at the destination (without path).
errorIfNotFound - The copy process will be aborted when this file was not found at the srcFileUrl.

RemoteFile

public RemoteFile(java.net.URL srcFileUrl,
                  java.lang.String destPath,
                  java.lang.String destFilename,
                  boolean errorIfNotFound,
                  java.lang.String md5Hash,
                  long length)
Constructor with all arguments.

Parameters:
srcFileUrl - URL of the remote file.
destPath - The (relative) path at the destination.
destFilename - The filename at the destination (without path).
errorIfNotFound - The copy process will be aborted when this file was not found at the srcFileUrl.
md5Hash - MD5 hash of the file or null for automatic calculation. You have to set both values md5Hash and length to avoid a download of the file for automatic determination of hash and length.
length - Length of the file or zero for automatic calculation. You have to set both values md5Hash and length to avoid a download of the file for automatic determination of hash and length
Method Detail

getSrcFileUrl

public final java.net.URL getSrcFileUrl()
Returns the URL of the remote file.

Returns:
Source file URL.

getDestPath

public final java.lang.String getDestPath()
Returns the (relative) path at the destination.

Returns:
Path.

getDestSlashPath

public final java.lang.String getDestSlashPath()
Returns the (relative) path at the destination.

Returns:
Path.

getDestFilename

public final java.lang.String getDestFilename()
Returns the filename at the destination.

Returns:
Filename (without path).

getMd5Hash

public final java.lang.String getMd5Hash()
Returns the MD5 hash of the file.

Returns:
Hash or null if the hash should be calculated automatically.

getLength

public final long getLength()
Returns the size of the file.

Returns:
File length or zero if the size should be calculated automatically.

isErrorIfNotFound

public final boolean isErrorIfNotFound()
Returns if the copy process will be aborted when this file was not found at the srcFileUrl.

Returns:
If an exception is throws when not found true else false.


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.