I would like to list the files in a certain URL that requires authentication. Note that I have no access to the FTP server. Is there any possible way that I can do this using Java?
Accessing FTP from java is at best an arduous task, because the standard library doesn't provide anything for it. However, there are a few ways. There are three way to read directory listings, explained on nsftools :
sun.net.ftp.FTPClient
class. This class is used internally by the java library to download files from FTP, but it is undocumented, not guaranteed to be present in all java implementations, &c. Plus, directory listings are very hard to parse.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.