All Packages Class Hierarchy This Package Previous Next Index
Class com.enterprisedt.net.ftp.FTPClient
java.lang.Object
|
+----com.enterprisedt.net.ftp.FTPClient
- public class FTPClient
- extends Object
Supports client-side FTP. Most common
FTP operations are present in this class.
Lots to do, but works ok.
- Author:
- Bruce Blackshaw
-
control
- Socket responsible for controlling
the connection
-
data
- Socket responsible for transferring
the data
-
transferType
- Record of the transfer type
-
FTPClient(InetAddress)
- Constructor.
-
FTPClient(String)
- Constructor.
-
chdir(String)
- Change the remote working directory to
that supplied
-
delete(String)
- Delete the specified remote file
-
get(String)
- Get data from the FTP server.
-
get(String, String)
- Get data from the FTP server.
-
getType()
- Get the current transfer type
-
login(String, String)
- Login into an account on the FTP server
-
mkdir(String)
- Create the specified remote working directory
-
put(byte[], String)
- Put data onto the FTP server.
-
put(String, String)
- Put a local file onto the FTP server.
-
quit()
- Quit the FTP session
-
rmdir(String)
- Delete the specified remote working directory
-
setType(FTPTransferType)
- Delete the specified remote file
control
private FTPControlSocket control
- Socket responsible for controlling
the connection
data
private Socket data
- Socket responsible for transferring
the data
transferType
private FTPTransferType transferType
- Record of the transfer type
FTPClient
public FTPClient(String remoteHost) throws IOException, FTPException
- Constructor. Creates the control
socket
- Parameters:
- remoteHost - the remote hostname
FTPClient
public FTPClient(InetAddress remoteAddr) throws IOException, FTPException
- Constructor. Creates the control
socket
- Parameters:
- remoteAddr - the address of the
remote host
login
public void login(String user,
String password) throws IOException, FTPException
- Login into an account on the FTP server
- Parameters:
- user - user name
- password - user's password
put
public void put(String localPath,
String remoteFile) throws IOException, FTPException
- Put a local file onto the FTP server. It
is placed in the current directory.
- Parameters:
- localPath - path of the local file
- remoteFile - name of remote file in
current directory
put
public void put(byte bytes[],
String remoteFile) throws IOException, FTPException
- Put data onto the FTP server. It
is placed in the current directory.
- Parameters:
- data - array of bytes
- remoteFile - name of remote file in
current directory
get
public void get(String localPath,
String remoteFile) throws IOException, FTPException
- Get data from the FTP server. Uses the currently
set transfer mode.
- Parameters:
- localPath - local file to put data in
- remoteFile - name of remote file in
current directory
get
public byte[] get(String remoteFile) throws IOException, FTPException
- Get data from the FTP server. Uses the currently
set transfer mode. Retrieve as a byte array. Note
that we may experience memory limitations as the
entire file must be held in memory at one time.
- Parameters:
- remoteFile - name of remote file in
current directory
getType
public FTPTransferType getType()
- Get the current transfer type
- Parameters:
- dir - name of remote file to
delete
setType
public void setType(FTPTransferType type) throws IOException, FTPException
- Delete the specified remote file
- Parameters:
- dir - name of remote file to
delete
delete
public void delete(String remoteFile) throws IOException, FTPException
- Delete the specified remote file
- Parameters:
- dir - name of remote file to
delete
rmdir
public void rmdir(String dir) throws IOException, FTPException
- Delete the specified remote working directory
- Parameters:
- dir - name of remote directory to
delete
mkdir
public void mkdir(String dir) throws IOException, FTPException
- Create the specified remote working directory
- Parameters:
- dir - name of remote directory to
create
chdir
public void chdir(String dir) throws IOException, FTPException
- Change the remote working directory to
that supplied
- Parameters:
- dir - name of remote directory to
change to
quit
public void quit() throws IOException, FTPException
- Quit the FTP session
All Packages Class Hierarchy This Package Previous Next Index