]> source.dussan.org Git - archiva.git/commitdiff
fix issue when deleting project version non snapshot
authorOlivier Lamy <olamy@apache.org>
Thu, 16 Jan 2014 00:00:17 +0000 (00:00 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 16 Jan 2014 00:00:17 +0000 (00:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1558620 13f79535-47bb-0310-9956-ffa450edef68

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

index 2adb32dea4e582efb35f5537eb114d170972261e..b9935199b07eef8b10fc7aca26caad3dfec21bf1 100644 (file)
@@ -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 );