Package edu.drexel.goodwin.cpd.exception

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


  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

TOP

Related Classes of edu.drexel.goodwin.cpd.exception.InputValidationException

Copyright © 2018 www.massapicom. 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.