public class InternalStaticResourceUtilities
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
causeByInvalidItemStateException(java.lang.Exception e)
Check to see if the specified exception caused by a jcr InvalidItemStateException.
|
static java.lang.Boolean |
checkPermission(ResourceResolver resolver,
java.lang.String path,
java.lang.String action)
Checks a path and an action based on the passed in resolver.
|
static Node |
getOrCreateByPathDepthFirst(java.lang.String path,
boolean createUniqueLeaf,
java.lang.String intermediateNodeType,
java.lang.String nodeType,
Session session,
boolean autoSave)
Creates or gets the
Node at the given path. |
static SocialResource |
getSocialResource(Resource res)
Check if a resource is a wrapped resource, and unwrap until a SocialResource is found.
|
static UserProperties |
getUserProperties(ResourceResolver resolver,
java.lang.String userId)
Returns the user properties denoted by the given
userId . |
static boolean |
isCloudUGC(java.lang.String path)
Check if path is non JCR based.
|
static boolean |
isSocialResource(Resource res)
Check if a given resource is an instance of SocialResource.
|
void |
start(BundleContext context) |
void |
stop(BundleContext context) |
public static java.lang.Boolean checkPermission(ResourceResolver resolver, java.lang.String path, java.lang.String action)
resolver
- the resource resolver to use to evaluate the permissionspath
- the path to the resource to checkaction
- the action to checkpublic static UserProperties getUserProperties(ResourceResolver resolver, java.lang.String userId)
userId
. The user props are looked for using the
provided resource resolver, so as to ensure that the user properties are only accessible to users having the
necessary access rights on the requested user properties.resolver
- The ResourceResolver
.userId
- The user id for which to retrieve the user properties.UserProperties
or null
if not found.public static boolean isCloudUGC(java.lang.String path)
path
- the path to the ugc resourcepublic static boolean isSocialResource(Resource res)
res
- the resource to checkpublic static SocialResource getSocialResource(Resource res)
res
- resource to unwrappublic static boolean causeByInvalidItemStateException(java.lang.Exception e)
e
- The exceptionpublic static Node getOrCreateByPathDepthFirst(java.lang.String path, boolean createUniqueLeaf, java.lang.String intermediateNodeType, java.lang.String nodeType, Session session, boolean autoSave) throws RepositoryException
Node
at the given path. In case it has to create the Node all
non-existent intermediate path-elements will be created with the given intermediate node type and the returned
node will be created with the given nodeType. This version exists to ensure creation only needs to read and
write the deepest of the existing ancestors of the target node. This allows creation of paths where some
ancestors exist but are not readable by the session in use. For further details see: JcrUtils.getOrCreateByPath(Node, String, boolean, String, String, boolean)
path
- the deep path to get or createcreateUniqueLeaf
- not used?intermediateNodeType
- node type to be used in creating any required intermediate nodesnodeType
- the node type for the leaf nodesession
- the session to create the nodes withautoSave
- to save when doneRepositoryException
- when JCR cannot create either any of the intermediate nodes or the leaf nodepublic void start(BundleContext context) throws java.lang.Exception
java.lang.Exception
public void stop(BundleContext context) throws java.lang.Exception
java.lang.Exception
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"