@Test(expected = MessagingException.class) public void testSelectMimeMultipart() throws Exception { MimeMultipart mmp = createMultipart(); SelectByHeader selector = new SelectByHeader("Content-Id", "payload1"); List<MimeBodyPart> parts = selector.select(mmp); }
@Override public MimeBodyPart select(BodyPartIterator m) throws MessagingException { MimeBodyPart result = null; assertConfig(); outer: while (m.hasNext()) { MimeBodyPart p = m.next(); String[] values = p.getHeader(getHeaderName()); if (values != null) { for (String value : values) { if (value.matches(getHeaderValueRegExp())) { result = p; break outer; } } } } return result; }
SelectByHeader implements PartSelector { @Override public MimeBodyPart select(BodyPartIterator m) throws MessagingException { MimeBodyPart result = null; assertConfig(); outer: while (m.hasNext()) { MimeBodyPart p = m.next(); String[] values = p.getHeader(getHeaderName()); if (values != null) { for (String value : values) { if (value.matches(getHeaderValueRegExp())) { result = p; break outer; } } } } return result; } }
SelectByHeader implements PartSelector { @Override public MimeBodyPart select(BodyPartIterator m) throws MessagingException { MimeBodyPart result = null; assertConfig(); outer: while (m.hasNext()) { MimeBodyPart p = m.next(); String[] values = p.getHeader(getHeaderName()); if (values != null) { for (String value : values) { if (value.matches(getHeaderValueRegExp())) { result = p; break outer; } } } } return result; } SelectByHeader();  SelectByHeader(String header, String regexp); }
SelectByHeader implements PartSelector { @Override public MimeBodyPart select(BodyPartIterator m) throws MessagingException { MimeBodyPart result = null; assertConfig(); outer: while (m.hasNext()) { MimeBodyPart p = m.next(); String[] values = p.getHeader(getHeaderName()); if (values != null) { for (String value : values) { if (value.matches(getHeaderValueRegExp())) { result = p; break outer; } } } } return result; } SelectByHeader();  SelectByHeader(String header, String regexp); @Override MimeBodyPart select(BodyPartIterator m); @Override /** * Functionality not supported in this PartSelector */ List<MimeBodyPart> select(MimeMultipart in); String getHeaderName(); void setHeaderName(String s); String getHeaderValueRegExp(); void setHeaderValueRegExp(String s); }
SelectByHeader implements PartSelector { @Override public MimeBodyPart select(BodyPartIterator m) throws MessagingException { MimeBodyPart result = null; assertConfig(); outer: while (m.hasNext()) { MimeBodyPart p = m.next(); String[] values = p.getHeader(getHeaderName()); if (values != null) { for (String value : values) { if (value.matches(getHeaderValueRegExp())) { result = p; break outer; } } } } return result; } SelectByHeader();  SelectByHeader(String header, String regexp); @Override MimeBodyPart select(BodyPartIterator m); @Override /** * Functionality not supported in this PartSelector */ List<MimeBodyPart> select(MimeMultipart in); String getHeaderName(); void setHeaderName(String s); String getHeaderValueRegExp(); void setHeaderValueRegExp(String s);  }