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; }
private void parseBaselineCollection(String parameter) throws SVNException { long revision = DAVResource.INVALID_REVISION; String parameterPath; if (SVNPathUtil.getSegmentsCount(parameter) == 1) { parameterPath = "/"; try { revision = Long.parseLong(parameter); } catch (NumberFormatException e) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, e.getMessage()), e, SVNLogType.NETWORK); } } else { try { revision = Long.parseLong(DAVPathUtil.head(parameter)); } catch (NumberFormatException e) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, e.getMessage()), e, SVNLogType.NETWORK); } parameterPath = DAVPathUtil.removeHead(parameter, false); } setType(DAVResourceType.REGULAR); setVersioned(true); setRevision(revision); setPath(parameterPath); }
private static File chooseTargetFilename(SvnPatch patch) { if (patch.getOldFileName().getPath().equals("/dev/null")) { return patch.getNewFileName(); } if (patch.getNewFileName().getPath().equals("/dev/null")) { return patch.getOldFileName(); } if (patch.getOperation() == SvnDiffCallback.OperationKind.Moved) { return patch.getOldFileName(); } int oldCount = SVNPathUtil.getSegmentsCount(SVNFileUtil.getFilePath(patch.getOldFileName())); int newCount = SVNPathUtil.getSegmentsCount(SVNFileUtil.getFilePath(patch.getNewFileName())); if (oldCount == newCount) { oldCount = SVNPathUtil.tail(SVNFileUtil.getFilePath(patch.getOldFileName())).length(); newCount = SVNPathUtil.tail(SVNFileUtil.getFilePath(patch.getNewFileName())).length(); if (oldCount == newCount) { oldCount = SVNFileUtil.getFilePath(patch.getOldFileName()).length(); newCount = SVNFileUtil.getFilePath(patch.getNewFileName()).length(); } } return (oldCount < newCount) ? patch.getOldFileName() : patch.getNewFileName(); }
private void parseVersion(String parameter) throws SVNException { setVersioned(true); setType(DAVResourceType.VERSION); if (SVNPathUtil.getSegmentsCount(parameter) == 1) { try { setRevision(Long.parseLong(parameter)); } catch (NumberFormatException e) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, "Invalid URI ''{0}''", e.getMessage()), e, SVNLogType.NETWORK); } setPath("/"); } else { try { setRevision(Long.parseLong(DAVPathUtil.head(parameter))); } catch (NumberFormatException e) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, e.getMessage()), e, SVNLogType.NETWORK); } setPath(DAVPathUtil.removeHead(parameter, false)); } }
int depth = 0; for (int i = 0; i < paths.length; i++) { int segments = SVNPathUtil.getSegmentsCount(paths[i]); if (depth < segments) { depth = segments;
int depth = 0; for (int i = 0; i < paths.length; i++) { int segments = SVNPathUtil.getSegmentsCount(paths[i]); if (depth < segments) { depth = segments;
int depth = 0; for (int i = 0; i < paths.length; i++) { int segments = SVNPathUtil.getSegmentsCount(paths[i]); if (depth < segments) { depth = segments;
final int parentPathSegments = SVNPathUtil.getSegmentsCount(path); Map dirEntsMap = new HashMap(); HTTPStatus status = DAVUtil.getProperties(myConnection, path, DAVUtil.DEPTH_ONE, null, null, dirEntsMap); DAVProperties child = (DAVProperties) dirEntsMap.get(url); String href = child.getURL(); if (parentPathSegments == SVNPathUtil.getSegmentsCount(href)) { continue;
path = SVNPathUtil.append(info.baselineBase, info.baselinePath); final int parentPathSegments = SVNPathUtil.getSegmentsCount(path); final List vccs = new ArrayList(); String href = child.getURL(); String name = ""; if (parentPathSegments != SVNPathUtil.getSegmentsCount(href)) { name = SVNEncodingUtil.uriDecode(SVNPathUtil.tail(href));
File srcPath = new File(adminArea.getRoot(), info.getPath()); File dstPath = new File(to, info.getPath()); if (SVNPathUtil.getSegmentsCount(info.getPath()) > 1) { if (!dstPath.getParentFile().exists() && !dstPath.getParentFile().mkdirs()) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CLIENT_IS_DIRECTORY, "Could not create directory ''{0}''", dstPath.getParentFile()), SVNLogType.WC);
File srcPath = new File(adminArea.getRoot(), info.getPath()); File dstPath = new File(to, info.getPath()); if (SVNPathUtil.getSegmentsCount(info.getPath()) > 1) { if (!dstPath.getParentFile().exists() && !dstPath.getParentFile().mkdirs()) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CLIENT_IS_DIRECTORY, "Could not create directory ''{0}''", dstPath.getParentFile()), SVNLogType.WC);
File srcPath = new File(adminArea.getRoot(), info.getPath()); File dstPath = new File(to, info.getPath()); if (SVNPathUtil.getSegmentsCount(info.getPath()) > 1) { if (!dstPath.getParentFile().exists() && !dstPath.getParentFile().mkdirs()) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CLIENT_IS_DIRECTORY, "Could not create directory ''{0}''", dstPath.getParentFile()), SVNLogType.WC);
private void parseWorking(String parameter) { setType(DAVResourceType.WORKING); setVersioned(true); setWorking(true); if (SVNPathUtil.getSegmentsCount(parameter) == 1) { setActivityID(parameter); setPath("/"); } else { setActivityID(DAVPathUtil.head(parameter)); final String path = DAVPathUtil.removeHead(parameter, false); // is decoding realy required ?? //setPath(SVNEncodingUtil.uriDecode(path)); setPath(path); } }
private void parseWorkingBaseline(String parameter) throws SVNException { setType(DAVResourceType.WORKING); setWorking(true); setVersioned(true); setBaseLined(true); if (SVNPathUtil.getSegmentsCount(parameter) == 1) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, "Invalid URI ''{0}''", getRequestURI()), SVNLogType.NETWORK); } setActivityID(DAVPathUtil.head(parameter)); try { String revisionParameter = DAVPathUtil.removeHead(parameter, false); long revision = Long.parseLong(DAVPathUtil.dropLeadingSlash(revisionParameter)); setRevision(revision); } catch (NumberFormatException e) { SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_ILLEGAL_URL, e), e, SVNLogType.NETWORK); } }
int levelsUP = SVNPathUtil.getSegmentsCount(dstReposPath) - SVNPathUtil.getSegmentsCount(ancestorPath); File currentWD = dstDir; for (int i = 0; i < levelsUP && currentWD != null; i++) {
} else { specialPart = DAVPathUtil.dropLeadingSlash(specialPart); if (!specialPart.endsWith("/") && SVNPathUtil.getSegmentsCount(specialPart) == 1) {
if (!myIsDepthSticky && entry.isThisDir() && myRequestedDepth == SVNDepth.IMMEDIATES) { int directoryDepth = SVNPathUtil.getSegmentsCount(dirInfo.getPath()); if (myTarget != null && !"".equals(myTarget)) { directoryDepth--;
if (!myIsDepthSticky && entry.isThisDir() && myRequestedDepth == SVNDepth.IMMEDIATES) { int directoryDepth = SVNPathUtil.getSegmentsCount(dirInfo.getPath()); if (myTarget != null && !"".equals(myTarget)) { directoryDepth--;
int directoryDepth = SVNPathUtil.getSegmentsCount(dirInfo.getPath()); if (myTarget != null && !"".equals(myTarget)) { directoryDepth--;
if (!myIsDepthSticky && entry.isThisDir() && myRequestedDepth == SVNDepth.IMMEDIATES) { int directoryDepth = SVNPathUtil.getSegmentsCount(dirInfo.getPath()); if (myTarget != null && !"".equals(myTarget)) { directoryDepth--;