Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD com.ibm.workplace.wcm.api.extensions.validation
Interface FileUploadValidationPlugin
public interface FileUploadValidationPluginRepresents a FileUploadValidation plugin.
A FileUploadValidation plugin is used to validate the contents of a file/image suite a given customers requirements for storing a file or image into the WCM Repository.
There are any number of validation that can be performed. Some examples include:
- Virus Scanning
- File size limitations, may be based on type of file (File Type or MimeType)
- Only allow certain types of files, PDF only ( i.e. no OpenOffice, Word, etc documents )
- Image must not be greater than a given size ( total bytes, or dimensions )
- ...
The plugin is registered w/ WCM by providing a plugin.xml in the JAR file including the implementation and specifying and extension provider similiar to this:
<extension point="com.ibm.workplace.wcm.api.FileUploadValidationPlugin" id="SampleValidation"> <provider class="com.yourco.validation.SampleValidation"/> </extension>Each FileUploadValidation plugin must also have a constructor with no arguments
- Since:
- 6.1.5
Method Summary java.lang.String getName()
Return the name for this pluginboolean validate(java.io.InputStream inputStream, FileUploadValidationContext context)
The FileUploadValidation Plugin should validate inputStream to determine if the file or image should be stored in the WCM repository.
Method Detail getName
java.lang.String getName()
- Returns the name for this plugin
- Returns:
- name of the plugin
validate
boolean validate(java.io.InputStream inputStream, FileUploadValidationContext context) throws FileUploadValidationException
- The FileUploadValidation Plugin should validate inputStream to determine if the file or image should be stored in the WCM repository.
- Parameters:
- inputStream - String containing the file/image bytes.
- context - context to be used to determine additional meta information about the file or image being saved.
- Returns:
- true if the file/image should be save false otherwise.
- Throws:
- FileUploadValidationException - - thrown if any errors occur processing the file/image, or if the file fails validation and the plugin wishes to pass back information about why it failed.
Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD