|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFileValidator
Interface to validate a file.
It's possible make a custom class validator for a file repository
.
For that, implement this interface, defining the validation behavior on the
validate(FileConfig)
method.
To configure the custom validators used by file repositories, define, in the property bag of the file repository's service instance channel, a property named lumis.portal.file.validation.className, having as its values the custom validator class names.
Example custom validator class:
public class FixedSizeValidator implements IFileValidator
{
public void validate(FileConfig file) throws FileValidationException, PortalException
{
if (file.getFileSize() > 1000000)
throw new FileValidationException("File size greater than 1000000"); // validation failed
}
}
IFileManager
Method Summary | |
---|---|
void |
validate(FileConfig file)
Validate the metadata of a file. |
Method Detail |
---|
void validate(FileConfig file) throws FileValidationException, PortalException
file
- The file to be validated.
FileValidationException
- If the validation has failed.
PortalException
- If any error occurs validating the metadata.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |