|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FTPClientInterface
Defines operations in common with a number of FTP implementations.
Method Summary | |
---|---|
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. |
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. |
boolean |
getDetectTransferMode()
Get the detect transfer mode |
java.lang.String |
getId()
Get the identifying string for this instance |
long |
getMonitorInterval()
Get the bytes transferred between each callback on the progress monitor |
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 TCP timeout on the underlying socket(s). |
FTPTransferType |
getType()
Get the current transfer type |
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 |
resume()
Make the next file transfer (put or get) resume. |
void |
rmdir(java.lang.String dir)
Delete the specified remote working directory |
void |
setDetectTransferMode(boolean detectTransferMode)
Set autodetect of filetypes on or off. |
void |
setId(java.lang.String id)
Set the identifying string for this instance |
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 TCP timeout on the underlying socket(s). |
void |
setType(FTPTransferType type)
Set the transfer type |
long |
size(java.lang.String remoteFile)
Get the size of a remote file. |
Method Detail |
---|
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 host
FTPException
- 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 milliseconds
java.io.IOException
FTPException
void 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 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 directory
java.io.IOException
FTPException
boolean exists(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file
java.io.IOException
FTPException
FTPTransferType getType()
void setType(FTPTransferType type) throws java.io.IOException, FTPException
type
- the transfer type to
set the server to
java.io.IOException
FTPException
void resume() 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 server
java.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 server
java.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 otherwise
java.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 server
java.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 otherwise
java.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 otherwise
java.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 directory
java.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 directory
java.io.IOException
FTPException
byte[] get(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file in
current directory
java.io.IOException
FTPException
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 filemask
java.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 otherwise
java.io.IOException
FTPException
void delete(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file to
delete
java.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 name
java.io.IOException
FTPException
void rmdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
delete
java.io.IOException
FTPException
void mkdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
create
java.io.IOException
FTPException
void chdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
change to
java.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 file
java.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |