public final class CmsLockUtil extends java.lang.Object
|Modifier and Type||Class and Description|
Helper to handle the lock reports together with the files.
|Modifier and Type||Method and Description|
Static helper method to lock a resource.
Utility method for locking and unlocking a set of resources conveniently with the try-with syntax from Java 1.7.
public static CmsLockActionRecord ensureLock(CmsObject cms, CmsResource resource) throws CmsException
cms- the CMS context to use
resource- the resource to lock
CmsException- if something goes wrong
public static java.io.Closeable withLockedResources(CmsObject cms, CmsResource... resources) throws java.lang.Exception
This method locks a set of resources and returns a Closeable instance that will unlock the locked resources when its close() method is called.
cms- the CMS context
resources- the resources to lock
java.lang.Exception- if something goes wrong