MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getAbsoluteURL

Method getAbsoluteURL

src/javajs/async/Assets.java:174–184  ·  view source on GitHub ↗

The difference here is that URL will not insert the %20 for space that URI will. @param path @return

(String path)

Source from the content-addressed store, hash-verified

172 * @return
173 */
174 public static URL getAbsoluteURL(String path) {
175 URL url = null;
176 try {
177 url = (path.indexOf("file:") == 0 ? new URL(path) : new File(new File(path).getAbsolutePath()).toURI().toURL());
178 if (path.indexOf("!/")>=0)
179 url = new URL("jar", null, url.toString());
180 } catch (MalformedURLException e) {
181 e.printStackTrace();
182 }
183 return url;
184 }
185
186 public static URI getAbsoluteURI(String path) {
187 URI uri = null;

Callers 3

getAssetBytesMethod · 0.95
_getURLFromPathMethod · 0.95
getURLWithCachedBytesMethod · 0.95

Calls 2

getAbsolutePathMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected