Package sonia.scm.repository.api
Class FileLockCommandBuilder
java.lang.Object
sonia.scm.repository.api.FileLockCommandBuilder
Can lock and unlock files and check lock states. Locked files can only be modified by the user holding the lock.
- Since:
- 2.26.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
-
Constructor Summary
ConstructorsConstructorDescriptionFileLockCommandBuilder
(FileLockCommand fileLockCommand, Repository repository) -
Method Summary
Modifier and TypeMethodDescriptiongetAll()
Retrieves all locks for the repository.Creates builder to lock the given file.Retrieves the lock for a file, if it is locked.Creates builder to unlock the given file.
-
Constructor Details
-
FileLockCommandBuilder
-
-
Method Details
-
lock
Creates builder to lock the given file.- Parameters:
file
- The file to lock.- Returns:
- Builder for lock creation.
-
unlock
Creates builder to unlock the given file.- Parameters:
file
- The file to unlock.- Returns:
- Builder to unlock a file.
-
status
Retrieves the lock for a file, if it is locked.- Parameters:
file
- The file to get the lock for.- Returns:
Optional
with the lock, if the file is locked, orOptional.empty()
, if the file is not locked
-
getAll
Retrieves all locks for the repository.- Returns:
- Collection of all locks for the repository.
-