xmlBlaster 2.2.0 client API

org.xmlBlaster.util.protocol.email
Class AttachmentHolder

java.lang.Object
  extended by org.xmlBlaster.util.protocol.email.AttachmentHolder

public class AttachmentHolder
extends java.lang.Object

Author:
Marcel Ruff

Constructor Summary
AttachmentHolder(java.lang.String fileName, java.lang.String content)
          Message contents of type "text/plain".
AttachmentHolder(java.lang.String fileName, java.lang.String contentType, byte[] content)
           
 
Method Summary
static java.lang.String createLiteral(byte[] arr)
          Get the raw messages as a string, for tests and for dumping only
 boolean equals(AttachmentHolder attachmentHolder)
          Does not need to be the same object instance.
 byte[] getContent()
           
 java.lang.String getContentType()
           
 java.lang.String getFileName()
          Returns the fileName, ready to be used as an attachment name in an email
 boolean hasExtension(java.lang.String extension)
          Checks if we are the given extension type.
 boolean hasExtensionFromList(java.lang.String extensionList)
          A comma separated list like ".txt,.xml"
 void setContent(byte[] content)
           
 void setContentType(java.lang.String contentType)
           
 void setFileName(java.lang.String fileName)
           
 java.lang.String toXml(boolean readable)
           
 java.lang.String toXml(boolean readable, boolean dumpAttachmentData)
          Dumps message to xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentHolder

public AttachmentHolder(java.lang.String fileName,
                        java.lang.String contentType,
                        byte[] content)
Parameters:
fileName -
contentType -
content -

AttachmentHolder

public AttachmentHolder(java.lang.String fileName,
                        java.lang.String content)
Message contents of type "text/plain".

Parameters:
fileName -
content -
Method Detail

equals

public boolean equals(AttachmentHolder attachmentHolder)
Does not need to be the same object instance.

Parameters:
attachmentHolder -
Returns:
If the fileName are equal

getContent

public byte[] getContent()
Returns:
Returns the content, never null

setContent

public void setContent(byte[] content)
Parameters:
content - The content to set.

getFileName

public java.lang.String getFileName()
Returns the fileName, ready to be used as an attachment name in an email

Returns:
Returns the fileName, never null

hasExtension

public boolean hasExtension(java.lang.String extension)
Checks if we are the given extension type.

Parameters:
extension - For example ".txt"
Returns:
true if our attachment is of this type

hasExtensionFromList

public boolean hasExtensionFromList(java.lang.String extensionList)
A comma separated list like ".txt,.xml"

Parameters:
extensionList - "*" matches all
Returns:
true if mark INLINE

setFileName

public void setFileName(java.lang.String fileName)
Parameters:
fileName - The fileName to set.

getContentType

public java.lang.String getContentType()
Returns:
Returns the contentType, never null

setContentType

public void setContentType(java.lang.String contentType)
Parameters:
contentType - The contentType to set.

createLiteral

public static final java.lang.String createLiteral(byte[] arr)
Get the raw messages as a string, for tests and for dumping only

Returns:
The stringified message, null or special bytes are replaced by '*'

toXml

public java.lang.String toXml(boolean readable)

toXml

public java.lang.String toXml(boolean readable,
                              boolean dumpAttachmentData)
Dumps message to xml.

Parameters:
readable - If true '\0' are replaced by '*'

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.