Interface LockedPath

    • Method Detail

      • getPath

        Path getPath()
        Retrieve the path being locked.
      • isValid

        boolean isValid()
        Indicate if the lock is valid.
      • isShared

        boolean isShared()
        Indicate if the lock is shared.
      • close

        void close()
        Release the lock.

        This does nothing if the lock is already closed or stolen.

        Specified by:
        close in interface AutoCloseable
      • closeAndGetPath

        @WillClose
        Path closeAndGetPath()
        Release the lock and obtain the underlying Path object.

        This does nothing if the lock is already closed or stolen.

      • toExclusive

        @WillClose
        LockedPath toExclusive()
        Convert this lock to an exclusive lock.

        This lock will be closed as a result.

        Throws:
        IllegalStateException - if this lock is already exclusive or no longer valid
      • stealWithPath

        @WillClose
        LockedPath stealWithPath​(Path path)
        Steal this lock with a different path. The lock will still be held on the original path, but will indicate a different path.
        Throws:
        IllegalStateException - if this lock is already stolen or no longer valid