org.apache.webdav.lib
Class HeaderElement
java.lang.Object
|
+--org.apache.webdav.lib.NameValuePair
|
+--org.apache.webdav.lib.HeaderElement
- All Implemented Interfaces:
- java.io.Serializable
- public class HeaderElement
- extends NameValuePair
Some HTTP headers (such as the set-cookie header) have values that
can be decomposed into multiple elements. Such headers must be in the
following form:
header = [ element ] *( "," [ element ] )
element = name [ "=" [ value ] ] *( ";" [ param ] )
param = name [ "=" [ value ] ]
name = token
value = ( token | quoted-string )
token = 1*<any char except "=", ",", ";", <"> and
white space>
quoted-string = <"> *( text | quoted-char ) <">
text = any char except <">
quoted-char = "\" char
Any amount of white space is allowed between any part of the
header, element or param and is ignored. A missing value in any
element or param will be stored as the empty string; if the "="
is also missing null will be stored instead.
This class represents an individual header element. This
class also has a parse()
method for parsing a header
value into an array of elements.
- Author:
- B.C. Holmes
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
parameters
protected NameValuePair[] parameters
- Name.
HeaderElement
public HeaderElement()
- Default constructor.
HeaderElement
public HeaderElement(java.lang.String name,
java.lang.String value)
- Constructor.
HeaderElement
public HeaderElement(java.lang.String name,
java.lang.String value,
NameValuePair[] parameters)
- Constructor.
static void ()
getParameters
public NameValuePair[] getParameters()
parse
public static final HeaderElement[] parse(java.lang.String headerValue)
throws WebdavException
- This parses the value part of a header. The result is an array of
HeaderElement objects.
- Parameters:
headerValue
- the string representation of the header value
(as received from the web server).- Returns:
- a Vector containing Header elements.
- Throws:
WebdavException
- if the above syntax rules are violated.
main
public static void main(java.lang.String[] args)