|
edtFTPj | |||||||||
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(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(String remoteFile)
Delete the specified remote file |
String[] |
dir()
List current directory's contents as an array of strings of filenames. |
String[] |
dir(String dirname)
List a directory's contents as an array of strings of filenames. |
String[] |
dir(String dirname,
boolean full)
List a directory's contents as an array of strings. |
FTPFile[] |
dirDetails(String dirname)
List a directory's contents as an array of FTPFile objects. |
boolean |
exists(String remoteFile)
Does the named file exist in the current server directory? |
void |
get(OutputStream destStream,
String remoteFile)
Get data from the FTP server. |
byte[] |
get(String remoteFile)
Get data from the FTP server. |
void |
get(String localPath,
String remoteFile)
Get data from the FTP server. |
boolean |
getDetectTransferMode()
Get the detect transfer mode |
String |
getId()
Get the identifying string for this instance |
long |
getMonitorInterval()
Get the bytes transferred between each callback on the progress monitor |
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(String dir)
Create the specified remote working directory |
Date |
modtime(String remoteFile)
Get modification time for a remote file. |
String |
put(byte[] bytes,
String remoteFile)
Put data onto the FTP server. |
String |
put(byte[] bytes,
String remoteFile,
boolean append)
Put data onto the FTP server. |
String |
put(InputStream srcStream,
String remoteFile)
Put a stream of data onto the FTP server. |
String |
put(InputStream srcStream,
String remoteFile,
boolean append)
Put a stream of data onto the FTP server. |
String |
put(String localPath,
String remoteFile)
Put a local file onto the FTP server. |
String |
put(String localPath,
String remoteFile,
boolean append)
Put a local file onto the FTP server. |
String |
pwd()
Get the current remote working directory |
void |
quit()
Quit the FTP session |
void |
quitImmediately()
Quit the FTP session immediately. |
void |
rename(String from,
String to)
Rename a file or directory |
void |
resume()
Make the next file transfer (put or get) resume. |
void |
rmdir(String dir)
Delete the specified remote working directory |
void |
setDetectTransferMode(boolean detectTransferMode)
Set autodetect of filetypes on or off. |
void |
setId(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(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(String remoteFile)
Get the size of a remote file. |
Method Detail |
---|
String getId()
void setId(String id)
id
- identifying stringString getRemoteHost()
void setRemoteHost(String remoteHost) throws IOException, FTPException
remoteHost
- The IP address or name of the remote host
FTPException
- Thrown if the client is already connected to the server.
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 IOException, FTPException
millis
- The length of the timeout, in milliseconds
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 IOException, FTPException
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(String remoteFile) throws IOException, FTPException
remoteFile
- name or path of remote file in current directory
IOException
FTPException
boolean exists(String remoteFile) throws IOException, FTPException
remoteFile
- name of remote file
IOException
FTPException
FTPTransferType getType()
void setType(FTPTransferType type) throws IOException, FTPException
type
- the transfer type to
set the server to
IOException
FTPException
void resume() throws FTPException
FTPException
void cancelResume() throws IOException, FTPException
IOException
FTPException
void cancelTransfer()
String put(String localPath, String remoteFile) throws 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
IOException
FTPException
String put(InputStream srcStream, String remoteFile) throws 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
IOException
FTPException
String put(InputStream srcStream, String remoteFile, boolean append) throws 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
IOException
FTPException
String put(byte[] bytes, String remoteFile) throws 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
IOException
FTPException
String put(byte[] bytes, String remoteFile, boolean append) throws 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
IOException
FTPException
String put(String localPath, String remoteFile, boolean append) throws 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
IOException
FTPException
void get(String localPath, String remoteFile) throws IOException, FTPException
localPath
- local file to put data inremoteFile
- name of remote file in
current directory
IOException
FTPException
void get(OutputStream destStream, String remoteFile) throws IOException, FTPException
destStream
- data stream to write data toremoteFile
- name of remote file in
current directory
IOException
FTPException
byte[] get(String remoteFile) throws IOException, FTPException
remoteFile
- name of remote file in
current directory
IOException
FTPException
FTPFile[] dirDetails(String dirname) throws IOException, FTPException, ParseException
dirname
- name of directory (some servers permit a filemask)
IOException
FTPException
ParseException
String[] dir() throws IOException, FTPException
IOException
FTPException
String[] dir(String dirname) throws IOException, FTPException
dirname
- name of directory OR filemask
IOException
FTPException
String[] dir(String dirname, boolean full) throws IOException, FTPException
dirname
- name of directory OR filemaskfull
- true if detailed listing required
false otherwise
IOException
FTPException
void delete(String remoteFile) throws IOException, FTPException
remoteFile
- name of remote file to
delete
IOException
FTPException
void rename(String from, String to) throws IOException, FTPException
from
- name of file or directory to renameto
- intended name
IOException
FTPException
void rmdir(String dir) throws IOException, FTPException
dir
- name of remote directory to
delete
IOException
FTPException
void mkdir(String dir) throws IOException, FTPException
dir
- name of remote directory to
create
IOException
FTPException
void chdir(String dir) throws IOException, FTPException
dir
- name of remote directory to
change to
IOException
FTPException
void cdup() throws IOException, FTPException
IOException
FTPException
Date modtime(String remoteFile) throws IOException, FTPException
remoteFile
- name of remote file
IOException
FTPException
String pwd() throws IOException, FTPException
IOException
FTPException
void keepAlive() throws IOException, FTPException
IOException
FTPException
void quit() throws IOException, FTPException
IOException
FTPException
void quitImmediately() throws IOException, FTPException
IOException
FTPException
|
edtFTPj | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |