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(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 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 SVNLock[] getLocks(String path) throws SVNException { try { openRepository(); path = getRepositoryPath(path); File digestFile = myFSFS.getDigestFileFromRepositoryPath(path); final ArrayList locks = new ArrayList(); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { locks.add(lock); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; myFSFS.walkDigestFiles(digestFile, handler, false); return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } finally { closeRepository(); } }
public SVNLock[] getLocks(String path) throws SVNException { try { openRepository(); path = getRepositoryPath(path); File digestFile = myFSFS.getDigestFileFromRepositoryPath(path); final ArrayList locks = new ArrayList(); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { locks.add(lock); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; myFSFS.walkDigestFiles(digestFile, handler, false); return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } finally { closeRepository(); } }
public SVNLock[] getLocks(String path) throws SVNException { try { openRepository(); path = getRepositoryPath(path); File digestFile = myFSFS.getDigestFileFromRepositoryPath(path); final ArrayList locks = new ArrayList(); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { locks.add(lock); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; myFSFS.walkDigestFiles(digestFile, handler, false); return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } finally { closeRepository(); } }
public SVNLock[] getLocks(String path) throws SVNException { try { openRepository(); path = getRepositoryPath(path); File digestFile = myFSFS.getDigestFileFromRepositoryPath(path); final ArrayList locks = new ArrayList(); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { locks.add(lock); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; myFSFS.walkDigestFiles(digestFile, handler, false); return (SVNLock[]) locks.toArray(new SVNLock[locks.size()]); } finally { closeRepository(); } }
public static void allowLockedOperation(FSFS fsfs, String path, final String username, final Collection lockTokens, boolean recursive, boolean haveWriteLock) throws SVNException { if (recursive) { ISVNLockHandler handler = new ISVNLockHandler() { private String myUsername = username; private Collection myTokens = lockTokens; public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { verifyLock(lock, myTokens, myUsername); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; fsfs.walkDigestFiles(fsfs.getDigestFileFromRepositoryPath(path), handler, haveWriteLock); } else { SVNLock lock = fsfs.getLockHelper(path, haveWriteLock); if (lock != null) { verifyLock(lock, lockTokens, username); } } }
fsfs.walkDigestFiles(digestFile, handler, false); } finally { SVNAdminHelper.closeRepository(fsfs);
fsfs.walkDigestFiles(digestFile, handler, false); } finally { SVNAdminHelper.closeRepository(fsfs);
public static void allowLockedOperation(FSFS fsfs, String path, final String username, final Collection lockTokens, boolean recursive, boolean haveWriteLock) throws SVNException { path = SVNPathUtil.canonicalizeAbsolutePath(path); if (recursive) { ISVNLockHandler handler = new ISVNLockHandler() { private String myUsername = username; private Collection myTokens = lockTokens; public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { verifyLock(lock, myTokens, myUsername); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; fsfs.walkDigestFiles(fsfs.getDigestFileFromRepositoryPath(path), handler, haveWriteLock); } else { SVNLock lock = fsfs.getLockHelper(path, haveWriteLock); if (lock != null) { verifyLock(lock, lockTokens, username); } } }
fsfs.walkDigestFiles(digestFile, handler, false); } finally { SVNAdminHelper.closeRepository(fsfs);
public static void allowLockedOperation(FSFS fsfs, String path, final String username, final Collection lockTokens, boolean recursive, boolean haveWriteLock) throws SVNException { path = SVNPathUtil.canonicalizeAbsolutePath(path); if (recursive) { ISVNLockHandler handler = new ISVNLockHandler() { private String myUsername = username; private Collection myTokens = lockTokens; public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { verifyLock(lock, myTokens, myUsername); } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; fsfs.walkDigestFiles(fsfs.getDigestFileFromRepositoryPath(path), handler, haveWriteLock); } else { SVNLock lock = fsfs.getLockHelper(path, haveWriteLock); if (lock != null) { verifyLock(lock, lockTokens, username); } } }
public void allowLockedOperation(FSFS fsfs, String path, final String username, final Collection<String> lockTokens, boolean recursive, boolean haveWriteLock) throws SVNException { path = SVNPathUtil.canonicalizeAbsolutePath(path); if (recursive) { ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { if (isAutoUnlock()) { scheduleForAutoUnlock(username, path, lock); } else { verifyLock(lock, lockTokens, username); } } public void handleUnlock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException { } }; fsfs.walkDigestFiles(fsfs.getDigestFileFromRepositoryPath(path), handler, haveWriteLock); } else { SVNLock lock = fsfs.getLockHelper(path, haveWriteLock); if (lock != null) { if (isAutoUnlock()) { scheduleForAutoUnlock(username, path, lock); } else { verifyLock(lock, lockTokens, username); } } } }