Package org.eclipse.core.runtime

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


  }
  */
  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

              }
          }
          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

            }
            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

   */
  public static boolean isTagDirDocument(final TLDDocument tldDoc, final IProject project) {
    if (tldDoc.getUri() == null || tldDoc.getUri().equals("")) { //$NON-NLS-1$
      IPath p = new Path(tldDoc.getBaseLocation());
      IPath webContentPath = ComponentCore.createComponent(project).getRootFolder().getUnderlyingFolder().getFullPath();
      if (p.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
        p = p.removeFirstSegments(webContentPath.segmentCount());
        if (p.matchingFirstSegments(new Path("WEB-INF/tags")) == 2) { //$NON-NLS-1$)  {
          return true;
        }
      }
View Full Code Here

    if (tldDoc.getUri() == null || tldDoc.getUri().equals("")) { //$NON-NLS-1$
      IPath p = new Path(tldDoc.getBaseLocation());
      IPath webContentPath = ComponentCore.createComponent(project).getRootFolder().getUnderlyingFolder().getFullPath();
      if (p.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
        p = p.removeFirstSegments(webContentPath.segmentCount());
        if (p.matchingFirstSegments(new Path("WEB-INF/tags")) == 2) { //$NON-NLS-1$)  {
          return true;
        }
      }
    }
    return false;
View Full Code Here

     
      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

      IPath relLocation = null;
      if (location.toOSString().toLowerCase().startsWith(
            workspaceLocation.toOSString().toLowerCase()))
      {
        relLocation = location.removeFirstSegments(
            location.matchingFirstSegments(workspaceLocation));
      }

      // project is outside the workspace otherwise not at the top of the
      // workspace
      if (relLocation == null || relLocation.segmentCount() != 1) {
View Full Code Here

      // 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

      return true;
    }
    File newLocationFile = newLocation.toFile();
    // check if new location is below the same repository
    Path workTree = new Path(srcm.getRepository().getWorkTree().getAbsolutePath());
    int matchingFirstSegments = workTree.matchingFirstSegments(newLocation);
    if (matchingFirstSegments == workTree.segmentCount()) {
      return moveProjectHelperMoveOnlyProject(tree, source, description, updateFlags,
          monitor, srcm, newLocationFile);
    } else {
      int dstAboveSrcRepo = newLocation.matchingFirstSegments(RepositoryMapping
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.