FTPDownload.java
API description
public FTPDownload (
String getFTPHost,
int getFTPPort,
String getFTPUser,
String getFTPPwd,
String getFTPDwnFilePath,
String getFTPLocalFilePath
)
public FTPDownload (
String getFTPHost,
int getFTPPort,
String getFTPUser,
String getFTPPwd,
String getFTPDwnFilePath
)
- start to download data from ftp server (開始自 FTP 伺服器下載資料)
public int startFTPDownload()
- get the downloaded data content (取得下載資料的內容)
public String getFTPData()
API Example
- Example.1 : get data content as string
FTPDownload fd = new FTPDownload(
"host", port, "user", "password", "file path on the server"
);
int ftpStatus = fd.startFTPDownload();
System.out.println(String.format("%s", fd.getFTPData()));
- Example.2 : download as file
FTPDownload fd = new FTPDownload(
"host", port, "user", "password", "file path on the server", "file path on the local"
);
int ftpStatus = fd.startFTPDownload();