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