summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-rest
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-05-30 16:05:28 +0000
committerOlivier Lamy <olamy@apache.org>2012-05-30 16:05:28 +0000
commitbbadcdcf91b5a6d00e1f533cb3ec055745509271 (patch)
tree997c696612e206d179b788f4ea0aec903932e065 /archiva-modules/archiva-web/archiva-rest
parente9c63be0d2a9cd36b41922ee7b4ca5360312fe1d (diff)
downloadarchiva-bbadcdcf91b5a6d00e1f533cb3ec055745509271.tar.gz
archiva-bbadcdcf91b5a6d00e1f533cb3ec055745509271.zip
start work on deleting artifacts tru the ui
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1344323 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java9
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java3
2 files changed, 7 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
index 92662b78e..b82ee5d16 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/RepositoriesService.java
@@ -19,11 +19,11 @@ package org.apache.archiva.rest.api.services;
* under the License.
*/
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
import org.apache.archiva.rest.api.model.Artifact;
import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.archiva.redback.authorization.RedbackAuthorization;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@@ -111,20 +111,21 @@ public interface RepositoriesService
@Path( "deleteArtifact" )
- @GET
+ @POST
+ @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
@RedbackAuthorization( noPermission = true )
/**
* <b>permissions are checked in impl</b>
* @since 1.4-M2
*/
- Boolean deleteArtifact( @QueryParam( "" ) Artifact artifact, @QueryParam( "repositoryId" ) String repositoryId )
+ Boolean deleteArtifact( Artifact artifact )
throws ArchivaRestServiceException;
@Path( "isAuthorizedToDeleteArtifacts/{repositoryId}" )
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
- @RedbackAuthorization( noPermission = true, noRestriction = true)
+ @RedbackAuthorization( noPermission = true, noRestriction = true )
Boolean isAuthorizedToDeleteArtifacts( @PathParam( "repositoryId" ) String repoId )
throws ArchivaRestServiceException;
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 4a25b5f87..3890a4cf3 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
@@ -620,10 +620,11 @@ public class DefaultRepositoriesService
}
}
- public Boolean deleteArtifact( Artifact artifact, String repositoryId )
+ public Boolean deleteArtifact( Artifact artifact )
throws ArchivaRestServiceException
{
+ String repositoryId = artifact.getContext();
if ( StringUtils.isEmpty( repositoryId ) )
{
throw new ArchivaRestServiceException( "repositoryId cannot be null", 400, null );