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 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<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(); } }
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(); } }
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 fsfs = SVNAdminHelper.openRepository(repositoryRoot, true); try { File digestFile = fsfs.getDigestFileFromRepositoryPath("/"); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException {
FSFS fsfs = SVNAdminHelper.openRepository(repositoryRoot, true); try { File digestFile = fsfs.getDigestFileFromRepositoryPath("/"); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException {
FSFS fsfs = SVNAdminHelper.openRepository(repositoryRoot, true); try { File digestFile = fsfs.getDigestFileFromRepositoryPath("/"); ISVNLockHandler handler = new ISVNLockHandler() { public void handleLock(String path, SVNLock lock, SVNErrorMessage error) throws SVNException {
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 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); } } }
File digestLockFile = getDigestFileFromRepositoryPath(repositoryPath); String digest = getDigestFromRepositoryPath(repositoryPath); File lockDigestSubdir = new File(myLocksRoot, digest.substring(0, FSFS.DIGEST_SUBDIR_LEN));//FSRepositoryUtil.getDigestSubdirectoryFromDigest(, reposRootDir);
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); } } } }
File digestLockFile = getDigestFileFromRepositoryPath(repositoryPath); String digest = getDigestFromRepositoryPath(repositoryPath); File lockDigestSubdir = new File(getDBLocksDir(), digest.substring(0, FSFS.DIGEST_SUBDIR_LEN));
File digestLockFile = getDigestFileFromRepositoryPath(repositoryPath); String digest = getDigestFromRepositoryPath(repositoryPath); File lockDigestSubdir = new File(getDBLocksDir(), digest.substring(0, FSFS.DIGEST_SUBDIR_LEN));
File digestLockFile = getDigestFileFromRepositoryPath(repositoryPath); String digest = getDigestFromRepositoryPath(repositoryPath); File lockDigestSubdir = new File(getDBLocksDir(), digest.substring(0, FSFS.DIGEST_SUBDIR_LEN));
public SVNLock fetchLockFromDigestFile(File digestFile, String repositoryPath, Collection children) throws SVNException { File digestLockFile = digestFile == null ? getDigestFileFromRepositoryPath(repositoryPath) : digestFile; SVNProperties lockProps = null;