]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1793] trailing spaces not trimmed in upload form
authorOlivier Lamy <olamy@apache.org>
Wed, 20 Nov 2013 03:15:32 +0000 (03:15 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 20 Nov 2013 03:15:32 +0000 (03:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1543704 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java

index 7d94e112bac6e9fff46968f5ec101f8ea6257aca..77b1c0c060435f309445f8a7762dba2c49f96aa4 100644 (file)
@@ -210,10 +210,16 @@ public class DefaultFileUploadService
         return fileMetadatas == null ? Collections.<FileMetadata>emptyList() : fileMetadatas;
     }
 
-    public Boolean save( String repositoryId, final String groupId, final String artifactId, String version,
-                         String packaging, final boolean generatePom )
+    public Boolean save( String repositoryId, String groupId, String artifactId, String version,
+                         String packaging, boolean generatePom )
         throws ArchivaRestServiceException
     {
+        repositoryId = StringUtils.trim( repositoryId );
+        groupId = StringUtils.trim( groupId );
+        artifactId = StringUtils.trim( artifactId );
+        version = StringUtils.trim( version );
+        packaging = StringUtils.trim( packaging );
+
         List<FileMetadata> fileMetadatas = getSessionFilesList();
         if ( fileMetadatas == null || fileMetadatas.isEmpty() )
         {