private void collectInfo(SVNRepository repos, SVNDirEntry entry, SVNRevision rev, String path, SVNURL root, String uuid, SVNURL url, Map locks, boolean recursive, ISVNInfoHandler handler) throws SVNException { checkCancelled(); String displayPath = repos.getFullPath(path); displayPath = displayPath.substring(repos.getLocation().getPath().length()); if ("".equals(displayPath) || "/".equals(displayPath)) { displayPath = path; } handler.handleInfo(SVNInfo.createInfo(displayPath, root, uuid, url, rev, entry, (SVNLock) locks.get(path))); if (entry.getKind() == SVNNodeKind.DIR && recursive) { Collection children = repos.getDir(path, rev.getNumber(), null, new ArrayList()); for (Iterator ents = children.iterator(); ents.hasNext();) { SVNDirEntry child = (SVNDirEntry) ents.next(); SVNURL childURL = url.appendPath(child.getName(), false); collectInfo(repos, child, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, recursive, handler); } } }
/** * Resolves a path, relative either to the location to which this * driver object is set or to the repository root directory, to a * path, relative to the host. * * @param relativeOrRepositoryPath a relative path within the * repository * @return a path relative to the host * @throws SVNException in case the repository could not be connected * @throws org.tmatesoft.svn.core.SVNAuthenticationException in case of authentication problems */ public String getFullPath(String relativeOrRepositoryPath) throws SVNException { if (relativeOrRepositoryPath == null) { return getFullPath("/"); } String fullPath; if (relativeOrRepositoryPath.length() > 0 && relativeOrRepositoryPath.charAt(0) == '/') { fullPath = SVNPathUtil.append(getRepositoryRoot(true).getPath(), relativeOrRepositoryPath); } else { fullPath = SVNPathUtil.append(getLocation().getPath(), relativeOrRepositoryPath); } if (!fullPath.startsWith("/")) { fullPath = "/" + fullPath; } return fullPath; }
/** * Resolves a path, relative either to the location to which this * driver object is set or to the repository root directory, to a * path, relative to the host. * * @param relativeOrRepositoryPath a relative path within the * repository * @return a path relative to the host * @throws SVNException in case the repository could not be connected * @throws org.tmatesoft.svn.core.SVNAuthenticationException in case of authentication problems */ public String getFullPath(String relativeOrRepositoryPath) throws SVNException { if (relativeOrRepositoryPath == null) { return getFullPath("/"); } String fullPath; if (relativeOrRepositoryPath.length() > 0 && relativeOrRepositoryPath.charAt(0) == '/') { fullPath = SVNPathUtil.append(getRepositoryRoot(true).getPath(), relativeOrRepositoryPath); } else { fullPath = SVNPathUtil.append(getLocation().getPath(), relativeOrRepositoryPath); } if (!fullPath.startsWith("/")) { fullPath = "/" + fullPath; } return fullPath; }
/** * Resolves a path, relative either to the location to which this * driver object is set or to the repository root directory, to a * path, relative to the host. * * @param relativeOrRepositoryPath a relative path within the * repository * @return a path relative to the host * @throws SVNException */ public String getFullPath(String relativeOrRepositoryPath) throws SVNException { if (relativeOrRepositoryPath == null) { return getFullPath("/"); } String fullPath; if (relativeOrRepositoryPath.length() > 0 && relativeOrRepositoryPath.charAt(0) == '/') { fullPath = SVNPathUtil.append(getRepositoryRoot(true).getPath(), relativeOrRepositoryPath); } else { fullPath = SVNPathUtil.append(getLocation().getPath(), relativeOrRepositoryPath); } if (!fullPath.startsWith("/")) { fullPath = "/" + fullPath; } return fullPath; }
/** * Resolves a path, relative either to the location to which this * driver object is set or to the repository root directory, to a * path, relative to the host. * * @param relativeOrRepositoryPath a relative path within the * repository * @return a path relative to the host * @throws SVNException in case the repository could not be connected * @throws org.tmatesoft.svn.core.SVNAuthenticationException in case of authentication problems */ public String getFullPath(String relativeOrRepositoryPath) throws SVNException { if (relativeOrRepositoryPath == null) { return getFullPath("/"); } String fullPath; if (relativeOrRepositoryPath.length() > 0 && relativeOrRepositoryPath.charAt(0) == '/') { fullPath = SVNPathUtil.append(getRepositoryRoot(true).getPath(), relativeOrRepositoryPath); } else { fullPath = SVNPathUtil.append(getLocation().getPath(), relativeOrRepositoryPath); } if (!fullPath.startsWith("/")) { fullPath = "/" + fullPath; } return fullPath; }
private void pushDirInfo(SVNRepository repos, SVNRevision rev, String path, SVNURL root, String uuid, SVNURL url, Map locks, SVNDepth depth, ISVNInfoHandler handler) throws SVNException { Collection children = repos.getDir(path, rev.getNumber(), null, SVNDirEntry.DIRENT_KIND | SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME | SVNDirEntry.DIRENT_LAST_AUTHOR, new ArrayList()); for (Iterator ents = children.iterator(); ents.hasNext();) { checkCancelled(); SVNDirEntry child = (SVNDirEntry) ents.next(); SVNURL childURL = url.appendPath(child.getName(), false); String childPath = SVNPathUtil.append(path, child.getName()); String displayPath = repos.getFullPath(childPath); displayPath = displayPath.substring(repos.getLocation().getPath().length()); if (displayPath.startsWith("/")) { displayPath = displayPath.substring(1); } if ("".equals(displayPath)) { displayPath = path; } SVNLock lock = (SVNLock) locks.get(path); SVNInfo info = SVNInfo.createInfo(displayPath, root, uuid, url, rev, child, lock); if (depth.compareTo(SVNDepth.IMMEDIATES) >= 0 || (depth == SVNDepth.FILES && child.getKind() == SVNNodeKind.FILE)) { handler.handleInfo(info); } if (depth == SVNDepth.INFINITY && child.getKind() == SVNNodeKind.DIR) { pushDirInfo(repos, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, depth, handler); } } }
private void pushDirInfo(SVNRepository repos, SVNRevision rev, String path, SVNURL root, String uuid, SVNURL url, Map locks, SVNDepth depth, ISVNInfoHandler handler) throws SVNException { Collection children = repos.getDir(path, rev.getNumber(), null, SVNDirEntry.DIRENT_KIND | SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME | SVNDirEntry.DIRENT_LAST_AUTHOR, new ArrayList()); for (Iterator ents = children.iterator(); ents.hasNext();) { checkCancelled(); SVNDirEntry child = (SVNDirEntry) ents.next(); SVNURL childURL = url.appendPath(child.getName(), false); String childPath = SVNPathUtil.append(path, child.getName()); String displayPath = repos.getFullPath(childPath); displayPath = displayPath.substring(repos.getLocation().getPath().length()); if (displayPath.startsWith("/")) { displayPath = displayPath.substring(1); } if ("".equals(displayPath)) { displayPath = path; } SVNLock lock = (SVNLock) locks.get(path); SVNInfo info = SVNInfo.createInfo(displayPath, root, uuid, childURL, rev, child, lock); if (depth.compareTo(SVNDepth.IMMEDIATES) >= 0 || (depth == SVNDepth.FILES && child.getKind() == SVNNodeKind.FILE)) { handler.handleInfo(info); } if (depth == SVNDepth.INFINITY && child.getKind() == SVNNodeKind.DIR) { pushDirInfo(repos, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, depth, handler); } } }
private void pushDirInfo(SVNRepository repos, SVNRevision rev, String path, SVNURL root, String uuid, SVNURL url, Map locks, SVNDepth depth, ISVNInfoHandler handler) throws SVNException { Collection children = repos.getDir(path, rev.getNumber(), null, SVNDirEntry.DIRENT_KIND | SVNDirEntry.DIRENT_CREATED_REVISION | SVNDirEntry.DIRENT_TIME | SVNDirEntry.DIRENT_LAST_AUTHOR, new ArrayList()); for (Iterator ents = children.iterator(); ents.hasNext();) { checkCancelled(); SVNDirEntry child = (SVNDirEntry) ents.next(); SVNURL childURL = url.appendPath(child.getName(), false); String childPath = SVNPathUtil.append(path, child.getName()); String displayPath = repos.getFullPath(childPath); displayPath = displayPath.substring(repos.getLocation().getPath().length()); if (displayPath.startsWith("/")) { displayPath = displayPath.substring(1); } if ("".equals(displayPath)) { displayPath = path; } SVNLock lock = (SVNLock) locks.get(path); SVNInfo info = SVNInfo.createInfo(displayPath, root, uuid, url, rev, child, lock); if (depth.compareTo(SVNDepth.IMMEDIATES) >= 0 || (depth == SVNDepth.FILES && child.getKind() == SVNNodeKind.FILE)) { handler.handleInfo(info); } if (depth == SVNDepth.INFINITY && child.getKind() == SVNNodeKind.DIR) { pushDirInfo(repos, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, depth, handler); } } }