use of org.apache.jackrabbit.oak.remote.RemoteCommitException in project jackrabbit-oak by apache.
the class RemoveContentRemoteOperation method apply.
@Override
public void apply(Root root) throws RemoteCommitException {
logger.debug("performing 'remove' operation on path={}", path);
Tree tree = root.getTree(path);
if (!tree.exists()) {
throw new RemoteCommitException("tree does not exists");
}
if (!tree.remove()) {
throw new RemoteCommitException("unable to remove the tree");
}
}
use of org.apache.jackrabbit.oak.remote.RemoteCommitException in project jackrabbit-oak by apache.
the class UnsetContentRemoteOperation method apply.
@Override
public void apply(Root root) throws RemoteCommitException {
logger.debug("performing 'unset' operation on path={}, name={}", path, name);
Tree tree = root.getTree(path);
if (!tree.exists()) {
throw new RemoteCommitException("tree does not exists");
}
if (!tree.hasProperty(name)) {
throw new RemoteCommitException("property does not exist");
}
tree.removeProperty(name);
}
Aggregations