Java 在我的文件系统web服务中创建文件的url

Java 在我的文件系统web服务中创建文件的url,java,web-services,soap,url-routing,java-ee-7,Java,Web Services,Soap,Url Routing,Java Ee 7,我试图将这些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

我试图将这些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;

    }
获取文件的url:

爪哇7+

Paths.get("path","to","file").toUri().toURL()
旧版本

new File(path).toURI().toURL();