|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jscape.inet.mime.MimeHeader
public class MimeHeader
Implements methods for managing mime headers for use in a
MimeMessage
.
Field Summary |
---|
Fields inherited from interface com.jscape.inet.mime.MimeConstants |
---|
COLON, CR, CRLF, EQUALS, LF, QUESTION_MARK, SEMI_COLON, SPACE, TAB |
Constructor Summary | |
---|---|
MimeHeader()
Constructs a new MimeHeader instance. |
|
MimeHeader(byte[] data)
Constructs a new MimeHeader instance. |
|
MimeHeader(java.lang.String name,
java.lang.String value)
Constructs a new MimeHeader instance. |
|
MimeHeader(java.lang.String name,
java.lang.String value,
java.lang.String characterEncoding)
Constructs a new MimeHeader instance. |
Method Summary | |
---|---|
void |
addAttribute(MimeHeaderAttr attr)
Adds attribute to this MimeHeader . |
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds attribute to this MimeHeader . |
MimeHeaderAttr |
getAttribute(java.lang.String name)
Gets attribute by name. |
java.util.Enumeration |
getAttributes()
Gets all attributes for this MimeHeader . |
java.lang.String |
getName()
Gets name for this MimeHeader . |
java.lang.String |
getValue()
Gets value for this MimeHeader . |
java.lang.String |
getValueString()
Gets value for this MimeHeader . |
boolean |
isFolding()
Checks if folding should be enabled for this MimeHeader . |
boolean |
isValid()
Checks if this header is valid. |
void |
removeAttribute(int index)
Removes specified index from attributes. |
void |
setFolding(boolean folding)
Enables or disables folding for this MimeHeader . |
void |
setName(java.lang.String name)
Sets name of this MimeHeader . |
void |
setValue(java.lang.String value)
Sets the value of this MimeHeader . |
java.lang.String |
toString()
Gets String representation of this MimeHeader . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MimeHeader() throws MimeException
MimeHeader
instance.
MimeException
- if a MIME related parsing error occurspublic MimeHeader(java.lang.String name, java.lang.String value) throws MimeException
MimeHeader
instance.
name
- the name of headervalue
- the value of header
MimeException
- if a MIME related parsing error occurspublic MimeHeader(java.lang.String name, java.lang.String value, java.lang.String characterEncoding) throws MimeException
MimeHeader
instance.
name
- the name of headervalue
- the value of headercharacterEncoding
- the character encoding to encode value as
MimeException
- thrown if character encoding can not be completed
or header does not allow character encodingpublic MimeHeader(byte[] data) throws MimeException
MimeHeader
instance. The MIME header data
is parsed.
data
- the MIME header data
MimeException
- if a MIME related parsing error occursMethod Detail |
---|
public java.lang.String getName()
MimeHeader
.
public java.lang.String getValue()
MimeHeader
. Any encoded values in
header will be decoded according to RFC 2047. Strips quotes from value.
public java.lang.String getValueString()
MimeHeader
. Leaves quotes in value. Any
encoded values in header will be decoded according to RFC 2047.
public void setName(java.lang.String name)
MimeHeader
.
name
- the header namepublic void setValue(java.lang.String value)
MimeHeader
.
value
- the header valuepublic void addAttribute(MimeHeaderAttr attr)
MimeHeader
.
attr
- a MimeHeaderAttrMimeHeaderAttr
public void addAttribute(java.lang.String name, java.lang.String value) throws MimeException
MimeHeader
.
name
- the name of the MIME header attributevalue
- the value of the MIME header attribute
MimeException
- if a MIME related error occurspublic void removeAttribute(int index)
index
- the index of attribute to removepublic MimeHeaderAttr getAttribute(java.lang.String name)
name
- the name of attribute to retrieve
MimeHeaderAttr
MimeHeaderAttr
public java.util.Enumeration getAttributes()
MimeHeader
. Returns an
Enumeration of MimeHeaderAttr
MimeHeaderAttr
public java.lang.String toString()
MimeHeader
.
toString
in class java.lang.Object
public boolean isFolding()
MimeHeader
.
Folding is enabled by default. If folding is enabled then the maximum length of a header is 76 characters.
Headers which exceed 76 characters will be folded according to RFC 822.
true
if folding is enabled, false
otherwisepublic void setFolding(boolean folding)
MimeHeader
.
Folding is enabled by default. If folding is enabled then the maximum length of a header is 76 characters.
Headers which exceed 76 characters will be folded according to RFC 822.
folding
- true
to enable folding, false
to disablepublic boolean isValid()
|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |