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
public class ImageUploadValidationService extends DefaultUploadValidationService
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hippoecm.frontend.plugins.yui.upload.validation.DefaultUploadValidationService
DefaultUploadValidationService.Validator
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
DEFAULT_EXTENSIONS_ALLOWED
static String
DEFAULT_IMAGE_VALIDATION_SERVICE_ID
static String
DEFAULT_MAX_FILE_SIZE
static int
DEFAULT_MAX_HEIGHT
static int
DEFAULT_MAX_WIDTH
-
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
Constructors Constructor Description ImageUploadValidationService(org.apache.wicket.util.value.IValueMap params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]
getDefaultExtensionsAllowed()
protected String
getDefaultMaxFileSize()
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 Detail
-
DEFAULT_IMAGE_VALIDATION_SERVICE_ID
public static final String DEFAULT_IMAGE_VALIDATION_SERVICE_ID
- See Also:
- Constant Field Values
-
DEFAULT_MAX_WIDTH
public static final int DEFAULT_MAX_WIDTH
- See Also:
- Constant Field Values
-
DEFAULT_MAX_HEIGHT
public static final int DEFAULT_MAX_HEIGHT
- See Also:
- Constant Field Values
-
DEFAULT_MAX_FILE_SIZE
public static final String DEFAULT_MAX_FILE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_EXTENSIONS_ALLOWED
public static final String[] DEFAULT_EXTENSIONS_ALLOWED
-
-
Method Detail
-
getDefaultExtensionsAllowed
protected String[] getDefaultExtensionsAllowed()
- Overrides:
getDefaultExtensionsAllowed
in classDefaultUploadValidationService
-
getDefaultMaxFileSize
protected String 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.
-
-