Java: how to get a File from an escaped URL?

The File constructor taking an URI in combination with URL#toURI() should work:

URL url = getItSomehow();
File file = new File(url.toURI());

Leave a Comment