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");
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts