IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceRoot root = workspace.getRoot(); IProject project = root.getProject("myProject"); if (project.exists()) { // Do something }
IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceRoot root = workspace.getRoot(); IProject project = root.getProject("myProject"); if (!project.exists()) { // Create the project IProjectDescription description = workspace.newProjectDescription(project.getName()); project.create(description, null); project.open(null); }
IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceRoot root = workspace.getRoot(); IProject project = root.getProject("myProject"); if (project.exists()) { // Delete the project project.delete(true, null); }The org.eclipse.core.resources package library belongs to the Eclipse Platform Runtime.