summaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins/metadata-store-file/src
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-11 22:43:15 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-11 22:43:15 +0000
commite7bc35db81e879f19a7846098d1f6eed31e1b142 (patch)
treeae48aa808bf1ada4698ea33a22009a47a8ab9503 /archiva-modules/plugins/metadata-store-file/src
parent092a635e39f0329c59d23745cdd93fdd000516e4 (diff)
downloadarchiva-e7bc35db81e879f19a7846098d1f6eed31e1b142.tar.gz
archiva-e7bc35db81e879f19a7846098d1f6eed31e1b142.zip
add unit test for new method in MetadataRepository and fix compilation for some impls/mocks
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1397345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/metadata-store-file/src')
-rw-r--r--archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java19
1 files changed, 18 insertions, 1 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 3294ab895..87c3b6711 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
@@ -703,7 +703,6 @@ public class FileMetadataRepository
* @param namespace
* @param project
* @param projectVersion
- * @param projectId
* @param metadataFacet will remove artifacts which have this {@link MetadataFacet} using equals
* @throws MetadataRepositoryException
*/
@@ -1163,6 +1162,24 @@ public class FileMetadataRepository
return projectVersions;
}
+
+ public void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
+ throws MetadataRepositoryException
+ {
+ File directory = new File( getDirectory( repoId ), namespace + "/" + projectId + "/" + projectVersion );
+ if ( directory.exists() )
+ {
+ try
+ {
+ FileUtils.deleteDirectory( directory );
+ }
+ catch ( IOException e )
+ {
+ throw new MetadataRepositoryException( e.getMessage(), e );
+ }
+ }
+ }
+
private void writeProperties( Properties properties, File directory, String propertiesKey )
throws IOException
{