}
public SVNLock getLock(String repositoryPath, boolean haveWriteLock) throws SVNException {
repositoryPath = SVNPathUtil.canonicalizeAbsolutePath(repositoryPath);
SVNLock lock = fetchLockFromDigestFile(null, repositoryPath, null);
if (lock == null) {
SVNErrorManager.error(FSErrors.errorNoSuchLock(repositoryPath, this), SVNLogType.FSFS);
}
Date current = new Date(System.currentTimeMillis());
if (lock.getExpirationDate() != null && current.compareTo(lock.getExpirationDate()) > 0) {
if (haveWriteLock) {
deleteLock(lock);
}
SVNErrorManager.error(FSErrors.errorLockExpired(lock.getID(), this), SVNLogType.FSFS);
}
return lock;
}