This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 205771

Summary: File > Import/Export Project > From/To ZIP
Product: projects Reporter: Jesse Glick <jglick>
Component: Generic Projects UIAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: normal CC: anebuzelsky, ilia
Priority: P3 Keywords: PLAN, UI
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Suggested patch

Description Jesse Glick 2011-12-01 13:08:53 UTC
contrib/projectpackager has a useful bit of functionality that has long been missing from the standard UI - the ability to export a project as a single ZIP file easily shared via (say) email, and correspondingly the ability to point to a downloaded ZIP and with one action unpack it (somewhere) and open it as a project in the IDE.

Possible features:

1. Automatically exclude build and private dirs (i.e. SharabilityQuery.NOT_SHARABLE).

2. Automatically include nested projects when a parent project is selected.

3. Permit multiple sibling projects to be packed.

4. Check if the (parent) project is the root of a DVCS (Hg, Git) and if so offer to create a history bundle instead (checking for local modifications first). Perhaps even offer to initialize the project as a DVCS.

5. The existing module supports sending the ZIP as an email attachment, though this relies on the user configuring SMTP in their IDE, which is awkward; and the RFC used by Desktop.mail(URI) is not sufficiently powerful to create a message with an attachment.

Note: File > Import/Export Project matches existing menu structure best, though in some ways this functionality better belongs in the Team menu - a lightweight SCM alternative akin to Local History.
Comment 1 Jesse Glick 2011-12-29 23:48:17 UTC
Implemented 1-3, and a brief note for 4. Skipping 5.

core-main #3e606e6d59a2
Comment 2 Quality Engineering 2011-12-31 15:42:59 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/3e606e6d59a2
User: Jesse Glick <jglick@netbeans.org>
Log: #205771: File > Import/Export Project > From/To ZIP.
Comment 3 ilia 2015-08-27 15:03:08 UTC
Created attachment 155695 [details]
Suggested patch
Comment 4 ilia 2015-08-27 15:03:13 UTC
Hi, 

If user selects a full remote C++ project [1] and tries to export it to ZIP -- exception occurs (see bug [2]).
That happens, because FileUtil.toFile(FileObject) returns null for remote fileobjects. 
Is it possible to apply a suggested patch? At least where will be no exception for now.

[1] https://netbeans.org/kb/docs/cnd/remote-modes.html#gmvfz
[2] https://netbeans.org/bugzilla/show_bug.cgi?id=217980

Suggested patch:
 * show an error in the status line instead of throwing NPE

Thanks