Class CmsLockUtil.LockedFile

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Enclosing class:
    CmsLockUtil

    public static final class CmsLockUtil.LockedFile
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Helper to handle the lock reports together with the files.
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
        See Also:
        AutoCloseable.close()
      • getFile

        public CmsFile getFile()
        Returns the file, or null if reading fails.
        Returns:
        the file, or null if reading fails.
      • isCreated

        public boolean isCreated()
        Returns a flag, indicating if the file is newly created.
        Returns:
        flag, indicating if the file is newly created.
      • setCreated

        public void setCreated​(boolean isNew)
        Set the flag, indicating if the file was newly created.
        Parameters:
        isNew - flag, indicating if the file was newly created.
      • tryUnlock

        public boolean tryUnlock()
        Unlocks the resource if it was not formerly locked.

        Returns:
        true in case the resource was unlocked