java.lang.Object
io.goobi.viewer.model.administration.configeditor.FileLocks

public class FileLocks extends Object
Manages per-session exclusive edit locks for configuration files in the config editor, preventing concurrent modifications by different HTTP sessions.
  • Constructor Details

    • FileLocks

      public FileLocks()
  • Method Details

    • lockFile

      public boolean lockFile(Path file, String sessionId)
      Parameters:
      file - the file path to lock
      sessionId - the HTTP session identifier acquiring the lock
      Returns:
      true if file locked successfully; false otherwise
    • unlockFile

      public boolean unlockFile(Path file, String sessionId)
      Parameters:
      file - the file path to unlock
      sessionId - the HTTP session identifier releasing the lock
      Returns:
      true if file unlocked successfully; false otherwise
    • isFileLockedByOthers

      public boolean isFileLockedByOthers(Path file, String sessionId)
      Parameters:
      file - path to the file to check
      sessionId - current HTTP session ID to compare against the lock holder
      Returns:
      true if file locked by different session; false otherwise
    • clearLocksForSessionId

      public void clearLocksForSessionId(String sessionId)
      Parameters:
      sessionId - the HTTP session identifier whose locks should be released