>我的文件系统
我试图将这些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;
}
获取文件的网址:
爪哇 7+
Paths.get("path","to","file").toUri().toURL()
旧版本
new File(path).toURI().toURL();