com.mirth.connect.server.userutil
Class Attachment

java.lang.Object
  extended by com.mirth.connect.server.userutil.Attachment

public class Attachment
extends java.lang.Object

Used to store and retrieve details about message attachments such as the ID, MIME type, and content.


Constructor Summary
Attachment()
          Instantiates a new Attachment with no ID, content, or MIME type.
Attachment(java.lang.String id, byte[] content, java.lang.String type)
          Instantiates a new Attachment.
 
Method Summary
 java.lang.String getAttachmentId()
          Returns the unique replacement token for the attachment.
 byte[] getContent()
          Returns the content of the attachment as a byte array.
 byte[] getData()
          Deprecated. This method is deprecated and will soon be removed. Please use getContent() instead.
 java.lang.String getId()
          Returns the unique ID for the attachment.
 java.lang.String getMessageId()
          Deprecated. The Attachment.getMessageId() method is deprecated and will soon be removed. This method always returns an empty string.
 int getSize()
          Deprecated. This method is deprecated and will soon be removed. Please use getContent().length instead.
 java.lang.String getType()
          Returns the MIME type of the attachment.
 void setAttachmentId(java.lang.String attachmentId)
          Deprecated. This method is deprecated and will soon be removed. Please use setId(id) instead.
 void setContent(byte[] content)
          Sets the content of the attachment.
 void setData(byte[] data)
          Deprecated. This method is deprecated and will soon be removed. Please use setContent(content) instead.
 void setId(java.lang.String id)
          Sets the unique ID for the attachment.
 void setMessageId(java.lang.String messageId)
          Deprecated. The Attachment.setMessageId(messageId) method is deprecated and will soon be removed. This method no longer does anything.
 void setSize(int size)
          Deprecated. The Attachment.setSize(size) method is deprecated and will soon be removed. This method no longer does anything.
 void setType(java.lang.String type)
          Sets the MIME type for the attachment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attachment

public Attachment()
Instantiates a new Attachment with no ID, content, or MIME type.


Attachment

public Attachment(java.lang.String id,
                  byte[] content,
                  java.lang.String type)
Instantiates a new Attachment.

Parameters:
id - The unique ID of the attachment.
content - The content (byte array) to store for the attachment.
type - The MIME type of the attachment.
Method Detail

getAttachmentId

public java.lang.String getAttachmentId()
Returns the unique replacement token for the attachment. This token should replace the attachment content in the message string, and will be used to re-attach the attachment content in the outbound message before it is sent to a downstream system.


setAttachmentId

public void setAttachmentId(java.lang.String attachmentId)
Deprecated. This method is deprecated and will soon be removed. Please use setId(id) instead.

Sets the unique ID for the attachment.

Parameters:
attachmentId - The unique ID to use for the attachment.

getId

public java.lang.String getId()
Returns the unique ID for the attachment.


setId

public void setId(java.lang.String id)
Sets the unique ID for the attachment.

Parameters:
id - The unique ID to use for the attachment.

getData

public byte[] getData()
Deprecated. This method is deprecated and will soon be removed. Please use getContent() instead.

Returns the content of the attachment as a byte array.


setData

public void setData(byte[] data)
Deprecated. This method is deprecated and will soon be removed. Please use setContent(content) instead.

Sets the content of the attachment.

Parameters:
data - The content (byte array) to use for the attachment.

getContent

public byte[] getContent()
Returns the content of the attachment as a byte array.


setContent

public void setContent(byte[] content)
Sets the content of the attachment.

Parameters:
content - The content (byte array) to use for the attachment.

getSize

public int getSize()
Deprecated. This method is deprecated and will soon be removed. Please use getContent().length instead.

Returns the number of bytes in the attachment content.


setSize

public void setSize(int size)
Deprecated. The Attachment.setSize(size) method is deprecated and will soon be removed. This method no longer does anything.


getType

public java.lang.String getType()
Returns the MIME type of the attachment.


setType

public void setType(java.lang.String type)
Sets the MIME type for the attachment.

Parameters:
type - The MIME type to set for the attachment.

getMessageId

public java.lang.String getMessageId()
Deprecated. The Attachment.getMessageId() method is deprecated and will soon be removed. This method always returns an empty string.


setMessageId

public void setMessageId(java.lang.String messageId)
Deprecated. The Attachment.setMessageId(messageId) method is deprecated and will soon be removed. This method no longer does anything.