|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.common.distribute.AbstractRemoteFile dk.netarkivet.common.distribute.FTPRemoteFile
public final class FTPRemoteFile
Class encapsulating upload to & download from an ftp-server. Transfers are done using binary type and passive mode, if available.
Field Summary | |
---|---|
protected java.lang.String |
checksum
If useChecksums is true, contains the file checksum. |
static java.lang.String |
FTP_DATATIMEOUT_SETTINGS
settings.common.remoteFile.datatimeout: The setting for the FTP data timeout in seconds. |
static java.lang.String |
FTP_RETRIES_SETTINGS
settings.common.remoteFile.retries: The setting for the number of times FTPRemoteFile should try before giving up a copyTo operation or logOn operation. |
static java.lang.String |
FTP_SERVER_NAME
settings.common.remoteFile.serverName: The setting for the FTP-server used. |
static java.lang.String |
FTP_SERVER_PORT
settings.common.remoteFile.serverPort: The setting for the FTP-server port used. |
static java.lang.String |
FTP_USER_NAME
settings.common.remoteFile.userName: The setting for the FTP username. |
static java.lang.String |
FTP_USER_PASSWORD
settings.common.remoteFile.userPassword: The setting for the FTP password. |
Fields inherited from class dk.netarkivet.common.distribute.AbstractRemoteFile |
---|
file, fileDeletable, filesize, multipleDownloads, useChecksums |
Method Summary | |
---|---|
void |
appendTo(java.io.OutputStream out)
Write the contents of this ftp remote file to an output stream. |
void |
cleanup()
Cleanup will delete the file on the FTP server. |
java.lang.String |
getChecksum()
Get checksum for file, or null if checksums were not requested. |
java.io.InputStream |
getInputStream()
An implementation of the getInputStream operation that works with FTP. |
static RemoteFile |
getInstance(java.io.File localFile,
java.lang.Boolean useChecksums,
java.lang.Boolean fileDeletable,
java.lang.Boolean multipleDownloads)
Create a remote file that handles the transport of the remote file data. |
int |
getNumberOfRetries()
Retrieval of the number of retries for retrieving a file from a FTP server. |
java.lang.String |
toString()
Return a human-readable description of the object. |
Methods inherited from class dk.netarkivet.common.distribute.AbstractRemoteFile |
---|
copyTo, getName, getSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String checksum
public static java.lang.String FTP_SERVER_NAME
public static java.lang.String FTP_SERVER_PORT
public static java.lang.String FTP_USER_NAME
public static java.lang.String FTP_USER_PASSWORD
public static java.lang.String FTP_RETRIES_SETTINGS
public static java.lang.String FTP_DATATIMEOUT_SETTINGS
Method Detail |
---|
public static RemoteFile getInstance(java.io.File localFile, java.lang.Boolean useChecksums, java.lang.Boolean fileDeletable, java.lang.Boolean multipleDownloads) throws IOFailure
localFile
- File object for the remote fileuseChecksums
- If true, checksums will be used to check
transfers.fileDeletable
- If true, this file will be deleted after upload
to FTP.multipleDownloads
- If true, the file will not be removed from FTP
server automatically after first download.
IOFailure
- if FTPRemoteFile creation failspublic java.io.InputStream getInputStream()
getInputStream
in interface RemoteFile
getInputStream
in class AbstractRemoteFile
public void appendTo(java.io.OutputStream out)
appendTo
in interface RemoteFile
appendTo
in class AbstractRemoteFile
out
- OutputStream that the data will be written to. This stream
will not be closed by this operation.
IOFailure
- If append operation failspublic void cleanup()
cleanup
in interface RemoteFile
cleanup
in class AbstractRemoteFile
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getChecksum()
getChecksum
in interface RemoteFile
getChecksum
in class AbstractRemoteFile
public int getNumberOfRetries()
getNumberOfRetries
in class AbstractRemoteFile
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |