我试图将这些csv文件显示为url,但我失败了
我如何在文件系统中获取文件的URL?
public DownloadFileResponse downloadFile(DownloadFileRequest req) {
//TODO: create and set ImportMarketResponse object and return the following as response data
// "EventSet Id: " + req.eventSetId;
String txt ="EventSet Id: " + req.eventSetId;
DownloadFileResponse res = new DownloadFileResponse();
res.setReturnDate(txt);
return res;
}
答案 0 :(得分:0)
获取文件的网址:
Java 7 +
Paths.get("path","to","file").toUri().toURL()
旧版本
new File(path).toURI().toURL();