mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-03 05:44:10 -08:00
This commit is contained in:
parent
9e9f7dbee2
commit
5034b49c36
|
@ -35,7 +35,18 @@ public class ClasspathResourceReader implements ResourceReader {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasResource(String name) {
|
public boolean hasResource(String name) {
|
||||||
return classLoader.getResource(name) != null;
|
if (classLoader.getResource(name) == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try (InputStream input = classLoader.getResourceAsStream(name)) {
|
||||||
|
if (input == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
input.read();
|
||||||
|
} catch (IOException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user