Class ResourceQueueUtils
java.lang.Object
org.apache.sling.distribution.queue.impl.resource.ResourceQueueUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.sling.api.resource.ResourcecreateResource(org.apache.sling.api.resource.Resource root, DistributionQueueItem queueItem) static voiddeleteResource(org.apache.sling.api.resource.Resource resource) static org.apache.sling.api.resource.ResourcegetResourceById(org.apache.sling.api.resource.Resource root, String entryId) static intgetResourceCount(org.apache.sling.api.resource.Resource root) static org.apache.sling.api.resource.ResourcegetRootResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String rootPath) static StringgetTimePath(Calendar now) Transforms current time to path 2018/01/03/23/54static voidincrementProcessingAttemptForQueueItem(org.apache.sling.api.resource.Resource queueItemResource) static booleanisSafeToDelete(String nowPath, String path) Checks if path is safe to delete at this time.static StringunescapeId(String itemId)
-
Field Details
-
RESOURCE_FOLDER
- See Also:
-
-
Constructor Details
-
ResourceQueueUtils
public ResourceQueueUtils()
-
-
Method Details
-
getRootResource
public static org.apache.sling.api.resource.Resource getRootResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String rootPath) throws org.apache.sling.api.resource.PersistenceException - Throws:
org.apache.sling.api.resource.PersistenceException
-
getResourceById
public static org.apache.sling.api.resource.Resource getResourceById(org.apache.sling.api.resource.Resource root, String entryId) -
createResource
public static org.apache.sling.api.resource.Resource createResource(org.apache.sling.api.resource.Resource root, DistributionQueueItem queueItem) throws org.apache.sling.api.resource.PersistenceException - Throws:
org.apache.sling.api.resource.PersistenceException
-
deleteResource
public static void deleteResource(org.apache.sling.api.resource.Resource resource) throws org.apache.sling.api.resource.PersistenceException - Throws:
org.apache.sling.api.resource.PersistenceException
-
getResourceCount
public static int getResourceCount(org.apache.sling.api.resource.Resource root) -
getTimePath
Transforms current time to path 2018/01/03/23/54- Parameters:
now- the current time- Returns:
- the serialized time
-
isSafeToDelete
Checks if path is safe to delete at this time. A path is safe to delete if the nowPath does not overlap with it.- Parameters:
nowPath- represents a full path of current time (e.g. 2018/01/03/23/54)path- the path to be checked (it can be a partial path e.g. 2018/01)- Returns:
- true if checked path is in the past
-
unescapeId
-
incrementProcessingAttemptForQueueItem
public static void incrementProcessingAttemptForQueueItem(org.apache.sling.api.resource.Resource queueItemResource)
-