public interface FileTransferClientInterface
Modifier and Type | Method and Description |
---|---|
void |
cancelAllTransfers()
Cancel current transfer if underway
|
void |
changeDirectory(java.lang.String directoryName)
Change directory on the FTP server.
|
void |
changeToParentDirectory()
Change to parent directory on the FTP server.
|
void |
connect()
Make a connection to the FTP server.
|
void |
createDirectory(java.lang.String directoryName)
Create directory on the FTP server.
|
void |
deleteDirectory(java.lang.String directoryName)
Delete directory on the FTP server.
|
void |
deleteFile(java.lang.String remoteFileName)
Deletes a remote file.
|
FTPFile[] |
directoryList()
List the current directory on the FTP server.
|
FTPFile[] |
directoryList(java.lang.String directoryName)
List a directory on the FTP server.
|
void |
directoryList(java.lang.String directoryName,
DirectoryListCallback lister)
List a directory on the FTP server.
|
java.lang.String[] |
directoryNameList()
List the names of files and directories in the current directory on the FTP server.
|
java.lang.String[] |
directoryNameList(java.lang.String directoryName,
boolean isLongListing)
List the names of files and directories of a directory on the FTP server.
|
void |
disconnect()
Disconnect from the FTP server.
|
void |
disconnect(boolean immediate)
Disconnect from the FTP server.
|
byte[] |
downloadByteArray(java.lang.String remoteFileName)
Download a file from the FTP server into a byte array.
|
void |
downloadFile(java.lang.String localFileName,
java.lang.String remoteFileName)
Download a file from the FTP server .
|
void |
downloadFile(java.lang.String localFileName,
java.lang.String remoteFileName,
WriteMode writeMode)
Download a file from the FTP server .
|
FileTransferInputStream |
downloadStream(java.lang.String remoteFileName)
Download a file from the FTP server as a stream.
|
java.lang.String |
executeCommand(java.lang.String command)
Request that the remote server execute the literal command supplied.
|
boolean |
exists(java.lang.String remoteFileName)
Determine if a remote file exists.
|
AdvancedFTPSettings |
getAdvancedFTPSettings()
Get the advanced FTP configuration parameters object
|
AdvancedGeneralSettings |
getAdvancedSettings()
Get the advanced general configuration parameters object
|
FTPTransferType |
getContentType()
Get the current content type for all connections.
|
java.util.Date |
getModifiedTime(java.lang.String remoteFileName)
Get the modified-time of a remote file.
|
int |
getNetworkBufferSize()
Get the size of the network buffers (SO_SNDBUF
and SO_RCVBUF).
|
java.lang.String |
getPassword()
Get the current user password.
|
java.lang.String |
getRemoteDirectory()
Get the current remote directory.
|
java.lang.String |
getRemoteHost()
Returns the IP address or name of the remote host.
|
int |
getRemotePort()
Returns the port being connected to on the remote server.
|
long |
getSize(java.lang.String remoteFileName)
Get the size of a remote file.
|
FileStatistics |
getStatistics()
Get statistics on file transfers and deletions.
|
java.lang.String |
getSystemType()
Get a string that represents the remote system that the client is logged
into.
|
int |
getTimeout()
Returns the timeout for socket connections.
|
java.lang.String |
getUserName()
Get the current user name.
|
boolean |
isConnected()
Is this client currently connected to the server?
|
boolean |
isDetectContentType()
Get the detect content type flag
|
void |
rename(java.lang.String renameFromName,
java.lang.String renameToName)
Rename a remote file or directory.
|
void |
setContentType(FTPTransferType type)
Set the transfer type for all connections, either ASCII or binary.
|
void |
setDetectContentType(boolean detectContentType)
Set auto detect of filetypes on or off.
|
void |
setEventListener(EventListener listener)
Set the event listener for transfer event notification
|
void |
setModifiedTime(java.lang.String remoteFileName,
java.util.Date modifiedTime)
Set the modified-time of a remote file.
|
void |
setNetworkBufferSize(int networkBufferSize)
Set the size of the network buffers (SO_SNDBUF
and SO_RCVBUF).
|
void |
setPassword(java.lang.String password)
Set the password of the user to log in with.
|
void |
setRemoteHost(java.lang.String remoteHost)
Set the IP address or name of the remote host
This may only be done if the client is not already connected to the server.
|
void |
setRemotePort(int remotePort)
Set the port to connect to on the remote server.
|
void |
setTimeout(int timeout)
Set the timeout for socket connections.
|
void |
setUserName(java.lang.String userName)
Set the name of the user to log in with.
|
java.lang.String |
uploadFile(java.lang.String localFileName,
java.lang.String remoteFileName)
Upload a file to the FTP server.
|
java.lang.String |
uploadFile(java.lang.String localFileName,
java.lang.String remoteFileName,
WriteMode writeMode)
Upload a file to the FTP server.
|
FileTransferOutputStream |
uploadStream(java.lang.String remoteFileName)
Upload a file to the FTP server by writing to a stream.
|
FileTransferOutputStream |
uploadStream(java.lang.String remoteFileName,
WriteMode writeMode)
Upload a file to the FTP server by writing to a stream.
|
boolean isConnected()
java.lang.String getRemoteHost()
void setRemoteHost(java.lang.String remoteHost) throws FTPException
remoteHost
- The IP address or name of the remote hostFTPException
- Thrown if the client is already connected to the server.int getTimeout()
void setTimeout(int timeout) throws FTPException
timeout
- the timeout to use in millisecondsFTPException
- Thrown if the client is already connected to the server.int getNetworkBufferSize()
void setNetworkBufferSize(int networkBufferSize) throws FTPException
networkBufferSize
- new buffer size to setFTPException
int getRemotePort()
void setRemotePort(int remotePort) throws FTPException
remotePort
- The port to use.FTPException
- Thrown if the client is already connected to the server.void setContentType(FTPTransferType type) throws java.io.IOException, FTPException
type
- transfer typeFTPException
java.io.IOException
FTPException
FTPTransferType getContentType()
void setDetectContentType(boolean detectContentType)
detectContentType
- true if detecting content type, false if notboolean isDetectContentType()
void setUserName(java.lang.String userName) throws FTPException
userName
- user-name to log in with.FTPException
java.lang.String getPassword()
void setPassword(java.lang.String password) throws FTPException
password
- password to log in with.FTPException
java.lang.String getUserName()
AdvancedFTPSettings getAdvancedFTPSettings()
AdvancedGeneralSettings getAdvancedSettings()
void setEventListener(EventListener listener)
listener
- event listener referencevoid connect() throws FTPException, java.io.IOException
FTPException
java.io.IOException
FileStatistics getStatistics()
java.lang.String executeCommand(java.lang.String command) throws FTPException, java.io.IOException
command
- command stringFTPException
java.io.IOException
void cancelAllTransfers()
java.lang.String getSystemType() throws FTPException, java.io.IOException
FTPException
java.io.IOException
java.lang.String[] directoryNameList() throws FTPException, java.io.IOException
FTPException,
- IOExceptionFTPException
java.io.IOException
java.lang.String[] directoryNameList(java.lang.String directoryName, boolean isLongListing) throws FTPException, java.io.IOException
directoryName
- name of the directory (generally not a path). Some
servers will accept a wildcard.isLongListing
- true if the listing is a long format listingFTPException,
- IOExceptionFTPException
java.io.IOException
FTPFile[] directoryList() throws FTPException, java.io.IOException, java.text.ParseException
FTPException,
- IOExceptionjava.text.ParseException
FTPException
java.io.IOException
FTPFile[] directoryList(java.lang.String directoryName) throws FTPException, java.io.IOException, java.text.ParseException
directoryName
- name of the directory (generally not a path). Some
servers will accept a wildcard.FTPException,
- IOExceptionjava.text.ParseException
FTPException
java.io.IOException
void directoryList(java.lang.String directoryName, DirectoryListCallback lister) throws FTPException, java.io.IOException, java.text.ParseException
directoryName
- name of the directory (generally not a path)FTPException,
- IOExceptionFTPException
java.io.IOException
java.text.ParseException
byte[] downloadByteArray(java.lang.String remoteFileName) throws FTPException, java.io.IOException
remoteFileName
- name of the remote file to be downloadedFTPException
java.io.IOException
void downloadFile(java.lang.String localFileName, java.lang.String remoteFileName) throws FTPException, java.io.IOException
localFileName
- name (or full path) of the local file to be downloaded toremoteFileName
- name of the remote file to be downloadedFTPException
java.io.IOException
void downloadFile(java.lang.String localFileName, java.lang.String remoteFileName, WriteMode writeMode) throws FTPException, java.io.IOException
localFileName
- name (or full path) of the local file to be downloaded toremoteFileName
- name of the remote file to be downloadedwriteMode
- mode in which the file is written to the client machineFTPException
java.io.IOException
FileTransferInputStream downloadStream(java.lang.String remoteFileName) throws FTPException, java.io.IOException
remoteFileName
- name of the remote file to be downloadedFTPException
java.io.IOException
java.lang.String uploadFile(java.lang.String localFileName, java.lang.String remoteFileName) throws FTPException, java.io.IOException
localFileName
- name (or full path) of the local file to be downloaded toremoteFileName
- name of the remote file to be downloaded (or null to generate a unique name)FTPException
java.io.IOException
java.lang.String uploadFile(java.lang.String localFileName, java.lang.String remoteFileName, WriteMode writeMode) throws FTPException, java.io.IOException
localFileName
- name (or full path) of the local file to be downloaded toremoteFileName
- name of the remote file to be downloaded (or null to generate a unique name)writeMode
- mode to write to the remote file withFTPException
java.io.IOException
FileTransferOutputStream uploadStream(java.lang.String remoteFileName) throws FTPException, java.io.IOException
FileTransferOutputStream.getRemoteFile()
remoteFileName
- name of the remote file to be uploadedFTPException
java.io.IOException
FileTransferOutputStream uploadStream(java.lang.String remoteFileName, WriteMode writeMode) throws FTPException, java.io.IOException
FileTransferOutputStream.getRemoteFile()
remoteFileName
- name of the remote file to be uploadedwriteMode
- mode for writing to the server (supporting use of append)FTPException
java.io.IOException
long getSize(java.lang.String remoteFileName) throws FTPException, java.io.IOException
remoteFileName
- name of remote fileFTPException
java.io.IOException
java.util.Date getModifiedTime(java.lang.String remoteFileName) throws FTPException, java.io.IOException
remoteFileName
- name of remote fileFTPException
java.io.IOException
void setModifiedTime(java.lang.String remoteFileName, java.util.Date modifiedTime) throws FTPException, java.io.IOException
remoteFileName
- name of remote filemodifiedTime
- new modified timeFTPException
java.io.IOException
boolean exists(java.lang.String remoteFileName) throws FTPException, java.io.IOException
remoteFileName
- name of remote fileFTPException
java.io.IOException
void deleteFile(java.lang.String remoteFileName) throws FTPException, java.io.IOException
remoteFileName
- name of remote fileFTPException
java.io.IOException
void rename(java.lang.String renameFromName, java.lang.String renameToName) throws FTPException, java.io.IOException
renameFromName
- original namerenameToName
- new nameFTPException,
- IOExceptionFTPException
java.io.IOException
void changeDirectory(java.lang.String directoryName) throws FTPException, java.io.IOException
directoryName
- name the remote directory to change intoFTPException,
- IOExceptionFTPException
java.io.IOException
void changeToParentDirectory() throws FTPException, java.io.IOException
FTPException,
- IOExceptionFTPException
java.io.IOException
java.lang.String getRemoteDirectory() throws java.io.IOException, FTPException
FTPException
java.io.IOException
void createDirectory(java.lang.String directoryName) throws FTPException, java.io.IOException
directoryName
- name the remote directory to createFTPException,
- IOExceptionFTPException
java.io.IOException
void deleteDirectory(java.lang.String directoryName) throws FTPException, java.io.IOException
directoryName
- name the remote directory to createFTPException,
- IOExceptionFTPException
java.io.IOException
void disconnect() throws FTPException, java.io.IOException
FTPException,
- IOExceptionFTPException
java.io.IOException
void disconnect(boolean immediate) throws FTPException, java.io.IOException
FTPException,
- IOExceptionFTPException
java.io.IOException
Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.