use commons-net-3.6.jar for FTP connection,
The connection is successful, also switch to the target directory, and then print it through ftp.listFiles ();
with a length of only 1 strong getName (), but it is .
accessed through the browser, there are many files in the directory. However, using java FTP connection, you cannot get the file name
if (changeDirector(parseFTPReq())) {
ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
FTPFile[] ftpFiles = ftp.listFiles();
for (int i = 0; i < ftpFiles.length; iPP) {
String fileName = ftpFiles[i].getName();
System.out.println(fileName);
}
}
in addition, the access to the page is very slow, does it have anything to do with the network speed?