| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private String | contentType
The URL that it is connected to |
| private Map | |
| protected MessageHeader | |
| private static final HashMap |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addRequestProperty(String key, String value)
Overrides java. The following three methods addRequestProperty, getRequestProperty, and getRequestProperties were copied from the superclass implementation before it was changed by CR:6230836, to maintain backward compatibility. |
| public boolean | |
| public void | |
| protected void | ensureCanServeHeaders()
This method is called whenever the headers related methods are called on the
|
| public int | getContentLength()
Overrides java. Call this routine to get the content-length associated with this object. |
| public String | getContentType()
Overrides java. Call this routine to get the content-type associated with this object. |
| public String | getHeaderField(String name)
Overrides java. Returns the value of the named header field. |
| public String | getHeaderField(int n)
Overrides java. Return the value for the nth header field. |
| public String | getHeaderFieldKey(int n)
Overrides java. Return the key for the nth header field. |
| public Map | getHeaderFields()
Overrides java. Returns an unmodifiable Map of the header fields. |
| public MessageHeader | |
| public Map | getRequestProperties()
Overrides java. Returns an unmodifiable Map of general request properties for this connection. |
| public String | getRequestProperty(String key)
Overrides java. Returns the value of the named general request property for this connection. |
| public static synchronized boolean | |
| protected void | setContentLength(int length)
Call this routine to set the content-length associated with this object. |
| public void | setContentType(String
The content type to use. One of the
content_* static variables in this
class should be used.
e.g. setType(URL.content_html); type)Set the content type of this URL to a specific value. |
| public void | |
| public static synchronized void | |
| public void | setRequestProperty(String key, String value)
Overrides java. Sets the general request property. |
| contentLength | back to summary |
|---|---|
| private int contentLength | |
| contentType | back to summary |
|---|---|
| private String contentType The URL that it is connected to | |
| headerFields | back to summary |
|---|---|
| private Map<String, List<String>> headerFields | |
| properties | back to summary |
|---|---|
| protected MessageHeader properties | |
| proxiedHosts | back to summary |
|---|---|
| private static final HashMap<String, Void> proxiedHosts | |
| URLConnection | back to summary |
|---|---|
| public URLConnection(URL u) Create a URLConnection object. These should not be created directly: instead they should be created by protocol handlers in response to URL.openConnection.
| |
| addRequestProperty | back to summary |
|---|---|
| public void addRequestProperty(String key, String value) Overrides java. The following three methods addRequestProperty, getRequestProperty, and getRequestProperties were copied from the superclass implementation before it was changed by CR:6230836, to maintain backward compatibility. | |
| canCache | back to summary |
|---|---|
| public boolean canCache() Returns true if the data associated with this URL can be cached. | |
| close | back to summary |
|---|---|
| public void close() Call this to close the connection and flush any remaining data. Overriders must remember to call super.close() | |
| ensureCanServeHeaders | back to summary |
|---|---|
| protected void ensureCanServeHeaders() throws IOException This method is called whenever the headers related methods are called on the
| |
| getContentLength | back to summary |
|---|---|
| public int getContentLength() Overrides java. Call this routine to get the content-length associated with this object. | |
| getContentType | back to summary |
|---|---|
| public String getContentType() Overrides java. Call this routine to get the content-type associated with this object. | |
| getHeaderField | back to summary |
|---|---|
| public String getHeaderField(String name) Overrides java. Doc from java. Returns the value of the named header field. If called on a connection that sets the same header multiple times with possibly different values, only the last value is returned. | |
| getHeaderField | back to summary |
|---|---|
| public String getHeaderField(int n) Overrides java. Return the value for the nth header field. Returns null if there are fewer than n fields. This can be used in conjunction with getHeaderFieldKey to iterate through all the headers in the message. | |
| getHeaderFieldKey | back to summary |
|---|---|
| public String getHeaderFieldKey(int n) Overrides java. Return the key for the nth header field. Returns null if there are fewer than n fields. This can be used to iterate through all the headers in the message. | |
| getHeaderFields | back to summary |
|---|---|
| public Map Overrides java. Doc from java. Returns an unmodifiable Map of the header fields.
The Map keys are Strings that represent the
response-header field names. Each Map value is an
unmodifiable List of Strings that represents
the corresponding field values.
This method is overridden by the subclasses of
| |
| getProperties | back to summary |
|---|---|
| public MessageHeader getProperties() Call this routine to get the property list for this object. Properties (like content-type) that have explicit getXX() methods associated with them should be accessed using those methods. | |
| getRequestProperties | back to summary |
|---|---|
| public Map Overrides java. Doc from java. Returns an unmodifiable Map of general request
properties for this connection. The Map keys
are Strings that represent the request-header
field names. Each Map value is a unmodifiable List
of Strings that represents the corresponding
field values.
If multiple values for a given key are added via the
| |
| getRequestProperty | back to summary |
|---|---|
| public String getRequestProperty(String key) Overrides java. Doc from java. Returns the value of the named general request property for this connection. | |
| isProxiedHost | back to summary |
|---|---|
| public static synchronized boolean isProxiedHost(String host) | |
| setContentLength | back to summary |
|---|---|
| protected void setContentLength(int length) Call this routine to set the content-length associated with this object. | |
| setContentType | back to summary |
|---|---|
| public void setContentType(String type) Set the content type of this URL to a specific value.
| |
| setProperties | back to summary |
|---|---|
| public void setProperties(MessageHeader properties) Call this routine to set the property list for this object. | |
| setProxiedHost | back to summary |
|---|---|
| public static synchronized void setProxiedHost(String host) | |
| setRequestProperty | back to summary |
|---|---|
| public void setRequestProperty(String key, String value) Overrides java. Doc from java. Sets the general request property. If a property with the key already exists, overwrite its value with the new value. Note HTTP requires all request properties which can legally have multiple instances with the same key to use a comma-separated list syntax which enables multiple properties to be appended into a single property. | |