aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
index 5f68ad97..06aec0d8 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
@@ -31,8 +31,12 @@ public class DGURLConnection extends URLConnection {
}
@Override
public InputStream getInputStream() throws IOException {
- String path = url.getPath().substring(1);
- if (!authenticator.getDynamicResources().containsKey(path)) throw new FileNotFoundException();
- return new ByteArrayInputStream(authenticator.getDynamicResources().get(path));
+ if (authenticator != null) {
+ String path = url.getPath().substring(1);
+ if (!authenticator.getDynamicResources().containsKey(path)) throw new FileNotFoundException();
+ return new ByteArrayInputStream(authenticator.getDynamicResources().get(path));
+ } else {
+ return DGURLConnection.class.getResourceAsStream(url.getPath());
+ }
}
}