| Summary: | [Navigator] Need to avoid delete before overwriting file | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Nick Edgar <n.a.edgar> |
| Component: | UI | Assignee: | Knut Radloff <knut_radloff> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | jed.anderson |
| Version: | 2.1 | ||
| Target Milestone: | 2.1 M4 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Nick Edgar
Sorry, the details are in bug 21666. This is needed for 2.1 M4. We should fix the cases we can while waiting for the new copy/move Core APIs: change any occurrences of delete/create to validateEdit/setContents. It seems that the there is no agreement yet on adding OVERWRITE flag for copy/move vs. using setContents. Discussed in bug 27184. *** Bug 21666 has been marked as a duplicate of this bug. *** Basically the semantics of copy in the case of overwrite are really unclear. Even in the non-overwrite case, the semantics are somewhat funny in that it copies persistent properties, but not session properties or markers. Until these issues are sorted out, the safer option is to just use setContents. This will at least not wipe out any persistent properties already on the dest. If the user really wants persistent properties copied from the source to replace those on the dest, they can manually delete the dest then copy. Fixed copy/move resource case with the following assumptions: 1. deleting the source after a move/setContents does not need to call validateEdit 2. an ERROR result from IWorkspace.validateEdit means the file validation was cancelled or the files could not be made read/write. 3. when passing multiple files to validateEdit and some files were rejected while others were made read/write the return status is a multi status. Further, The order of the status children must match that of the files that were passed in. See bug 28216 for details. Fixed import cases (using wizard, paste, drag and drop). Changed ImportOperation to prompt for overwrite and validateEdit before starting the import. Added ImportOperation.setContext API to set a context for the validateEdit call. The behavior when deselecting all verified files in the prompting dialog is unexpected. The return status is the same as when pressing cancel. This means that when importing multiple files the operation will be cancelled if all validated files are deselected. Files that don't need to be validated will also be cancelled which is wrong. See bug 28313. |