org.apache.turbine.services.intake.validator
Class FileValidator

java.lang.Object
  extended byorg.apache.turbine.services.intake.validator.DefaultValidator
      extended byorg.apache.turbine.services.intake.validator.FileValidator
All Implemented Interfaces:
InitableByConstraintMap, Validator

public class FileValidator
extends DefaultValidator

A validator that will compare a FileItem testValue against the following constraints in addition to those listed in DefaultValidator. This validator can serve as the base class for more specific validators

Version:
$Id: FileValidator.java 534527 2007-05-02 16:10:59Z tv $
Author:
John McNally, Quinton McCombs, Colin Chalmers

Field Summary
 
Fields inherited from class org.apache.turbine.services.intake.validator.DefaultValidator
errorMessage, log, maxLength, maxLengthMessage, minLength, minLengthMessage, required, requiredMessage
 
Fields inherited from interface org.apache.turbine.services.intake.validator.Validator
FLEXIBLE_RULE_NAME, FORMAT_RULE_NAME, INVALID_NUMBER_RULE_NAME, MASK_RULE_NAME, MAX_LENGTH_RULE_NAME, MAX_VALUE_RULE_NAME, MIN_LENGTH_RULE_NAME, MIN_VALUE_RULE_NAME, REQUIRED_RULE_NAME
 
Constructor Summary
FileValidator()
          Default constructor
FileValidator(java.util.Map paramMap)
          Constructor
 
Method Summary
 void assertValidity(org.apache.commons.fileupload.FileItem testValue)
          Determine whether a testValue meets the criteria specified in the constraints defined for this validator
 
Methods inherited from class org.apache.turbine.services.intake.validator.DefaultValidator
assertValidity, assertValidity, getMaxLength, getMaxLengthMessage, getMessage, getMinLength, getMinLengthMessage, getRequiredMessage, init, isRequired, isValid, isValid, setMaxLength, setMaxLengthMessage, setMinLength, setMinLengthMessage, setRequired, setRequiredMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileValidator

public FileValidator(java.util.Map paramMap)
              throws IntakeException
Constructor

Parameters:
paramMap - a Map of rule's containing constraints on the input.
Throws:
InvalidMaskException - an invalid mask was specified
IntakeException

FileValidator

public FileValidator()
Default constructor

Method Detail

assertValidity

public void assertValidity(org.apache.commons.fileupload.FileItem testValue)
                    throws ValidationException
Determine whether a testValue meets the criteria specified in the constraints defined for this validator

Parameters:
testValue - a FileItem to be tested
Throws:
ValidationException - containing an error message if the testValue did not pass the validation tests.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.