jetbrains.buildServer.serverSide.artifacts
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
 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.

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

Parameters:
fileToUnlock - file to unlock

lockReading

void lockReading(@NotNull
                 java.io.File fileToLock)
Locks specified file or directory for reading.

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

Parameters:
fileToUnlock - file to unlock