public class FTPDownloader
extends java.lang.Object
| Constructor and Description |
|---|
FTPDownloader(java.lang.String host)
Set up an anonymous FTP connection (without protocol commands printed).
|
FTPDownloader(java.lang.String host,
boolean debug)
Set up an anonymous FTP connection.
|
FTPDownloader(java.lang.String host,
java.lang.String user,
java.lang.String pwd,
boolean debug)
Set up an FTP connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect()
Disconnect from the FTP server.
|
void |
downloadFile(java.lang.String remoteFilePath,
java.io.File localFilePath)
Download the given file from the FTP server.
|
public FTPDownloader(java.lang.String host)
throws java.lang.Exception
host - the FTP hostjava.lang.Exception - thrown if the connection could not be madepublic FTPDownloader(java.lang.String host,
boolean debug)
throws java.lang.Exception
host - the FTP hostdebug - if true, the FTP protocol commands are printedjava.lang.Exception - thrown if the connection could not be madepublic FTPDownloader(java.lang.String host,
java.lang.String user,
java.lang.String pwd,
boolean debug)
throws java.lang.Exception
host - the FTP hostuser - the FTP user namepwd - the FTP passworddebug - if true, the FTP protocol commands are printedjava.lang.Exception - thrown if the connection could not be madepublic void downloadFile(java.lang.String remoteFilePath,
java.io.File localFilePath)
throws java.io.FileNotFoundException,
java.io.IOException
remoteFilePath - localFilePath - java.io.FileNotFoundExceptionjava.io.IOExceptionpublic void disconnect()
throws java.io.IOException
java.io.IOExceptionCopyright © 2014. All Rights Reserved.