new File(String url, String child) modify url

浪子不回头ぞ 提交于 2020-06-08 15:13:00

问题


I'm trying to create a new File passing a url as parent pathName and the fileName as child.

File savedFile = new File(Path.getPathDocumentAttach(), renameTo);

The path Path.getPathDocumentAttach() is correct, but the url "https://...." it's modified to "https:/...." (with only 1 "/").

So, when I pass savedFile to FileItem.write(savedFile) I got a java.lang.NullPointerException.

What am I doing wrong? What can I do to make it works?

ps. I want to save the file in the url I'm passing as first parameter (new File(URL(it's a string), "name"))

来源:https://stackoverflow.com/questions/62044306/new-filestring-url-string-child-modify-url

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!