ResourceLocator { public static URL toURL(String s) throws Exception { URI configuredUri = toURI(s); return isLocal(configuredUri) ? localResource(configuredUri) : new URL(configuredUri.toString()); }  static URL toURL(String s);  }
@Test public void testToURL() throws Exception { assertNotNull(toURL("./config/jetty.xml")); assertNotNull(toURL("file: assertNotNull(toURL("file: assertNotNull(toURL("file: assertNotNull(toURL("\\absolute\\path\\to\\jetty.xml")); assertNotNull(toURL("https: assertNotNull(toURL(JettyServerManager.DEFAULT_JETTY_XML)); }
@Test(expected = URISyntaxException.class) public void testToURL_URISyntax() throws Exception { toURL("file: }
@Test public void testToURL_Relative() throws Exception { relativeFile.mkdirs(); trackFile(relativeFile, this); File tempFile = createTrackedFile(this, relativeFile); URL url = toURL("file: try (InputStream in = url.openStream()) { } URL url2 = toURL("file: try (InputStream in = url2.openStream()) { } }