|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.wbi.util.MimeObject
| Constructor Summary | |
MimeObject()
Constructs an empty MimeObject. |
|
MimeObject(byte[] buffer,
boolean headers_included)
Constructs a MimeObject by parsing the specified
bytes. |
|
MimeObject(byte[] buffer,
int offset,
int size,
boolean headers_included)
Constructs a MimeObject by parsing the specified
bytes. |
|
MimeObject(MimeHeaders h)
Constructs a MimeObject with the specified headers
but with no body. |
|
MimeObject(MimeHeaders h,
byte[] body)
Constructs a MimeObject having the specified
headers and body. |
|
MimeObject(java.lang.String boundary,
byte[] buffer)
Constructs a MimeObject of type "multipart/mixed",
splitting the specified body using the specified boundary. |
|
MimeObject(java.lang.String boundary,
byte[] buffer,
int offset,
int size)
Constructs a MimeObject of type "multipart/mixed",
splitting the specified body using the specified boundary. |
|
| Method Summary | |
protected static void |
decode24Bits(byte[] bits,
byte[] dest,
int offset)
Decode a set of four base64 characters into three eight-bit bytes. |
protected static int |
decode6Bits(char ch)
Decode the bits represented by one base64 character. |
protected static byte[] |
decodeBase64(byte[] input)
Decode the base64-encoded input. |
protected static byte[] |
decodeBase64(byte[] input,
int offset,
int len)
Decode the base64-encoded input. |
protected static void |
encode24Bits(int bits,
int len,
byte[] dest,
int offset)
Encode one, two, or three eight-bit bytes into four base64 characters. |
protected static byte |
encode6Bits(int b)
Encode six bits into one base64 character. |
static byte[] |
encodeBase64(byte[] input)
Encodes the input into base64. |
static byte[] |
encodeBase64(byte[] input,
int offset,
int len)
Encodes the input into base64. |
static void |
enumerateParts(MimeObject o)
|
byte[] |
getContent()
Get the non-multipart content of the MimeObject,
decoded if necessary. |
MimeHeaders |
getHeaders()
Get the headers of the MimeObject. |
MimeObject |
getPartByHeader(java.lang.String header_name,
java.lang.String desired_value)
Get a specified subpart of a multipart MimeObject. |
MimeObject |
getPartByParameter(java.lang.String header_name,
java.lang.String parameter_name,
java.lang.String desired_value)
Get a specified subpart of a multipart MimeObject. |
java.util.Vector |
getParts()
Get the subparts of the multipart MimeObject. |
protected static boolean |
isBase64Char(byte ch)
Checks if the specified character is a member of the base64 character set. |
static void |
main(java.lang.String[] argv)
|
static void |
printByteArray(byte[] arr)
|
static void |
printByteArrayAsChars(byte[] arr)
|
void |
setContent(byte[] buffer,
int offset,
int size)
Set the non-multipart content of the MimeObject to
the specified bytes. |
void |
setParts(java.util.Vector pts)
Set the subparts of the MimeObject. |
protected void |
splitBodyIntoParts(java.lang.String boundary,
byte[] body)
Splits the specified body into its parts according to the specified boundary, storing the resultant parts in the MimeObjectitself. |
protected void |
splitBodyIntoParts(java.lang.String boundary,
byte[] body,
int offset,
int size)
Splits the specified body into its parts according to the specified boundary, storing the resultant parts in the MimeObjectitself. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MimeObject()
MimeObject.public MimeObject(MimeHeaders h)
MimeObject with the specified headers
but with no body.h - The specified headers.
public MimeObject(byte[] buffer,
boolean headers_included)
MimeObject by parsing the specified
bytes.buffer - The bytes to be parsed.headers_included - Specifies whether buffer
includes the MIME headers or only the body. If no headers are
included, the object will receive a default type of
"text/plain; charset=US-ASCII".
public MimeObject(byte[] buffer,
int offset,
int size,
boolean headers_included)
MimeObject by parsing the specified
bytes.buffer - The bytes to be parsed.offset - The offset within buffer at which
parsing should begin.size - The number of bytes to parse.headers_included - Specifies whether buffer
includes the MIME headers or only the body. If no headers are
included, the object will receive a default type of
"text/plain; charset=US-ASCII".
public MimeObject(MimeHeaders h,
byte[] body)
MimeObject having the specified
headers and body.h - The specified headers.body - The specified body.
public MimeObject(java.lang.String boundary,
byte[] buffer)
MimeObject of type "multipart/mixed",
splitting the specified body using the specified boundary.boundary - The boundary string.buffer - The multipart body.
public MimeObject(java.lang.String boundary,
byte[] buffer,
int offset,
int size)
MimeObject of type "multipart/mixed",
splitting the specified body using the specified boundary.boundary - The multipart boundary string.buffer - Contains the body.offset - The offset within buffer at which
the body begins.size - The length of the body.| Method Detail |
protected void splitBodyIntoParts(java.lang.String boundary,
byte[] body)
MimeObjectitself.boundary - The multipart boundary string.body - The multipart body.
protected void splitBodyIntoParts(java.lang.String boundary,
byte[] body,
int offset,
int size)
MimeObjectitself.boundary - The multipart boundary string.body - Contains the multipart body.offset - The offset within body at which the
multipart body begins.size - The length of the multipart body.public byte[] getContent()
MimeObject,
decoded if necessary. Supports 7bit, 8bit, binary, and base64
encodings. Should support quoted-printable.
public void setContent(byte[] buffer,
int offset,
int size)
MimeObject to
the specified bytes.buffer - Contains the body.offset - The offset within buffer at which
the body begins.size - The length of the body.public java.util.Vector getParts()
MimeObject.Vector of MimeObjects which
constitute the subparts of the object.public void setParts(java.util.Vector pts)
MimeObject.pts - A Vector of MimeObjects
which will constitute the subparts of the object.public MimeHeaders getHeaders()
MimeObject.
public MimeObject getPartByHeader(java.lang.String header_name,
java.lang.String desired_value)
throws java.util.NoSuchElementException
MimeObject.header_name - The header field name to search.desired_value - The value of header_name
which is sought.MimeObject that has header
header_name equal to desired_value.NoSuchElementException - if no subpart of
the object has the specified characteristics.
public MimeObject getPartByParameter(java.lang.String header_name,
java.lang.String parameter_name,
java.lang.String desired_value)
throws java.util.NoSuchElementException
MimeObject.header_name - The header field name to search.parameter_name - The parameter of header_name
to search.desired_value - The value of parameter_name
which is sought.parameter_name of header header_name
equal to desired_value.NoSuchElementException - if no subpart of
the object has the specified characteristics.protected static boolean isBase64Char(byte ch)
ch - The character.true if the character is a member of the
base64 character set, or false otherwise.protected static int decode6Bits(char ch)
ch - One base64 character.int.
protected static void decode24Bits(byte[] bits,
byte[] dest,
int offset)
bits - The four characters to be decoded, represented as
four bytes.dest - An array of bytes, which must have a
length of three, that will receive the decoded bits.protected static byte[] decodeBase64(byte[] input)
input - The input to be decoded.
protected static byte[] decodeBase64(byte[] input,
int offset,
int len)
input - Contains the input.offset - The offset within input at which
decoding should start.len - The number of bytes to decode.protected static byte encode6Bits(int b)
b - The bits to be encoded; b must be less
than 64.
protected static void encode24Bits(int bits,
int len,
byte[] dest,
int offset)
bits - Contains the bits to be encoded in the low-order 24
bits; the other bits must be zero.len - The number of bytes to encode.dest - A byte array that will receive the
encoded characters.offset - The offset within dest at which the
encoded bytes should be placed.public static byte[] encodeBase64(byte[] input)
input - The bytes to encode.
public static byte[] encodeBase64(byte[] input,
int offset,
int len)
input - Contains the bytes to encode.offset - The offset within input at which
encoding should begin.len - The number of bytes to encode.public static void enumerateParts(MimeObject o)
public static void printByteArray(byte[] arr)
public static void printByteArrayAsChars(byte[] arr)
public static void main(java.lang.String[] argv)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||