public final class FtpClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FTP_CIENT_CONNECTED |
static int |
FTP_CIENT_CONNECTING |
static int |
FTP_CIENT_DISCONNECTED |
static int |
FTP_CIENT_RESET |
Constructor and Description |
---|
FtpClient() |
Modifier and Type | Method and Description |
---|---|
static int |
appendTextFile(java.lang.String path,
java.lang.String data)
Append text file on the ftp server.
|
static int |
changeDir(java.lang.String path)
Change current directory at remote.
|
static int |
changeDirUp()
Change current directory to up dir at remote.
|
static int |
connect(java.lang.String host,
short port)
Connect the ftp client to specific host and port.
|
static int |
deleteTextFile(java.lang.String path)
Delete text file on the ftp server.
|
static void |
disconnect()
Disconnect ftp client.
|
static java.lang.String |
getCurrentDir()
Get current directory path at remote.
|
static int |
getStatus()
Get Ftp Client current status
Version: +2.18
|
static java.lang.String |
getTextFile(java.lang.String path)
Get text file from the ftp server.
|
static java.lang.String |
listDir(java.lang.String path)
List files & dir from the remote current dir.
|
static int |
login(java.lang.String user,
java.lang.String pass)
Login to the ftp server with user and password.
|
static int |
makeDir(java.lang.String path)
Create a new directory at remote.
|
static java.lang.String |
mlsdDir(java.lang.String path)
List files & dir from the remote current dir.
|
static int |
putTextFile(java.lang.String path,
java.lang.String data)
Put text file on the ftp server.
|
static int |
removeDir(java.lang.String path)
Remove a directory at remote.
|
static int |
renameTextFile(java.lang.String src,
java.lang.String dst)
Rename text file on the ftp server.
|
static java.lang.String |
verboseListDir(java.lang.String path)
List (verbose) files & dir from the remote current dir.
|
public static final int FTP_CIENT_RESET
public static final int FTP_CIENT_CONNECTING
public static final int FTP_CIENT_CONNECTED
public static final int FTP_CIENT_DISCONNECTED
public static int connect(java.lang.String host, short port)
host
- hostname of the ftp serverport
- port of the ftp serverpublic static int login(java.lang.String user, java.lang.String pass)
user
- ftp server usernamepass
- ftp server passwordpublic static void disconnect()
public static int getStatus()
public static java.lang.String getCurrentDir()
public static int changeDir(java.lang.String path)
path
- path to the requested dirpublic static int changeDirUp()
public static int makeDir(java.lang.String path)
path
- dir path to create.public static int removeDir(java.lang.String path)
path
- dir path to remove.public static java.lang.String verboseListDir(java.lang.String path)
path
- dir path to list.public static java.lang.String listDir(java.lang.String path)
path
- dir path to list.public static java.lang.String mlsdDir(java.lang.String path)
path
- dir path to list.public static java.lang.String getTextFile(java.lang.String path)
path
- path to the file.public static int putTextFile(java.lang.String path, java.lang.String data)
path
- path to the file.data
- data to write to the file.public static int appendTextFile(java.lang.String path, java.lang.String data)
path
- path to the file.data
- data to append to the file.public static int deleteTextFile(java.lang.String path)
path
- path to the file.public static int renameTextFile(java.lang.String src, java.lang.String dst)
src
- current file name.dst
- new file name.