Class FileFormValidator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.parameter.DefaultValidator
org.ametys.plugins.forms.question.validators.FileFormValidator
- All Implemented Interfaces:
Validator
,PluginAware
,Configurable
,LogEnabled
,Serviceable
Default validator for input files in Forms
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The allowed extensionsprotected Long
The max sizeFields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
Constructor Summary
ConstructorsConstructorDescriptionFileFormValidator
(String regexp, boolean mandatory, Long max, String extensions) A file form validator -
Method Summary
Modifier and TypeMethodDescriptionprotected void
validateArrayValues
(Object[] values, Errors errors) Validates a array of values.protected void
validateSingleValue
(Object value, Errors errors) Validates a single value.Methods inherited from class org.ametys.runtime.parameter.DefaultValidator
configure, equals, getConfiguration, hashCode, service, setPluginInfo, validate
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_max
The max size -
_extensions
The allowed extensions
-
-
Constructor Details
-
FileFormValidator
A file form validator- Parameters:
regexp
- the regexpmandatory
- true is mandatorymax
- the max sizeextensions
- the allowed extensions
-
-
Method Details
-
validateSingleValue
Description copied from class:DefaultValidator
Validates a single value.- Overrides:
validateSingleValue
in classDefaultValidator
- Parameters:
value
- the value to validate (can benull
).errors
- the structure to populate if the validation failed.
-
validateArrayValues
Description copied from class:DefaultValidator
Validates a array of values.- Overrides:
validateArrayValues
in classDefaultValidator
- Parameters:
values
- the values to validateerrors
- the structure to populate if the validation failed.
-