archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1558620 - /archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
Date Thu, 16 Jan 2014 00:00:17 GMT
Author: olamy
Date: Thu Jan 16 00:00:17 2014
New Revision: 1558620

URL: http://svn.apache.org/r1558620
Log:
fix issue when deleting project version non snapshot

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java?rev=1558620&r1=1558619&r2=1558620&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
Thu Jan 16 00:00:17 2014
@@ -610,6 +610,7 @@ public class DefaultRepositoriesService
         {
             Artifact artifact = new Artifact( namespace, projectId, version );
             artifact.setRepositoryId( repositoryId );
+            artifact.setContext( repositoryId );
             return deleteArtifact( artifact );
         }
 
@@ -711,6 +712,12 @@ public class DefaultRepositoriesService
     {
 
         String repositoryId = artifact.getContext();
+        // some rest call can use context or repositoryId
+        // so try both!!
+        if ( StringUtils.isEmpty( repositoryId ) )
+        {
+            repositoryId = artifact.getRepositoryId();
+        }
         if ( StringUtils.isEmpty( repositoryId ) )
         {
             throw new ArchivaRestServiceException( "repositoryId cannot be null", 400, null
);



Mime
View raw message