Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 407512

Summary: Zip import overrides existing files
Product: [ECD] Orion Reporter: Malgorzata Janczarska <malgorzata.tomczyk>
Component: ServerAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, Szymon.Brandys
Version: 3.0   
Target Milestone: 3.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Malgorzata Janczarska CLA 2013-05-08 05:35:08 EDT
Zip import and possibly other imports like SFTP may override existing files without asking. This is inconsistent with our Copy action that forbids to copy a directory when it  may overwrite existing directories. It is especially harmful if the overwritten files are some metadata files like .git directory. This usually causes malfunction of some functionality depending on them.
I suggest we fail zip import when there are files that could be overwritten, but add a exclude parameter for some metadata files that will just be ignored when importing the zip file, those could be contributed by some extensions, like filter, similar like in Bug 407508. We can also of cause add "force" parameter to indicate that we want the files to be overwritten, but it should not be invoked by default.
Comment 1 Malgorzata Janczarska CLA 2013-05-08 13:25:56 EDT
Fixed.
I added a check if the destination exists. If yes the file is skipped and added to a list returned to the user. All files are imported except the ones that would override existing files.
I added a force parameter where import works as it used to.
When there are files that would be overwritten I display the message for the user with a question if he wants to override the files. If answer is yes, then I retry with force option.
There is also the same parameter as in bug Bug 407508. If we add it files from the list will be ignored.