public void closeDir() throws SVNException { myCurrentDirectory = myCurrentDirectory.getParentFile(); myCurrentPath = SVNPathUtil.removeTail(myCurrentPath); }
public void closeDir() throws SVNException { myCurrentDirectory = myCurrentDirectory.getParentFile(); myCurrentPath = SVNPathUtil.removeTail(myCurrentPath); }
public void closeDir() throws SVNException { myCurrentDirectory = myCurrentDirectory.getParentFile(); myCurrentPath = SVNPathUtil.removeTail(myCurrentPath); }
private static boolean hasProcessedParents(Collection paths, String path) throws SVNException { path = SVNPathUtil.removeTail(path); if (paths.contains(path)) { return true; } if ("".equals(path)) { return false; } return hasProcessedParents(paths, path); }
private static boolean hasProcessedParents(Collection paths, String path) { path = SVNPathUtil.removeTail(path); if (paths.contains(path)) { return true; } if ("".equals(path)) { return false; } return hasProcessedParents(paths, path); }
private static boolean hasProcessedParents(Collection paths, String path) throws SVNException { path = SVNPathUtil.removeTail(path); if (paths.contains(path)) { return true; } if ("".equals(path)) { return false; } return hasProcessedParents(paths, path); }
private static boolean hasProcessedParents(Collection paths, String path) throws SVNException { path = SVNPathUtil.removeTail(path); if (paths.contains(path)) { return true; } if ("".equals(path)) { return false; } return hasProcessedParents(paths, path); }
public static File getParentFile(File file) { String path = file.getAbsolutePath(); path = path.replace(File.separatorChar, '/'); path = SVNPathUtil.canonicalizePath(path); int up = 0; while (path.endsWith("/..")) { path = SVNPathUtil.removeTail(path); up++; } for(int i = 0; i < up; i++) { path = SVNPathUtil.removeTail(path); } path = path.replace('/', File.separatorChar); file = new File(path); return file.getParentFile(); }
public static File getParentFile(File file) { String path = file.getAbsolutePath(); path = path.replace(File.separatorChar, '/'); path = SVNPathUtil.canonicalizePath(path); int up = 0; while (path.endsWith("/..")) { path = SVNPathUtil.removeTail(path); up++; } for (int i = 0; i < up; i++) { path = SVNPathUtil.removeTail(path); } path = path.replace('/', File.separatorChar); file = new File(path); return file.getParentFile(); }
public static String findRepositoryRoot(String host, String path) { if (path == null) { path = ""; } String testPath = host != null ? SVNPathUtil.append("\\\\" + host, path) : path; testPath = testPath.replaceFirst("\\|", "\\:"); File rootPath = new File(testPath).getAbsoluteFile(); while (!isRepositoryRoot(rootPath)) { if (rootPath.getParentFile() == null) { return null; } path = SVNPathUtil.removeTail(path); rootPath = rootPath.getParentFile(); } while (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } while (path.endsWith("\\")) { path = path.substring(0, path.length() - 1); } return path; }
private SVNPath getParentPath(SVNPath target) { return new SVNPath(SVNPathUtil.removeTail(target.getTarget()), target.getPegRevision()); }
private SVNPath getParentPath(SVNPath target) { return new SVNPath(SVNPathUtil.removeTail(target.getTarget()), target.getPegRevision()); }
private String getRealPath(String path) { path = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(getAnchor(), path)); if (getPathMap().isEmpty()) { return path; } String repositoryPath = (String) getPathMap().get(path); if (repositoryPath != null) { return repositoryPath; } String tmpPath = path; do { tmpPath = SVNPathUtil.removeTail(tmpPath); repositoryPath = (String) getPathMap().get(tmpPath); if (repositoryPath != null) { return SVNPathUtil.append(repositoryPath, path.substring(tmpPath.length())); } } while (SVNPathUtil.getSegmentsCount(tmpPath) > 0); return path; }
public long fetchFile(String path, long revision, OutputStream os, SVNProperties properties) throws SVNException { SVNURL url = reposRoot.appendPath(SVNPathUtil.removeTail(path), false); if (repos2[0] == null) { repos2[0] = createRepository(url, null, null, false); } else { repos2[0].setLocation(url, false); } return repos2[0].getFile(SVNPathUtil.tail(path), revision, properties, os); } };
protected DAVResource getParentResource(DAVResource resource) throws DAVException { DAVResource parentResource = new DAVResource(); resource.copyTo(parentResource); DAVResourceURI parentResourceURI = parentResource.getResourceURI(); String uri = parentResourceURI.getURI(); String path = parentResourceURI.getPath(); parentResourceURI.setURI(SVNPathUtil.removeTail(uri)); parentResourceURI.setPath(SVNPathUtil.removeTail(path)); parentResource.setExists(true); parentResource.setCollection(true); parentResource.setVersioned(true); return parentResource; }
/** * Constructs a new <b>SVNURL</b> representation removing a tail path * segment from the path component of this representation. * * @return a new <b>SVNURL</b> representation */ public SVNURL removePathTail() throws SVNException { String newPath = SVNPathUtil.removeTail(myPath); String url = composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), newPath); return parseURIDecoded(url); } /**
/** * Constructs a new <b>SVNURL</b> representation removing a tail path * segment from the path component of this representation. * * @return a new <b>SVNURL</b> representation * @throws SVNException */ public SVNURL removePathTail() throws SVNException { String newPath = SVNPathUtil.removeTail(myPath); String url = composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), newPath); return parseURIDecoded(url); } /**
/** * Constructs a new <b>SVNURL</b> representation removing a tail path * segment from the path component of this representation. * * @return a new <b>SVNURL</b> representation * @throws SVNException */ public SVNURL removePathTail() throws SVNException { String newPath = SVNPathUtil.removeTail(myPath); String url = composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), newPath); return parseURIDecoded(url); } /**
/** * Constructs a new <b>SVNURL</b> representation removing a tail path * segment from the path component of this representation. * * @return a new <b>SVNURL</b> representation * @throws SVNException */ public SVNURL removePathTail() throws SVNException { final String newPath = SVNPathUtil.removeTail(myEncodedPath); final String url = composeURL(getProtocol(), getUserInfo(), getHost(), myIsDefaultPort ? -1 : getPort(), newPath); return parseURIEncoded(url); } /**
public SVNDirEntry info(String path, long revision) throws SVNException { try { openRepository(); path = getRepositoryPath(path); if (FSRepository.isInvalidRevision(revision)) { revision = myFSFS.getYoungestRevision(); } FSRevisionRoot root = myFSFS.createRevisionRoot(revision); if (root.checkNodeKind(path) == SVNNodeKind.NONE) { return null; } FSRevisionNode revNode = root.getRevisionNode(path); String fullPath = getFullPath(path); String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath); SVNURL url = getLocation().setPath(parentFullPath, false); String name = "/".equals(path) ? "" : SVNPathUtil.tail(path); FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name); SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, SVNDirEntry.DIRENT_ALL); return entry; } finally { closeRepository(); } }