diff options
author | Olivier Lamy <olamy@apache.org> | 2012-06-02 21:14:37 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-06-02 21:14:37 +0000 |
commit | 297bb0fcff28f5683fbde97e8e035a175e25bb43 (patch) | |
tree | 84a0b49f935cae069da2c641243fd69d5a6e489a /archiva-modules/plugins/metadata-store-file | |
parent | e02d0cdc8b85d6d1b54e6c70f9b3e296d2b0a794 (diff) | |
download | archiva-297bb0fcff28f5683fbde97e8e035a175e25bb43.tar.gz archiva-297bb0fcff28f5683fbde97e8e035a175e25bb43.zip |
fix an issue with not removing project version when removing an artifact from Metadatarepository with metadata-store-file.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1345578 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/metadata-store-file')
-rw-r--r-- | archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index d25324a11..ad483d5ec 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -19,6 +19,8 @@ package org.apache.archiva.metadata.repository.file; * under the License. */ +import org.apache.archiva.configuration.ArchivaConfiguration; +import org.apache.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.CiManagement; import org.apache.archiva.metadata.model.Dependency; @@ -33,11 +35,8 @@ import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.model.ProjectVersionReference; import org.apache.archiva.metadata.model.Scm; import org.apache.archiva.metadata.repository.MetadataRepository; -import org.apache.archiva.metadata.repository.MetadataRepositoryException; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.apache.archiva.configuration.ArchivaConfiguration; -import org.apache.archiva.configuration.ManagedRepositoryConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -599,6 +598,7 @@ public class FileMetadataRepository public void removeArtifact( String repoId, String namespace, String project, String version, String id ) { + File directory = new File( getDirectory( repoId ), namespace + "/" + project + "/" + version ); Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY ); @@ -623,7 +623,10 @@ public class FileMetadataRepository try { - writeProperties( properties, directory, PROJECT_VERSION_METADATA_KEY ); + + FileUtils.deleteDirectory( directory ); + + //writeProperties( properties, directory, PROJECT_VERSION_METADATA_KEY ); } catch ( IOException e ) { |