1 33 package net.myvietnam.mvncore.interceptor.sample; 34 35 import net.myvietnam.mvncore.interceptor.MailInterceptor; 36 import net.myvietnam.mvncore.exception.InterceptorException; 37 38 45 public class NoPublicMailInterceptor implements MailInterceptor { 46 47 public NoPublicMailInterceptor() { 48 } 49 50 57 public void validateEmail(String email) throws InterceptorException { 58 email = email.toLowerCase(); 59 if (email.endsWith("@yahoo.com") || 60 email.endsWith("@hotmail.com") || 61 email.endsWith("@aol.com") ) { 62 throw new InterceptorException("Cannot accept email that is in public domain. Your email = " + email); 63 } 64 } 65 } 66 | Popular Tags |