Interface ArtifactsGuard


  • public interface ArtifactsGuard
    Artifacts guard provides hierarchical read/write locking while accessing artifacts. An artifact can be read concurrently, but only one thread can write to the artifact at a time.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void lockReading​(java.io.File fileToLock)
      Locks specified file or directory for reading.
      void lockWriting​(java.io.File fileToLock)
      Locks specified file or directory for writing.
      void unlockReading​(java.io.File fileToUnlock)
      Unlocks reading.
      void unlockWriting​(java.io.File fileToUnlock)
      Unlocks writing.
    • Method Detail

      • lockWriting

        void lockWriting​(@NotNull
                         java.io.File fileToLock)

        Locks specified file or directory for writing. Doesn't throw any exceptions if the file system path doesn't exist.

        Parameters:
        fileToLock - file to lock, can be absolute file or relative. If relative, than system artifacts directory will be added to the file path.
      • unlockWriting

        void unlockWriting​(@NotNull
                           java.io.File fileToUnlock)

        Unlocks writing. Doesn't throw any exceptions if the file system path doesn't exist.

        Parameters:
        fileToUnlock - file to unlock
      • lockReading

        void lockReading​(@NotNull
                         java.io.File fileToLock)

        Locks specified file or directory for reading. Doesn't throw any exceptions if the file system path doesn't exist.

        Parameters:
        fileToLock - file to lock, can be absolute file or relative. If relative, than system artifacts directory will be added to the file path.
      • unlockReading

        void unlockReading​(@NotNull
                           java.io.File fileToUnlock)

        Unlocks reading. Doesn't throw any exceptions if the file system path doesn't exist.

        Parameters:
        fileToUnlock - file to unlock