Example usage for javax.mail.internet InternetHeaders load

List of usage examples for javax.mail.internet InternetHeaders load

Introduction

In this page you can find the example usage for javax.mail.internet InternetHeaders load.

Prototype

public void load(InputStream is) throws MessagingException 

Source Link

Document

Read and parse the given RFC822 message stream till the blank line separating the header from the body.

Usage

From source file:org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer.java

/**
 * Reads the manifest entries from the provided file.
 *
 * @param manifest the manifest//w  ww.j a v  a  2  s .  c  o  m
 * @return the manifest entries
 */
private static InternetHeaders getManifestProperties(File manifest) {
    final InternetHeaders result = new InternetHeaders();
    if (null == manifest) {
        LOGGER.debug("Manifest file not found.");
    } else {
        try {
            result.load(new AutoCloseInputStream(new BufferedInputStream(new FileInputStream(manifest))));
        } catch (MessagingException e) {
            LOGGER.warn(e.getMessage(), e);
        } catch (FileNotFoundException e) {
            LOGGER.warn(e.getMessage(), e);
        }
    }
    return result;
}