aboutsummaryrefslogtreecommitdiff
path: root/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java
diff options
context:
space:
mode:
authorJoshua Rahm <joshua.rahm@colorado.edu>2015-01-30 17:11:48 -0700
committerJoshua Rahm <joshua.rahm@colorado.edu>2015-01-30 17:11:48 -0700
commit1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch)
tree926cef8cb76d46862ed2c4ec7028720611e47476 /src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java
downloadModulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz
Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2
Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip
added source
Diffstat (limited to 'src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java')
-rw-r--r--src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java
new file mode 100644
index 0000000..9cc10e7
--- /dev/null
+++ b/src/org/eclipse/jdt/internal/jarinjarloader/RsrcURLConnection.java
@@ -0,0 +1,36 @@
+/* */ package org.eclipse.jdt.internal.jarinjarloader;
+/* */
+/* */ import java.io.IOException;
+/* */ import java.io.InputStream;
+/* */ import java.net.MalformedURLException;
+/* */ import java.net.URL;
+/* */ import java.net.URLConnection;
+/* */ import java.net.URLDecoder;
+/* */
+/* */ public class RsrcURLConnection extends URLConnection
+/* */ {
+/* */ private ClassLoader classLoader;
+/* */
+/* */ public RsrcURLConnection(URL url, ClassLoader classLoader)
+/* */ {
+/* 34 */ super(url);
+/* 35 */ this.classLoader = classLoader;
+/* */ }
+/* */
+/* */ public void connect() throws IOException {
+/* */ }
+/* */
+/* */ public InputStream getInputStream() throws IOException {
+/* 42 */ String file = URLDecoder.decode(this.url.getFile(), "UTF-8");
+/* 43 */ InputStream result = this.classLoader.getResourceAsStream(file);
+/* 44 */ if (result == null) {
+/* 45 */ throw new MalformedURLException("Could not open InputStream for URL '" + this.url + "'");
+/* */ }
+/* 47 */ return result;
+/* */ }
+/* */ }
+
+/* Location: Modulus.jar
+ * Qualified Name: org.eclipse.jdt.internal.jarinjarloader.RsrcURLConnection
+ * JD-Core Version: 0.6.2
+ */ \ No newline at end of file