Summary: | [UI] Impossible to delete a read only project (1GF7Y2S) | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Tod Creasey <Tod_Creasey> |
Component: | Resources | Assignee: | John Arthorne <john.arthorne> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0 | ||
Target Milestone: | 2.0 M2 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Tod Creasey
2001-10-10 22:37:03 EDT
PRODUCT VERSION: 122 Wasn't this one fixed in the 1.0 patch? Just checked in the wswb rollup - this problem still existed in the 1.0 refresh. This is a Core bug We are calling the IProject.delete with the delete contents flag set to false. The bug lies in the following method of Project. Note that path.toFile().delete() is being called relying on the fact that it will not be deleted if it has contents. However this is causing the OS level write protect error dialog to appear. If I say ignore (WinNT - I get two dialogs), then the Project is successfully deleted from the workspace. /** * Deletes everything but contents. Needed for restore where we do not find * the .prj file. Also used from #delete. */ public void basicDelete(MultiStatus status) throws CoreException { // get the location first because it will be null after we delete the // project from the tree. IPath path = getLocation(); deleteResource(false, status); // Delete the contents directory for the project. Note that this is a garbage // collection action only, and the directory will not get deleted if it still // contains files. if (path != null) path.toFile().delete(); workspace.getMetaArea().delete(this); clearHistory(null); } I could not reproduce with the CD-ROM, but I received the following steps from Randy which reproduce the bug on Win2000: 1) Create a folder with a couple files on the floppy 2) Remove the floppy and move its tab to read-only 3) Replace the floppy and create a project targeted to the floppy folder. 4) Try to delete the project, say "No" to delete content. You get an OS dialog saying the disk is write-protected. This doesn't make sense to the user because he said not to delete content. Fixed, tested and released. Fix was to remove the call to delete() from the basicDelete method. It was only a cleanup operation to remove the directory if empty. It is more appropriate to just leave the empty directory if the caller has specified not to delete contents. |