Package org.eclipse.core.runtime

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


                            } else {
                                return 1;
                            }
                        }

                        return p1.segment(p1.segmentCount() - 1).compareTo(p2.segment(p2.segmentCount() - 1));
                    }

                    // find the first different segment path and return that
                    for (int i = 0; i < p1.segmentCount(); i++) {
                        String s1 = p1.segment(i);
View Full Code Here


  @Override
  public boolean visit(IResourceDelta delta) throws CoreException {
    IResource res = delta.getResource();
    IPath ppath = res.getProjectRelativePath();
    int segmentCount = ppath.segmentCount();
    if (segmentCount == 1 && !"app".equals(ppath.segment(0))) {
      return false;
    } else if (segmentCount >= 2) {
      if ("japidviews".equals(ppath.segment(1))) {
         handleJapidviewsChange(delta, res);
View Full Code Here

        IPath currentPath = moduleResource.getModuleRelativePath();

        logger.trace("Ensuring that parent of path {0} is published", currentPath);

        // we assume the root is always published
        if (currentPath.segmentCount() == 0) {
            logger.trace("Path {0} can not have a parent, skipping", currentPath);
            return;
        }

        IPath parentPath = currentPath.removeLastSegments(1);
View Full Code Here

    return textEditor.getTitle();
  }

  public String enclosingDirectory() {
    IPath path = getFilePath();
    return path.segment(path.segmentCount() - 2);
  }

  /**
   *
   * @return the path of the file currently edited in the editor
View Full Code Here

      // exist to the workspace.
      if (file == null) {
        continue;
      }
      IPath path = new Path(defaultRoot);
      for (int k = 0; k < path.segmentCount(); k++) {
        String segment = path.segment(k);
        IVResource v = root.get(segment);
        if (v == null) {
          /* creating virtual directory structure, so READ ONLY */
          v = new VDirectory( root, segment,true);
View Full Code Here


  protected IVResource getLibFile(String p1) {
    IPath path = new Path(p1);
    IVResource root = this.workspace;
    for (int i = 0; i < path.segmentCount() && root != null; i++) {
      root = root.get(path.segment(i));

    }

    return root;
View Full Code Here

          /*
           * security check, dont want to return a resource BELOW the workspace
           * root
           */
          IPath workspaceRoot = new Path(this.userDirectory.getAbsolutePath());
          if (a.matchingFirstSegments(workspaceRoot) != workspaceRoot.segmentCount()) {
              return null;
          }

          File f1 = new File(a.toOSString());

View Full Code Here

      IStorage[] files = projectDir.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 that into the template
          // because non-Eclipse projects shouldn't have that file.
          // When a new Eclipse project is created using the template, a .project file
          // will be added then.
          continue;
View Full Code Here

          // Eclipse projects have a .project file. Don't copy that into the template
          // because non-Eclipse projects shouldn't have that file.
          // When a new Eclipse project is created using the template, a .project file
          // will be added then.
          continue;
        }else if(file.isDirectory() && path.segmentCount() > 1 && path.segment(1).equals(IDavinciServerConstants.DOT_SETTINGS)){
          // For .settings folder, only copy the libs.settings file.
          // For Eclipse projects, there are several other files, but we don't want them in the template.
          // When a new Eclipse project is created using the template, those extra files
          // in .settings will be created at that time.
          IStorage destinationDir = templateDir.newInstance(templateDir, IDavinciServerConstants.DOT_SETTINGS);
View Full Code Here

          destinationDir.mkdirs();
          IStorage libsSettingsSource = file.newInstance(file, IDavinciServerConstants.LIBS_SETTINGS);
          IStorage libsSettingsDestination = destinationDir.newInstance(destinationDir, IDavinciServerConstants.LIBS_SETTINGS);
          // Strip out the "WebContent/" string from the library paths in libs.settings before writing out to the template.
          copyFileStripWebContent(libsSettingsSource, libsSettingsDestination);
        }else if(file.isDirectory() && path.segmentCount() > 1 && path.segment(1).equals(IDavinciServerConstants.WEBCONTENT)){
          // Copy the contents of WebContent/* into the base folder for the template
          copyDirectory(file, templateDir);
        }else if (file.isFile()) {
          IStorage destination = templateDir.newInstance(templateDir, 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.