public class DirectoryLockManager extends Object implements LockManager
Constructor and Description |
---|
DirectoryLockManager(File dir) |
Modifier and Type | Method and Description |
---|---|
String |
getLocation()
Technical description of where the lock is located, such as a URL.
|
boolean |
isLocked()
Determines if the directory is locked.
|
Lock |
lockOrFail()
Creates a lock in a directory if it does not yet exist.
|
boolean |
revokeLock()
Revokes a lock owned by another process.
|
Lock |
tryLock()
Creates a lock in a directory if it does not yet exist.
|
public DirectoryLockManager(File dir)
public String getLocation()
LockManager
getLocation
in interface LockManager
public boolean isLocked()
isLocked
in interface LockManager
true
if the directory is already locked.public Lock tryLock()
tryLock
in interface LockManager
public Lock lockOrFail() throws SailLockedException
lockOrFail
in interface LockManager
SailLockedException
- if the directory is already locked.public boolean revokeLock()
revokeLock
in interface LockManager
true
if a lock was successfully revoked.Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.