Class FileUploadExecutorManager
- java.lang.Object
-
- org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager
-
public class FileUploadExecutorManager extends Object
This class is responsible for delegating the file upload requests to the different FileUploadExecutors.
The FileUploadExecutors may be registered in the following manner:
- 1. Using FileUploadConfig configuration section in the carbon.xml
- 2. Instances of
AbstractFileUploadExecutorregistered as OSGi services - 3. Using component.xml file in UI components
If a FileUploadExecutor cannot be found in the above 3 collections, as a final resort, we will finally try to upload the file using an
AnyFileUploadExecutor, if it has been registered in the carbon.xml file. Searching for an FileUploadExecutor in the above 3 types of items is done using the chain of execution pattern. As soon as a FileUploadExecutor which can handle the uploaded file type is found, execution of the chain is terminated.
-
-
Constructor Summary
Constructors Constructor Description FileUploadExecutorManager(org.osgi.framework.BundleContext bundleContext, org.apache.axis2.context.ConfigurationContext configCtx, String webContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExecutor(String action, String executorClass)booleanexecute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)When a FileUpload request is received, this method will be called.voidremoveExecutor(String action)
-
-
-
Constructor Detail
-
FileUploadExecutorManager
public FileUploadExecutorManager(org.osgi.framework.BundleContext bundleContext, org.apache.axis2.context.ConfigurationContext configCtx, String webContext) throws org.wso2.carbon.CarbonException- Throws:
org.wso2.carbon.CarbonException
-
-
Method Detail
-
execute
public boolean execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOExceptionWhen a FileUpload request is received, this method will be called.- Parameters:
request- The HTTP Requestresponse- The HTTP Response- Returns:
- true - if the file uploading was successful, false - otherwise
- Throws:
IOException- If an unrecoverable error occurs during file upload
-
addExecutor
public void addExecutor(String action, String executorClass) throws org.wso2.carbon.CarbonException
- Throws:
org.wso2.carbon.CarbonException
-
removeExecutor
public void removeExecutor(String action)
-
-