1 package org.apache.turbine.services.intake.validator;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Map;
23
24 import org.apache.commons.fileupload.FileItem;
25
26 import org.apache.turbine.services.intake.IntakeException;
27
28 /***
29 * A validator that will compare a FileItem testValue against the following
30 * constraints in addition to those listed in DefaultValidator.
31 *
32 *
33 *
34 * This validator can serve as the base class for more specific validators
35 *
36 * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
37 * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
38 * @author <a href="mailto:Colin.Chalmers@maxware.nl">Colin Chalmers</a>
39 * @version $Id: FileValidator.java 534527 2007-05-02 16:10:59Z tv $
40 */
41 public class FileValidator
42 extends DefaultValidator
43 {
44
45 /***
46 *
47 * Constructor
48 *
49 * @param paramMap a <code>Map</code> of <code>rule</code>'s
50 * containing constraints on the input.
51 * @exception InvalidMaskException an invalid mask was specified
52 */
53 public FileValidator(Map paramMap)
54 throws IntakeException
55 {
56 init(paramMap);
57 }
58
59 /***
60 * Default constructor
61 */
62 public FileValidator()
63 {
64 }
65
66 /***
67 * Determine whether a testValue meets the criteria specified
68 * in the constraints defined for this validator
69 *
70 * @param testValue a <code>FileItem</code> to be tested
71 * @exception ValidationException containing an error message if the
72 * testValue did not pass the validation tests.
73 */
74 public void assertValidity(FileItem testValue)
75 throws ValidationException
76 {
77 super.assertValidity(testValue.getString());
78 }
79 }