Example usage for javax.mail.internet MimePart getMatchingHeaderLines

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

Introduction

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

Prototype

public Enumeration<String> getMatchingHeaderLines(String[] names) throws MessagingException;

Source Link

Document

Get matching header lines as an Enumeration of Strings.

Usage

From source file:com.stimulus.archiva.store.MessageStore.java

public void writeTo(MimePart part, OutputStream os, String[] includeList)
        throws IOException, MessagingException {
    LineOutputStream los = null;/*from   ww w .j  av a 2 s. c  om*/
    if (os instanceof LineOutputStream) {
        los = (LineOutputStream) os;
    } else {
        los = new LineOutputStream(os);
    }
    Enumeration hdrLines = part.getMatchingHeaderLines(includeList);
    while (hdrLines.hasMoreElements()) {
        String line = (String) hdrLines.nextElement();
        los.writeln(line);
    }
    los.writeln();
    os = MimeUtility.encode(os, part.getEncoding());
    part.getDataHandler().writeTo(os);
    os.flush();
}