|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mirth.connect.server.userutil.AttachmentUtil
public class AttachmentUtil
Provides utility methods for creating, retrieving, and re-attaching message attachments.
Method Summary | |
---|---|
static Attachment |
addAttachment(java.util.List<Attachment> attachments,
java.lang.Object content,
java.lang.String type)
Creates an Attachment and adds it to the provided list. |
static Attachment |
createAttachment(ImmutableConnectorMessage connectorMessage,
java.lang.Object content,
java.lang.String type)
Creates an attachment associated with a given connector message, and inserts it into the database. |
static java.util.List<Attachment> |
getMessageAttachments(ImmutableConnectorMessage connectorMessage)
Retrieves all attachments associated with a connector message. |
static java.util.List<Attachment> |
getMessageAttachments(MessageObject messageObject)
Deprecated. This method is deprecated and will soon be removed. Please use getMessageAttachments(connectorMessage) instead. |
static java.lang.String |
reAttachMessage(ImmutableConnectorMessage connectorMessage)
Replaces any unique attachment tokens (e.g. |
static java.lang.String |
reAttachMessage(MessageObject messageObject)
Deprecated. This method is deprecated and will soon be removed. Please use reAttachMessage(connectorMessage) instead. |
static java.lang.String |
reAttachMessage(java.lang.String raw,
ImmutableConnectorMessage connectorMessage)
Replaces any unique attachment tokens (e.g. |
static byte[] |
reAttachMessage(java.lang.String raw,
ImmutableConnectorMessage connectorMessage,
java.lang.String charsetEncoding,
boolean binary)
Replaces any unique attachment tokens (e.g. |
static java.lang.String |
reAttachRawMessage(ImmutableConnectorMessage connectorMessage)
Deprecated. This method is deprecated and will soon be removed. Please use reAttachMessage(raw, connectorMessage) instead. |
static java.lang.String |
reAttachRawMessage(MessageObject messageObject)
Deprecated. This method is deprecated and will soon be removed. Please use reAttachMessage(raw, connectorMessage) instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static byte[] reAttachMessage(java.lang.String raw, ImmutableConnectorMessage connectorMessage, java.lang.String charsetEncoding, boolean binary)
raw
- The message string to re-attach attachments to.connectorMessage
- The connector message associated with the attachments.charsetEncoding
- The charset encoding to use when returning the re-attached messagebinary
- If true, the message string passed in is assumed to be Base64 encoded.
public static java.lang.String reAttachMessage(MessageObject messageObject)
messageObject
- The connector message associated with the attachments. The encoded data will be
used as the raw message string to re-attach attachments to, if it exists.
Otherwise, the connector message's raw data will be used.
public static java.lang.String reAttachMessage(ImmutableConnectorMessage connectorMessage)
connectorMessage
- The connector message associated with the attachments. The encoded data will be
used as the raw message string to re-attach attachments to, if it exists.
Otherwise, the connector message's raw data will be used.
public static java.lang.String reAttachRawMessage(MessageObject messageObject)
messageObject
- The connector message associated with the attachments. The raw data will be used
as the raw message string to re-attach attachments to.
public static java.lang.String reAttachRawMessage(ImmutableConnectorMessage connectorMessage)
connectorMessage
- The connector message associated with the attachments. The raw data will be used
as the raw message string to re-attach attachments to.
public static java.lang.String reAttachMessage(java.lang.String raw, ImmutableConnectorMessage connectorMessage)
raw
- The message string to re-attach attachments to.connectorMessage
- The connector message associated with the attachments. The raw data will be used
as the raw message string to re-attach attachments to.
public static java.util.List<Attachment> getMessageAttachments(MessageObject messageObject) throws com.mirth.connect.donkey.model.message.XmlSerializerException
messageObject
- The connector message associated with the attachments.
com.mirth.connect.donkey.model.message.XmlSerializerException
public static java.util.List<Attachment> getMessageAttachments(ImmutableConnectorMessage connectorMessage) throws com.mirth.connect.donkey.model.message.XmlSerializerException
connectorMessage
- The connector message associated with the attachments.
com.mirth.connect.donkey.model.message.XmlSerializerException
public static Attachment addAttachment(java.util.List<Attachment> attachments, java.lang.Object content, java.lang.String type) throws javax.activation.UnsupportedDataTypeException
attachments
- The list of attachments to add to.content
- The attachment content (must be a string or byte array).type
- The MIME type of the attachment.
javax.activation.UnsupportedDataTypeException
public static Attachment createAttachment(ImmutableConnectorMessage connectorMessage, java.lang.Object content, java.lang.String type) throws javax.activation.UnsupportedDataTypeException
connectorMessage
- The connector message to be associated with the attachment.content
- The attachment content (must be a string or byte array).type
- The MIME type of the attachment.
javax.activation.UnsupportedDataTypeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |