问题
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