code: public static Path asPath(URI uri) {
      try {
        return Paths.get(uri);
      } catch (FileSystemNotFoundException e) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (cl == null) {
          throw e;
        }
        try {
          return FileSystems.newFileSystem(uri, new HashMap<>(), cl).provider().getPath(uri);
        } catch (IOException ex) {
          throw new RuntimeException("Cannot create filesystem for " + uri, ex);
        }
      }
    }
docs: Convert the given path {@link URI} to a {@link Path} object.
  @param uri the path to convert
  @return a {@link Path} object