public class WaarpFtpClient extends Object
Modifier and Type | Field and Description |
---|---|
protected FTPClient |
ftpClient |
protected String |
result |
Constructor and Description |
---|
WaarpFtpClient(String server,
int port,
String user,
String pwd,
String acct,
boolean isPassive,
int ssl,
int controlTimeout,
int timeout)
WARNING: SSL mode (FTPS and FTPSE) are not working due to a bug in Apache
Commons-Net
|
Modifier and Type | Method and Description |
---|---|
boolean |
changeDir(String newDir)
Change remote directory
|
boolean |
changeFileType(boolean binaryTransfer1)
Change the FileType of Transfer (Binary true, ASCII false)
|
void |
changeMode(boolean passive)
Change to passive (true) or active (false) mode
|
boolean |
connect()
Try to connect to the server and goes with the authentication
|
void |
disconnect()
Disconnect the Ftp Client
|
String[] |
executeCommand(String params) |
String[] |
executeSiteCommand(String params) |
boolean |
featureEnabled(String feature) |
String[] |
listFiles() |
void |
logout()
Logout from the Control connection
|
boolean |
makeDir(String newDir)
Create a new directory
|
boolean |
transferFile(String local,
String remote,
int getStoreOrAppend)
Ask to transfer a file
|
protected final FTPClient ftpClient
protected String result
public WaarpFtpClient(String server, int port, String user, String pwd, String acct, boolean isPassive, int ssl, int controlTimeout, int timeout)
server
- port
- user
- pwd
- acct
- isPassive
- ssl
- timeout
- public boolean connect()
public void logout()
public void disconnect()
public boolean makeDir(String newDir)
newDir
- public boolean changeDir(String newDir)
newDir
- public boolean changeFileType(boolean binaryTransfer1)
binaryTransfer1
- public void changeMode(boolean passive)
passive
- public boolean transferFile(String local, String remote, int getStoreOrAppend)
local
- local filepath (limited to path if get, else full
path)remote
- filenamegetStoreOrAppend
- -1 = get, 1 = store, 2 = appendpublic String[] listFiles()
public boolean featureEnabled(String feature)
feature
- public String[] executeCommand(String params)
params
- Copyright © 2009–2020 Waarp. All rights reserved.