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

Bug 389764

Summary: import local file: no way to import a zip without unzipping it
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: antonm
Version: 0.5   
Target Milestone: 1.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2012-09-17 16:26:55 EDT
I was trying to import a zip into my workspace without actually unzipping it.  We are now allowing plugins to specify a zip file that contains a content template for a new project.  I wanted to store one of these template zip files in Orion.  But if I try to use "Import local file..." it assumes I want to unzip a zip file.  Can we have an option to not unzip it?
Comment 1 Susan McCourt CLA 2012-09-17 16:40:15 EDT
I can take this.  The dialog is deciding what to do based on filetype.  Instead, I think we need a checkbox that could default based on file type but could be changed.  This serves two purposes:  

- allows zip files to be uploaded as is
- allows compressed files with different extensions (gzip, tar, etc.) to be unpacked by the server.
Comment 2 Susan McCourt CLA 2012-09-18 11:37:03 EDT
I talked to John about what the server does.  It doesn't care about file name.  It is using java.util.zip.ZipFile which in theory could handle gzip but it would take special code.  So zip format is all we support at the moment, but we agree it makes sense to let the user control whether we try to zip or not, using the extension to determine the default value.
Comment 3 Susan McCourt CLA 2012-09-18 15:08:40 EDT
Fixed with
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=9040edf74538c15b61e52043afa67d54fa18303f

There is now a checkbox in the drag and drop section that can be used to specify whether zip files are automatically unzipped.  

At first I was going to remove the checking for "*.zip" altogether and make the user explicitly choose whether to unzip the file or not, but this really penalizes the user who liked the old behavior of automatic unzipping.  Since what we're trying to do is get the 80% case right, it makes sense to always unzip a *.zip file and let the user opt out of that behavior.

This doesn't solve the problem of unzipping something that is not called "*.zip" but since we don't explicitly support gzip yet, this is less important than getting the 80% case right.

Some day if we support lots of different formats, we can either expand our type checking or make it explicit for the user.

I also changed "import from URL" to use the same logic.  instead of interpreting the checkbox to be explicit for unzipping or not, the checkbox now determines whether zip files will be automatically unzipped.
Comment 4 Susan McCourt CLA 2012-09-21 11:13:54 EDT
This feature is not fully working yet (see bug 390045) so we aren't going to mention it in particular in the N&N.  Instead, when we describe the content extension point, we'll mention that to get your zip file into Orion you can use the checkbox.