Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.hipermail
Class HeadersHelper

    java.lang.Object
      org.xml.sax.helpers.DefaultHandler
          com.knowgate.hipermail.HeadersHelper

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class HeadersHelper

extends org.xml.sax.helpers.DefaultHandler

Set of utility functions for managing MimeMessage headers

Constructor Summary
`HeadersHelper()`
`HeadersHelper(MimeMessage oMimeMsg)`

Method Summary
`static java.lang.String` | `computeContentMD5(byte[] byArray)`
`java.lang.String` | `decodeMessageId()` Get decoded Message Id This method first calls MimeMessage.getMessageID() If nothing is returned then it tries to retrieve header X-Qmail-Scanner-Message-ID or Resent-Message-ID.
`static java.lang.String` | `decodeMessageId(MimeMessage oMimeMsg)` Get decoded Message Id This method first calls MimeMessage.getMessageID() If nothing is returned then it tries to retrieve header X-Qmail-Scanner-Message-ID or Resent-Message-ID.
`java.lang.String` | `getContentID()`
`static java.lang.String` | `getContentID(MimeMessage oMsg)`
`java.lang.String` | `getContentMD5()`
`static java.lang.String` | `getContentMD5(MimeMessage oMsg)`
`java.lang.String` | `getContentType()`
`static java.lang.String` | `getContentType(MimeMessage oMsg)`
`java.lang.String` | `getDescription()`
`static java.lang.String` | `getDescription(MimeMessage oMsg)`
`java.lang.String` | `getDisposition()`
`static java.lang.String` | `getDisposition(MimeMessage oMsg)`
`java.lang.String` | `getEncoding()`
`static java.lang.String` | `getEncoding(MimeMessage oMsg)`
`java.lang.String` | `getFileName()`
`static java.lang.String` | `getFileName(MimeMessage oMsg)`
`Flags` | `getFlags()`
`static Flags` | `getFlags(MimeMessage oMsg)`
`InternetAddress` | `getFrom()`
`java.lang.String` | `getPriority()`
`static java.lang.String` | `getPriority(MimeMessage oMsg)`
`java.sql.Timestamp` | `getReceivedTimestamp()`
`static java.sql.Timestamp` | `getReceivedTimestamp(MimeMessage oMsg)`
`java.sql.Timestamp` | `getSentTimestamp()`
`static java.sql.Timestamp` | `getSentTimestamp(MimeMessage oMsg)`
`java.lang.String` | `getSubject()`
`static java.lang.String` | `getSubject(MimeMessage oMsg)`
`boolean` | `isSpam()`
`static boolean` | `isSpam(MimeMessage oMsg)`
`void` | `setMessage(MimeMessage oMimeMsg)`
`java.lang.String` | `toXML()` Get headers in XML format

