org.linkedin.util-core/src/main/java/org/linkedin/util/io/resource/URLResource.java
public static Resource create(URL url)
  {
    URLBuilder rootURL = URLBuilder.createFromPath("/");
    rootURL.setScheme(url.getProtocol());
    rootURL.setHost(url.getHost());
    rootURL.setPort(url.getPort());
    rootURL.setUserInfo(url.getUserInfo());

    return create(rootURL.toJavaURL(), "/").createRelative(url.getPath());
  }
public static Resource create(URL url)
  {
    URLBuilder rootURL = URLBuilder.createFromPath("/");
    rootURL.setScheme(url.getProtocol());
    rootURL.setHost(url.getHost());
    rootURL.setPort(url.getPort());
    rootURL.setUserInfo(url.getUserInfo());

    return create(rootURL.toJavaURL(), "/").createRelative(url.getPath());
  }
Creates the resource from a url...

@param url
@return the resource