|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.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 int |
FTP_DATATIMEOUT
How large a data timeout on our FTP connections. |
static int |
FTP_RETRIES
How many times we will retry upload, download, and logon. |
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. |
static RemoteFile |
getInstance(java.io.File localFile,
java.lang.Boolean useChecksums,
java.lang.Boolean fileDeletable,
java.lang.Boolean multipleDownloads,
RemoteFileSettings connectionParams)
|
int |
getNumberOfRetries()
Retrieval of the number of retries for retrieving a file from a FTP server. |
static RemoteFileSettings |
getRemoteFileSettings()
|
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 |
---|
public static int FTP_RETRIES
public static int FTP_DATATIMEOUT
protected final java.lang.String checksum
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 static RemoteFile getInstance(java.io.File localFile, java.lang.Boolean useChecksums, java.lang.Boolean fileDeletable, java.lang.Boolean multipleDownloads, RemoteFileSettings connectionParams) throws IOFailure
IOFailure
public 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
public static RemoteFileSettings getRemoteFileSettings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |