Package oracle.soa.api.message
Interface Attachment
- All Superinterfaces:
Serializable
Message attachment
Example:
Attachment attachment =
AttachmentFactory.getInstance().createAttachment("xyz",
"plain/text; charset=us-ascii",
"Attachment Content".getBytes("us-ascii"));
message.addAttachment(attachment);
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]Gets the attachment contents as a byte arrayGets the content identifier associated with the attachmentGets the attachment content typeGets the attachment contents as an input streamGets the MIME part name for the attachmentintgetSize()Gets the attachment contents size, measured in number of bytesGets the transfer encoding for the attachmentvoidsetContentID(String contentId) Sets the content identifier associated with the attachmentvoidsetContentType(String contentType) Sets the attachment content typevoidsetPartName(String name) Sets the MIME part name for the attachmentvoidsetTransferEncoding(String encoding) Sets the transfer encoding for the attachment
-
Method Details
-
getContentID
String getContentID()Gets the content identifier associated with the attachment- Returns:
- the content identifier
-
setContentID
Sets the content identifier associated with the attachment- Parameters:
contentId- the content identifier
-
getContentType
String getContentType()Gets the attachment content type- Returns:
- the content type
-
setContentType
Sets the attachment content type- Parameters:
contentType- the content type
-
getInputStream
Gets the attachment contents as an input stream- Throws:
IOException
-
getAsByteArray
Gets the attachment contents as a byte array- Throws:
IOException
-
getSize
Gets the attachment contents size, measured in number of bytes- Returns:
- the content size
- Throws:
IOException
-
setTransferEncoding
Sets the transfer encoding for the attachment- Parameters:
encoding- A valid transfer encoding, complying to those values defined by http://www.iana.org/assignments/transfer-encodings/
-
getTransferEncoding
String getTransferEncoding()Gets the transfer encoding for the attachment- Returns:
- the transfer encoding
-
setPartName
Sets the MIME part name for the attachment- Parameters:
name- the part name
-
getPartName
String getPartName()Gets the MIME part name for the attachment- Returns:
- the part name, or null
-