java.lang.Object | |
↳ | sun.net.www.MessageHeader |
An RFC 844 or MIME message header. Includes methods for parsing headers from incoming streams, fetching values, setting values, and printing headers. Key values of null are legal: they indicate lines in the header that don't have a valid key, but do have a value (this isn't legal according to the standard, but lines like this are everywhere).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a key value pair to the end of the
header.
| |||||||||||
Convert a message-id string to canonical form (strips off
leading and trailing <>s)
| |||||||||||
Deprecated: Use multiValueIterator() instead.
| |||||||||||
Find the value that corresponds to this key.
| |||||||||||
Parse and merge a MIME header from an input stream.
| |||||||||||
return an Iterator that returns all values of a particular
key in sequence
| |||||||||||
Parse a MIME header from an input stream.
| |||||||||||
Prepends a key value pair to the beginning of the
header.
| |||||||||||
Prints the key-value pairs represented by this
header.
| |||||||||||
Remove the key from the header.
| |||||||||||
Reset a message header (all key/values removed)
| |||||||||||
Overwrite the previous key/val pair at location 'i'
with the new k/v.
| |||||||||||
Sets the value of a key.
| |||||||||||
Set's the value of a key only if there is no
key with that value already.
| |||||||||||
Returns a string representation of the object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Adds a key value pair to the end of the header. Duplicates are allowed
Convert a message-id string to canonical form (strips off leading and trailing <>s)
Deprecated: Use multiValueIterator() instead. Find the next value that corresponds to this key. It finds the first value that follows v. To iterate over all the values of a key use:
for(String v=h.findValue(k); v!=null; v=h.findNextValue(k, v)) { ... }
Find the value that corresponds to this key. It finds only the first occurrence of the key.
k | the key to find. |
---|
Parse and merge a MIME header from an input stream.
IOException |
---|
return an Iterator that returns all values of a particular key in sequence
Parse a MIME header from an input stream.
IOException |
---|
Prepends a key value pair to the beginning of the header. Duplicates are allowed
Prints the key-value pairs represented by this header. Also prints the RFC required blank line at the end. Omits pairs with a null key.
Remove the key from the header. If there are multiple values under the same key, they are all removed. Nothing is done if the key doesn't exist. After a remove, the other pairs' order are not changed.
k | the key to remove |
---|
Reset a message header (all key/values removed)
Overwrite the previous key/val pair at location 'i' with the new k/v. If the index didn't exist before the key/val is simply tacked onto the end.
Sets the value of a key. If the key already exists in the header, it's value will be changed. Otherwise a new key/value pair will be added to the end of the header.
Set's the value of a key only if there is no key with that value already.
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())