Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 15894 - Move folder overwrites destination
Summary: Move folder overwrites destination
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 9814 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-13 15:34 EDT by Rodrigo Peretti CLA
Modified: 2002-09-05 17:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Peretti CLA 2002-05-13 15:34:24 EDT
build 20020510

Example workspace:

Project
 - A
   - B
     - C.txt
 - X
   - A
     - Y
       - Z.txt

In the navigator, if I move X/A to Project, a dialog shows up asking if I want 
to overwrite Project/A. If the answer is Yes, it deletes the Project/A and 
moves X/A to Project/A.

Expected result was a merge having the following workspace as a result:

Project
 - A
   - B
     - C.txt
   - Y
     - Z.txt

This is the result provided by Windows Explorer. Windows explorer DOES ask the 
same question about overwriting the folder A but it does not delete the 
destination folder. It merges the final result.
The current behaviour can lead to user data being lost.
Comment 1 Nick Edgar CLA 2002-05-13 17:00:05 EDT
This is a major problem since it risks losing the user's work.
This has been reported before, and we should address it for 2.0 if at all 
possible.
Comment 2 Randy Giffen CLA 2002-05-15 13:42:28 EDT
We perform the copy folder as a single operation. We need to do one file at a 
time. See performCopyWithAutoRename.
Comment 3 Randy Giffen CLA 2002-05-15 13:43:23 EDT
Lynne, Nick asked if you could look at this for me. Thanks
Comment 4 Lynne Kues CLA 2002-05-16 18:22:37 EDT
Happens under both Move and Copy actions.
Comment 5 Lynne Kues CLA 2002-05-17 10:30:57 EDT
Explorer Win2K tells you that you are doing a folder replace and tells you that 
any files in the existing folder have the same names as files in the folder you 
are moving/copying, these files will be replaced, and gives you the options of 
yes, yes to all, no, cancel.
Comment 6 Nick Edgar CLA 2002-05-17 11:42:17 EDT
This is the behaviour we want.  It should merge the folders rather than wiping 
out the dest first.
Comment 7 Lynne Kues CLA 2002-05-17 18:00:19 EDT
Knut to wrap up on Monday.  Waiting on NE for okay on paste code.  Made similar 
changes for MoveResourceAction.
Comment 8 Knut Radloff CLA 2002-05-20 19:13:43 EDT
Copied fix from CopyFilesAndFoldersOperation to CopyResourceAction. Should 
refactor at some point since the two are very similar.
Cleaned up exception handling in all three actions/operations. copy/move no 
longer returns a return code but just lets CoreExceptions drop through to 
performCopy where they are logged and false is returned.
As part of this the move operation no longer deletes the source folder if 
moving the contents failed. This could have led to data loss.
Comment 9 Knut Radloff CLA 2002-05-20 19:16:50 EDT
Opened bug 16500 for the refactoring.
Comment 10 Knut Radloff CLA 2002-09-05 17:34:50 EDT
*** Bug 9814 has been marked as a duplicate of this bug. ***