code: public static URI uriFromPath(String path) throws IllegalArgumentException {
          try {
              return new URI(null, null, path, null);
          } catch (URISyntaxException e) {
              throw new IllegalArgumentException(e);
          }
      }
docs: Create a {@link URI} from a path. This is similar to calling
  `new URI(null, null, path, null)` with the {@link URISyntaxException}
  converted to a {@link IllegalArgumentException}.
  
  @param path the path
  @return the uri
  @throws IllegalArgumentException if the string violates
  RFC 2396