|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines operations in common with a number of FTP implementations.
Method Summary | |
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. |
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 |
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. |
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 |
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 |
void |
put(byte[] bytes,
java.lang.String remoteFile)
Put data onto the FTP server. |
void |
put(java.io.InputStream srcStream,
java.lang.String remoteFile)
Put a stream of data onto the FTP server. |
void |
put(java.lang.String localPath,
java.lang.String remoteFile)
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 |
rename(java.lang.String from,
java.lang.String to)
Rename a file or directory |
void |
rmdir(java.lang.String dir)
Delete the specified remote working directory |
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 |
public java.lang.String getRemoteHost()
public 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
public int getRemotePort()
public void setRemotePort(int remotePort) throws FTPException
remotePort
- The port to use.
FTPException
- Thrown if the client is already connected to the server.public int getTimeout()
public void setTimeout(int millis) throws java.io.IOException, FTPException
millis
- The length of the timeout, in milliseconds
java.io.IOException
FTPException
public void setProgressMonitor(FTPProgressMonitor monitor, long interval)
monitor
- the monitor objectinterval
- bytes transferred in between callbackspublic void setProgressMonitor(FTPProgressMonitor monitor)
monitor
- the monitor objectpublic long getMonitorInterval()
public 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.public 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
public FTPTransferType getType()
public void setType(FTPTransferType type) throws java.io.IOException, FTPException
type
- the transfer type to
set the server to
java.io.IOException
FTPException
public void 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
java.io.IOException
FTPException
public void 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
java.io.IOException
FTPException
public void put(byte[] bytes, java.lang.String remoteFile) throws java.io.IOException, FTPException
bytes
- array of bytesremoteFile
- name of remote file in
current directory
java.io.IOException
FTPException
public 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
public 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
public byte[] get(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file in
current directory
java.io.IOException
FTPException
public FTPFile[] dirDetails(java.lang.String dirname) throws java.io.IOException, FTPException, java.text.ParseException
dirname
- name of directory OR filemask
java.io.IOException
FTPException
java.text.ParseException
public java.lang.String[] dir() throws java.io.IOException, FTPException
java.io.IOException
FTPException
public java.lang.String[] dir(java.lang.String dirname) throws java.io.IOException, FTPException
dirname
- name of directory OR filemask
java.io.IOException
FTPException
public 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
public void delete(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file to
delete
java.io.IOException
FTPException
public 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
public void rmdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
delete
java.io.IOException
FTPException
public void mkdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
create
java.io.IOException
FTPException
public void chdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
change to
java.io.IOException
FTPException
public void cdup() throws java.io.IOException, FTPException
java.io.IOException
FTPException
public java.util.Date modtime(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file
java.io.IOException
FTPException
public java.lang.String pwd() throws java.io.IOException, FTPException
java.io.IOException
FTPException
public void quit() 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 |