+2003-12-30 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (requestProperties): New field.
+ (addRequestProperty): New method.
+ (getRequestProperty): New method.
+ (setRequestProperty): New method.
+ (getRequestProperties): New method.
+
2003-12-28 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/http/Connection.java
import java.net.Socket;
import java.net.URL;
import java.net.URLConnection;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import gnu.java.net.HeaderFieldHelper;
*/
private DataInputStream inputStream;
+ /**
+ * This object holds the request properties.
+ */
+ private HashMap requestProperties = new HashMap();
+
/**
* This is the object that holds the header field information
*/
method);
}
+ public void addRequestProperty(String key, String value)
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ String old = (String) requestProperties.put(key, value);
+
+ if (old != null)
+ requestProperties.put(key, old + "," + value);
+ }
+
+ public String getRequestProperty(String key)
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ return (String) requestProperties.get(key);
+ }
+
+ public void setRequestProperty(String key, String value)
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ requestProperties.put(key, value);
+ }
+
+ public Map getRequestProperties()
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ return requestProperties;
+ }
+
public String getHeaderField(String name)
{
if (!connected)