1 10 11 package org.mule.providers.email.filters; 12 13 import javax.mail.Message ; 14 import javax.mail.MessagingException ; 15 16 import org.mule.routing.filters.RegExFilter; 17 18 22 public class MailSubjectRegExFilter extends AbstractMailFilter 23 { 24 private RegExFilter filter = new RegExFilter(); 25 26 public boolean accept(Message message) 27 { 28 try 29 { 30 return filter.accept(message.getSubject()); 31 } 32 catch (MessagingException e) 33 { 34 logger.warn("Failed to read message subject: " + e.getMessage(), e); 35 return false; 36 } 37 } 38 39 public void setPattern(String pattern) 40 { 41 filter.setPattern(pattern); 42 } 43 44 public String getPattern() 45 { 46 return filter.getPattern(); 47 } 48 } 49 | Popular Tags |