MCPcopy Create free account
hub / github.com/ReadyTalk/avian / getResource

Method getResource

classpath/java/lang/Class.java:582–594  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

580 }
581
582 public URL getResource(String path) {
583 if (path.startsWith("/")) {
584 path = path.substring(1);
585 } else {
586 String name = Classes.makeString
587 (vmClass.name, 0, vmClass.name.length - 1);
588 int index = name.lastIndexOf('/');
589 if (index >= 0) {
590 path = name.substring(0, index) + "/" + path;
591 }
592 }
593 return getClassLoader().getResource(path);
594 }
595
596 public InputStream getResourceAsStream(String path) {
597 URL url = getResource(path);

Callers 1

getResourceAsStreamMethod · 0.95

Calls 5

substringMethod · 0.95
makeStringMethod · 0.95
lastIndexOfMethod · 0.95
getClassLoaderMethod · 0.95
startsWithMethod · 0.80

Tested by

no test coverage detected