implement jar and file URL stream handlers

This commit is contained in:
Joel Dice
2011-03-25 19:14:21 -06:00
parent 31eb047391
commit 3dd091c67a
13 changed files with 342 additions and 23 deletions

View File

@ -34,12 +34,13 @@ public class SystemClassLoader extends ClassLoader {
return c == null ? null : getClass(c);
}
private native boolean resourceExists(String name);
private native String resourceURLPrefix(String name);
protected URL findResource(String name) {
if (resourceExists(name)) {
String prefix = resourceURLPrefix(name);
if (prefix != null) {
try {
return new URL("resource:" + name);
return new URL(prefix + name);
} catch (MalformedURLException ignored) { }
}
return null;