Examples of segmentCount()


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

  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.IPath.segmentCount()

   * 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.IPath.segmentCount()

          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.IPath.segmentCount()

                  }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

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

        {
            IPath srcPrefix = (IPath) srcPrefixes.get(srcPrefixI[i].intValue());
           
            if (srcPrefix.isPrefixOf(path))
            {
                path = path.removeFirstSegments(srcPrefix.segmentCount());
                return ((IPath) targetPrefixes.get(srcPrefixI[i].intValue())).append(path);
            }
        }
        return null;
    }
View Full Code Here

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

                IClasspathEntry[] entries = new IClasspathEntry[sourceLength
                    + libLength];
                for (int i = 0; i < sourceLength; i++) {
                    IPath sourcePath = new Path(sourceFolders[i]);
                    int segmentCount = sourcePath.segmentCount();
                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
View Full Code Here

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

                                : null, vars.length > 2
                                ? new Path(new String(vars[2]))
                                : null);
                    } else {
                        IPath libPath = new Path(lib);
                        if (!libPath.isAbsolute() && libPath.segmentCount() > 0
                            && libPath.getFileExtension() == null) {
                            project.getFolder(libPath).create(true, true, null);
                            libPath = projectPath.append(libPath);
                        }
                        entries[sourceLength + i] = JavaCore.newLibraryEntry(
View Full Code Here

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

                    }
                }

                // create project's output folder
                IPath outputPath = new Path(projectOutput);
                if (outputPath.segmentCount() > 0) {
                    IFolder output = project.getFolder(outputPath);
                    if (!output.exists()) {
                        output.create(true, true, null);
                    }
                }
View Full Code Here

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

        // 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
            entry = JavaCore.newProjectEntry(
                        path,
                        accessRules,
                        combineAccessRestrictions,
View Full Code Here

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

      CharOperation.replace(pkgName, '/', '.');
      return root.getPackageFragment(new String(pkgName));
    } else {
      Path path = new Path(new String(fileName, 0, pkgEnd));
      IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
      IContainer folder = path.segmentCount() == 1 ? workspaceRoot.getProject(path.lastSegment()) : (IContainer) workspaceRoot.getFolder(path);
      IJavaElement element = JavaCore.create(folder);
      if (element == null) return null;
      switch (element.getElementType()) {
        case IJavaElement.PACKAGE_FRAGMENT:
          return (IPackageFragment) element;
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.