Class AbstractFileUploadExecutor

    • Field Detail

      • log

        protected static final org.apache.commons.logging.Log log
      • configurationContext

        protected org.apache.axis2.context.ConfigurationContext configurationContext
    • Constructor Detail

      • AbstractFileUploadExecutor

        protected AbstractFileUploadExecutor()
    • Method Detail

      • execute

        public abstract boolean execute​(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
                                 throws org.wso2.carbon.CarbonException,
                                        IOException
        Throws:
        org.wso2.carbon.CarbonException
        IOException
      • getErrorRedirectionPage

        protected String getErrorRedirectionPage()
      • getWorkingDir

        protected String getWorkingDir()
      • generateUUID

        protected String generateUUID()
      • getFileName

        protected String getFileName​(String fileName)
      • parseRequest

        protected List parseRequest​(org.apache.commons.fileupload.servlet.ServletRequestContext requestContext)
                             throws org.apache.commons.fileupload.FileUploadException
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • checkServiceFileExtensionValidity

        protected void checkServiceFileExtensionValidity​(String fileExtension,
                                                         String[] allowedExtensions)
                                                  throws org.apache.commons.fileupload.FileUploadException
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • uploadFile

        protected File uploadFile​(javax.servlet.http.HttpServletRequest request,
                                  String repoDir,
                                  javax.servlet.http.HttpServletResponse response,
                                  String extension)
                           throws org.apache.commons.fileupload.FileUploadException
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • executeCommon

        protected boolean executeCommon​(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
                                 throws org.apache.commons.fileupload.FileUploadException
        This is the common method that can be used for Fileupload. extraStoreDirUUID is the name of the javascript that's going to execute on the client side at the secound run.
        Parameters:
        request -
        response -
        Returns:
        Status true/fase.
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • uploadArtifacts

        protected boolean uploadArtifacts​(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          String uploadDirName,
                                          String[] extensions,
                                          String utilityString)
                                   throws org.apache.commons.fileupload.FileUploadException,
                                          IOException
        This is a helper method that will be used upload main entity (ex: wsdd, jar, class etc) and its resources to a given deployer.
        Parameters:
        request -
        response -
        uploadDirName -
        extensions -
        utilityString -
        Returns:
        boolean
        Throws:
        IOException
        org.apache.commons.fileupload.FileUploadException
      • getAllFileItems

        protected List<org.wso2.carbon.utils.FileItemData> getAllFileItems()
      • getContextRoot

        protected String getContextRoot​(javax.servlet.http.HttpServletRequest request)
      • getFormFieldValue

        public List<String> getFormFieldValue​(String formFieldName)
        Retrieve the form field values of the provided form field with name formFieldName
        Parameters:
        formFieldName - Name of the form field to be retrieved
        Returns:
        List of form field values
      • getFileItemsMap

        protected Map<String,​ArrayList<org.wso2.carbon.utils.FileItemData>> getFileItemsMap()