Skip to content
Advertisement

How to convert https url to File in Java?

I have an https url which is of String format. How can I convert it to File? I tried this but I’m getting error – URI scheme is not "file"

JavaScript

Advertisement

Answer

FileUtils.copyURLToFile worked well for me.

Reference – https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#copyURLToFile-java.net.URL-java.io.File-

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement