import java.net.*;
import java.io.*;

public class StringURLConnection extends URLConnection {
    private URL base;
    public final static int DEFPORT=80;
    public StringURLConnection(URL url) { super(url); }

    public String getContentType() { return "application/x-jstring"; }

    public synchronized void connect() throws IOException {
	if (!connected) {
// remove old protocol and substitute http://
	    String newurl="http://" + url.toExternalForm().substring(9);
	    base=new URL(newurl);
	}
    }

    public synchronized InputStream getInputStream() throws IOException {
	connect();
	return base.openStream();
    }
}
