From 1f180c0a27890a84abccfe5cda6d416cb5f8fd1b Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Mon, 18 Jan 2010 22:51:27 +0000 Subject: [PATCH] [MRM-1315] delete artifact should log artifact audit information consistently git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@900594 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/web/action/DeleteArtifactAction.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java index 1037ccf57..caecd1e37 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java @@ -211,7 +211,8 @@ public class DeleteArtifactAction String path = repository.toMetadataPath( ref ); int index = path.lastIndexOf( '/' ); - File targetPath = new File( repoConfig.getLocation(), path.substring( 0, index ) ); + path = path.substring( 0, index ); + File targetPath = new File( repoConfig.getLocation(), path ); if ( !targetPath.exists() ) { @@ -246,14 +247,14 @@ public class DeleteArtifactAction listener.deleteArtifact( repository.getId(), artifact.getNamespace(), artifact.getProject(), artifact.getVersion(), artifact.getId() ); } + + triggerAuditEvent( repositoryId, path, AuditEvent.REMOVE_FILE ); } } String msg = "Artifact \'" + groupId + ":" + artifactId + ":" + version + "\' was successfully deleted from repository \'" + repositoryId + "\'"; - triggerAuditEvent( repositoryId, groupId + ":" + artifactId + ":" + version, AuditEvent.REMOVE_FILE ); - addActionMessage( msg ); reset(); -- 2.39.5