resources/src/main/java/org/robolectric/res/Fs.java
public static Path fromUrl(String urlString) {
    if (urlString.startsWith("file:") || urlString.startsWith("jar:")) {
      URL url;
      try {
        url = new URL(urlString);
      } catch (MalformedURLException e) {
        throw new RuntimeException("Failed to resolve path from " + urlString, e);
      }
      return fromUrl(url);
    } else {
      return Paths.get(urlString);
    }
  }
public static Path fromUrl(String urlString) {
    if (urlString.startsWith("file:") || urlString.startsWith("jar:")) {
      URL url;
      try {
        url = new URL(urlString);
      } catch (MalformedURLException e) {
        throw new RuntimeException("Failed to resolve path from " + urlString, e);
      }
      return fromUrl(url);
    } else {
      return Paths.get(urlString);
    }
  }
Use this method instead of {@link Paths#get(String, String...)} or {@link Paths#get(URI)}.

<p>Supports "file:path", "jar:file:jarfile.jar!/path", and plain old paths.

<p>For JAR files, automatically open and cache filesystems.