diff options
| author | Michael Koch <konqueror@gmx.de> | 2003-12-27 20:15:16 +0000 |
|---|---|---|
| committer | Michael Koch <konqueror@gmx.de> | 2003-12-27 20:15:16 +0000 |
| commit | 3d6f58179a90d86117efabc33a32bde6805ac230 (patch) | |
| tree | 85cb124d806cefacfe90d8f3da821bb1051c330a /gnu/java/net/protocol/http/Connection.java | |
| parent | f504d31d0595d691190eff1fbbfae7aa40d8def9 (diff) | |
| download | classpath-3d6f58179a90d86117efabc33a32bde6805ac230.tar.gz | |
2003-12-27 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
(setRequestProperty): New method.
(getRequestProperty): New method.
(getHeaderField): Reformated.
(getHeaderFieldKey): Reformated.
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; } |
