|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsun.net.NetworkClient
sun.net.TransferProtocolClient
sun.net.ftp.FtpClient
public class FtpClient
This class implements the FTP client.
| Field Summary | |
|---|---|
static int |
FTP_PORT
|
static String |
ftpProxyHost
Deprecated. |
static int |
ftpProxyPort
Deprecated. |
static boolean |
useFtpProxy
Deprecated. |
String |
welcomeMsg
Welcome message from the server, if any. |
| Fields inherited from class sun.net.TransferProtocolClient |
|---|
serverResponse |
| Fields inherited from class sun.net.NetworkClient |
|---|
defaultConnectTimeout, defaultSoTimeout, encoding, serverInput, serverOutput, serverSocket |
| Constructor Summary | |
|---|---|
FtpClient()
Create an uninitialized FTP client. |
|
FtpClient(String host)
New FTP client connected to host host. |
|
FtpClient(String host,
int port)
New FTP client connected to host host, port port. |
|
| Method Summary | |
|---|---|
void |
ascii()
Set transfer type to 'A' |
void |
binary()
Set transfer type to 'I' |
void |
cd(String remoteDirectory)
CD to a specific directory on a remote FTP server |
void |
closeServer()
issue the QUIT command to the FTP server and close the connection. |
TelnetInputStream |
get(String filename)
GET a file from the FTP server |
static String |
getFtpProxyHost()
|
static int |
getFtpProxyPort()
|
static boolean |
getUseFtpProxy()
|
protected int |
issueCommand(String cmd)
|
protected void |
issueCommandCheck(String cmd)
|
TelnetInputStream |
list()
LIST files on a remote FTP server |
void |
login(String user,
String password)
login user to a host with username user and password password |
protected Socket |
openDataConnection(String cmd)
|
void |
openServer(String host)
open a FTP connection to host host. |
void |
openServer(String host,
int port)
open a FTP connection to host host on port port. |
TelnetOutputStream |
put(String filename)
PUT a file to the FTP server |
protected int |
readReply()
|
| Methods inherited from class sun.net.TransferProtocolClient |
|---|
getResponseString, getResponseStrings, readServerResponse, sendServer |
| Methods inherited from class sun.net.NetworkClient |
|---|
doConnect, getLocalAddress, serverIsOpen |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FTP_PORT
public String welcomeMsg
public static boolean useFtpProxy
public static String ftpProxyHost
public static int ftpProxyPort
| Constructor Detail |
|---|
public FtpClient(String host)
throws IOException
IOException
public FtpClient(String host,
int port)
throws IOException
IOExceptionpublic FtpClient()
| Method Detail |
|---|
public static boolean getUseFtpProxy()
public static String getFtpProxyHost()
public static int getFtpProxyPort()
public void closeServer()
throws IOException
closeServer in class NetworkClientIOException
protected int issueCommand(String cmd)
throws IOException
IOException
protected void issueCommandCheck(String cmd)
throws IOException
IOException
protected int readReply()
throws IOException
IOException
protected Socket openDataConnection(String cmd)
throws IOException
IOException
public void openServer(String host)
throws IOException
IOException
public void openServer(String host,
int port)
throws IOException
openServer in class NetworkClientIOException
public void login(String user,
String password)
throws IOException
IOException
public TelnetInputStream get(String filename)
throws IOException
IOException
public TelnetOutputStream put(String filename)
throws IOException
IOException
public TelnetInputStream list()
throws IOException
IOException
public void cd(String remoteDirectory)
throws IOException
IOException
public void binary()
throws IOException
IOException
public void ascii()
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||