org.nuxeo.ecm.platform.ui.web.component.file
Class InputFileSizeValidator
java.lang.Object
org.nuxeo.ecm.platform.ui.web.component.file.InputFileSizeValidator
- All Implemented Interfaces:
- EventListener, StateHolder, Validator
public class InputFileSizeValidator
- extends Object
- implements Validator, StateHolder
Input file size validator.
Validates an InputFileInfo
blob value in case it's been uploaded.
Value is set using the "maxSize" attribute and setting it to (for instance)
"10Ko", "10Mo" or "10Go".
- Author:
- Anahide Tchertchian
VALIDATOR_ID
public static final String VALIDATOR_ID
- See Also:
- Constant Field Values
MAXIMUM_MESSAGE_ID
public static final String MAXIMUM_MESSAGE_ID
- The message identifier of the
FacesMessage
to be created if the maximum
size check fails. The message format string for this message may
optionally include the following placeholders:
{0}
replaced by the configured maximum length.
- See Also:
- Constant Field Values
InputFileSizeValidator
public InputFileSizeValidator()
validate
public void validate(FacesContext context,
UIComponent component,
Object value)
throws ValidatorException
- Specified by:
validate
in interface Validator
- Throws:
ValidatorException
getMaxSize
public String getMaxSize()
getMaxSizeBytes
public long getMaxSizeBytes()
setMaxSize
public void setMaxSize(String maxSizeString)
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interface StateHolder
setTransient
public void setTransient(boolean newTransientValue)
- Specified by:
setTransient
in interface StateHolder
saveState
public Object saveState(FacesContext context)
- Specified by:
saveState
in interface StateHolder
restoreState
public void restoreState(FacesContext context,
Object state)
- Specified by:
restoreState
in interface StateHolder
Copyright © 2011 Nuxeo SAS. All Rights Reserved.