Examples of segment()


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

          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

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

                                        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

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

    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

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

    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

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

    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

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

  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

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

    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

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

   * when this is called, since passing in a random path will create a random project, which
   * probably wasn't intended.
   */
  public IStorage create(String name) {
    IPath path = new Path(name);
    VOrionStorage parent = (VOrionStorage) this.createProject(path.segment(0));
    if (path.segmentCount() > 1) {
      return parent.create(path.removeFirstSegments(1).toString());
    }
    return parent;
  }
View Full Code Here

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

          IStorage[] files = projectToCloneDir.listFiles();
          for (int i = 0; i < files.length; i++) {
            IStorage file = files[i];
            String filename = file.getPath();
            IPath path = new Path(filename);
            if(file.isFile() && path.segmentCount() > 0 && path.segment(1).equals(IDavinciServerConstants.DOT_PROJECT)){
              // Eclipse projects have a .project file. Don't copy the cloned project's .project file
              // into the new project - if the new project is an Eclipse project, other code adds the .project file.
              continue;
            }else if(file.isDirectory() && file.getName().equals(IDavinciServerConstants.DOT_SETTINGS)){
              IStorage destinationDir = projectDir.newInstance(projectDir, IDavinciServerConstants.DOT_SETTINGS);
View Full Code Here

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

                  }else{
                    copyFile(settingsFile, destination);
                  }
                }
              }
            }else if(file.isDirectory() && path.segmentCount() > 1 && path.segment(1).equals(IDavinciServerConstants.WEBCONTENT)){
              // Copy the contents of WebContent/* into the base folder for the new project
              copyDirectory(file, basePathDir);
            }else if (file.isFile()) {
              IStorage destination = basePathDir.newInstance(basePathDir, file.getName());
              copyFile(file, destination);
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.