Package org.eclipse.core.runtime

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


   *  
   */
  public void addAtributesFor(HttpServletRequest request, URI resource,JSONObject representation) {
    IPath resourcePath = new Path(request.getServletPath() + (request.getPathInfo() == null ? "" : request.getPathInfo()));
   
    if ("/workspace".equals(request.getServletPath()) && resourcePath.segmentCount() == 2) {
      try {
        JSONArray projObjects = representation.getJSONArray("Children");
        for (int i = 0; i < projObjects.length(); i++) {
          JSONObject projectObject = (JSONObject) projObjects.get(i);
          if (checkMaqettaProject(projectObject)){
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

   * 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

          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

                  }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

        setErrorMessage("Debug Package File Path missing");
      else {
        Path path = new Path(name);
        File file = path.removeLastSegments(1).toFile();

        if (!path.isValidPath(name) || path.segmentCount() == 0
            || !file.exists())
          setErrorMessage("Debug Package File Path invalid");
      }

    }
View Full Code Here

      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

      // 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

      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

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.