Class ImageUploadValidationService
java.lang.Object
org.hippoecm.frontend.plugins.yui.upload.validation.DefaultUploadValidationService
org.hippoecm.frontend.plugins.yui.upload.validation.ImageUploadValidationService
- All Implemented Interfaces:
Serializable
,org.apache.wicket.util.io.IClusterable
,FileUploadValidationService
,IValidationService
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.hippoecm.frontend.plugins.yui.upload.validation.DefaultUploadValidationService
DefaultUploadValidationService.Validator
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String[]
static final String
static final String
static final int
static final int
Fields inherited from class org.hippoecm.frontend.plugins.yui.upload.validation.DefaultUploadValidationService
EXTENSION_MIMETYPE_ALLOWED_MAPPINGS, EXTENSIONS_ALLOWED, MAX_FILE_SIZE, MIME_TYPES_ALLOWED
Fields inherited from interface org.hippoecm.frontend.validation.IValidationService
VALIDATE_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
protected String
Check if the defaultMaximumUploadSize stored in the ApplicationSettings is set explicitly and only then used it, otherwise use DEFAULT_MAX_FILE_SIZE.static FileUploadValidationService
getValidationService
(IPluginContext pluginContext, IPluginConfig pluginConfig) Get the validation service specified by the parameterIValidationService.VALIDATE_ID
in the plugin config.Methods inherited from class org.hippoecm.frontend.plugins.yui.upload.validation.DefaultUploadValidationService
addValidator, addViolation, getAllowedExtensions, getMaxFileSize, getValidationResult, getValidationService, setAllowedExtensions, setAllowedMimeTypes, validate, validate
-
Field Details
-
DEFAULT_IMAGE_VALIDATION_SERVICE_ID
- See Also:
-
DEFAULT_MAX_WIDTH
public static final int DEFAULT_MAX_WIDTH- See Also:
-
DEFAULT_MAX_HEIGHT
public static final int DEFAULT_MAX_HEIGHT- See Also:
-
DEFAULT_MAX_FILE_SIZE
- See Also:
-
DEFAULT_EXTENSIONS_ALLOWED
-
-
Constructor Details
-
ImageUploadValidationService
public ImageUploadValidationService(org.apache.wicket.util.value.IValueMap params)
-
-
Method Details
-
getDefaultExtensionsAllowed
- Overrides:
getDefaultExtensionsAllowed
in classDefaultUploadValidationService
-
getDefaultMaxFileSize
Description copied from class:DefaultUploadValidationService
Check if the defaultMaximumUploadSize stored in the ApplicationSettings is set explicitly and only then used it, otherwise use DEFAULT_MAX_FILE_SIZE. This is because it is set to Bytes.MAX by default which is a bit overkill (8388608T).- Overrides:
getDefaultMaxFileSize
in classDefaultUploadValidationService
- Returns:
- The String value of the default maximum file size for an upload
-
getValidationService
public static FileUploadValidationService getValidationService(IPluginContext pluginContext, IPluginConfig pluginConfig) Get the validation service specified by the parameterIValidationService.VALIDATE_ID
in the plugin config. If no service id configuration is found, the service with idDEFAULT_IMAGE_VALIDATION_SERVICE_ID
is used.
-