Interface ArtifactsGuard
-
- All Known Implementing Classes:
ArtifactsGuardImpl
public interface ArtifactsGuardArtifacts 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 voidlockReading(File fileToLock)Locks specified file or directory for reading.voidlockWriting(File fileToLock)Locks specified file or directory for writing.voidunlockReading(File fileToUnlock)Unlocks reading.voidunlockWriting(File fileToUnlock)Unlocks writing.
-
-
-
Method Detail
-
lockWriting
void lockWriting(@NotNull 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 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 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 File fileToUnlock)Unlocks reading. Doesn't throw any exceptions if the file system path doesn't exist.
- Parameters:
fileToUnlock- file to unlock
-
-