01.
package
com.java.myapp;
02.
03.
import
it.sauronsoftware.ftp4j.FTPClient;
04.
05.
import
java.io.File;
06.
07.
public
class
MyClass {
08.
09.
public
static
void
main(String[] args) {
10.
11.
try
{
12.
13.
FTPClient client =
new
FTPClient();
14.
15.
client.connect(
"ftp.thaicreate.com"
,
21
);
16.
17.
client.login(
"ftp@thaicreate.com"
,
"password"
);
18.
19.
20.
client.download(
"DocumentPDF1.pdf"
,
new
File(
"C:\\java\\DocumentPDF1.pdf"
));
21.
client.download(
"DocumentPDF2.pdf"
,
new
File(
"C:\\java\\DocumentPDF2.pdf"
));
22.
23.
client.disconnect(
true
);
24.
25.
System.out.println(
"Download Successfully"
);
26.
27.
}
28.
catch
(Exception e) {
29.
e.printStackTrace();
30.
}
31.
32.
}
33.
34.
}