Package org.eclipse.core.runtime

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


  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


      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

  }
 
  public ILibraryFinder getInstance(URI baseResource, String project) {
    // TODO Auto-generated method stub
    IPath p = new Path(baseResource.getPath());
    String projectPiece = p.segment(p.segmentCount()-1);
   
    return new DojoLibraryFinder(baseResource, project);
  }

  private static URI appendPath(URI u, String piece){
View Full Code Here

    if (url != null) {
      return url;
    }
    IUser user = null;
    IPath ipath = new Path(path);
    if (ipath.segment(0).equals(contextPathSegment)) {
       ipath = ipath.removeFirstSegments(1);
    }
    if (ipath.segment(0).equals("maqetta")) {
      if (ipath.segment(1).equals("user")) {
         ipath = ipath.removeFirstSegments(2);
View Full Code Here

    IUser user = null;
    IPath ipath = new Path(path);
    if (ipath.segment(0).equals(contextPathSegment)) {
       ipath = ipath.removeFirstSegments(1);
    }
    if (ipath.segment(0).equals("maqetta")) {
      if (ipath.segment(1).equals("user")) {
         ipath = ipath.removeFirstSegments(2);
        String userName = ipath.segment(0);
        try {
          user = userManager.getUser(userName);
View Full Code Here

    IPath ipath = new Path(path);
    if (ipath.segment(0).equals(contextPathSegment)) {
       ipath = ipath.removeFirstSegments(1);
    }
    if (ipath.segment(0).equals("maqetta")) {
      if (ipath.segment(1).equals("user")) {
         ipath = ipath.removeFirstSegments(2);
        String userName = ipath.segment(0);
        try {
          user = userManager.getUser(userName);
        } catch (UserException e) {
View Full Code Here

       ipath = ipath.removeFirstSegments(1);
    }
    if (ipath.segment(0).equals("maqetta")) {
      if (ipath.segment(1).equals("user")) {
         ipath = ipath.removeFirstSegments(2);
        String userName = ipath.segment(0);
        try {
          user = userManager.getUser(userName);
        } catch (UserException e) {
          // TODO surface error up the stack
          e.printStackTrace();
View Full Code Here

          // TODO surface error up the stack
          e.printStackTrace();
          return null;
        }
        ipath = ipath.removeFirstSegments(1);
        if (ipath.segment(0).equals("ws") && ipath.segment(1).equals("workspace")) {
          ipath = ipath.removeFirstSegments(2);
        }
      } else {
        user = userManager.getSingleUser();
      }
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.