我有一个可以从服务器访问的URL,它有很多XML,记录定期更新的文件,因此我需要继续点击以便用户查看
有可能我可以获取这些文件的名称,甚至可能在视图中显示内容供用户查看吗?
我试过这个,但它根本没用。
注意我无法以任何其他方式访问机器,只需访问网址
String path = request.getContextPath();
path += DOWNLOADS;
URL url = null;
String server = request.getServerName();
try {
url = new URL("https", server, request.getLocalPort(), path);
} catch (MalformedURLException e) {
e.printStackTrace();
}
if (url != null) {
String externalForm = url.toExternalForm();
File directory = new File(externalForm);
String[] files = directory.list();
for (String file : files) {
;
}
}
由于