USING the baseName instead of itemName in oder to avoid adding extension as suffix

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@171887 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-10-03 15:26:47 +00:00
parent b4adb4d065
commit a7f03e20a7
1 changed files with 2 additions and 5 deletions

View File

@ -494,7 +494,6 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
inputStream.addListener(uploadProgressListener);
workspaceUploader.setUploadProgress(uploadProgressListener.getUploadProgress());
//USING isOverwrite to check if the file already exists
try {
isOverwrite = storageHubWrapper.getWorkspace().exists(itemName, destinationFolder.getId());
@ -528,10 +527,8 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
if (isSupportedArchive){ //Uploading Archive OK
logger.debug("Supported archive " +uploadItem.getContentType() +" for unpacking");
workspaceUploader = WorkspaceUploaderMng.uploadArchive(storageHubWrapper, user, scopeGroupId, workspaceUploader, request, itemName, inputStream, destinationFolder, size);
// if (MimeTypeUtil.isZipContentType(uploadItem.getContentType())){ //UNZIP??
// logger.debug("Unziping content");
// //THE WORKSPACE HAS BEEN INSTANCIED ABOVE
//USING the baseName instead of itemName in oder to avoid adding extension as suffix
workspaceUploader = WorkspaceUploaderMng.uploadArchive(storageHubWrapper, user, scopeGroupId, workspaceUploader, request, baseName, inputStream, destinationFolder, size);
if(workspaceUploader==null)
throw new Exception("Error when creating uploader, it is null!");