diff options
author | Olivier Lamy <olamy@apache.org> | 2012-12-19 15:21:20 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-12-19 15:21:20 +0000 |
commit | e92fede1556b025a9db90d334d77481450e119bf (patch) | |
tree | 04bd05151354ceaf86c6a84f8e83704302bbce32 /archiva-modules/plugins | |
parent | 58afcb111487f09821d20ce25015352ee5140b65 (diff) | |
download | archiva-e92fede1556b025a9db90d334d77481450e119bf.tar.gz archiva-e92fede1556b025a9db90d334d77481450e119bf.zip |
fix all RepositoryManager implementations
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1423879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
3 files changed, 14 insertions, 1 deletions
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index dc1e92bde..ba4cc6952 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -230,4 +230,10 @@ public class TestMetadataRepository throw new UnsupportedOperationException(); } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + return false; + } + }
\ No newline at end of file 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 91f148665..0e62fe375 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 @@ -309,6 +309,13 @@ public class FileMetadataRepository return facets; } + public boolean hasMetadataFacet( String repositoryId, String facetId ) + throws MetadataRepositoryException + { + // TODO could be improved a bit + return !getMetadataFacets( repositoryId, facetId ).isEmpty(); + } + private void recurse( List<String> facets, String prefix, File directory ) { File[] list = directory.listFiles(); 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 7bff556f6..764387ee7 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 @@ -407,7 +407,7 @@ public class JcrMetadataRepository try { Node node = getJcrSession().getRootNode().getNode( getFacetPath( repositoryId, facetId ) ); - return JcrUtils.getChildNodes( node ).iterator().hasNext(); + return node.getNodes().hasNext(); } catch ( PathNotFoundException e ) { |