/** * Reads the manifest entries from the provided file. * * @param manifest the manifest * @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 (InputStream in = new BufferedInputStream(new FileInputStream(manifest))) { result.load(in); } catch (MessagingException | FileNotFoundException e) { LOGGER.warn(e.getMessage(), e); } catch (IOException ex) { LOGGER.warn(ex.getMessage(), ex); } } return result; }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the * header lines inside this InternetHeaders object. The order * of header lines is preserved. <p> * * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. Headers are added to the end of the existing list * of headers, in order. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public void load(InputStream is) throws MessagingException { load(is, false); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The * header lines are stored internally. <p> * * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. <p> * * No placeholder entries are inserted; the original order of * the headers is preserved. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public InternetHeaders(InputStream is) throws MessagingException { headers = new ArrayList<InternetHeader>(40); load(is); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The * header lines are stored internally. <p> * * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. <p> * * No placeholder entries are inserted; the original order of * the headers is preserved. * * @param is RFC822 input stream * @param allowutf8 if UTF-8 encoded headers are allowed * @exception MessagingException for any I/O error reading the stream * @since JavaMail 1.6 */ public InternetHeaders(InputStream is, boolean allowutf8) throws MessagingException { headers = new ArrayList<>(40); load(is, allowutf8); }
/** * Create a new InternetHeaders initialized by reading headers from the * stream. * * @param in * the RFC822 input stream to load from * @throws MessagingException * if there is a problem pasring the stream */ public InternetHeaders(InputStream in) throws MessagingException { load(in); }
/** * Create a new InternetHeaders initialized by reading headers from the * stream. * * @param in * the RFC822 input stream to load from * @throws MessagingException * if there is a problem pasring the stream */ public InternetHeaders(InputStream in) throws MessagingException { load(in); }
h.load(headerStream); if (headers == null || allHeaders) headers = h;
h.load(headerStream); if (headers == null || allHeaders) headers = h;
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the * header lines inside this InternetHeaders object. The order * of header lines is preserved. <p> * * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. Headers are added to the end of the existing list * of headers, in order. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public void load(InputStream is) throws MessagingException { load(is, false); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the * header lines inside this InternetHeaders object. The order * of header lines is preserved. <p> * * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. Headers are added to the end of the existing list * of headers, in order. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public void load(InputStream is) throws MessagingException { load(is, false); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the * header lines inside this InternetHeaders object. The order * of header lines is preserved. <p> * * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. Headers are added to the end of the existing list * of headers, in order. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public void load(InputStream is) throws MessagingException { load(is, false); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the * header lines inside this InternetHeaders object. The order * of header lines is preserved. <p> * * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. Headers are added to the end of the existing list * of headers, in order. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public void load(InputStream is) throws MessagingException { load(is, false); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the * header lines inside this InternetHeaders object. The order * of header lines is preserved. <p> * * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. Headers are added to the end of the existing list * of headers, in order. * * @param is RFC822 input stream * @exception MessagingException for any I/O error reading the stream */ public void load(InputStream is) throws MessagingException { load(is, false); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The * header lines are stored internally. <p> * * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. <p> * * No placeholder entries are inserted; the original order of * the headers is preserved. * * @param is RFC822 input stream */ public InternetHeaders(InputStream is) throws MessagingException { headers = new ArrayList(40); load(is); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The * header lines are stored internally. <p> * * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. <p> * * No placeholder entries are inserted; the original order of * the headers is preserved. * * @param is RFC822 input stream * @param allowutf8 if UTF-8 encoded headers are allowed * @exception MessagingException for any I/O error reading the stream * @since JavaMail 1.6 */ public InternetHeaders(InputStream is, boolean allowutf8) throws MessagingException { headers = new ArrayList<>(40); load(is, allowutf8); }
/** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The * header lines are stored internally. <p> * * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. <p> * * No placeholder entries are inserted; the original order of * the headers is preserved. * * @param is RFC822 input stream */ public InternetHeaders(InputStream is) throws MessagingException { headers = new ArrayList(40); load(is); }
throw new MessagingException("Failed to fetch headers"); headers.load(bis);
throw new MessagingException("Failed to fetch headers"); headers.load(bis);
headers.load(is); // load this header into the Headers object.
headers.load(is); // load this header into the Headers object.