public class MimeUtils extends Object
Copyright 2004 SAP AG
Constructor and Description |
---|
MimeUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyContentToOutputstream(IContent content,
OutputStream out) |
static IContent |
getContent(MimePart mimepart)
set the content of a
MimeMessage to the given body content. |
static String |
getContentAsString(IContent content)
convert a
IContent to a string. |
static IContent |
getContentFromString(String text,
String type)
convert a
String to a content. |
static MimeMessage |
setContent(MimeMessage mimemessage,
IContent body)
set the content of a
MimeMessage to the given body content. |
static MimeMessage |
setContent(MimeMessage mimemessage,
IContent body,
IResource[] attachments)
set the content of a
MimeMessage to a given body content with
several attachments. |
public static void copyContentToOutputstream(IContent content, OutputStream out) throws WcmException
WcmException
public static IContent getContentFromString(String text, String type) throws WcmException
String
to a content.text
- a String
with the message texttype
- StringIContent
is the content object for the converted
String.WcmException
- Exception raised in failure situationpublic static String getContentAsString(IContent content) throws WcmException
IContent
to a string.content
- a IContent
to get the text String
of.String
is the content converted to a String.WcmException
- Exception raised in failure situationpublic static IContent getContent(MimePart mimepart) throws WcmException
MimeMessage
to the given body content.mimepart
- MimePartMimeMessage
the mime message.WcmException
- if the message could not be generated.public static MimeMessage setContent(MimeMessage mimemessage, IContent body) throws WcmException
MimeMessage
to the given body content.mimemessage
- content to be setbody
- content to be setMimeMessage
the mime message.WcmException
- if the message could not be generated.public static MimeMessage setContent(MimeMessage mimemessage, IContent body, IResource[] attachments) throws WcmException
MimeMessage
to a given body content with
several attachments.mimemessage
- content to be setbody
- content to be setattachments
- content to be setMimeMessage
the mime message.WcmException
- if the message could not be generated.Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice