Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFolder.create()


  public static IFolder createFolder(IContainer container, String folderName) throws PearException {
    try {
      IFolder folder = container.getFolder(new Path(folderName));
      // If the folder does not exist, create and return, failure returns null
      if (!folder.exists()) {
        folder.create(true, true, null);
        return folder;
      } else {
        // return what already exisited
        return folder;
      }
View Full Code Here


      return null;

    IFile prxFile = null;

    IFolder newPlanFolder = sourceFolder.getFolder(planName);
    newPlanFolder.create(IResource.FORCE, true, null);
    newPlanFolder.setPersistentProperty(toolPlanNameQualifiedName, planName);

    ToolPlan newToolPlan = ToolPlan.newPlan(newPlanFolder, planName, display, dataBase);

    prxFile = newToolPlan.getFile();
View Full Code Here

    IFolder udsFolder = project.getFolder(UDS_LIBRARY_FOLDER_NAME);
//    if (udsFolder.exists())
//      return;
    try {
      if (!udsFolder.exists()){
        udsFolder.create(true, true, null);
       
      }

      File forteLibsDir = udsFolder.getLocation().toFile();
      if (forteLibsDir.exists()) {
View Full Code Here

        return null;
     
      IFile prxFile = null;
     
        IFolder newPlanFolder = sourceFolder.getFolder(planName);
        newPlanFolder.create(IResource.FORCE, true, null);
        newPlanFolder.setPersistentProperty(toolPlanNameQualifiedName, planName);
       
        ToolPlan newToolPlan = ToolPlan.newPlan(newPlanFolder, planName, display, dataBase);
       
        prxFile = newToolPlan.getFile();
View Full Code Here

          }

          if (!plan.isLibrary()){
            IFolder planDir = projectsDir.getFolder(plan.getName());
            if (!planDir.exists()){
              planDir.create(false, true, null);

            }
            repos.exportPlanAndComponents(plan.getName(), planDir.getLocation().toOSString(), true);
            IResource planResource = planDir.findMember(plan.getName() + ".prx");
            planDir.setPersistentProperty(ToolProjectSupport.toolPlanNameQualifiedName, plan.getName());
View Full Code Here

    IContainer parent = pexFile.getParent();
    String planName = pexFile.getName().substring(0, pexFile.getName().lastIndexOf('.'));
    IFolder folder = (IFolder) parent.getFolder(new Path(planName));
    if (!folder.exists()){
      try {
        folder.create(true, true, null);
        folder.getParent().refreshLocal(IResource.DEPTH_ZERO, null);
      } catch (CoreException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
View Full Code Here

    int segmentCount = folders.segmentCount();
    for(int i = 0; i < segmentCount; i++) {
      checkPath = checkPath.addTrailingSeparator().append(folders.segment(i));
      IFolder folder = project.getFolder(checkPath);
      if(!folder.exists())
        folder.create(true, true, null);
    }
    linkFile.createLink(uri, IResource.ALLOW_MISSING_LOCAL, null);
  }

  private static int getFirstFreeUntitled(IProject project) throws CoreException {
View Full Code Here

  }

  private static int getFirstFreeUntitled(IProject project) throws CoreException {
    IFolder untitledFolder = project.getFolder("untitled");
    if(!untitledFolder.exists()) {
      untitledFolder.create(true, true, new NullProgressMonitor());
      return 0;
    }
    IResource[] resources = untitledFolder.members();
    int result = resources.length > 0
        ? 1
View Full Code Here

  private IFolder getOrCreateUnnamedScriptFolder(IProject project) {
    IFolder unnamedDir = project.getFolder(UNNAMED_SCRIPTS_FOLDER_NAME);
    if (!unnamedDir.exists()) {
      try {
        unnamedDir.create(true, true, null);
      } catch (CoreException e) {
        throw new RuntimeException(e);
      }
    }
    return unnamedDir;
View Full Code Here

        else
          packageFragmentPath = packageFragmentPath.append("client");//$NON-NLS-1$

        IFolder folder = javaProject.getProject().getFolder(packageFragmentPath.removeFirstSegments(1));
        if (!folder.exists())
          folder.create(true, true, null);
        packageFragment = javaProject.findPackageFragment(packageFragmentPath);
      } catch (Exception e) {
        Activator.logException(e);
      }
    }
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.