aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/customurl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/customurl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java42
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java18
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java20
3 files changed, 0 insertions, 80 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
deleted file mode 100644
index 06aec0d8..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package kr.syeyoung.dungeonsguide.customurl;
-
-import kr.syeyoung.dungeonsguide.Authenticator;
-import kr.syeyoung.dungeonsguide.DungeonsGuideMain;
-import lombok.SneakyThrows;
-import net.minecraft.launchwrapper.LaunchClassLoader;
-
-import javax.crypto.Cipher;
-import javax.crypto.CipherInputStream;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-import java.io.*;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
-public class DGURLConnection extends URLConnection {
- private Authenticator authenticator;
- protected DGURLConnection(URL url, Authenticator authenticator) {
- super(url);
- connected = false;
- this.authenticator = authenticator;
- }
-
- @Override
- public void connect() throws IOException {
- }
- @Override
- public InputStream getInputStream() throws IOException {
- 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());
- }
- }
-}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java
deleted file mode 100644
index b5d0f861..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandler.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package kr.syeyoung.dungeonsguide.customurl;
-
-import kr.syeyoung.dungeonsguide.Authenticator;
-import lombok.AllArgsConstructor;
-
-import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-
-@AllArgsConstructor
-public class DGURLStreamHandler extends URLStreamHandler {
- private Authenticator authenticator;
- @Override
- protected URLConnection openConnection(URL url) throws IOException {
- return new DGURLConnection(url, authenticator);
- }
-}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java
deleted file mode 100644
index 418c55f0..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package kr.syeyoung.dungeonsguide.customurl;
-
-import kr.syeyoung.dungeonsguide.Authenticator;
-import lombok.AllArgsConstructor;
-
-import java.net.URLStreamHandler;
-import java.net.URLStreamHandlerFactory;
-
-@AllArgsConstructor
-public class DGURLStreamHandlerFactory implements URLStreamHandlerFactory {
- private Authenticator authenticator;
- @Override
- public URLStreamHandler createURLStreamHandler(String s) {
- if ("dungeonsguide".equals(s)) {
- return new DGURLStreamHandler(authenticator);
- }
-
- return null;
- }
-}