Package org.eclipse.core.runtime

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


                        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

    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

          if (!entry.isDirectory() && org.aspectj.org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(entryName = entry.getName())) {
            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

                                        continue;

                                    IPath packagePath = new Path(entry.getKey());
                                    if (packagePath.segmentCount() < 1)
                                        continue;
                                    if ("META-INF".equalsIgnoreCase(packagePath.segment(0)))
                                        continue;

                                    availablePackages.add(packagePath);
                                }
                            } catch (Exception e) {} finally {
View Full Code Here

    if (parent == null)
      parent = this;

    IPath path = new Path(name);
    for (int i = 0; i < path.segmentCount(); i++) {
      parent = (VOrionStorage) parent.create(path.segment(i));
    }

    return parent;
  }
View Full Code Here

    IPath path = new Path(name);
    VOrionStorage result = this;
    for (int i = 0, len = path.segmentCount(); i < len; i++) {
      // getChild() is a handle-only method; a child is provided regardless of whether this
      // store or the child store exists, or whether this store represents a directory or not.
      IFileStore childStore = result.store.getChild(path.segment(i));
      result = new VOrionStorage(path.segment(i), childStore, result);
    }
    return result;
  }
View Full Code Here

    VOrionStorage result = this;
    for (int i = 0, len = path.segmentCount(); i < len; i++) {
      // getChild() is a handle-only method; a child is provided regardless of whether this
      // store or the child store exists, or whether this store represents a directory or not.
      IFileStore childStore = result.store.getChild(path.segment(i));
      result = new VOrionStorage(path.segment(i), childStore, result);
    }
    return result;
  }

  public Collection<IStorage> findFiles(IStorage parentFolder, String pathStr, boolean ignoreCase) {
View Full Code Here

  public IVResource create(String path) throws IOException {
    IPath ps = new Path(path);
    IVResource parent = this;
   
    for(int i=0;i<ps.segmentCount();i++){
      String segment = ps.segment(i);
      IVResource f= parent.get(segment);
      if(f==null ){
        IStorage file = this.store.create(path);
        f = new VOrionResource(file, parent, segment);
       
View Full Code Here

    this.webWorkspace = webWorkspace;
  }

  public IStorage newInstance(String name) {
    IPath path = new Path(name);
    String seg1 = path.segment(0);
    WebProject project = webWorkspace.getProjectByName(seg1);
    if (project == null) {
      // Trying to create a new instance of a project which doesn't currently exist.  However,
      // since all projects are first created through direct calls to `create()`, a null
      // value here most likely means that we have an invalid URL.
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.