diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-23 04:54:03 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-23 04:54:03 +0000 |
commit | 07b454867419ca7555e053238b773ca4184e3b12 (patch) | |
tree | e988743f8265d8bc9d37140fdc6474101dd74487 /libjava | |
parent | 355351aad1a9ce586630cd700a4ec285a9b16a36 (diff) | |
download | gcc-07b454867419ca7555e053238b773ca4184e3b12.tar.gz |
2003-08-23 Michael Koch <konqueror@gmx.de>
* java/net/URLConnection.java,
java/netJarURLConnection.java,
gnu/gcj/protocol/core/Connection.java,
gnu/gcj/protocol/file/Connection.java,
gnu/gcj/protocol/http/Connection.java: Added implementation of
getHeaderFields().
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56532 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 9 | ||||
-rw-r--r-- | libjava/gnu/gcj/protocol/core/Connection.java | 15 | ||||
-rw-r--r-- | libjava/gnu/gcj/protocol/file/Connection.java | 15 | ||||
-rw-r--r-- | libjava/gnu/gcj/protocol/http/Connection.java | 17 | ||||
-rw-r--r-- | libjava/java/net/JarURLConnection.java | 15 | ||||
-rw-r--r-- | libjava/java/net/URLConnection.java | 10 |
6 files changed, 81 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e01ab1ba9ae..b4f319f5315 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2003-08-23 Michael Koch <konqueror@gmx.de> + + * java/net/URLConnection.java, + java/netJarURLConnection.java, + gnu/gcj/protocol/core/Connection.java, + gnu/gcj/protocol/file/Connection.java, + gnu/gcj/protocol/http/Connection.java: Added implementation of + getHeaderFields(). + 2002-08-22 Tom Tromey <tromey@redhat.com> * gij.cc (help): Document -cp and -classpath. diff --git a/libjava/gnu/gcj/protocol/core/Connection.java b/libjava/gnu/gcj/protocol/core/Connection.java index 6513e336214..5bcbb8611c7 100644 --- a/libjava/gnu/gcj/protocol/core/Connection.java +++ b/libjava/gnu/gcj/protocol/core/Connection.java @@ -13,6 +13,7 @@ package gnu.gcj.protocol.core; import gnu.gcj.Core; import java.net.*; import java.io.*; +import java.util.Map; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; @@ -72,6 +73,20 @@ class Connection extends URLConnection } // Override default method in URLConnection. + public Map getHeaderFields() + { + try + { + getHeaders(); + } + catch (IOException x) + { + return null; + } + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { try diff --git a/libjava/gnu/gcj/protocol/file/Connection.java b/libjava/gnu/gcj/protocol/file/Connection.java index 5510c5d74ea..4fcdb11ed52 100644 --- a/libjava/gnu/gcj/protocol/file/Connection.java +++ b/libjava/gnu/gcj/protocol/file/Connection.java @@ -12,6 +12,7 @@ package gnu.gcj.protocol.file; import java.net.*; import java.io.*; +import java.util.Map; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; @@ -96,6 +97,20 @@ class Connection extends URLConnection } // Override default method in URLConnection. + public Map getHeaderFields() + { + try + { + getHeaders(); + } + catch (IOException x) + { + return null; + } + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { try diff --git a/libjava/gnu/gcj/protocol/http/Connection.java b/libjava/gnu/gcj/protocol/http/Connection.java index 10fbfd66723..caababa6823 100644 --- a/libjava/gnu/gcj/protocol/http/Connection.java +++ b/libjava/gnu/gcj/protocol/http/Connection.java @@ -12,6 +12,7 @@ package gnu.gcj.protocol.http; import java.net.*; import java.io.*; +import java.util.Map; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; @@ -168,6 +169,22 @@ class Connection extends HttpURLConnection } // Override default method in URLConnection. + public Map getHeaderFields() + { + if (!connected) + try + { + connect(); + } + catch (IOException x) + { + return null; + } + + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { if (!connected) diff --git a/libjava/java/net/JarURLConnection.java b/libjava/java/net/JarURLConnection.java index 60adfcd9c61..a2b3434352d 100644 --- a/libjava/java/net/JarURLConnection.java +++ b/libjava/java/net/JarURLConnection.java @@ -12,6 +12,7 @@ import java.net.*; import java.io.*; import java.util.jar.*; import java.util.zip.*; +import java.util.Map; import java.util.Vector; import java.util.Hashtable; @@ -215,6 +216,20 @@ public abstract class JarURLConnection extends URLConnection } // Override default method in URLConnection. + public Map getHeaderFields() + { + try + { + getHeaders(); + } + catch (IOException x) + { + return null; + } + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { try diff --git a/libjava/java/net/URLConnection.java b/libjava/java/net/URLConnection.java index 8f8cf5ed575..6ee41aa5776 100644 --- a/libjava/java/net/URLConnection.java +++ b/libjava/java/net/URLConnection.java @@ -17,6 +17,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.Hashtable; +import java.util.Map; import java.util.StringTokenizer; import gnu.gcj.io.MimeTypes; @@ -107,6 +108,15 @@ public abstract class URLConnection return null; } + /** + * @since 1.4 + */ + public Map getHeaderFields() + { + // Subclasses for specific protocols override this. + return null; + } + public int getHeaderFieldInt(String name, int val) { String str = getHeaderField(name); |