Task #17152 Workspace uploader: avoid . (dot) char added as suffix when the filename does not contain an extension

Updated pom version at 2.0.3

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@181177 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-07-09 09:06:48 +00:00
parent b9379a457c
commit adfd7f4839
3 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,11 @@
<ReleaseNotes>
<Changeset
component="org.gcube.portlets-widgets.workspace-uploader.2-0-3"
date="${buildDate}">
<Change>[Task #17152] Workspace uploader: avoid . (dot) char added as
suffix when the filename does not contain an extension
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-widgets.workspace-uploader.2-0-2"
date="${buildDate}">

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>workspace-uploader</artifactId>
<packaging>jar</packaging>
<version>2.0.2-SNAPSHOT</version>
<version>2.0.3-SNAPSHOT</version>
<name>Workspace Uploader Widget</name>
<description>Workspace Uploader Widget allows your application to upload file/s in the gCube Workspace</description>
<scm>

View File

@ -502,7 +502,11 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
logger.debug("extension: "+extension);
//Getting base name
String baseName = FilenameUtils.getBaseName(itemName); //Using base name in order to avoid Task #12470
itemName = baseName+"."+extension;
//Task #17152
extension = extension.isEmpty()?"":"."+extension;
itemName = baseName+extension;
logger.debug("purged item name is: "+itemName);
//SIZE
Long size = getContentLength(request);