Examples of InputValidationException


Examples of edu.drexel.goodwin.cpd.exception.InputValidationException

    Policy policy;
    try {
      ClassPathResource resource = new ClassPathResource(LIMITED_HTML_POLICY_FILE_LOCATION);
      policy = Policy.getInstance(resource.getInputStream());
    } catch (Exception e) {
      throw new InputValidationException("Cannot create required AntiSamy policy object. Hint: make sure a policy file is located at " + LIMITED_HTML_POLICY_FILE_LOCATION, e);
    }
    antiSamy = new AntiSamy(policy);
  }
View Full Code Here

Examples of edu.drexel.goodwin.cpd.exception.InputValidationException

  public CleanResults scan(String taintedInput) {
    try {
      return antiSamy.scan(taintedInput);
    } catch (PolicyException pe) {
      pe.printStackTrace();
      throw new InputValidationException("There was an error with the AntiSamy policy for validating user input");
    } catch (ScanException se) {
      se.printStackTrace();
      throw new InputValidationException("There was an error validating your submission. Please check your input and try again.");
    }
  }
View Full Code Here

Examples of org.jboss.security.auth.spi.InputValidationException

      // we start with a validation using patterns.
      Matcher usernameMatcher = this.usernamePattern.matcher(username);
      Matcher passwordMatcher = this.passwordPattern.matcher(password);
      if (!usernameMatcher.matches() || !passwordMatcher.matches())
         throw new InputValidationException("Username or password does not adhere to the acceptable pattern");

      // now we proceed with a blacklist validation.
      if (matchesBlackList(username) || matchesBlackList(password))
         throw new InputValidationException("Username or password contains invalid tokens");
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.