本文整理了Java中javax.jcr.AccessDeniedException.getMessage()
方法的一些代码示例,展示了AccessDeniedException.getMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AccessDeniedException.getMessage()
方法的具体详情如下:
包路径:javax.jcr.AccessDeniedException
类名称:AccessDeniedException
方法名:getMessage
暂无
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static String getName(Node node) {
try {
return node.getName();
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Unable to get name of Node " + node, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static Node createNode(Node parentNode, String name, String nodeType) {
try {
return parentNode.addNode(name, nodeType);
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to create the Node named " + name, e);
}
}
代码示例来源:origin: apache/jackrabbit
public void testMoveNode() throws Exception {
Node n = (Node) readOnlySession.getItem(testNodePath);
String destPath = testRootNode.getPath() + "/" + nodeName2;
try {
readOnlySession.move(n.getPath(), destPath);
readOnlySession.save();
fail("A read only session must not be allowed to move a node");
} catch (AccessDeniedException e) {
// expected
log.debug(e.getMessage());
}
}
代码示例来源:origin: apache/jackrabbit
public void testWorkspaceMoveNode() throws Exception {
Node n = (Node) readOnlySession.getItem(testNodePath);
String destPath = testRootNode.getPath() + "/" + nodeName2;
try {
readOnlySession.getWorkspace().move(n.getPath(), destPath);
fail("A read only session must not be allowed to move a node");
} catch (AccessDeniedException e) {
// expected
log.debug(e.getMessage());
}
}
代码示例来源:origin: apache/jackrabbit
public void testCopyNode() throws Exception {
Node n = (Node) readOnlySession.getItem(testNodePath);
String destPath = testRootNode.getPath() + "/" + nodeName2;
try {
readOnlySession.getWorkspace().copy(n.getPath(), destPath);
fail("A read only session must not be allowed to copy a node");
} catch (AccessDeniedException e) {
// expected
log.debug(e.getMessage());
}
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static Node copy(Node srcNode, Node destNode) {
try {
Session sess = srcNode.getSession();
return copy(sess, srcNode.getPath(), destNode.getPath());
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to copy source node: " + srcNode + " to destination node: " + destNode, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean hasAnyPermission(Node node, Principal principal, Privilege... privileges) {
try {
return hasAnyPermission(node.getSession(), node.getPath(), principal, privileges);
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to check permission(s) of node " + node + ": "
+ Arrays.toString(privileges), e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean removePermissions(Node node, Principal principal, String... privilegeNames) {
try {
return removePermissions(node.getSession(), node.getPath(), principal, privilegeNames);
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to remove permission(s) from node " + node + ": " + Arrays.toString(privilegeNames), e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean removePermissions(Node node, Principal principal, Privilege... privileges) {
try {
return removePermissions(node.getSession(), node.getPath(), principal, privileges);
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to remove permission(s) from node " + node + ": " + Arrays.toString(privileges), e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean addPermissions(Node node, Principal principal, Collection<String> privilegeNames) {
try {
return addPermissions(node.getSession(), node.getPath(), principal, privilegeNames);
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to add permission(s) to node " + node + ": " + privilegeNames, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static <T extends Serializable> T getGenericJson(Node parent, String nodeName, boolean allowClassNotFound) {
try {
Node jsonNode = parent.getNode(nodeName);
return getGenericJson(jsonNode, allowClassNotFound);
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to deserialize generic JSON node", e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean setPermissions(Node node, Principal principal, Collection<String> privilegeNames) {
try {
return setPermissions(node.getSession(), node.getPath(), principal, privilegeNames);
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to set permission(s) on node " + node + ": " + privilegeNames, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean hasAnyPermission(Node node, Principal principal, String... privileges) {
try {
return hasAnyPermission(node.getSession(), node.getPath(), principal, privileges);
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to check permission(s) for node: " + node);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean clearPermissions(Node node) {
try {
return clearPermissions(node.getSession(), node.getPath());
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to remove all permission(s) from node " + node, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static Node getParent(Property prop) {
try {
return prop.getParent();
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to get the parent node of the property: " + prop, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static void removeNode(Node node) {
try {
node.remove();
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to remove the node " + node, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean removePermissions(Session session, String path, Principal principal, String... privilegeNames) {
try {
return removePermissions(session, path, principal, asPrivileges(session, privilegeNames));
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to remove permission(s) from node " + path + ": "
+ Arrays.toString(privilegeNames), e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static NodeType getNodeType(Session session, String typeName) {
try {
return session.getWorkspace().getNodeTypeManager().getNodeType(typeName);
} catch (NoSuchNodeTypeException e) {
throw new MetadataRepositoryException("No node type exits named: " + typeName, e);
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to retrieve node type named: " + typeName, e);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean hasAnyPermission(Session session, String path, Principal principal, String... privilegeNames) {
try {
return hasAnyPermission(session, path, principal, asPrivileges(session, privilegeNames));
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to check permission(s) for node: " + path);
}
}
代码示例来源:origin: com.thinkbiganalytics.kylo/kylo-metadata-modeshape
public static boolean setPermissions(Session session, String path, Principal principal, Collection<String> privilegeNames) {
try {
return setPermissions(session, path, principal, asPrivileges(session, privilegeNames));
} catch (AccessDeniedException e) {
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new MetadataRepositoryException("Failed to set permission(s) on node " + path + ": " + privilegeNames, e);
}
}
内容来源于网络,如有侵权,请联系作者删除!