I use it like this in the code.
Project.refreshLocal(IResource.DEPTH_ONE, null); Project.delete(false, true, new NullProgressMonitor());
Then