Example usage for javax.mail.internet MimePart getAllHeaders

List of usage examples for javax.mail.internet MimePart getAllHeaders

Introduction

In this page you can find the example usage for javax.mail.internet MimePart getAllHeaders.

Prototype

public Enumeration<Header> getAllHeaders() throws MessagingException;

Source Link

Document

Return all the headers from this part as an Enumeration of Header objects.

Usage

From source file:org.simplejavamail.internal.util.MimeMessageParser.java

private void extractCustomUserHeaders(final MimePart part) throws MessagingException {
    final Enumeration e = part.getAllHeaders();
    while (e.hasMoreElements()) {
        final Object headerObj = e.nextElement();
        if (headerObj instanceof Header) {
            final Header header = (Header) headerObj;
            if (isCustomUserHeader(header)) {
                headers.put(header.getName(), header.getValue());
            }/*from w  w  w  .j  a  v  a 2s . c om*/
        }
    }
}