[英]Listing files from a remote URL using Java
I would like to list the files in a certain URL that requires authentication. 我想在需要身份验证的特定URL中列出文件。 Note that I have no access to the FTP server.
请注意,我无权访问FTP服务器。 Is there any possible way that I can do this using Java?
有什么办法可以使用Java做到这一点?
Accessing FTP from java is at best an arduous task, because the standard library doesn't provide anything for it. 从Java访问FTP充其量是一项艰巨的任务,因为标准库没有为此提供任何服务。 However, there are a few ways.
但是,有几种方法。 There are three way to read directory listings, explained on nsftools :
有三种读取目录列表的方法,在nsftools上进行了解释 :
sun.net.ftp.FTPClient
class. sun.net.ftp.FTPClient
类。 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.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.