Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
List FTP Directory with FTPClientExample.java
How to list a FTP directory with examples.ftp.FTPClientExample.java program? I know the directory path on the anonymous server.
✍: FYIcenter.com
If you know the directory path on an anonymous FTP server, you can use the following command to list the directory on the FTP server:
java -a -A -d examples.ftp.FTPClientExample host path Where: -a - Use active mode for data connections to avoid firewall settings -A - Use anonymous login -d - List a directory host - Host name or IP address of the FTP server path - Path name of the directory on the FTP server
Here is an example of running examples.ftp.FTPClientExample.java program to list the /pub/davis directory from the space.mit.edu FTP server:
C:\fyicenter> java -cp .;C:\local\commons-net-3.5\commons-net-3.5.jar ;C:\local\commons-net-3.5\commons-net-examples-3.5.jar examples.ftp.FTPClientExample -a -A -d space.mit.edu /pub/davis 220-space.mit.edu NcFTPd Server (free educational license) ready. 220- 220- This server is operated by the MIT Center for Space Research. 220- Only anonymous FTP access is allowed to this server. Use the 220- login Name `ftp', and use your e-mail address for the password. 220- Connected to space.mit.edu on 21 USER ******* 331 Guest login ok, send your complete e-mail address as password. PASS ******* 230 Logged in anonymously. SYST 215 UNIX Type: L8 Remote system is UNIX Type: L8 TYPE A 200 Type okay. PORT 192,168,1,7,238,190 200 PORT command successful. MLSD /pub/davis 150 Opening ASCII mode data connection for MLS. 226 Listing completed. Type=cdir;Modify=20040203180606;UNIX.mode=0755; /pub/davis drwxr-xr-x 0 -1 2004-02-03 18:06:06 GMT /pub/davis Type=pdir;Modify=20160902130025;UNIX.mode=0755; /pub drwxr-xr-x 0 -1 2016-09-02 13:00:25 GMT /pub Type=file;Size=537;Modify=19950811161207;UNIX.mode=0644; VMS.readme -rw-r--r-- 0 537 1995-08-11 16:12:07 GMT VMS.readme Type=file;Size=10175;Modify=20000426170956;UNIX.mode=0644; acsite.m4 -rw-r--r-- 010175 2000-04-26 17:09:56 GMT acsite.m4 Type=dir;Modify=20091214023711;UNIX.mode=0755; jed drwxr-xr-x 0 -1 2009-12-14 02:37:11 GMT jed Type=dir;Modify=20130924151431;UNIX.mode=0755; misc drwxr-xr-x 0 -1 2013-09-24 15:14:31 GMT misc Type=dir;Modify=20080925205417;UNIX.mode=0755; most drwxr-xr-x 0 -1 2008-09-25 20:54:17 GMT most Type=dir;Modify=20120317034319;UNIX.mode=0755; slang drwxr-xr-x 0 -1 2012-03-17 03:43:19 GMT slang Type=dir;Modify=20121222011319;UNIX.mode=0755; slrn drwxr-xr-x 0 -1 2012-12-22 01:13:19 GMT slrn Type=dir;Modify=20040228142210;UNIX.mode=0755; slsc drwxr-xr-x 0 -1 2004-02-28 14:22:10 GMT slsc Type=file;Size=0;Modify=19960429185651;UNIX.mode=0644; {READ_BUGS_FILE_IF_PRESENT} -rw-r--r-- 0 0 1996-04-29 18:56:51 GMT {READ_BUGS_FILE_IF_PRESENT} Type=file;Size=0;Modify=19960429185454;UNIX.mode=0644; {SPECIFY_BINARY_BEFORE_DOWNLOADING} -rw-r--r-- 0 0 1996-04-29 18:54:54 GMT {SPECIFY_BINARY_BEFORE_DOWNLOADING} NOOP 200 No-op okay. QUIT 221- 221- Thanks for stopping by! 221
⇒ Download FTP File with FTPClientExample.java
⇐ Run examples.ftp.FTPClientExample.java
2017-05-12, 2491🔥, 0💬
Popular Posts:
jlGui is a music player for the Java platform. It is based on Java Sound 1.0 (i.e. JDK 1.3+). It sup...
The Jakarta-ORO Java classes are a set of text-processing Java classes that provide Perl5 compatible...
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...
JDK 11 jdk.internal.opt.jmod is the JMOD file for JDK 11 Internal Opt module. JDK 11 Internal Opt mo...
JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module. JDK 11 Hotspot Agent...