|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.tck.util.ftp.FtpClient
public class FtpClient
Ftp client wrapper for working with an FTP server.
Field Summary | |
---|---|
protected Log |
logger
|
static int |
TIMEOUT
|
Constructor Summary | |
---|---|
FtpClient(String server,
int port,
String user,
String password)
|
Method Summary | |
---|---|
protected void |
connect()
Initiate a connection to the ftp server |
boolean |
deleteDir(String dir)
Delete a directory |
boolean |
deleteFile(String name)
Delete a single file. |
boolean |
dirExists(String path)
Check if a directory exists by trying to go to it |
void |
disconnect()
Disconnect the ftp client |
boolean |
expectFileCount(String directory,
int count,
long timeout)
Verify that a number of files exist on the ftp server |
boolean |
fileExists(String file)
Check if a file exists on the ftp server |
String[] |
getFileList(String path)
Get a list of file names in a given directory for admin |
boolean |
isConnected()
Check if the ftp client is connected |
boolean |
makeDir(String dir)
Create a directory |
boolean |
putFile(String fileName,
String targetDir)
Upload a file to the ftp server |
boolean |
putFile(String fileName,
String targetDir,
String fileContent)
Upload a file to the ftp server |
void |
recursiveDelete(String path)
Delete all files and subdirectories. |
boolean |
testConnection()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final transient Log logger
public static final int TIMEOUT
Constructor Detail |
---|
public FtpClient(String server, int port, String user, String password)
Method Detail |
---|
public boolean testConnection() throws IOException
IOException
public String[] getFileList(String path) throws IOException
IOException
public boolean makeDir(String dir) throws IOException
dir
-
IOException
public boolean deleteDir(String dir) throws IOException
dir
- The directory to delete
IOException
public boolean putFile(String fileName, String targetDir) throws IOException
fileName
- The file to upload
IOException
public boolean putFile(String fileName, String targetDir, String fileContent) throws IOException
fileName
- The file to upload
IOException
public boolean dirExists(String path) throws IOException
path
- The directory to try
IOException
public void recursiveDelete(String path) throws IOException
IOException
protected void connect() throws IOException
IOException
public boolean isConnected()
public void disconnect() throws IOException
IOException
public boolean fileExists(String file) throws IOException
file
- The name of the file to check
IOException
public boolean deleteFile(String name) throws IOException
name
- The file to delete
IOException
public boolean expectFileCount(String directory, int count, long timeout) throws InterruptedException, IOException
directory
- The remote directory to checktimeout
- The max time to wait
InterruptedException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |