| java.lang.Object com.lutris.mime.MimeHeader
All known Subclasses: com.lutris.mime.ContentHeader,
MimeHeader | public class MimeHeader (Code) | | 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 | |
public | MimeHeader(String headerLine) Constructs a generic MimeHeader object and initializes its
internal parameter list. |
Method Summary | |
public String | getHeaderType() Returns the header type of this header. | public String | getParameter(String name) Returns a single String value representing the last
occurence of the parameter named by name . | public Enumeration | getParameterNames() Returns an enumeration of all of the parameter names parsed from the
current Mime header. | public String[] | getParameters(String name) Returns an array of String containing all occurences of
values named by name . | public String | getRawHeaderLine() Returns the string passed to the constructor without any parsing. | public String | getValue() Returns the "value" of this header. | protected void | parseParameters(String headerLine) Parses the a given string into key=parameter pairs in accordance
with RFC2045 Section 5.1 Page 11. | protected void | putParameter(String name, String value) Used by derived classes to put a parameter into the internal parameter
value holder. |
MimeHeader | public MimeHeader(String headerLine)(Code) | | Constructs a generic MimeHeader object and initializes its
internal parameter list.
|
getHeaderType | public String getHeaderType()(Code) | | Returns the header type of this header. This is defined to be the
substring from the first character up to first colon (':') character. 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 .
The header type of this Mime header. |
getParameter | public String getParameter(String name)(Code) | | Returns a single 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 .
Parameters: name - The name of the parameter to return. The value of the last occurence of the named parameter ornull if not found. |
getParameterNames | public Enumeration getParameterNames()(Code) | | Returns an enumeration of all of the parameter names parsed from the
current Mime header.
An enumeration of the names of all parameters parsed from theMime header. |
getParameters | public String[] getParameters(String name)(Code) | | Returns an array of 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 .
Parameters: name - The name of the parameter to return. Array containing all values for the named parameter ornull if not found. |
getRawHeaderLine | public String getRawHeaderLine()(Code) | | Returns the string passed to the constructor without any parsing.
|
getValue | public String getValue()(Code) | | Returns the "value" of this header. This is defined to be the trimmed
substring between the first colon (':') character and the first semicolon
(';') character. 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 .
The value of this Mime header. |
parseParameters | protected void parseParameters(String headerLine)(Code) | | Parses the a given string into key=parameter pairs in accordance
with RFC2045 Section 5.1 Page 11. Quoted strings are parsed in accordance
with the RFC822 definition of the "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.
|
putParameter | protected void putParameter(String name, String value)(Code) | | Used by derived classes to put a parameter into the internal parameter
value holder.
Parameters: name - The name of the parameter value to add. Parameters: value - The value to add. |
|
|