HashSet set = new HashSet();
for (int i = 0; i < strings.length; i++) {
set.add(strings[i]);
}
Path targetPath;
try {
targetPath = PathFormat.parse(absPath, getNamespaceResolver()).getNormalizedPath();
} catch (MalformedPathException mpe) {
String msg = "invalid path: " + absPath;
log.debug(msg, mpe);
throw new RepositoryException(msg);
}
if (!targetPath.isAbsolute()) {
throw new RepositoryException("not an absolute path: " + absPath);
}
ItemId targetId = null;
/**
* "read" action:
* requires READ permission on target item
*/
if (set.contains(READ_ACTION)) {
try {
targetId = hierMgr.resolvePath(targetPath);
if (targetId == null) {
// target does not exist, throw exception
throw new AccessControlException(READ_ACTION);
}
accessMgr.checkPermission(targetId, AccessManager.READ);
} catch (AccessDeniedException re) {
// otherwise the RepositoryException catch clause will
// log a warn message, which is not appropriate in this case.
throw new AccessControlException(READ_ACTION);
}
}
Path parentPath = null;
ItemId parentId = null;
/**
* "add_node" action:
* requires WRITE permission on parent item