@Test(expected = RepositoryException.class) public void testRemovePropertyOutSideScope() throws Exception { properties.removeProperty("../../" + JcrConstants.JCR_PRIMARYTYPE); }
@Override public boolean removeProperty(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree node = getTree(); TreeLocation propertyLocation = getLocation(node, oakPath); if (propertyLocation.getProperty() != null) { if (isAuthorizableProperty(node, propertyLocation, true)) { return propertyLocation.remove(); } else { throw new ConstraintViolationException("Property " + relPath + " isn't a modifiable authorizable property"); } } else { checkScope(node.getPath(), propertyLocation.getPath(), relPath); } return false; }
AuthorizablePropertiesImpl implements AuthorizableProperties { @Override public boolean removeProperty(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree node = getTree(); TreeLocation propertyLocation = getLocation(node, oakPath); if (propertyLocation.getProperty() != null) { if (isAuthorizableProperty(node, propertyLocation, true)) { return propertyLocation.remove(); } else { throw new ConstraintViolationException("Property " + relPath + " isn't a modifiable authorizable property"); } } else { checkScope(node.getPath(), propertyLocation.getPath(), relPath); } return false; } }
AuthorizablePropertiesImpl implements AuthorizableProperties { @Override public boolean removeProperty(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree node = getTree(); TreeLocation propertyLocation = getLocation(node, oakPath); if (propertyLocation.getProperty() != null) { if (isAuthorizableProperty(node, propertyLocation, true)) { return propertyLocation.remove(); } else { throw new ConstraintViolationException("Property " + relPath + " isn't a modifiable authorizable property"); } } else { checkScope(node.getPath(), propertyLocation.getPath(), relPath); } return false; } AuthorizablePropertiesImpl(@NotNull AuthorizableImpl authorizable,
                               @NotNull PartialValueFactory valueFactory); }
AuthorizablePropertiesImpl implements AuthorizableProperties { @Override public boolean removeProperty(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree node = getTree(); TreeLocation propertyLocation = getLocation(node, oakPath); if (propertyLocation.getProperty() != null) { if (isAuthorizableProperty(node, propertyLocation, true)) { return propertyLocation.remove(); } else { throw new ConstraintViolationException("Property " + relPath + " isn't a modifiable authorizable property"); } } else { checkScope(node.getPath(), propertyLocation.getPath(), relPath); } return false; } 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 { @Override public boolean removeProperty(@NotNull String relPath) throws RepositoryException { String oakPath = getOakPath(relPath); Tree node = getTree(); TreeLocation propertyLocation = getLocation(node, oakPath); if (propertyLocation.getProperty() != null) { if (isAuthorizableProperty(node, propertyLocation, true)) { return propertyLocation.remove(); } else { throw new ConstraintViolationException("Property " + relPath + " isn't a modifiable authorizable property"); } } else { checkScope(node.getPath(), propertyLocation.getPath(), relPath); } return false; } 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);  }