Examples of uptoSegment()


Examples of org.eclipse.core.runtime.IPath.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.IPath.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.IPath.uptoSegment()

      p = new Path(path.substring(index + 1));
    }else{
      p = new Path(path);
    }
    if (!p.hasTrailingSeparator()){
      p = p.uptoSegment(p.segmentCount() - 1);
    }
    return p.makeRelative().addTrailingSeparator().toOSString();
  }

  /**
 
View Full Code Here

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

   */
  public static String getFullPath(String path)
  {
    IPath p = Path.fromOSString(path);
    if (!p.hasTrailingSeparator()){
      p = p.uptoSegment(p.segmentCount() - 1);
    }
    return p.addTrailingSeparator().toOSString();
  }

  /**
 
View Full Code Here

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

   * @return The full path.
   */
  public static String getDirName(String path)
  {
    IPath p = Path.fromOSString(path);
    p = p.uptoSegment(p.segmentCount() - 1);
    return p.addTrailingSeparator().toOSString();
  }

  /**
   * Gets the file name minus the extension from the supplied path.
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.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.IPath.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.IPath.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.IPath.uptoSegment()

        // initialized
        // Once we hit a higher-level container that's already added we
        // need go no further
        int pathSegmentCount = path.segmentCount();
        if (pathSegmentCount > 1) {
          createContainer(path.uptoSegment(pathSegmentCount - 1));
        }
        createFile(entry);
      }
    }
  }
View Full Code Here

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

        // initialized
        // Once we hit a higher-level container that's already added we
        // need go no further
        int pathSegmentCount = path.segmentCount();
        if (pathSegmentCount > 1) {
          createContainer(path.uptoSegment(pathSegmentCount - 1));
        }
        createFile(entry);
      }
    }
  }
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.