public synchronized static AccessControlList getAccessControlList(AccessControlManager acm, String path)
throws RepositoryException {
// search for an access control list
AccessControlList acl = null;
AccessControlPolicyIterator policyIterator = acm.getApplicablePolicies(path);
public synchronized static AccessControlList getAccessControlList(AccessControlManager acm, String path)
throws RepositoryException {
// search for an access control list
AccessControlList acl = null;
AccessControlPolicyIterator policyIterator = acm.getApplicablePolicies(path);
while (policyIterator.hasNext()) {
AccessControlPolicy acp = policyIterator.nextAccessControlPolicy();
while (policyIterator.hasNext()) {
AccessControlPolicy acp = policyIterator.nextAccessControlPolicy();
- for (AccessControlPolicy acp : existingPolicies) {
- if (acp instanceof AccessControlList)
+ existingPolicies: for (AccessControlPolicy acp : existingPolicies) {
+ if (acp instanceof AccessControlList) {
contentNode = fileNode.getNode(Node.JCR_CONTENT);
} else {
fileNode = folderNode.addNode(fileName, NodeType.NT_FILE);
contentNode = fileNode.getNode(Node.JCR_CONTENT);
} else {
fileNode = folderNode.addNode(fileName, NodeType.NT_FILE);
}
binary = contentNode.getSession().getValueFactory().createBinary(in);
contentNode.setProperty(Property.JCR_DATA, binary);
}
binary = contentNode.getSession().getValueFactory().createBinary(in);
contentNode.setProperty(Property.JCR_DATA, binary);
try (InputStream in = fileNode.getNode(Node.JCR_CONTENT).getProperty(Property.JCR_DATA).getBinary()
.getStream()) {
return digest(algorithm, in);
} catch (RepositoryException | IOException e) {
throw new ArgeoJcrException("Cannot checksum file " + fileNode, e);
try (InputStream in = fileNode.getNode(Node.JCR_CONTENT).getProperty(Property.JCR_DATA).getBinary()
.getStream()) {
return digest(algorithm, in);
} catch (RepositoryException | IOException e) {
throw new ArgeoJcrException("Cannot checksum file " + fileNode, e);