/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ @Override public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The header match method. * * @param msg The match is applied to this Message's header * @return true if the match succeeds, otherwise false */ public boolean match(Message msg) { String[] headers; try { headers = msg.getHeader(headerName); } catch (Exception e) { return false; } if (headers == null) return false; for (int i=0; i < headers.length; i++) if (super.match(headers[i])) return true; return false; }
/** * The match method. * * @param msg the match is applied to this Message's * Message-ID header * @return true if the match succeeds, otherwise false */ public boolean match(Message msg) { String[] s; try { s = msg.getHeader("Message-ID"); } catch (Exception e) { return false; } if (s == null) return false; for (int i=0; i < s.length; i++) if (super.match(s[i])) return true; return false; }
/** * The header match method. * * @param msg The match is applied to this Message's header * @return true if the match succeeds, otherwise false */ @Override public boolean match(Message msg) { String[] headers; try { headers = msg.getHeader(headerName); } catch (Exception e) { return false; } if (headers == null) return false; for (int i=0; i < headers.length; i++) if (super.match(headers[i])) return true; return false; }
/** * Check whether the address pattern specified in the constructor is * a substring of the string representation of the given Address * object. <p> * * Note that if the string representation of the given Address object * contains charset or transfer encodings, the encodings must be * accounted for, during the match process. <p> * * @param a The comparison is applied to this Address object. * @return true if the match succeeds, otherwise false. */ protected boolean match(Address a) { if (a instanceof InternetAddress) { InternetAddress ia = (InternetAddress)a; // We dont use toString() to get "a"'s String representation, // because InternetAddress.toString() returns a RFC 2047 // encoded string, which isn't what we need here. return super.match(ia.toUnicodeString()); } else return super.match(a.toString()); }
/** * The match method. * * @param msg the match is applied to this Message's * Message-ID header * @return true if the match succeeds, otherwise false */ @Override public boolean match(Message msg) { String[] s; try { s = msg.getHeader("Message-ID"); } catch (Exception e) { return false; } if (s == null) return false; for (int i=0; i < s.length; i++) if (super.match(s[i])) return true; return false; }
/** * Check whether the address pattern specified in the constructor is * a substring of the string representation of the given Address * object. <p> * * Note that if the string representation of the given Address object * contains charset or transfer encodings, the encodings must be * accounted for, during the match process. <p> * * @param a The comparison is applied to this Address object. * @return true if the match succeeds, otherwise false. */ protected boolean match(Address a) { if (a instanceof InternetAddress) { InternetAddress ia = (InternetAddress)a; // We dont use toString() to get "a"'s String representation, // because InternetAddress.toString() returns a RFC 2047 // encoded string, which isn't what we need here. return super.match(ia.toUnicodeString()); } else return super.match(a.toString()); }
return super.match(s); } else if (p.isMimeType("multipart/*")) { Multipart mp = (Multipart)p.getContent();
return super.match(s); } else if (p.isMimeType("multipart/*")) { Multipart mp = (Multipart)p.getContent();
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ @Override public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ @Override public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ @Override public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ @Override public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The header match method. * * @param msg The match is applied to this Message's header * @return true if the match succeeds, otherwise false */ @Override public boolean match(Message msg) { String[] headers; try { headers = msg.getHeader(headerName); } catch (Exception e) { return false; } if (headers == null) return false; for (int i=0; i < headers.length; i++) if (super.match(headers[i])) return true; return false; }
/** * The match method. * * @param msg the pattern match is applied to this Message's * subject header * @return true if the pattern match succeeds, otherwise false */ @Override public boolean match(Message msg) { String subj; try { subj = msg.getSubject(); } catch (Exception e) { return false; } if (subj == null) return false; return super.match(subj); }
/** * The header match method. * * @param msg The match is applied to this Message's header * @return true if the match succeeds, otherwise false */ public boolean match(Message msg) { String[] headers; try { headers = msg.getHeader(headerName); } catch (Exception e) { return false; } if (headers == null) return false; for (int i=0; i < headers.length; i++) if (super.match(headers[i])) return true; return false; }
private boolean matchPart(Part part) throws MessagingException, IOException { if (part.isMimeType("multipart/*")) { Multipart mp = (Multipart) part.getContent(); int count = mp.getCount(); for (int i=0; i < count; i++) { BodyPart bp = mp.getBodyPart(i); if (matchPart(bp)) { return true; } } return false; } else if (part.isMimeType("text/*")) { String content = (String) part.getContent(); return super.match(content); } else { return false; } } }