aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-01-16 00:00:17 +0000
committerOlivier Lamy <olamy@apache.org>2014-01-16 00:00:17 +0000
commit28c5e2e323d74761b5fcf56ba03e7326fc389711 (patch)
tree1648303038c95dc0e9697a0be5683dacde1e12a6
parent97ff21c1f1e91706d35258a9dcecb9fcc86191f4 (diff)
downloadarchiva-28c5e2e323d74761b5fcf56ba03e7326fc389711.tar.gz
archiva-28c5e2e323d74761b5fcf56ba03e7326fc389711.zip
fix issue when deleting project version non snapshot
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1558620 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
index 2adb32dea..b9935199b 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
@@ -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 );