public interface FTPClientInterface
Modifier and Type | Method and Description |
---|---|
void |
cancelResume()
Cancel the resume.
|
void |
cancelTransfer()
Cancels the current transfer.
|
void |
cdup()
Change the remote working directory to
the parent directory
|
void |
chdir(java.lang.String dir)
Change the remote working directory to
that supplied
|
void |
connect()
Connects to the server at the address and port number defined
in the constructor.
|
boolean |
connected()
Is the client currently connected?
|
void |
delete(java.lang.String remoteFile)
Delete the specified remote file
|
java.lang.String[] |
dir()
List current directory's contents as an array of strings of
filenames.
|
java.lang.String[] |
dir(java.lang.String dirname)
List a directory's contents as an array of strings of filenames.
|
java.lang.String[] |
dir(java.lang.String dirname,
boolean full)
List a directory's contents as an array of strings.
|
FTPFile[] |
dirDetails(java.lang.String dirname)
List a directory's contents as an array of FTPFile objects.
|
void |
dirDetails(java.lang.String dirname,
DirectoryListCallback lister)
List a directory's contents via a callback.
|
java.lang.String |
executeCommand(java.lang.String command)
Request that the remote server execute the literal command supplied.
|
boolean |
exists(java.lang.String remoteFile)
Does the named file exist in the current server directory?
|
void |
get(java.io.OutputStream destStream,
java.lang.String remoteFile)
Get data from the FTP server.
|
byte[] |
get(java.lang.String remoteFile)
Get data from the FTP server.
|
void |
get(java.lang.String localPath,
java.lang.String remoteFile)
Get data from the FTP server.
|
int |
getDeleteCount()
Get the number of files deleted since the count was
reset
|
boolean |
getDetectTransferMode()
Get the detect transfer mode
|
int |
getDownloadCount()
Get the number of files downloaded since the count was
reset
|
boolean |
getFileLockingEnabled()
Determine if file locking on local downloaded files is being used or not.
|
java.lang.String |
getId()
Get the identifying string for this instance
|
long |
getMonitorInterval()
Get the bytes transferred between each callback on the
progress monitor
|
int |
getNetworkBufferSize()
Get the size of the network buffers (SO_SNDBUF
and SO_RCVBUF).
|
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.
|
int |
getTimeout()
Get the timeout used for sockets and other resources
|
FTPTransferType |
getType()
Get the current transfer type
|
int |
getUploadCount()
Get the number of files uploaded since the count was
reset
|
void |
keepAlive()
Tries to keep the current connection alive by
some means, usually by sending an innocuous commmand.
|
void |
mkdir(java.lang.String dir)
Create the specified remote working directory
|
java.util.Date |
modtime(java.lang.String remoteFile)
Get modification time for a remote file.
|
java.lang.String |
put(byte[] bytes,
java.lang.String remoteFile)
Put data onto the FTP server.
|
java.lang.String |
put(byte[] bytes,
java.lang.String remoteFile,
boolean append)
Put data onto the FTP server.
|
java.lang.String |
put(java.io.InputStream srcStream,
java.lang.String remoteFile)
Put a stream of data onto the FTP server.
|
java.lang.String |
put(java.io.InputStream srcStream,
java.lang.String remoteFile,
boolean append)
Put a stream of data onto the FTP server.
|
java.lang.String |
put(java.lang.String localPath,
java.lang.String remoteFile)
Put a local file onto the FTP server.
|
java.lang.String |
put(java.lang.String localPath,
java.lang.String remoteFile,
boolean append)
Put a local file onto the FTP server.
|
java.lang.String |
pwd()
Get the current remote working directory
|
void |
quit()
Quit the FTP session
|
void |
quitImmediately()
Quit the FTP session immediately.
|
void |
rename(java.lang.String from,
java.lang.String to)
Rename a file or directory
|
void |
resetDeleteCount()
Reset the count of deleted files to zero.
|
void |
resetDownloadCount()
Reset the count of downloaded files to zero.
|
void |
resetUploadCount()
Reset the count of uploaded files to zero.
|
void |
resume()
Make the next file transfer (put or get) resume.
|
void |
resumeNextDownload(long offset)
Make the next download resume at a specific point.
|
void |
rmdir(java.lang.String dir)
Delete the specified remote working directory
|
void |
setControlEncoding(java.lang.String controlEncoding)
Set the encoding used on the control channel.
|
void |
setDetectTransferMode(boolean detectTransferMode)
Set autodetect of filetypes on or off.
|
void |
setFileLockingEnabled(boolean lockingEnabled)
Set file locking to enabled or disabled.
|
void |
setId(java.lang.String id)
Set the identifying string for this instance
|
void |
setModTime(java.lang.String path,
java.util.Date modTime)
Set the last modified time (UTC) for the supplied file.
|
void |
setNetworkBufferSize(int networkBufferSize)
Set the size of the network buffers (SO_SNDBUF
and SO_RCVBUF).
|
void |
setProgressMonitor(FTPProgressMonitor monitor)
Set a progress monitor for callbacks.
|
void |
setProgressMonitor(FTPProgressMonitor monitor,
long interval)
Set a progress monitor for callbacks.
|
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 millis)
Set the timeout on the underlying sockets and other resources
that may be used.
|
void |
setType(FTPTransferType type)
Set the transfer type
|
long |
size(java.lang.String remoteFile)
Get the size of a remote file.
|
java.lang.String |
system()
Get a string representing the remote system
|
java.lang.String getId()
void setId(java.lang.String id)
id
- identifying stringjava.lang.String getRemoteHost()
void setRemoteHost(java.lang.String remoteHost) throws java.io.IOException, FTPException
remoteHost
- The IP address or name of the remote hostFTPException
- Thrown if the client is already connected to the server.java.io.IOException
int getRemotePort()
void setRemotePort(int remotePort) throws FTPException
remotePort
- The port to use.FTPException
- Thrown if the client is already connected to the server.int getTimeout()
void setTimeout(int millis) throws java.io.IOException, FTPException
millis
- The length of the timeout, in millisecondsjava.io.IOException
FTPException
int getNetworkBufferSize()
void setNetworkBufferSize(int networkBufferSize)
networkBufferSize
- new buffer size to setvoid setProgressMonitor(FTPProgressMonitor monitor, long interval)
monitor
- the monitor objectinterval
- bytes transferred in between callbacksvoid setProgressMonitor(FTPProgressMonitor monitor)
monitor
- the monitor objectlong getMonitorInterval()
void setDetectTransferMode(boolean detectTransferMode)
detectTransferMode
- true if detecting transfer mode, false if notboolean getDetectTransferMode()
void setFileLockingEnabled(boolean lockingEnabled)
lockingEnabled
- true to enable locking, false to disableboolean getFileLockingEnabled()
void setControlEncoding(java.lang.String controlEncoding) throws FTPException
controlEncoding
- The controlEncoding to set, which is the name of a CharsetFTPException
Charset
void connect() throws java.io.IOException, FTPException
java.io.IOException
- Thrown if there is a TCP/IP-related error.FTPException
- Thrown if there is an error related to the FTP protocol.boolean connected()
long size(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name or path of remote file in current directoryjava.io.IOException
FTPException
boolean exists(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote filejava.io.IOException
FTPException
java.lang.String executeCommand(java.lang.String command) throws FTPException, java.io.IOException
It is up to the user to send a sensible command.
command
- command stringFTPException
java.io.IOException
java.lang.String system() throws FTPException, java.io.IOException
FTPException
java.io.IOException
FTPTransferType getType()
void setType(FTPTransferType type) throws java.io.IOException, FTPException
type
- the transfer type to
set the server tojava.io.IOException
FTPException
void resume() throws FTPException
FTPException
void resumeNextDownload(long offset) throws FTPException
FTPException
void cancelResume() throws java.io.IOException, FTPException
java.io.IOException
FTPException
void cancelTransfer()
java.lang.String put(java.lang.String localPath, java.lang.String remoteFile) throws java.io.IOException, FTPException
localPath
- path of the local fileremoteFile
- name of remote file in
current directory, or null if
a unique filename is to be generated by the serverjava.io.IOException
FTPException
java.lang.String put(java.io.InputStream srcStream, java.lang.String remoteFile) throws java.io.IOException, FTPException
srcStream
- input stream of data to putremoteFile
- name of remote file in
current directory, or null if
a unique filename is to be generated by the serverjava.io.IOException
FTPException
java.lang.String put(java.io.InputStream srcStream, java.lang.String remoteFile, boolean append) throws java.io.IOException, FTPException
srcStream
- input stream of data to putremoteFile
- name of remote file in
current directory, or null if
a unique filename is to be generated by the serverappend
- true if appending, false otherwisejava.io.IOException
FTPException
java.lang.String put(byte[] bytes, java.lang.String remoteFile) throws java.io.IOException, FTPException
bytes
- array of bytesremoteFile
- name of remote file in
current directory, or null if
a unique filename is to be generated by the serverjava.io.IOException
FTPException
java.lang.String put(byte[] bytes, java.lang.String remoteFile, boolean append) throws java.io.IOException, FTPException
bytes
- array of bytesremoteFile
- name of remote file in
current directory, or null if
a unique filename is to be generated by the serverappend
- true if appending, false otherwisejava.io.IOException
FTPException
java.lang.String put(java.lang.String localPath, java.lang.String remoteFile, boolean append) throws java.io.IOException, FTPException
localPath
- path of the local fileremoteFile
- name of remote file in current directory, or null if
a unique filename is to be generated by the serverappend
- true if appending, false otherwisejava.io.IOException
FTPException
void get(java.lang.String localPath, java.lang.String remoteFile) throws java.io.IOException, FTPException
localPath
- local file to put data inremoteFile
- name of remote file in
current directoryjava.io.IOException
FTPException
void get(java.io.OutputStream destStream, java.lang.String remoteFile) throws java.io.IOException, FTPException
destStream
- data stream to write data toremoteFile
- name of remote file in
current directoryjava.io.IOException
FTPException
byte[] get(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file in
current directoryjava.io.IOException
FTPException
int getDownloadCount()
void resetDownloadCount()
int getUploadCount()
void resetUploadCount()
int getDeleteCount()
void resetDeleteCount()
void dirDetails(java.lang.String dirname, DirectoryListCallback lister) throws java.io.IOException, FTPException, java.text.ParseException
dirname
- name of directory (some servers permit a filemask)lister
- callback to be notified of errorsjava.io.IOException
FTPException
java.text.ParseException
FTPFile[] dirDetails(java.lang.String dirname) throws java.io.IOException, FTPException, java.text.ParseException
dirname
- name of directory (some servers permit a filemask)java.io.IOException
FTPException
java.text.ParseException
java.lang.String[] dir() throws java.io.IOException, FTPException
java.io.IOException
FTPException
java.lang.String[] dir(java.lang.String dirname) throws java.io.IOException, FTPException
dirname
- name of directory OR filemaskjava.io.IOException
FTPException
java.lang.String[] dir(java.lang.String dirname, boolean full) throws java.io.IOException, FTPException
dirname
- name of directory OR filemaskfull
- true if detailed listing required
false otherwisejava.io.IOException
FTPException
void delete(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file to
deletejava.io.IOException
FTPException
void rename(java.lang.String from, java.lang.String to) throws java.io.IOException, FTPException
from
- name of file or directory to renameto
- intended namejava.io.IOException
FTPException
void rmdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
deletejava.io.IOException
FTPException
void mkdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
createjava.io.IOException
FTPException
void chdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
change tojava.io.IOException
FTPException
void cdup() throws java.io.IOException, FTPException
java.io.IOException
FTPException
java.util.Date modtime(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote filejava.io.IOException
FTPException
void setModTime(java.lang.String path, java.util.Date modTime) throws java.io.IOException, FTPException
path
- the path to the file/directory on the remote servermodTime
- the time stamp to set the modified time to in UTCjava.io.IOException
FTPException
java.lang.String pwd() throws java.io.IOException, FTPException
java.io.IOException
FTPException
void keepAlive() throws java.io.IOException, FTPException
java.io.IOException
FTPException
void quit() throws java.io.IOException, FTPException
java.io.IOException
FTPException
void quitImmediately() throws java.io.IOException, FTPException
java.io.IOException
FTPException
Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.