class ResourceLocator {

  public static URL toURL(String s) throws Exception {
    URI configuredUri = toURI(s);
    return isLocal(configuredUri) ? localResource(configuredUri)
        : new URL(configuredUri.toString());
  }

}