Package org.ametys.cms.data
Class FileValidator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.parameter.DefaultValidator
org.ametys.cms.data.FileValidator
- All Implemented Interfaces:
Validator
,PluginAware
,Configurable
,LogEnabled
,Serviceable
DefaultValidator
extension to enforce the file 'type' or extension based on the widget params.-
Field Summary
Modifier and TypeFieldDescriptionThe list of file extension that are consider as imageThe list of file extension that are consider as multimediaThe list of file extension that are consider as pdfThe list of file extension that are consider as soundThe list of file extension that are considered as imageFields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) protected 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
equals, getConfiguration, hashCode, service, setPluginInfo, validate
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
IMAGE_FILTER
The list of file extension that are consider as image -
VIDEO_FILTER
The list of file extension that are considered as image -
SOUND_FILTER
The list of file extension that are consider as sound -
MULTIMEDIA_FILTER
The list of file extension that are consider as multimedia -
PDF_FILTER
The list of file extension that are consider as pdf
-
-
Constructor Details
-
FileValidator
public FileValidator()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDefaultValidator
- Throws:
ConfigurationException
-
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.
-