diff -r 05224402145d -r b679a7dad297 emul/mini/src/main/java/java/net/URL.java
--- a/emul/mini/src/main/java/java/net/URL.java Wed Jan 23 20:39:23 2013 +0100
+++ b/emul/mini/src/main/java/java/net/URL.java Thu Jan 24 19:36:40 2013 +0100
@@ -29,6 +29,7 @@
import java.io.InputStream;
import org.apidesign.bck2brwsr.core.JavaScriptBody;
+
/**
* Class URL
represents a Uniform Resource
* Locator, a pointer to a "resource" on the World
@@ -212,6 +213,9 @@
* @serial
*/
private int hashCode = -1;
+
+ /** input stream associated with the URL */
+ private InputStream is;
/**
* Creates a URL
object from the specified
@@ -421,6 +425,11 @@
public URL(String spec) throws MalformedURLException {
this(null, spec);
}
+
+ private URL(String spec, InputStream is) throws MalformedURLException {
+ this(null, spec);
+ this.is = is;
+ }
/**
* Creates a URL by parsing the given spec within a specified context.
@@ -950,8 +959,10 @@
* @see java.net.URLConnection#getInputStream()
*/
public final InputStream openStream() throws java.io.IOException {
+ if (is != null) {
+ return is;
+ }
throw new IOException();
-// return openConnection().getInputStream();
}
/**
@@ -1006,7 +1017,6 @@
}
}
-
class Parts {
String path, query, ref;