public void walkDigestFiles(File digestFile, ISVNLockHandler getLocksHandler, boolean haveWriteLock) throws SVNException { Collection children = new LinkedList(); SVNLock lock = fetchLockFromDigestFile(digestFile, null, children); if (lock != null) { Date current = new Date(System.currentTimeMillis()); if (lock.getExpirationDate() == null || current.compareTo(lock.getExpirationDate()) < 0) { getLocksHandler.handleLock(null, lock, null); } else if (haveWriteLock) { deleteLock(lock); } } if (children.isEmpty()) { return; } for (Iterator entries = children.iterator(); entries.hasNext();) { String digestName = (String) entries.next(); File parent = new File(myLocksRoot, digestName.substring(0, FSFS.DIGEST_SUBDIR_LEN)); File childDigestFile = new File(parent, digestName); walkDigestFiles(childDigestFile, getLocksHandler, haveWriteLock); } }
public void walkDigestFiles(File digestFile, ISVNLockHandler getLocksHandler, boolean haveWriteLock) throws SVNException { Collection children = new LinkedList(); SVNLock lock = fetchLockFromDigestFile(digestFile, null, children); if (lock != null) { Date current = new Date(System.currentTimeMillis()); if (lock.getExpirationDate() == null || current.compareTo(lock.getExpirationDate()) < 0) { getLocksHandler.handleLock(null, lock, null); } else if (haveWriteLock) { deleteLock(lock); } } if (children.isEmpty()) { return; } for (Iterator entries = children.iterator(); entries.hasNext();) { String digestName = (String) entries.next(); File parent = new File(getDBLocksDir(), digestName.substring(0, FSFS.DIGEST_SUBDIR_LEN)); File childDigestFile = new File(parent, digestName); walkDigestFiles(childDigestFile, getLocksHandler, haveWriteLock); } }
public void walkDigestFiles(File digestFile, ISVNLockHandler getLocksHandler, boolean haveWriteLock) throws SVNException { Collection children = new LinkedList(); SVNLock lock = fetchLockFromDigestFile(digestFile, null, children); if (lock != null) { Date current = new Date(System.currentTimeMillis()); if (lock.getExpirationDate() == null || current.compareTo(lock.getExpirationDate()) < 0) { getLocksHandler.handleLock(null, lock, null); } else if (haveWriteLock) { deleteLock(lock); } } if (children.isEmpty()) { return; } for (Iterator entries = children.iterator(); entries.hasNext();) { String digestName = (String) entries.next(); File parent = new File(getDBLocksDir(), digestName.substring(0, FSFS.DIGEST_SUBDIR_LEN)); File childDigestFile = new File(parent, digestName); walkDigestFiles(childDigestFile, getLocksHandler, haveWriteLock); } }
public void walkDigestFiles(File digestFile, ISVNLockHandler getLocksHandler, boolean haveWriteLock) throws SVNException { Collection children = new LinkedList(); SVNLock lock = fetchLockFromDigestFile(digestFile, null, children); if (lock != null) { Date current = new Date(System.currentTimeMillis()); if (lock.getExpirationDate() == null || current.compareTo(lock.getExpirationDate()) < 0) { getLocksHandler.handleLock(lock.getPath(), lock, null); } else if (haveWriteLock) { deleteLock(lock); } } if (children.isEmpty()) { return; } for (Iterator entries = children.iterator(); entries.hasNext();) { String digestName = (String) entries.next(); File parent = new File(getDBLocksDir(), digestName.substring(0, FSFS.DIGEST_SUBDIR_LEN)); File childDigestFile = new File(parent, digestName); walkDigestFiles(childDigestFile, getLocksHandler, haveWriteLock); } }
public void deleteLock(SVNLock lock) throws SVNException { String reposPath = lock.getPath(); String childToKill = null; Collection<String> children = new ArrayList<String>(); while (true) { fetchLockFromDigestFile(null, reposPath, children); if (childToKill != null) { children.remove(childToKill); } if (children.size() == 0) { childToKill = getDigestFromRepositoryPath(reposPath); File digestFile = getDigestFileFromRepositoryPath(reposPath); SVNFileUtil.deleteFile(digestFile); } else { writeDigestLockFile(null, children, reposPath, false); childToKill = null; } if ("/".equals(reposPath)) { break; } reposPath = SVNPathUtil.removeTail(reposPath); if ("".equals(reposPath)) { reposPath = "/"; } children.clear(); } }
public void deleteLock(SVNLock lock) throws SVNException { String reposPath = lock.getPath(); String childToKill = null; Collection children = new ArrayList(); while (true) { fetchLockFromDigestFile(null, reposPath, children); if (childToKill != null) { children.remove(childToKill); } if (children.size() == 0) { childToKill = getDigestFromRepositoryPath(reposPath); File digestFile = getDigestFileFromRepositoryPath(reposPath); SVNFileUtil.deleteFile(digestFile); } else { writeDigestLockFile(null, children, reposPath, false); childToKill = null; } if ("/".equals(reposPath)) { break; } reposPath = SVNPathUtil.removeTail(reposPath); if ("".equals(reposPath)) { reposPath = "/"; } children.clear(); } }
while (true) { String digestFileName = getDigestFromRepositoryPath(path); SVNLock fetchedLock = fetchLockFromDigestFile(null, path, children);
public void deleteLock(SVNLock lock) throws SVNException { String reposPath = lock.getPath(); String childToKill = null; Collection children = new ArrayList(); while (true) { fetchLockFromDigestFile(null, reposPath, children); if (childToKill != null) { children.remove(childToKill); } if (children.size() == 0) { childToKill = getDigestFromRepositoryPath(reposPath); File digestFile = getDigestFileFromRepositoryPath(reposPath); SVNFileUtil.deleteFile(digestFile); } else { writeDigestLockFile(null, children, reposPath); childToKill = null; } if ("/".equals(reposPath)) { break; } reposPath = SVNPathUtil.removeTail(reposPath); if ("".equals(reposPath)) { reposPath = "/"; } children.clear(); } }
public void deleteLock(SVNLock lock) throws SVNException { String reposPath = lock.getPath(); String childToKill = null; Collection children = new ArrayList(); while (true) { fetchLockFromDigestFile(null, reposPath, children); if (childToKill != null) { children.remove(childToKill); } if (children.size() == 0) { childToKill = getDigestFromRepositoryPath(reposPath); File digestFile = getDigestFileFromRepositoryPath(reposPath); SVNFileUtil.deleteFile(digestFile); } else { writeDigestLockFile(null, children, reposPath, false); childToKill = null; } if ("/".equals(reposPath)) { break; } reposPath = SVNPathUtil.removeTail(reposPath); if ("".equals(reposPath)) { reposPath = "/"; } children.clear(); } }
while (true) { String digestFileName = getDigestFromRepositoryPath(path); SVNLock fetchedLock = fetchLockFromDigestFile(null, path, children);
while (true) { String digestFileName = getDigestFromRepositoryPath(path); SVNLock fetchedLock = fetchLockFromDigestFile(null, path, children);
while (true) { String digestFileName = getDigestFromRepositoryPath(path); SVNLock fetchedLock = fetchLockFromDigestFile(null, path, children);
public SVNLock getLock(String repositoryPath, boolean haveWriteLock) throws SVNException { SVNLock lock = fetchLockFromDigestFile(null, repositoryPath, null); if (lock == null) { SVNErrorManager.error(FSErrors.errorNoSuchLock(repositoryPath, this)); } 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)); } return lock; }
public SVNLock getLock(String repositoryPath, boolean haveWriteLock, boolean throwError) throws SVNException { repositoryPath = SVNPathUtil.canonicalizeAbsolutePath(repositoryPath); SVNLock lock = fetchLockFromDigestFile(null, repositoryPath, null); if (lock == null) { if (!throwError) { return 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); } if (!throwError) { return null; } SVNErrorManager.error(FSErrors.errorLockExpired(lock.getID(), this), SVNLogType.FSFS); } return lock; }
public SVNLock getLock(String repositoryPath, boolean haveWriteLock, boolean throwError) throws SVNException { repositoryPath = SVNPathUtil.canonicalizeAbsolutePath(repositoryPath); SVNLock lock = fetchLockFromDigestFile(null, repositoryPath, null); if (lock == null) { if (!throwError) { return 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); } if (!throwError) { return null; } SVNErrorManager.error(FSErrors.errorLockExpired(lock.getID(), this), SVNLogType.FSFS); } return lock; }
public SVNLock getLock(String repositoryPath, boolean haveWriteLock, boolean throwError) throws SVNException { repositoryPath = SVNPathUtil.canonicalizeAbsolutePath(repositoryPath); SVNLock lock = fetchLockFromDigestFile(null, repositoryPath, null); if (lock == null) { if (!throwError) { return 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); } if (!throwError) { return null; } SVNErrorManager.error(FSErrors.errorLockExpired(lock.getID(), this), SVNLogType.FSFS); } return lock; }