Examples of uptoSegment()


Examples of org.eclipse.core.runtime.Path.uptoSegment()

    String remoteLocation = remote.getString(ProtocolConstants.KEY_LOCATION);
    assertNotNull(remoteLocation);

    URI u = URI.create(toRelativeURI(remoteLocation));
    IPath p = new Path(u.getPath());
    p = p.uptoSegment(2).append("xxx").append(p.removeFirstSegments(3));
    URI nu = new URI(u.getScheme(), u.getUserInfo(), u.getHost(), u.getPort(), p.toString(), u.getQuery(), u.getFragment());

    request = getGetGitRemoteRequest(nu.toString());
    response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(response);
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

    response = webConversation.getResponse(request);
    ServerStatus status = waitForTask(response);
    assertEquals(status.toString(), status.getHttpCode(), HttpURLConnection.HTTP_NOT_FOUND);

    p = new Path(u.getPath());
    p = p.uptoSegment(3).append("xxx").append(p.removeFirstSegments(3));
    nu = new URI(u.getScheme(), u.getUserInfo(), u.getHost(), u.getPort(), p.toString(), u.getQuery(), u.getFragment());

    request = getGetGitRemoteRequest(nu.toString());
    response = webConversation.getResponse(request);
    assertEquals(HttpURLConnection.HTTP_NOT_FOUND, response.getResponseCode());
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

        }
      }
      JSONObject errorData = new JSONObject();
      errorData.put(GitConstants.KEY_CLONE, cloneLocation);
      return statusHandler.handleRequest(request, response, new ServerStatus(new Status(IStatus.ERROR, GitActivator.PI_GIT, "No remote branch found: "
          + p.uptoSegment(2).removeTrailingSeparator()), HttpServletResponse.SC_NOT_FOUND, errorData));
    }
    return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_BAD_REQUEST,
        "Bad request, \"/git/remote/{remote}/{branch}/file/{path}\" expected", null));
  }
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

  @Override
  protected URI getLocation() throws URISyntaxException {
    if (tagLocation == null) {
      IPath p = new Path(cloneLocation.getPath());
      p = p.uptoSegment(1).append(RESOURCE).append(getName(false, true)).addTrailingSeparator().append(p.removeFirstSegments(2));
      tagLocation = new URI(cloneLocation.getScheme(), cloneLocation.getUserInfo(), cloneLocation.getHost(), cloneLocation.getPort(), p.toString(),
          cloneLocation.getQuery(), cloneLocation.getFragment());
    }
    return tagLocation;
  }
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

  @PropertyDescription(name = GitConstants.KEY_COMMIT)
  private URI getCommitLocation() throws URISyntaxException {
    if (commitLocation == null) {
      IPath p = new Path(cloneLocation.getPath());
      p = p.uptoSegment(1).append(Commit.RESOURCE).append(parseCommit().getName()).addTrailingSeparator().append(p.removeFirstSegments(2));
      commitLocation = new URI(cloneLocation.getScheme(), cloneLocation.getUserInfo(), cloneLocation.getHost(), cloneLocation.getPort(), p.toString(),
          cloneLocation.getQuery(), cloneLocation.getFragment());
    }
    return commitLocation;
  }
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

              IPath path = new Path(entryName);
              int segmentCount = path.segmentCount();
              if (segmentCount > 1) {
                for (int i = 0, max = path.segmentCount() - 1; i < max; i++) {
                  if (firstLevelPackageNames.contains(path.segment(i))) {
                    tempRoots.add(path.uptoSegment(i));
                    // don't break here as this path could contain other first level package names (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=74014)
                  }
                  if (i == max - 1 && containsADefaultPackage) {
                    tempRoots.add(path.uptoSegment(max));
                  }
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

                  if (firstLevelPackageNames.contains(path.segment(i))) {
                    tempRoots.add(path.uptoSegment(i));
                    // don't break here as this path could contain other first level package names (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=74014)
                  }
                  if (i == max - 1 && containsADefaultPackage) {
                    tempRoots.add(path.uptoSegment(max));
                  }
                }
              } else if (containsADefaultPackage) {
                tempRoots.add(new Path("")); //$NON-NLS-1$
              }
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

    IPath path = new Path(jarPath);
    rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
  } else {
    IPath path = new Path(resourcePathString);
    if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) {
      IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/));
      if (resource != null)
        rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation());
    } else {
      rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
      while (rootInfo == null && path.segmentCount() > 0) {
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

    IPath path = new Path(jarPath);
    rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
  } else {
    IPath path = new Path(resourcePathString);
    if (ExternalFoldersManager.isInternalPathForExternalFolder(path)) {
      IResource resource = JavaModel.getWorkspaceTarget(path.uptoSegment(2/*linked folders for external folders are always of size 2*/));
      if (resource != null)
        rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation());
    } else {
      rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
      while (rootInfo == null && path.segmentCount() > 0) {
View Full Code Here

Examples of org.eclipse.core.runtime.Path.uptoSegment()

              IPath path = new Path(entryName);
              int segmentCount = path.segmentCount();
              if (segmentCount > 1) {
                for (int i = 0, max = path.segmentCount() - 1; i < max; i++) {
                  if (firstLevelPackageNames.contains(path.segment(i))) {
                    tempRoots.add(path.uptoSegment(i));
                    // don't break here as this path could contain other first level package names (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=74014)
                  }
                  if (i == max - 1 && containsADefaultPackage) {
                    tempRoots.add(path.uptoSegment(max));
                  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.