Examples of segment()


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

    }
    IPath path = relativePath;
    if (path.segmentCount() == 1) {
      // The path may be the project itself
      IProject project = ResourcesPlugin.getWorkspace().getRoot()
          .getProject(path.segment(0));
      if (project.isAccessible()) {
        path = project.getLocation();
      }
    } else {
      IFolder folder = ResourcesPlugin.getWorkspace().getRoot()
View Full Code Here

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

    if ( path.hasTrailingSeparator() ) {
      path = path.removeTrailingSeparator();
    }

    path = path.removeFirstSegments(1);
    String userName = path.segment(0);
    if ( path.segmentCount() < 4 || !path.segment(1).equals("ws") || !path.segment(2).equals("workspace") ) {
      theLogger.warning("incorrectly formed workspace path: " + path);
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
      return;
    }
View Full Code Here

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

      path = path.removeTrailingSeparator();
    }

    path = path.removeFirstSegments(1);
    String userName = path.segment(0);
    if ( path.segmentCount() < 4 || !path.segment(1).equals("ws") || !path.segment(2).equals("workspace") ) {
      theLogger.warning("incorrectly formed workspace path: " + path);
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
      return;
    }
    path = path.removeFirstSegments(3);
View Full Code Here

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

      path = path.removeTrailingSeparator();
    }

    path = path.removeFirstSegments(1);
    String userName = path.segment(0);
    if ( path.segmentCount() < 4 || !path.segment(1).equals("ws") || !path.segment(2).equals("workspace") ) {
      theLogger.warning("incorrectly formed workspace path: " + path);
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
      return;
    }
    path = path.removeFirstSegments(3);
View Full Code Here

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

  private boolean containsPublishedFiles(IStorage dir, IDesignerUser user, String timeStamp){
    for(Version version : user.getVersions()){
      if(!version.getTime().equals(timeStamp)) continue;
      for(String res : version.resources){
        IPath resPath = new Path(res);
        while(resPath.segment(0).equals(".")) resPath = resPath.removeFirstSegments(1);
        if(dir.getName().equals(resPath.segment(0))){
          return true;
        }
      }
    }
View Full Code Here

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

    for(Version version : user.getVersions()){
      if(!version.getTime().equals(timeStamp)) continue;
      for(String res : version.resources){
        IPath resPath = new Path(res);
        while(resPath.segment(0).equals(".")) resPath = resPath.removeFirstSegments(1);
        if(dir.getName().equals(resPath.segment(0))){
          return true;
        }
      }
    }
    return false;
View Full Code Here

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

        List<File> files)
    {
        IPath p = cp.getPath();

        IProject project = sigil.getProject().getWorkspace().getRoot().getProject(
            p.segment(0));
        if (project.exists())
        {
            p = project.getLocation().append(p.removeFirstSegments(1));
        }
View Full Code Here

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

                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
                                sourcePath.segment(j)));
                            if (!folder.exists()) {
                                folder.create(true, true, null);
                            }
                            container = folder;
                        }
View Full Code Here

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

                        extraAttributes,
                        isExported);
        break;
      case IClasspathEntry.CPE_SOURCE :
        // must be an entry in this project or specify another project
        String projSegment = path.segment(0);
        if (projSegment != null && projSegment.equals(project.getElementName())) { // this project
          entry = JavaCore.newSourceEntry(path, inclusionPatterns, exclusionPatterns, outputLocation, extraAttributes);
        } else {
          if (path.segmentCount() == 1) {
            // another project
View Full Code Here

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

    SourceIndexerRequestor requestor = new SourceIndexerRequestor(this);
    String documentPath = this.document.getPath();
    SourceElementParser parser = ((InternalSearchDocument) this.document).parser;
    if (parser == null) {
      IPath path = new Path(documentPath);
      IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
      parser = JavaModelManager.getJavaModelManager().indexManager.getSourceElementParser(JavaCore.create(project), requestor);
    } else {
      parser.requestor = requestor;
    }
   
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.