diff options
Diffstat (limited to 'gnu/java/net/protocol/http/Connection.java')
| -rw-r--r-- | gnu/java/net/protocol/http/Connection.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/gnu/java/net/protocol/http/Connection.java b/gnu/java/net/protocol/http/Connection.java index 66a2f7510..55d700e5b 100644 --- a/gnu/java/net/protocol/http/Connection.java +++ b/gnu/java/net/protocol/http/Connection.java @@ -134,6 +134,22 @@ public final class Connection extends HttpURLConnection doOutput = false; } + public void setRequestProperty(String key, String value) + { + if (connected) + throw new IllegalAccessError("Connection already established."); + + requestProperties.put(key, value); + } + + public String getRequestProperty(String key) + { + if (connected) + throw new IllegalAccessError("Connection already established."); + + return (String) requestProperties.get(key); + } + /** * Connects to the remote host, sends the request, and parses the reply * code and header information returned @@ -424,11 +440,11 @@ public final class Connection extends HttpURLConnection { if (!connected) try - { + { connect(); } - catch (IOException e) - { + catch (IOException x) + { return null; } @@ -448,11 +464,11 @@ public final class Connection extends HttpURLConnection { if (!connected) try - { + { connect(); } - catch (IOException e) - { + catch (IOException x) + { return null; } |
