oracle.workspaces.ws.beans
Class MessageBodyPart
java.lang.Object
oracle.workspaces.ws.beans.MessageBodyPart
- public class MessageBodyPart
- extends java.lang.Object
This class represents a message body part and contains the byte form of the message body part. It is used in sending back a native attachment included in a message.
Method Summary |
byte[] |
getByteArray()
Gets the body part in the form of an array of bytes. |
java.lang.String |
getContentType()
Convenience method to get the content type of the body part.Returns null if the Content-Type could not be determined. |
java.lang.String |
getName()
Convenience method to get the file name associated with this body part. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageBodyPart
public MessageBodyPart()
getName
public java.lang.String getName()
- Convenience method to get the file name associated with this body part.
-
- Returns:
- file name
getByteArray
public byte[] getByteArray()
- Gets the body part in the form of an array of bytes.
Below is a code snippet in Java illustrating how to get the body part from a byte array:-
Suppose arr is the byte array
ByteArrayInputStream bais = new ByteArrayInputStream(arr);
MimeBodyPart mbp = new MimeBodyPart(bais);
-
- Returns:
- byte[] - the byte array representation of the body part.
getContentType
public java.lang.String getContentType()
- Convenience method to get the content type of the body part.Returns null if the Content-Type could not be determined. The MIME typing system is used to name Content-types.
-
- Returns:
- String - the Content Type of body part