IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.cs.ajax.fileupload
Interface IFileHandler

All Known Implementing Classes:
AbstractFileHandler

public interface IFileHandler

This class is a abstract class used to handler file upload process


Method Summary
 int cleanContext()
          clean the fileupload info from processor or session context pre-defined.
 int deleteFile(java.lang.String fileId)
          delete file from system, db or file system or other storages
 java.lang.String getFileId()
          a Id used to identifier the upload file(s).
 java.lang.String getFileInfo(int code)
          this method will return a json object that will be part of reply message of the request some thing like this {"name":"test", "fileId":"c:\temp\test.txt", [{"name":"test0", "fileId":"c:\temp\test0.txt"}, {"name":"test", "fileId":"c:\temp\test.txt"} ] } developer should implement this method align with the UI widget customization.
 java.lang.String getFileName(java.lang.String fileId)
          get readable file name for developer or end user
 long getTimeout()
          get the time out value of the file upload handler the time is milli-seconds.
 void initConfig(KeyedCollection config)
          initial handler relative configuration info, it will be invoked when the handler created
 void onRequestExpired(java.lang.String fileId)
          take actions when the fileupload request expired when file uploading.
 int requestValidate(javax.servlet.http.HttpServletRequest request)
          validate whether the fileupload request is valid. e.g session expired, context error, or file system storage error etc.
 java.io.File retrieveFile(java.lang.String fileId)
          retrieve saved file from system
 int saveFile(javax.servlet.http.HttpServletRequest request)
          save the file into proper storage. e.g file system or database or remote server
 int upldateContext(java.lang.String fileId)
          update the fileId info into processor or session context pre-defined.
 

Method Detail

saveFile

int saveFile(javax.servlet.http.HttpServletRequest request)
save the file into proper storage. e.g file system or database or remote server

Parameters:
request - fileupload request
Returns:
error code, 0: save file ok, others means that errors when do save

deleteFile

int deleteFile(java.lang.String fileId)
delete file from system, db or file system or other storages

Parameters:
fileId - identifier of the file to be deleted
Returns:
error code, 0 means delete success, other values mean that error occurred when do delete

retrieveFile

java.io.File retrieveFile(java.lang.String fileId)
retrieve saved file from system

Parameters:
fileId - identifier of the file to be deleted
Returns:
File, if retrieve file success else return null if errors

onRequestExpired

void onRequestExpired(java.lang.String fileId)
take actions when the fileupload request expired when file uploading. e.g delete the temp file and stop uploading process or others

Parameters:
fileId - identifier of the file

getFileId

java.lang.String getFileId()
a Id used to identifier the upload file(s). fileId maybe a encryped, meaning-less string, maybe a key to real file system path of the uploaded file or a key by which the file can be accessed from DB.

Returns:
String file Id or null if errors

getFileName

java.lang.String getFileName(java.lang.String fileId)
get readable file name for developer or end user

Parameters:
fileId - identifier of the file
Returns:
file name or null if errors

upldateContext

int upldateContext(java.lang.String fileId)
update the fileId info into processor or session context pre-defined.

Parameters:
fileId - identifier of the file
Returns:
error code, 0 means upldate context success, other values mean that error occurred when do context update

cleanContext

int cleanContext()
clean the fileupload info from processor or session context pre-defined.

Returns:
error code, 0 means clean context success, other values mean that error occurred when context clean

requestValidate

int requestValidate(javax.servlet.http.HttpServletRequest request)
validate whether the fileupload request is valid. e.g session expired, context error, or file system storage error etc.

Parameters:
request - fileupload request
Returns:
0, the request is valid, others means that the request is invalid.

initConfig

void initConfig(KeyedCollection config)
                throws DSEException
initial handler relative configuration info, it will be invoked when the handler created

Parameters:
config - a keyed collection with config info
Throws:
DSEException

getTimeout

long getTimeout()
get the time out value of the file upload handler the time is milli-seconds.

Returns:
time out value with milliseconds

getFileInfo

java.lang.String getFileInfo(int code)
this method will return a json object that will be part of reply message of the request some thing like this {"name":"test", "fileId":"c:\temp\test.txt", [{"name":"test0", "fileId":"c:\temp\test0.txt"}, {"name":"test", "fileId":"c:\temp\test.txt"} ] } developer should implement this method align with the UI widget customization.

Parameters:
code - file upload code, e.g REQ_VALID,SAVE_SUCCESS,UPDATE_CTX_SUCCESS or other customized code in extension handlers
Returns:

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011