Examples of uptoSegment()


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()

              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()

      }
     
      if (entryPath.segmentCount() == pathLength + 1) {
        childZipEntries.put(zipEntry.getName(), zipEntry);
      } else {
        String name = entryPath.uptoSegment(pathLength + 1).
          addTrailingSeparator().toString();
       
        if (!childZipEntries.containsKey(name)) {
          ZipEntry dirEntry = new ZipEntry(name);
          childZipEntries.put(name, dirEntry);
View Full Code Here

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

    if (!configFile.exists()) {
      ByteArrayInputStream input = new ByteArrayInputStream(new byte[] {});
      try {
        IPath path = configFile.getParent().getProjectRelativePath();
        for (int i=1; i<=path.segmentCount(); i++) {
          IFolder folder = project.getFolder(path.uptoSegment(i));
          if (!folder.exists()) {
            folder.create(true, true, null);
           
          }
        }
View Full Code Here

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

      List<IPath> exclusions = new ArrayList<IPath>();
      exclusions.addAll(Arrays.asList(parent.getExclusionPatterns()));
     
      IPath diff = path.removeFirstSegments(path.matchingFirstSegments(parent.getPath()));
      if (parent.getPath().equals(composerPath)) {
        diff = diff.uptoSegment(1);
      }
      diff = diff.removeTrailingSeparator().addTrailingSeparator();
      if (!exclusions.contains(diff)) {
        exclusions.add(diff);
      }
View Full Code Here

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