Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public boolean isValidEMail(String sEmail) {
  2. int iAt;
  3. String sMethod = CLASS + ".isValidEmail";
  4. if (this.log.isLoggingDebug()) {
  5. this.log.logEnter(sMethod, (Object) sEmail);
  6. }
  7. if ((iAt = (sEmail = sEmail.trim()).indexOf(64)) >= 0) {
  8. String sUser = sEmail.substring(0, iAt);
  9. String sDomain = sEmail.substring(iAt + 1);
  10. sEmail = sUser + "@" + IDN.toASCII(sDomain);
  11. if (this.log.isLoggingDebug()) {
  12. this.log.logDebug(sMethod,
  13. (Object) ("E-Mail nach IDN-Auflösung: '" + sEmail + "'"));
  14. }
  15. }
  16. boolean bResult = false;
  17.  
  18. org.apache.commons.validator.routines.EmailValidator apacheValidator = org.apache.commons.validator.routines.EmailValidator
  19. .getInstance();
  20. bResult = apacheValidator.isValid(sEmail);
  21. if (this.log.isLoggingDebug()) {
  22. this.log.logReturn(sMethod, (Object) bResult);
  23. }
  24. return bResult;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement