|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.enterprisedt.net.ftp.FTPClient
Supports client-side FTP. Most common FTP operations are present in this class.
Constructor Summary | |
FTPClient(java.net.InetAddress remoteAddr)
Constructor. |
|
FTPClient(java.net.InetAddress remoteAddr,
int controlPort)
Constructor. |
|
FTPClient(java.lang.String remoteHost)
Constructor. |
|
FTPClient(java.lang.String remoteHost,
int controlPort)
Constructor. |
Method Summary | |
void |
chdir(java.lang.String dir)
Change the remote working directory to that supplied |
void |
debugResponses(boolean on)
Switch debug of responses on or off |
void |
delete(java.lang.String remoteFile)
Delete the specified remote file |
java.lang.String[] |
dir(java.lang.String mask)
List a directory's contents as an array of strings of filenames. |
java.lang.String[] |
dir(java.lang.String mask,
boolean full)
List a directory's contents as an array of strings. |
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. |
FTPTransferType |
getType()
Get the current transfer type |
void |
initSOCKS(java.lang.String port,
java.lang.String host)
Set up SOCKS v4 proxy settings. |
java.lang.String |
list(java.lang.String mask)
Deprecated. As of FTP 1.1, replaced by dir(String) |
java.lang.String |
list(java.lang.String mask,
boolean full)
Deprecated. As of FTP 1.1, replaced by dir(String,boolean) |
void |
login(java.lang.String user,
java.lang.String password)
Login into an account on the FTP server. |
void |
mkdir(java.lang.String dir)
Create the specified remote working directory |
void |
password(java.lang.String password)
Supplies the password for a previously supplied username to log into the FTP server. |
void |
put(byte[] bytes,
java.lang.String remoteFile)
Put data onto the FTP server. |
void |
put(byte[] bytes,
java.lang.String remoteFile,
boolean append)
Put data onto the FTP server. |
void |
put(java.lang.String localPath,
java.lang.String remoteFile)
Put a local file onto the FTP server. |
void |
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 |
quote(java.lang.String command,
java.lang.String[] validCodes)
Issue arbitrary ftp commands to the FTP server. |
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 |
setConnectMode(FTPConnectMode mode)
Set the connect mode |
void |
setTimeout(int millis)
Set the TCP timeout on the underlying socket. |
void |
setType(FTPTransferType type)
Set the transfer type |
boolean |
site(java.lang.String command)
Run a site-specific command on the server. |
java.lang.String |
system()
Get the type of the OS at the server |
void |
user(java.lang.String user)
Supply the user name to log into an account on the FTP server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FTPClient(java.lang.String remoteHost) throws java.io.IOException, FTPException
remoteHost
- the remote hostnamepublic FTPClient(java.lang.String remoteHost, int controlPort) throws java.io.IOException, FTPException
remoteHost
- the remote hostnamecontrolPort
- port for control streampublic FTPClient(java.net.InetAddress remoteAddr) throws java.io.IOException, FTPException
remoteAddr
- the address of the
remote hostpublic FTPClient(java.net.InetAddress remoteAddr, int controlPort) throws java.io.IOException, FTPException
remoteAddr
- the address of the
remote hostcontrolPort
- port for control streamMethod Detail |
public void setTimeout(int millis) throws java.io.IOException
millis
- The length of the timeout, in millisecondspublic void setConnectMode(FTPConnectMode mode)
mode
- ACTIVE or PASV modepublic void login(java.lang.String user, java.lang.String password) throws java.io.IOException, FTPException
user
- user namepassword
- user's passwordpublic void user(java.lang.String user) throws java.io.IOException, FTPException
user
- user namepassword
- user's passwordpublic void password(java.lang.String password) throws java.io.IOException, FTPException
user
- user namepassword
- user's passwordpublic void initSOCKS(java.lang.String port, java.lang.String host)
port
- SOCKS proxy porthost
- SOCKS proxy hostnamepublic void quote(java.lang.String command, java.lang.String[] validCodes) throws java.io.IOException, FTPException
command
- ftp command to be sent to servervalidCodes
- valid return codes for this commandpublic 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 directorypublic void 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 directoryappend
- true if appending, false otherwisepublic void put(byte[] bytes, java.lang.String remoteFile) throws java.io.IOException, FTPException
data
- array of bytesremoteFile
- name of remote file in
current directorypublic void put(byte[] bytes, java.lang.String remoteFile, boolean append) throws java.io.IOException, FTPException
data
- array of bytesremoteFile
- name of remote file in
current directoryappend
- true if appending, false otherwisepublic 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 directorypublic byte[] get(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file in
current directorypublic boolean site(java.lang.String command) throws java.io.IOException, FTPException
command
- the site command to runpublic java.lang.String list(java.lang.String mask) throws java.io.IOException, FTPException
dir(String)
mask
- the file mask to usepublic java.lang.String list(java.lang.String mask, boolean full) throws java.io.IOException, FTPException
dir(String,boolean)
mask
- the file mask to usefull
- true if detailed listing required
false otherwisepublic java.lang.String[] dir(java.lang.String mask) throws java.io.IOException, FTPException
mask
- the file mask to usepublic java.lang.String[] dir(java.lang.String mask, boolean full) throws java.io.IOException, FTPException
mask
- the file mask to usefull
- true if detailed listing required
false otherwisepublic void debugResponses(boolean on)
on
- true if you wish to have responses to
stdout, false otherwisepublic FTPTransferType getType()
public void setType(FTPTransferType type) throws java.io.IOException, FTPException
type
- the transfer type to
set the server topublic void delete(java.lang.String remoteFile) throws java.io.IOException, FTPException
remoteFile
- name of remote file to
deletepublic void rename(java.lang.String from, java.lang.String to) throws java.io.IOException, FTPException
from
- name of file or directory to renameto
- intended namepublic void rmdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
deletepublic void mkdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
createpublic void chdir(java.lang.String dir) throws java.io.IOException, FTPException
dir
- name of remote directory to
change topublic java.lang.String pwd() throws java.io.IOException, FTPException
public java.lang.String system() throws java.io.IOException, FTPException
public void quit() throws java.io.IOException, FTPException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |