code: public static File getFile(URL resourceUrl, String description) throws FileNotFoundException {
          if (!URL_PROTOCOL_FILE.equals(resourceUrl.getProtocol())) {
              throw new FileNotFoundException(
                  description + " cannot be resolved to absolute file path " +
                      "because it does not reside in the file system: " + resourceUrl);
          }
          try {
              return new File(toURI(resourceUrl).getSchemeSpecificPart());
          } catch (URISyntaxException ex) {
              // Fallback for URLs that are not valid URIs (should hardly ever happen).
              return new File(resourceUrl.getFile());
          }
      }
docs: Resolve the given resource URL to a <code>java.io.File</code>,
  i.e. to a file in the file system.
  
  @param resourceUrl the resource URL to resolve
  @param description a description of the original resource that
  the URL was created for (for example, a class path location)
  @return a corresponding File object
  @throws java.io.FileNotFoundException if the URL cannot be resolved to
  a file in the file system