devxlogo

April 24, 2019

Define an URL to a Local File

If we want to define a valid URL instance for a file we need to add the “file” protocol as in the following example: URL url = new URL(“file:///C:/photos/me.png”);