Using the upload security adapter interface
To implement a custom upload security adapter, create a class that implements the com.actuate.iportal.security.IUploadSecurityAdapter interface. This interface defines the following methods.
getErrorMessage( )
Syntax
String getErrorMessage( javax.servlet.http.HttpServletRequest request)
Parameter
request
The request parameter sent from the iHub Information Console client web application.
Description
A method that returns a custom error string when either isFileTypeAllowed or verifyFile returns False.
Returns
String. An error message. If null, iHub Information Console client displays a generic default error message.
isFileTypeAllowed( )
Syntax
boolean isFileTypeAllowed( javax.servlet.http.HttpServletRequest request, string fileType)
Parameters
request
The request parameter sent from the iHub Information Console client web application.
fileType
String. The type of the upload file, as determined by file extension.
Description
A required method used to do additional validation of the upload file.
Returns
Boolean. True for an allowed file type and False otherwise.
verifyFile( )
Syntax
boolean verifyFile( javax.servlet.http.HttpServletRequest request, string filePath, string dstPath)
Parameters
request
The request parameter sent from the iHub Information Console client web application.
filePath
String. The path of the file stored on iHub Information Console client. The default location is the directory specified by TEMP_FOLDER_LOCATION parameter in web.xml.
dstPath
String. The repository path to which the upload sends the file.
Description
A required method used to do additional validation of the upload file.
Returns
Boolean. True for successful file validation and False otherwise.