Class AbstractFileUploadExecutor
java.lang.Object
org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor
- Direct Known Subclasses:
DBSFileUploadExecutor
This class is responsible for handling File uploads of specific file types in Carbon. The file
type is decided depending on the file extensio.
This class should be extended by all FileUploadExecutors
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.axis2.context.ConfigurationContextprotected static final org.apache.commons.logging.Log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckServiceFileExtensionValidity(String fileExtension, String[] allowedExtensions) abstract booleanexecute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected booleanexecuteCommon(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) This is the common method that can be used for Fileupload.protected Stringprotected List<org.wso2.carbon.utils.FileItemData> protected StringgetContextRoot(javax.servlet.http.HttpServletRequest request) protected Stringprotected StringgetFileName(String fileName) getFormFieldValue(String formFieldName) Retrieve the form field values of the provided form field with nameformFieldNameprotected Stringprotected voidparseRequest(javax.servlet.http.HttpServletRequest request) protected ListparseRequest(org.apache.commons.fileupload.servlet.ServletRequestContext requestContext) protected booleanuploadArtifacts(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String uploadDirName, String[] extensions, String utilityString) This is a helper method that will be used upload main entity (ex: wsdd, jar, class etc) and its resources to a given deployer.protected FileuploadFile(javax.servlet.http.HttpServletRequest request, String repoDir, javax.servlet.http.HttpServletResponse response, String extension)
-
Field Details
-
log
protected static final org.apache.commons.logging.Log log -
configurationContext
protected org.apache.axis2.context.ConfigurationContext configurationContext
-
-
Constructor Details
-
AbstractFileUploadExecutor
protected AbstractFileUploadExecutor()
-
-
Method Details
-
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.CarbonExceptionIOException
-
getErrorRedirectionPage
-
parseRequest
protected void parseRequest(javax.servlet.http.HttpServletRequest request) throws FileUploadFailedException, FileSizeLimitExceededException -
getWorkingDir
-
generateUUID
-
getFileName
-
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:
IOExceptionorg.apache.commons.fileupload.FileUploadException
-
getAllFileItems
-
getContextRoot
-
getFormFieldValue
Retrieve the form field values of the provided form field with nameformFieldName- Parameters:
formFieldName- Name of the form field to be retrieved- Returns:
- List of form field values
-
getFileItemsMap
-
getFormFieldsMap
-