public final class FTPRemoteFile extends AbstractRemoteFile
Transfers are done using binary type and passive mode, if available.
Modifier and Type | Field and Description |
---|---|
protected 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.
|
file, fileDeletable, filesize, multipleDownloads, useChecksums
Modifier and Type | Method and Description |
---|---|
void |
appendTo(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.
|
String |
getChecksum()
Get checksum for file, or null if checksums were not requested.
|
InputStream |
getInputStream()
An implementation of the getInputStream operation that works with FTP.
|
static RemoteFile |
getInstance(File localFile,
Boolean useChecksums,
Boolean fileDeletable,
Boolean multipleDownloads)
Create a remote file that handles the transport of the remote file data.
|
static RemoteFile |
getInstance(File localFile,
Boolean useChecksums,
Boolean fileDeletable,
Boolean multipleDownloads,
RemoteFileSettings connectionParams) |
int |
getNumberOfRetries()
Retrieval of the number of retries for retrieving a file from a FTP server.
|
static RemoteFileSettings |
getRemoteFileSettings() |
String |
toString()
Return a human-readable description of the object.
|
copyTo, getName, getSize
public static int FTP_RETRIES
public static int FTP_DATATIMEOUT
public static RemoteFile getInstance(File localFile, Boolean useChecksums, Boolean fileDeletable, 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(File localFile, Boolean useChecksums, Boolean fileDeletable, Boolean multipleDownloads, RemoteFileSettings connectionParams) throws IOFailure
IOFailure
public InputStream getInputStream()
getInputStream
in interface RemoteFile
getInputStream
in class AbstractRemoteFile
public void appendTo(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 String toString()
toString
in class AbstractRemoteFile
public String getChecksum()
getChecksum
in interface RemoteFile
getChecksum
in class AbstractRemoteFile
public int getNumberOfRetries()
getNumberOfRetries
in class AbstractRemoteFile
public static RemoteFileSettings getRemoteFileSettings()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.