Methods inherited from class org.xml.sax.helpers.DefaultHandler
`characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HeadersHelper

    public HeadersHelper()

### HeadersHelper

    public HeadersHelper(MimeMessage oMimeMsg)

Method Detail

### setMessage

    public void setMessage(MimeMessage oMimeMsg)

### decodeMessageId

    public static java.lang.String decodeMessageId(MimeMessage oMimeMsg)
                                            throws MessagingException,
                                                   java.io.UnsupportedEncodingException

  Get decoded Message Id

  This method first calls MimeMessage.getMessageID() If nothing is returned then it tries to retrieve header X-Qmail-Scanner-Message-ID or Resent-Message-ID.
  If neither Message-Id nor X-Qmail-Scanner-Message-ID nor Resent-Message-ID headers are found then a message id is assigned by using the message sent date and from address like:
  <20050722140022.sender@domain.com> The result is then decoded by calling MimeUtility.decodeText() before being returned

  Parameters:
    `oMimeMsg` - MimeMessage
  Returns:
    String Decoded value of Message Id.
  Throws:
    `MessagingException`
    `java.io.UnsupportedEncodingException`

### decodeMessageId

    public java.lang.String decodeMessageId()
                                     throws MessagingException,
                                            java.io.UnsupportedEncodingException

  Get decoded Message Id

  This method first calls MimeMessage.getMessageID() If nothing is returned then it tries to retrieve header X-Qmail-Scanner-Message-ID or Resent-Message-ID.
  If neither Message-Id nor X-Qmail-Scanner-Message-ID nor Resent-Message-ID headers are found then a message id is assigned by using the message sent date and from address like:
  <20050722140022.sender@domain.com> The result is then decoded by calling MimeUtility.decodeText() before being returned

  Returns:
    String Decoded value of Message Id.
  Throws:
    `MessagingException`
    `java.io.UnsupportedEncodingException`

### getContentType

    public static java.lang.String getContentType(MimeMessage oMsg)
                                           throws java.io.UnsupportedEncodingException,
                                                  MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getContentType

    public java.lang.String getContentType()
                                    throws java.io.UnsupportedEncodingException,
                                           MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getContentID

    public static java.lang.String getContentID(MimeMessage oMsg)
                                         throws java.io.UnsupportedEncodingException,
                                                MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getContentID

    public java.lang.String getContentID()
                                  throws java.io.UnsupportedEncodingException,
                                         MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getDisposition

    public static java.lang.String getDisposition(MimeMessage oMsg)
                                           throws java.io.UnsupportedEncodingException,
                                                  MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getDisposition

    public java.lang.String getDisposition()
                                    throws java.io.UnsupportedEncodingException,
                                           MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getContentMD5

    public static java.lang.String getContentMD5(MimeMessage oMsg)
                                          throws java.io.UnsupportedEncodingException,
                                                 MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### computeContentMD5

    public static java.lang.String computeContentMD5(byte[] byArray)

### getContentMD5

    public java.lang.String getContentMD5()
                                   throws java.io.UnsupportedEncodingException,
                                          MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getDescription

    public static java.lang.String getDescription(MimeMessage oMsg)
                                           throws java.io.UnsupportedEncodingException,
                                                  MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getDescription

    public java.lang.String getDescription()
                                    throws java.io.UnsupportedEncodingException,
                                           MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getFileName

    public static java.lang.String getFileName(MimeMessage oMsg)
                                        throws java.io.UnsupportedEncodingException,
                                               MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getFileName

    public java.lang.String getFileName()
                                 throws java.io.UnsupportedEncodingException,
                                        MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getEncoding

    public static java.lang.String getEncoding(MimeMessage oMsg)
                                        throws java.io.UnsupportedEncodingException,
                                               MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getEncoding

    public java.lang.String getEncoding()
                                 throws java.io.UnsupportedEncodingException,
                                        MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getSubject

    public static java.lang.String getSubject(MimeMessage oMsg)
                                       throws java.io.UnsupportedEncodingException,
                                              MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getSubject

    public java.lang.String getSubject()
                                throws java.io.UnsupportedEncodingException,
                                       MessagingException

  Throws:
    `java.io.UnsupportedEncodingException`
    `MessagingException`

### getSentTimestamp

    public static java.sql.Timestamp getSentTimestamp(MimeMessage oMsg)
                                               throws MessagingException

  Throws:
    `MessagingException`

### getSentTimestamp

    public java.sql.Timestamp getSentTimestamp()
                                        throws MessagingException

  Throws:
    `MessagingException`

### getReceivedTimestamp

    public static java.sql.Timestamp getReceivedTimestamp(MimeMessage oMsg)
                                                   throws MessagingException

  Throws:
    `MessagingException`

### getReceivedTimestamp

    public java.sql.Timestamp getReceivedTimestamp()
                                            throws MessagingException

  Throws:
    `MessagingException`

### getPriority

    public static java.lang.String getPriority(MimeMessage oMsg)
                                        throws MessagingException

  Throws:
    `MessagingException`

### getPriority

    public java.lang.String getPriority()
                                 throws MessagingException

  Throws:
    `MessagingException`

### getFlags

    public static Flags getFlags(MimeMessage oMsg)
                          throws MessagingException

  Throws:
    `MessagingException`

### getFlags

    public Flags getFlags()
                   throws MessagingException

  Throws:
    `MessagingException`

### getFrom

    public InternetAddress getFrom()
                            throws MessagingException

  Throws:
    `MessagingException`

### isSpam

    public static boolean isSpam(MimeMessage oMsg)
                          throws MessagingException

  Throws:
    `MessagingException`

### isSpam

    public boolean isSpam()
                   throws MessagingException

  Throws:
    `MessagingException`

### toXML

    public java.lang.String toXML()

  Get headers in XML format

  Returns:
    String with syntax:
    <msg> <num>[1..n]</num> <id>message unique identifier</id> <len>message length in bytes</len> <type>message content-type</type> <disposition>message content-disposition</disposition> <priority>X-Priority header</priority> <spam>X-Spam-Flag header</spam> <subject><![CDATA[message subject]]></subject> <sent>yyy-mm-dd hh:mi:ss</sent> <received>yyy-mm-dd hh:mi:ss</received> <from><![CDATA[personal name or e-mail of sender]]></from> <to><![CDATA[personal name or e-mail of receiver]]></to> <size>integer size in kilobytes</size> <err>error description (if any)</err> </msg>
  Since:
    4.0

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD