Delete Project Resource is not working in Eclplse2.1 [message #150333] |
Tue, 28 October 2003 14:18 |
Eclipse User |
|
|
|
Originally posted by: kunal.nortelnetworks.com
The following code is working under Win2K Eclipse 2.0 but with Eclipse
2.1, the content under the project is partially deleted. As .project is
getting deleted leaving some folders inside, the project can not be
deleted from the context menu in package explorer. The project can only be
deleted manually outside eclipse.
Any help will be appreciated.
// Create a project
IWorkspaceRoot root = MyPlugin.getWorkspace().getRoot();
IProject newProjectHandle = root.getProject("MyProject");
try {
if (newProjectHandle.exists())
newProjectHandle.delete(true, null);
} catch (CoreException e) {
System.out.println(e.getMessage());
}
IProjectDescription description =
root.getWorkspace().newProjectDescription(
newProjectHandle.getName());
try {
newProjectHandle.create(description, null);
newProjectHandle.open(null);
} catch (CoreException e) {
System.out.println(e.getMessage());
}
// add folders, files to this project
// Delete the project
try {
newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE,
null); newProjectHandle.delete(true,true,null);
} catch (CoreException e ) {
System.out.println(e.getMessage());
}
|
|
|
Powered by
FUDForum. Page generated in 0.02761 seconds