Details
-
Type:
Wish
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: plexus-archiver
-
Labels:None
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
It would be nice to have a finer grain API to setup the permissions of files and directories than setDefault*Mode();
I realize it is possible to do it by adding each file that requires non default permissions explicitly to the archive.
However it seems like it would be nice to be able to do this:
AbstractArchiver za = new TarArchiver();
TarLongFileMode tarFileMode = new TarLongFileMode();
tarFileMode.setValue(TarLongFileMode.GNU);
((TarArchiver)za).setLongfile(tarFileMode);
Map EXEC_ENTRIES_FOR_MAC = new HashMap();
EXEC_ENTRIES_FOR_MAC.put("eclipse/Eclipse.app/Contents/MacOS/eclipse", new Integer(0755));
za.setEntriesWithNonDefaultPermission(EXEC_ENTRIES_FOR_MAC);
TarCompressionMethod comp = new TarCompressionMethod();
comp.setValue("gzip");
((TarArchiver)za).setCompression(comp);
Attached is the patch to plexus-archive that lets me do just that.
I am using it for tar.gz.
I have inserted 2 small test cases: one for tar.gz and another one for zip.
Let me know if you are interested and or would like me to revise it.
Thanks for your attention.
Sorry the first patch did not have the test for zip and needed some cleanup too.