[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
This commit is contained in:
Brett Porter 2010-01-18 22:51:27 +00:00
parent 82f8a22ed6
commit 1f180c0a27
1 changed files with 4 additions and 3 deletions

View File

@ -211,7 +211,8 @@ public class DeleteArtifactAction
String path = repository.toMetadataPath( ref ); String path = repository.toMetadataPath( ref );
int index = path.lastIndexOf( '/' ); 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() ) if ( !targetPath.exists() )
{ {
@ -246,14 +247,14 @@ public class DeleteArtifactAction
listener.deleteArtifact( repository.getId(), artifact.getNamespace(), artifact.getProject(), listener.deleteArtifact( repository.getId(), artifact.getNamespace(), artifact.getProject(),
artifact.getVersion(), artifact.getId() ); artifact.getVersion(), artifact.getId() );
} }
triggerAuditEvent( repositoryId, path, AuditEvent.REMOVE_FILE );
} }
} }
String msg = "Artifact \'" + groupId + ":" + artifactId + ":" + version + String msg = "Artifact \'" + groupId + ":" + artifactId + ":" + version +
"\' was successfully deleted from repository \'" + repositoryId + "\'"; "\' was successfully deleted from repository \'" + repositoryId + "\'";
triggerAuditEvent( repositoryId, groupId + ":" + artifactId + ":" + version, AuditEvent.REMOVE_FILE );
addActionMessage( msg ); addActionMessage( msg );
reset(); reset();