aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-06 12:37:14 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-06 12:37:14 +0000
commit911dd05b235fc2b684049b5ab9dac30acf52fce6 (patch)
tree780e4fbc098e310f0735c21db29fa7288798f472 /archiva-modules/plugins
parent035423d8a7d4319170e2f6696e37421093c7b1e2 (diff)
downloadarchiva-911dd05b235fc2b684049b5ab9dac30acf52fce6.tar.gz
archiva-911dd05b235fc2b684049b5ab9dac30acf52fce6.zip
add a method to remove namespace(groupId) in MetadataRepository
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1381575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
index 5322e2d91..6dd78efe5 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
@@ -476,6 +476,28 @@ public class JcrMetadataRepository
}
}
+ public void removeNamespace( String repositoryId, String projectId )
+ throws MetadataRepositoryException
+ {
+ try
+ {
+ Node root = getJcrSession().getRootNode();
+ String path = getNamespacePath( repositoryId, projectId );
+ if ( root.hasNode( path ) )
+ {
+ Node node = root.getNode( path );
+ if ( node.isNodeType( NAMESPACE_NODE_TYPE ) )
+ {
+ node.remove();
+ }
+ }
+ }
+ catch ( RepositoryException e )
+ {
+ throw new MetadataRepositoryException( e.getMessage(), e );
+ }
+ }
+
public void removeMetadataFacets( String repositoryId, String facetId )
throws MetadataRepositoryException
{