org.apache.ivy.plugins.lock

## Class FileBasedLockStrategy

- java.lang.Object
- - org.apache.ivy.plugins.lock.AbstractLockStrategy
  - - org.apache.ivy.plugins.lock.FileBasedLockStrategy

- All Implemented Interfaces:
    LockStrategy
  Direct Known Subclasses:
    ArtifactLockStrategy

      public abstract class FileBasedLockStrategy
      extends AbstractLockStrategy

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FileBasedLockStrategy.CreateFileLocker` "locks" a file by creating it if it doesn't exist, relying on the `File.createNewFile()` atomicity.
    `static interface` | `FileBasedLockStrategy.FileLocker`
    `static class` | `FileBasedLockStrategy.NIOFileLocker` Locks a file using the `FileLock` mechanism.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `FileBasedLockStrategy()`
    `protected` | `FileBasedLockStrategy(boolean debugLocking)`
    `protected` | `FileBasedLockStrategy(FileBasedLockStrategy.FileLocker locker, boolean debugLocking)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `acquireLock(java.io.File file)`
    `protected java.lang.String` | `getCurrentLockHolderNames(java.io.File file)` Return a string naming the threads which currently hold this lock.
    `protected void` | `releaseLock(java.io.File file)`

    - ### Methods inherited from class org.apache.ivy.plugins.lock.AbstractLockStrategy

      `getName, isDebugLocking, setName, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ivy.plugins.lock.LockStrategy

      `lockArtifact, unlockArtifact`

- - ### Constructor Detail

    - #### FileBasedLockStrategy

          protected FileBasedLockStrategy()

    - #### FileBasedLockStrategy

          protected FileBasedLockStrategy(boolean debugLocking)

    - #### FileBasedLockStrategy

          protected FileBasedLockStrategy(FileBasedLockStrategy.FileLocker locker,
                               boolean debugLocking)

  - ### Method Detail

    - #### acquireLock

          protected boolean acquireLock(java.io.File file)
                                 throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`

    - #### releaseLock

          protected void releaseLock(java.io.File file)

    - #### getCurrentLockHolderNames

          protected java.lang.String getCurrentLockHolderNames(java.io.File file)

      Return a string naming the threads which currently hold this lock.