Class 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. 1. Using FileUploadConfig configuration section in the carbon.xml
    2. 2. Instances of AbstractFileUploadExecutor registered as OSGi services
    3. 3. Using component.xml file in UI components

    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 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 IOException
        When a FileUpload request is received, this method will be called.
        Parameters:
        request - The HTTP Request
        response - 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)