add URLConnection methods

This commit is contained in:
Joel Dice 2011-01-11 18:25:34 -07:00
parent 2e86f0ac57
commit dd52908f89

View File

@ -16,6 +16,9 @@ import java.io.OutputStream;
public abstract class URLConnection {
protected final URL url;
protected boolean doInput = true;
protected boolean doOutput = false;
protected boolean useCaches = true;
protected URLConnection(URL url) {
this.url = url;
@ -29,6 +32,8 @@ public abstract class URLConnection {
return -1;
}
public abstract void connect() throws IOException;
public InputStream getInputStream() throws IOException {
throw new UnknownServiceException();
}
@ -36,4 +41,24 @@ public abstract class URLConnection {
public OutputStream getOutputStream() throws IOException {
throw new UnknownServiceException();
}
public boolean getDoInput() {
return doInput;
}
public boolean getDoOutput() {
return doOutput;
}
public void setDoInput(boolean v) {
doInput = v;
}
public void setDoOutput(boolean v) {
doInput = v;
}
public void setUseCaches(boolean v) {
useCaches = v;
}
}