|
EAF 6.4 Implementation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.mime.MimeHeader
Represents a generic parsed Mime header. Specific header types, such
as Content-Type
are represented by classes derived from
this header. The constructor for this class parses only parameters
according to the rules specified in RFC2045 Section 5.1 Page 11.
It is left to derived classes to parse type-specifiec information
such as the Mime type (Content-Type
) or content disposition
(Content-Disposition
).
Constructor Summary | |
MimeHeader(java.lang.String headerLine)
Constructs a generic MimeHeader object and initializes
its internal parameter list. |
Method Summary | |
java.lang.String |
getHeaderType()
Returns the header type of this header. |
java.lang.String |
getParameter(java.lang.String name)
Returns a single String value representing the
last occurence of the parameter named by name . |
java.util.Enumeration |
getParameterNames()
Returns an enumeration of all of the parameter names parsed from the current Mime header. |
java.lang.String[] |
getParameters(java.lang.String name)
Returns an array of String containing all occurences
of values named by name . |
java.lang.String |
getRawHeaderLine()
Returns the string passed to the constructor without any parsing. |
java.lang.String |
getValue()
Returns the "value" of this header. |
protected void |
parseParameters(java.lang.String headerLine)
Parses the a given string into key=parameter pairs in accordance with RFC2045 Section 5.1 Page 11. |
protected void |
putParameter(java.lang.String name,
java.lang.String value)
Used by derived classes to put a parameter into the internal parameter value holder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MimeHeader(java.lang.String headerLine)
MimeHeader
object and initializes
its internal parameter list.
Method Detail |
protected void putParameter(java.lang.String name, java.lang.String value)
name
- The name of the parameter value to add.value
- The value to add.public java.lang.String getValue()
Content-Type: multipart/form-data; boundary="000572A9AD4"The value of this header is multipart/form-data, the header type is Content-Type, and the first parameter is named boundary and has the value 00572A9AD4.
public java.lang.String getHeaderType()
Content-Type: multipart/form-data; boundary="000572A9AD4"The value of this header is multipart/form-data, the header type is Content-Type, and the first parameter is named boundary and has the value 00572A9AD4.
public java.lang.String getRawHeaderLine()
public java.lang.String getParameter(java.lang.String name)
String
value representing the
last occurence of the parameter named by name
.
For example, observe the following header line:
Content-Type: multipart/form-data; boundary="000572A9AD4"The value of this header is multipart/form-data, the header type is Content-Type, and the first parameter is named boundary and has the value 00572A9AD4.
name
- The name of the parameter to return.
null
if not found.public java.lang.String[] getParameters(java.lang.String name)
String
containing all occurences
of values named by name
.
For example, observe the following header line:
Content-Type: multipart/form-data; boundary="000572A9AD4"The value of this header is multipart/form-data, the header type is Content-Type, and the first parameter is named boundary and has the value 00572A9AD4.
name
- The name of the parameter to return.
null
if not found.public java.util.Enumeration getParameterNames()
protected void parseParameters(java.lang.String headerLine)
quoted-string
" grammatic construct. According
to RFC822, quoted strings are strings, enclosed in double-quote
marks, which contain any character except LF or double-quote.
The backslash character is used to literally quote the following
character. Octal or hex code backquoting is not supported.
|
EAF 6.4 Implementation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |