Examples of matchingFirstSegments()


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

     
      if (namespace != null) {
        String nmspc = namespace.getNamespace();
        IPath nmspcPath = new Path(nmspc.replace("\\", "/"));
       
        int match = nmspcPath.matchingFirstSegments(appendix);
        appendix = appendix.removeFirstSegments(match);

        if (appendix.segmentCount() > 0) {
          nmspc += (!nmspc.isEmpty() ? "\\" : "") +
            appendix.removeTrailingSeparator().toString().replace("/", "\\");
View Full Code Here

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

            IClasspathEntry curr= oldEntries[i];
            if (curr.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
              IPath path= curr.getPath();
              if (path.equals(entry.getPath())) {
                return new NullChange(); // already on build path
              } else if (path.matchingFirstSegments(entry.getPath()) > 0) {
                if (!added) {
                  curr= entry; // replace
                  added= true;
                } else {
                  curr= null;
View Full Code Here

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

    }

    @Override
    public IPath getConfigurationFile(final String key) {
        final IPath origFile = parentKarafModel.getConfigurationFile(key);
        final int matchingSegments = origFile.matchingFirstSegments(parentKarafModel
                        .getConfigurationDirectory());

        final IPath configFile = origFile.removeFirstSegments(matchingSegments - 1);

        return location.append(configFile);
View Full Code Here

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

      // workspace. Also, take the last segment as the new project name.
      if (location.toOSString().toLowerCase().startsWith(
            workspaceLocation.toOSString().toLowerCase()))
      {
        String name = location.removeFirstSegments(
            location.matchingFirstSegments(workspaceLocation)).toString();
        // hack for windows... manually remove drive letter
        name = name.replaceFirst("^[A-Z]:", "");
        name = name.replaceFirst("/$", "");

        location = null;
View Full Code Here

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

      return moveProjectHelperMoveOnlyProject(tree, source, description, updateFlags,
          monitor, srcm, newLocationFile);
    } else {
      int dstAboveSrcRepo = newLocation.matchingFirstSegments(RepositoryMapping
          .getMapping(source).getGitDirAbsolutePath());
      int srcAboveSrcRepo = sourceLocation.matchingFirstSegments(RepositoryMapping.getMapping(source).getGitDirAbsolutePath());
      if (dstAboveSrcRepo > 0 && srcAboveSrcRepo > 0) {
        return moveProjectHelperMoveRepo(tree, source, description, updateFlags, monitor,
          srcm, newLocation, sourceLocation);
      } else {
        return FINISH_FOR_ME;
View Full Code Here

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

    IPath workspaceLocation = ResourcesPlugin.getWorkspace().getRoot()
        .getLocation();
    if (workspaceLocation != null
        && workspaceLocation.isPrefixOf(pharData
            .getAbsolutePharLocation())) {
      int segments = workspaceLocation.matchingFirstSegments(pharData
          .getAbsolutePharLocation());
      IPath path = pharData.getAbsolutePharLocation()
          .removeFirstSegments(segments);
      IResource resource = ResourcesPlugin.getWorkspace().getRoot()
          .findMember(path);
View Full Code Here

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

        boolean directory = path.charAt(path.length()-1)=='/';
       
        String[] segments = a.segments();
        IPath me = new Path(this.file.getAbsolutePath());
        IVResource parent = this;
        for (int i = me.matchingFirstSegments(a); i < segments.length; i++) {
            int segsToEnd = segments.length - i - 1;
            IStorage f = file.newInstance(a.removeLastSegments(segsToEnd).toString());
           
            if((i+1==segments.length) && directory)
              f.mkdir();
View Full Code Here

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

  }
  */
  public boolean isValid(String path){
     IPath workspaceRoot = new Path(this.userDirectory.getAbsolutePath());
     IPath a = new Path(path);
       if (a.matchingFirstSegments(workspaceRoot) != workspaceRoot.segmentCount()) {
           return false;
        }
       return true;
  }
 
View Full Code Here

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

              }
          }
          String[] segments = a.segments();
          IPath me = new Path(this.userDirectory.getAbsolutePath());
          IVResource parent = this.workspace;
          for (int i = me.matchingFirstSegments(a); i < segments.length; i++) {
              int segsToEnd = segments.length - i - 1;
              String s = a.removeLastSegments(segsToEnd).toOSString();
              IStorage f = this.userDirectory.newInstance(s);
              parent = new VFile(f, parent, segments[i]);
          }
View Full Code Here

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

            }
            if(!includeLibs && files[i] instanceof VLibraryResource)
              continue;

          IPath filePath = new Path(files[i].getPath());
            String pathString = filePath.removeFirstSegments(filePath.matchingFirstSegments(root)).toString();
           
            if(pathString==null) return;
           
            /* remove leading characters that confuse and anger windows built in archive util */
            if(pathString.length() > 1 && pathString.indexOf("./")==0)
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.