Bug 29838 - [resources] API: allow #move to merge with existing destination
Summary: [resources] API: allow #move to merge with existing destination
Status: RESOLVED DUPLICATE of bug 31883
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
: 19372 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-20 15:40 EST by Kathy Endres CLA
Modified: 2003-11-18 17:59 EST (History)
3 users (show)

See Also:


Attachments
example newFolder/Java Source/my/pkg/Test2.java (652 bytes, application/octet-stream)
2003-01-27 06:17 EST, Adam Kiezun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Endres CLA 2003-01-20 15:40:57 EST
From the Package Explorer view in a Java perspective:
1. create a Java project, TestJavaProj
2. create a Source Folder in Test Java Proj named Java Source
3. create a Java class in Test Java Proj (Test1 in package my.pkg)
4. import a zip file which contains (newFolder/Java Source/my/pkg/Test2.java) 
into TestJavaProj.
5. to move the imported source file to the correct folder, drag the Java
Source folder under newFolder to TestJavaProj.  Was expecting that this would 
cause the new Java Source directory contents to be merged with the original Java 
Source directory contents (created in step 2); however, all of the original 
contents are now deleted (my.pkg.Test1 no longer exists).  A prompt appeared 
asking "do you want to overwrite", but thought this meant "do you want to 
replace any files that may already exist in the folder", not "we're going to 
wipe out everything in the folder and only keep your new stuff".
When you try the same scenario in the Navigator view, a folder "copy of Java 
Source" gets created, so you don't lose what was in Java Source.  And in Windows 
Explorer, if you drag a Java Source folder that contains Test2.java onto a 
folder (Folder1) that contains Java Source/Test1.java, a prompt appears saying, 
"This folder already contains a folder named 'Java Source'. If the files in the 
existing folder have the same name as files in the folder you are moving or 
copying, they will be replaced.  Do you still want to copy the folder?" So, 
Windows Explorer clearly describes what is meant by overwrite and performs a 
replace only if files of the same name are encountered.

So, in summary, drag/drop or copy/cut/paste of a folder within the 
Package Explorer view overwrites existing folder contents instead of merging 
contents (when files in one folder do NOT share file names with files in the 
other folder).  The prompt does not clearly explain what is meant by overwrite 
too, so users who may expect a merge to occur (when files names do not conflict 
between folders) will be disappointed when the contents of their original folder 
are lost/deleted.
Comment 1 Dirk Baeumer CLA 2003-01-21 04:12:59 EST
Adam, can you please have a look. I would also expect that Test1.java still 
exists after the operation. That would be consistent with normal Explorer 
behavior.
Comment 2 Adam Kiezun CLA 2003-01-27 05:59:53 EST
will have a look
Comment 3 Adam Kiezun CLA 2003-01-27 06:17:26 EST
Created attachment 3154 [details]
example newFolder/Java Source/my/pkg/Test2.java
Comment 4 Adam Kiezun CLA 2003-01-27 06:41:53 EST
imo, this should be handled in core - 
IResource.move should have a flag that, when set, merges folders.
it's strange that the ui has to do workarounds for this limitation

suggest doing nothing for now - putting all these workarounds for missing core 
function would be risky at this point i think

the existing code assumed that IResource.move would do the right thing, but it 
was wrong
Comment 5 Adam Kiezun CLA 2003-01-27 07:00:22 EST
asking core for comment on the suggested MERGE_FOLDERS flag for move
Comment 6 DJ Houghton CLA 2003-02-04 13:38:11 EST
Old Summary:
[resources] replace instead of copy/merge being performed within Package
Explorer [ccp] [dnd]

Changed summary to reflect request.
Not for 2.1
Comment 7 Dirk Baeumer CLA 2003-02-12 13:43:00 EST
*** Bug 19372 has been marked as a duplicate of this bug. ***
Comment 8 DJ Houghton CLA 2003-11-18 17:59:14 EST
Re-opening for investigation.
Comment 9 DJ Houghton CLA 2003-11-18 17:59:55 EST
Marking as duplicate since both methods should be changed at the same time.

*** This bug has been marked as a duplicate of 31883 ***