This commit is contained in:
parent
51b2727555
commit
c2235c5c2c
2 changed files with 8 additions and 5 deletions
|
@ -394,7 +394,7 @@ public class Loader implements Util {
|
||||||
byte[] bytes = new StreamReader(stream).readAllAsBytes();
|
byte[] bytes = new StreamReader(stream).readAllAsBytes();
|
||||||
try(FileOutputStream os = new FileOutputStream(filename)) {
|
try(FileOutputStream os = new FileOutputStream(filename)) {
|
||||||
os.write(bytes);
|
os.write(bytes);
|
||||||
}
|
} catch (IOException ignored) { }
|
||||||
stream = new ByteArrayInputStream(bytes);
|
stream = new ByteArrayInputStream(bytes);
|
||||||
}
|
}
|
||||||
ZipInputStream jar = new ZipInputStream(stream);
|
ZipInputStream jar = new ZipInputStream(stream);
|
||||||
|
|
|
@ -23,12 +23,15 @@ public class SimpleClassLoader extends ClassLoader {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected URL findResource(String name) {
|
protected URL findResource(String name) {
|
||||||
|
if(classes.get(name) != null) {
|
||||||
try {
|
try {
|
||||||
return URLWrapper.wrap(name, classes.get(name));
|
return URLWrapper.wrap(name, classes.get(name));
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
|
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
|
||||||
|
|
Loading…
Add table
Reference in a new issue