Class FileLocks
java.lang.Object
io.goobi.viewer.model.administration.configeditor.FileLocks
Manages per-session exclusive edit locks for configuration files in the config editor, preventing
concurrent modifications by different HTTP sessions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearLocksForSessionId(String sessionId) booleanisFileLockedByOthers(Path file, String sessionId) booleanbooleanunlockFile(Path file, String sessionId)
-
Constructor Details
-
FileLocks
public FileLocks()
-
-
Method Details
-
lockFile
- Parameters:
file- the file path to locksessionId- the HTTP session identifier acquiring the lock- Returns:
- true if file locked successfully; false otherwise
-
unlockFile
- Parameters:
file- the file path to unlocksessionId- the HTTP session identifier releasing the lock- Returns:
- true if file unlocked successfully; false otherwise
-
isFileLockedByOthers
- Parameters:
file- path to the file to checksessionId- current HTTP session ID to compare against the lock holder- Returns:
- true if file locked by different session; false otherwise
-
clearLocksForSessionId
- Parameters:
sessionId- the HTTP session identifier whose locks should be released
-