@Test(expected = RepositoryException.class) public void testGetNamesEmptyPath() throws Exception { emptyProperties.getNames(""); }
@NotNull @Override public Iterator<String> getNames(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree tree = getTree(); TreeLocation location = getLocation(tree, oakPath); Tree parent = location.getTree(); if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) { List<String> l = new ArrayList<>(); for (PropertyState property : parent.getProperties()) { String propName = property.getName(); if (isAuthorizableProperty(tree, location.getChild(propName), false)) { l.add(valueFactory.getNamePathMapper().getJcrName(propName)); } } return l.iterator(); } else { throw new RepositoryException("Relative path " + relPath + " refers to non-existing tree or tree outside of scope of authorizable."); } }
AuthorizablePropertiesImpl implements AuthorizableProperties { @NotNull @Override public Iterator<String> getNames(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree tree = getTree(); TreeLocation location = getLocation(tree, oakPath); Tree parent = location.getTree(); if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) { List<String> l = new ArrayList<>(); for (PropertyState property : parent.getProperties()) { String propName = property.getName(); if (isAuthorizableProperty(tree, location.getChild(propName), false)) { l.add(valueFactory.getNamePathMapper().getJcrName(propName)); } } return l.iterator(); } else { throw new RepositoryException("Relative path " + relPath + " refers to non-existing tree or tree outside of scope of authorizable."); } } }
AuthorizablePropertiesImpl implements AuthorizableProperties { @NotNull @Override public Iterator<String> getNames(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree tree = getTree(); TreeLocation location = getLocation(tree, oakPath); Tree parent = location.getTree(); if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) { List<String> l = new ArrayList<>(); for (PropertyState property : parent.getProperties()) { String propName = property.getName(); if (isAuthorizableProperty(tree, location.getChild(propName), false)) { l.add(valueFactory.getNamePathMapper().getJcrName(propName)); } } return l.iterator(); } else { throw new RepositoryException("Relative path " + relPath + " refers to non-existing tree or tree outside of scope of authorizable."); } } AuthorizablePropertiesImpl(@NotNull AuthorizableImpl authorizable,
                               @NotNull PartialValueFactory valueFactory); }
AuthorizablePropertiesImpl implements AuthorizableProperties { @NotNull @Override public Iterator<String> getNames(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree tree = getTree(); TreeLocation location = getLocation(tree, oakPath); Tree parent = location.getTree(); if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) { List<String> l = new ArrayList<>(); for (PropertyState property : parent.getProperties()) { String propName = property.getName(); if (isAuthorizableProperty(tree, location.getChild(propName), false)) { l.add(valueFactory.getNamePathMapper().getJcrName(propName)); } } return l.iterator(); } else { throw new RepositoryException("Relative path " + relPath + " refers to non-existing tree or tree outside of scope of authorizable."); } } AuthorizablePropertiesImpl(@NotNull AuthorizableImpl authorizable,
                               @NotNull PartialValueFactory valueFactory); @NotNull @Override Iterator<String> getNames(@NotNull String relPath); @Override boolean hasProperty(@NotNull String relPath); @Override Value[] getProperty(@NotNull String relPath); @Override void setProperty(@NotNull String relPath, @Nullable Value value); @Override void setProperty(@NotNull String relPath, @Nullable Value[] values); @Override boolean removeProperty(@NotNull String relPath); }
AuthorizablePropertiesImpl implements AuthorizableProperties { @NotNull @Override public Iterator<String> getNames(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree tree = getTree(); TreeLocation location = getLocation(tree, oakPath); Tree parent = location.getTree(); if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) { List<String> l = new ArrayList<>(); for (PropertyState property : parent.getProperties()) { String propName = property.getName(); if (isAuthorizableProperty(tree, location.getChild(propName), false)) { l.add(valueFactory.getNamePathMapper().getJcrName(propName)); } } return l.iterator(); } else { throw new RepositoryException("Relative path " + relPath + " refers to non-existing tree or tree outside of scope of authorizable."); } } AuthorizablePropertiesImpl(@NotNull AuthorizableImpl authorizable,
                               @NotNull PartialValueFactory valueFactory); @NotNull @Override Iterator<String> getNames(@NotNull String relPath); @Override boolean hasProperty(@NotNull String relPath); @Override Value[] getProperty(@NotNull String relPath); @Override void setProperty(@NotNull String relPath, @Nullable Value value); @Override void setProperty(@NotNull String relPath, @Nullable Value[] values); @Override boolean removeProperty(@NotNull String relPath);  }