code: @VisibleForTesting
    static File toFile(URL url) {
      checkArgument(url.getProtocol().equals("file"));
      try {
        return new File(url.toURI()); // Accepts escaped characters like %20.
      } catch (URISyntaxException e) { // URL.toURI() doesn't escape chars.
        return new File(url.getPath()); // Accepts non-escaped chars like space.
      }
    }
docs: TODO(benyu): Try java.nio.file.Paths#get() when Guava drops JDK 6 support.