[jira] [Resolved] (VFS-291) ZIP archives are not properly closed after unzipping and cannot be deleted until the JVM exists

2017-07-19 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/VFS-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory resolved VFS-291.
--
   Resolution: Fixed
Fix Version/s: 2.2

Fixed in svn trunk. Please verify and close from svn trunk or 
https://repository.apache.org/content/repositories/snapshots/

{noformat}
commit -m "[VFS-291] ZIP archives are not properly closed after unzipping and 
cannot be deleted until the JVM exists." -N 
C:/vcs/svn/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
 C:/vcs/svn/apache/commons/trunks-proper/vfs/src/changes/changes.xml 
C:/vcs/svn/apache/commons/trunks-proper/vfs/core/src/main/java/org/apache/commons/vfs2/provider/zip/ZipFileObject.java
Sending
C:/vcs/svn/apache/commons/trunks-proper/vfs/core/src/main/java/org/apache/commons/vfs2/provider/zip/ZipFileObject.java
Sending
C:/vcs/svn/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
Sending
C:/vcs/svn/apache/commons/trunks-proper/vfs/src/changes/changes.xml
Transmitting file data ...
Unknown action received: commit finalizing
Committed revision 1802443.
{noformat}


> ZIP archives are not properly closed after unzipping and cannot be deleted 
> until the JVM exists
> ---
>
> Key: VFS-291
> URL: https://issues.apache.org/jira/browse/VFS-291
> Project: Commons VFS
>  Issue Type: Bug
> Environment: Windows
>Reporter: Roman
>Priority: Critical
>  Labels: patch
> Fix For: 2.2
>
> Attachments: AbstractFileObject.java.2.patch, 
> AbstractFileObject.java.patch, FileLockUnitTest.diff, vfs-291.diff, 
> ZipCloseBug.zip, ZipFileObject.java, ZipFileObject.java.patch
>
>
> Open a zip file with the ZipFileObject
> get an inputstream on its content
> try to delete it... 
> it fails.
> I have attached a possible solution to this bug.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (VFS-291) ZIP archives are not properly closed after unzipping and cannot be deleted until the JVM exists

2017-07-19 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/VFS-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory updated VFS-291:
-
Summary: ZIP archives are not properly closed after unzipping and cannot be 
deleted until the JVM exists  (was: An zip archive is not properly closed after 
unzipping. And thous cannot be delted until the JVM dies)

> ZIP archives are not properly closed after unzipping and cannot be deleted 
> until the JVM exists
> ---
>
> Key: VFS-291
> URL: https://issues.apache.org/jira/browse/VFS-291
> Project: Commons VFS
>  Issue Type: Bug
> Environment: Windows
>Reporter: Roman
>Priority: Critical
>  Labels: patch
> Attachments: AbstractFileObject.java.2.patch, 
> AbstractFileObject.java.patch, FileLockUnitTest.diff, vfs-291.diff, 
> ZipCloseBug.zip, ZipFileObject.java, ZipFileObject.java.patch
>
>
> Open a zip file with the ZipFileObject
> get an inputstream on its content
> try to delete it... 
> it fails.
> I have attached a possible solution to this bug.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread alphacome (JIRA)

 [ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

alphacome updated COMPRESS-417:
---
Attachment: (was: 2102.+0800-2102.0015+0800_0.tar.gz)

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
>  Labels: tar
> Fix For: 1.15
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread alphacome (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16094014#comment-16094014
 ] 

alphacome commented on COMPRESS-417:


[~bodewig], I 've tried 1.15-SNAPSHOT.  issue is fixed. many thx for your 
support. 

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
>  Labels: tar
> Fix For: 1.15
>
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (VFS-291) An zip archive is not properly closed after unzipping. And thous cannot be delted until the JVM dies

2017-07-19 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/VFS-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16093990#comment-16093990
 ] 

Gary Gregory commented on VFS-291:
--

I added org.apache.commons.vfs2.provider.zip.test.FileLockTestCase with @Ignore.

> An zip archive is not properly closed after unzipping. And thous cannot be 
> delted until the JVM dies
> 
>
> Key: VFS-291
> URL: https://issues.apache.org/jira/browse/VFS-291
> Project: Commons VFS
>  Issue Type: Bug
> Environment: Windows
>Reporter: Roman
>Priority: Critical
>  Labels: patch
> Attachments: AbstractFileObject.java.2.patch, 
> AbstractFileObject.java.patch, FileLockUnitTest.diff, vfs-291.diff, 
> ZipCloseBug.zip, ZipFileObject.java, ZipFileObject.java.patch
>
>
> Open a zip file with the ZipFileObject
> get an inputstream on its content
> try to delete it... 
> it fails.
> I have attached a possible solution to this bug.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (VFS-639) Update Apache Commons Compress from 1.13 to 1.14

2017-07-19 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/VFS-639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory closed VFS-639.

Resolution: Fixed

In svn trunk.

> Update Apache Commons Compress from 1.13 to 1.14
> 
>
> Key: VFS-639
> URL: https://issues.apache.org/jira/browse/VFS-639
> Project: Commons VFS
>  Issue Type: Improvement
>Affects Versions: 2.1
> Environment: Update Apache Commons Compress from 1.12 to 1.13.
>Reporter: Gary Gregory
> Fix For: 2.2
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (VFS-639) Update Apache Commons Compress from 1.13 to 1.14

2017-07-19 Thread Gary Gregory (JIRA)
Gary Gregory created VFS-639:


 Summary: Update Apache Commons Compress from 1.13 to 1.14
 Key: VFS-639
 URL: https://issues.apache.org/jira/browse/VFS-639
 Project: Commons VFS
  Issue Type: Improvement
Affects Versions: 2.1
 Environment: Update Apache Commons Compress from 1.12 to 1.13.
Reporter: Gary Gregory
 Fix For: 2.2






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (VFS-629) Update Apache Commons Compress from 1.12 to 1.13.

2017-07-19 Thread Gary Gregory (JIRA)

 [ 
https://issues.apache.org/jira/browse/VFS-629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory closed VFS-629.

   Resolution: Fixed
Fix Version/s: 2.2

In svn trunk from a while back. Just forgot to close this issue.

> Update Apache Commons Compress from 1.12 to 1.13.
> -
>
> Key: VFS-629
> URL: https://issues.apache.org/jira/browse/VFS-629
> Project: Commons VFS
>  Issue Type: Improvement
>Affects Versions: 2.1
>Reporter: Gary Gregory
>Assignee: Gary Gregory
> Fix For: 2.2
>
>
> Update Apache Commons Compress from 1.12 to 1.13.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (CLI-278) Missing getParsedOptionValue which takes default value

2017-07-19 Thread Paul Suchko (JIRA)

 [ 
https://issues.apache.org/jira/browse/CLI-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul Suchko updated CLI-278:

Component/s: (was: CLI-2.x)
 CLI-1.x

> Missing getParsedOptionValue which takes default value
> --
>
> Key: CLI-278
> URL: https://issues.apache.org/jira/browse/CLI-278
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: CLI-1.x
>Reporter: Paul Suchko
>Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (CLI-278) Missing getParsedOptionValue which takes default value

2017-07-19 Thread Paul Suchko (JIRA)
Paul Suchko created CLI-278:
---

 Summary: Missing getParsedOptionValue which takes default value
 Key: CLI-278
 URL: https://issues.apache.org/jira/browse/CLI-278
 Project: Commons CLI
  Issue Type: Improvement
  Components: CLI-2.x
Reporter: Paul Suchko
Priority: Minor






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-79) Investigate adding string search algorithms

2017-07-19 Thread Amey Jadiye (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16093415#comment-16093415
 ] 

Amey Jadiye commented on TEXT-79:
-

[~kinow], can you please check above links if they are possible usecases *OR*  
if you save some time and find across apache ?

> Investigate adding string search algorithms
> ---
>
> Key: TEXT-79
> URL: https://issues.apache.org/jira/browse/TEXT-79
> Project: Commons Text
>  Issue Type: New Feature
>Reporter: Bruno P. Kinoshita
>Priority: Minor
>  Labels: algorithm, help-wanted, text
> Fix For: 1.x
>
>
> There are a few [string searching 
> algorithms|https://en.wikipedia.org/wiki/String_searching_algorithm] (e.g. 
> Rabin Karp) that do not have an implementation in commons yet.
> Would be interesting to check if any other ASF projects use any of these or 
> others (e.g. Lucene, Solr, Tika, etc) and see if they could be implemented in 
> [text].



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092944#comment-16092944
 ] 

Stefan Bodewig commented on COMPRESS-417:
-

fixed in master branch, maybe you can try a recent 1.15-SNAPSHOT. I'll close 
this issue once I've got a unit test. It should be easy to create one myself 
should your archive contain sensitive data.

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
>  Labels: tar
> Fix For: 1.15
>
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

 [ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Bodewig updated COMPRESS-417:

Fix Version/s: 1.15

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
>  Labels: tar
> Fix For: 1.15
>
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092936#comment-16092936
 ] 

Stefan Bodewig commented on COMPRESS-417:
-

The archive contains the value "dos" where the "major device number" is 
expected in ustar tar archives. After reading what the GNU tar and BSD tar 
pages say, we should probably ignore devmajor and devminor unless the file type 
is a character or block special file.

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
>  Labels: tar
> Fix For: 1.15
>
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

 [ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Bodewig updated COMPRESS-417:

Labels: tar  (was: )

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
>  Labels: tar
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092928#comment-16092928
 ] 

Stefan Bodewig commented on COMPRESS-417:
-

The problem is inside the tar package as

{code}
public class Untargz {
public static void main(String[] args) throws Exception {
final File input = new File(args[0]);
try (InputStream is = new FileInputStream(input);
 CompressorInputStream in = new GzipCompressorInputStream(is, true);
 OutputStream out = new FileOutputStream("foo.tar")) {
IOUtils.copy(in, out);
}
try (InputStream is = new FileInputStream("foo.tar");
 TarArchiveInputStream tin = new TarArchiveInputStream(is)) {
TarArchiveEntry entry = tin.getNextTarEntry();
while (entry != null) {
File archiveEntry = new File(entry.getName());
archiveEntry.getParentFile().mkdirs();
if (entry.isDirectory()) {
archiveEntry.mkdir();
entry = tin.getNextTarEntry();
continue;
}
try (OutputStream out = new FileOutputStream(archiveEntry)) {
IOUtils.copy(tin, out);
}
entry = tin.getNextTarEntry();
}
}
}
{code}

fails for me and {{foo.tar}} is a valid archive.

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092928#comment-16092928
 ] 

Stefan Bodewig edited comment on COMPRESS-417 at 7/19/17 10:57 AM:
---

The problem is inside the tar package as

{code}
public class Untargz {
public static void main(String[] args) throws Exception {
final File input = new File(args[0]);
try (InputStream is = new FileInputStream(input);
 CompressorInputStream in = new GzipCompressorInputStream(is, true);
 OutputStream out = new FileOutputStream("foo.tar")) {
IOUtils.copy(in, out);
}
try (InputStream is = new FileInputStream("foo.tar");
 TarArchiveInputStream tin = new TarArchiveInputStream(is)) {
TarArchiveEntry entry = tin.getNextTarEntry();
while (entry != null) {
File archiveEntry = new File(entry.getName());
archiveEntry.getParentFile().mkdirs();
if (entry.isDirectory()) {
archiveEntry.mkdir();
entry = tin.getNextTarEntry();
continue;
}
try (OutputStream out = new FileOutputStream(archiveEntry)) {
IOUtils.copy(tin, out);
}
entry = tin.getNextTarEntry();
}
}
}
}
{code}

fails for me and {{foo.tar}} is a valid archive.


was (Author: bodewig):
The problem is inside the tar package as

{code}
public class Untargz {
public static void main(String[] args) throws Exception {
final File input = new File(args[0]);
try (InputStream is = new FileInputStream(input);
 CompressorInputStream in = new GzipCompressorInputStream(is, true);
 OutputStream out = new FileOutputStream("foo.tar")) {
IOUtils.copy(in, out);
}
try (InputStream is = new FileInputStream("foo.tar");
 TarArchiveInputStream tin = new TarArchiveInputStream(is)) {
TarArchiveEntry entry = tin.getNextTarEntry();
while (entry != null) {
File archiveEntry = new File(entry.getName());
archiveEntry.getParentFile().mkdirs();
if (entry.isDirectory()) {
archiveEntry.mkdir();
entry = tin.getNextTarEntry();
continue;
}
try (OutputStream out = new FileOutputStream(archiveEntry)) {
IOUtils.copy(tin, out);
}
entry = tin.getNextTarEntry();
}
}
}
{code}

fails for me and {{foo.tar}} is a valid archive.

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 

[jira] [Updated] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

 [ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Bodewig updated COMPRESS-417:

Component/s: (was: Compressors)
 Archivers

> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Archivers
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (COMPRESS-417) Decompress tar.gz file failed. java.io.Exception:Error detected parsing the header

2017-07-19 Thread Stefan Bodewig (JIRA)

[ 
https://issues.apache.org/jira/browse/COMPRESS-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092923#comment-16092923
 ] 

Stefan Bodewig commented on COMPRESS-417:
-

I didn't mean to use the tar command, but rather {{TarArchiveInputStream}}, 
I'll have a look myself.

The somewhat good news is I can reproduce the error.

Does the archive containing anything sensitive or would it be OK to ship it 
with Compress' unit tests?


> Decompress tar.gz file failed. java.io.Exception:Error detected parsing the 
> header
> --
>
> Key: COMPRESS-417
> URL: https://issues.apache.org/jira/browse/COMPRESS-417
> Project: Commons Compress
>  Issue Type: Bug
>  Components: Compressors
>Affects Versions: 1.14
>Reporter: alphacome
>Priority: Critical
> Attachments: 2102.+0800-2102.0015+0800_0.tar.gz
>
>
> {code:java}
> public static void deGzipArchive(String filepath,String dir)
> throws Exception {
> final File input = new File(filepath);
> final InputStream is = new FileInputStream(input);
> final CompressorInputStream in = new GzipCompressorInputStream(is, 
> true);
> TarArchiveInputStream tin = new TarArchiveInputStream(in);
> TarArchiveEntry entry = tin.getNextTarEntry();
> while (entry != null) {
> File archiveEntry = new File(dir, entry.getName());
> archiveEntry.getParentFile().mkdirs();
> if (entry.isDirectory()) {
> archiveEntry.mkdir();
> entry = tin.getNextTarEntry();
> continue;
> }
> OutputStream out = new FileOutputStream(archiveEntry);
> IOUtils.copy(tin, out);
> out.close();
> entry = tin.getNextTarEntry();
> }
> in.close();
> tin.close();
> }
> public static void main(String[] args) throws Exception {
> 
> Gztest.deGzipArchive("D:/2102.+0800-2102.0015+0800_0.tar.gz","D:/");
> }
> {code}
> the tar.gz file can be decompressed in linux environment use 'tar' command.
> The error log:
> Exception in thread "main" java.io.IOException: Error detected parsing the 
> header
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:286)
>   at gztest.deGzipArchive(gztest.java:23)
>   at gztest.main(gztest.java:149)
> Caused by: java.lang.IllegalArgumentException: Invalid byte 100 at offset 0 
> in 'dos{NUL}{NUL}{NUL}{NUL}{NUL}' len=8
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:141)
>   at 
> org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:171)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1128)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:1091)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:368)
>   at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:284)
>   ... 2 more
>   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CLI-179) Needs "standalone" options that can be used even if required options are not set

2017-07-19 Thread Emmanuel Bourg (JIRA)

[ 
https://issues.apache.org/jira/browse/CLI-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092863#comment-16092863
 ] 

Emmanuel Bourg commented on CLI-179:


[~iweiss] That's only the first pass. If the parsing fails because --help and 
--version are missing, you catch the exception and run a second pass with the 
other options.

> Needs "standalone" options that can be used even if required options are not 
> set
> 
>
> Key: CLI-179
> URL: https://issues.apache.org/jira/browse/CLI-179
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: Parser
>Affects Versions: 1.2
>Reporter: Joël Royer
> Attachments: CLI-179.patch
>
>
> it is currently impossible to have options like "help" or "version" if we 
> also have some required options. The parsing results in an error "Missing 
> parameters".
> But for an "help" or "version" option, it would be usefull to display the 
> wanted information, even if required options are not set.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (CLI-179) Needs "standalone" options that can be used even if required options are not set

2017-07-19 Thread Ingo Weiss (JIRA)

[ 
https://issues.apache.org/jira/browse/CLI-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092834#comment-16092834
 ] 

Ingo Weiss edited comment on CLI-179 at 7/19/17 9:22 AM:
-

[~ebourg], I don't quite understand your suggestion here. If I set the option 
group as required then it will require to have a --help or --version but that 
doesn't translate to "if --help or --version are provided, skip the required 
options list outside this option group".

Here is a practical example:
{noformat}
java -jar app.jar --help
Missing required options: s, t
usage: server-migration [-e ] [-h] [-i ] -s 
 -t 
 -e,--environmentenv
 -h,--help help
 -i,--interactive  int
 -s,--source   src
 -t,--target   tgt
{noformat}

If I provide -s and -t then all is fine and help is printed as expected. If I 
don't provide any options, than this message is correct, s and t are indeed 
missing.


was (Author: iweiss):
[~ebourg], I don't quite understand your suggestion here. If I set the option 
group as required then it will require to have a --help or --version but that 
doesn't translate to "if --help or --version are provided, skip the required 
options list outside this option group".

> Needs "standalone" options that can be used even if required options are not 
> set
> 
>
> Key: CLI-179
> URL: https://issues.apache.org/jira/browse/CLI-179
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: Parser
>Affects Versions: 1.2
>Reporter: Joël Royer
> Attachments: CLI-179.patch
>
>
> it is currently impossible to have options like "help" or "version" if we 
> also have some required options. The parsing results in an error "Missing 
> parameters".
> But for an "help" or "version" option, it would be usefull to display the 
> wanted information, even if required options are not set.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CLI-179) Needs "standalone" options that can be used even if required options are not set

2017-07-19 Thread Ingo Weiss (JIRA)

[ 
https://issues.apache.org/jira/browse/CLI-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16092834#comment-16092834
 ] 

Ingo Weiss commented on CLI-179:


[~ebourg], I don't quite understand your suggestion here. If I set the option 
group as required then it will require to have a --help or --version but that 
doesn't translate to "if --help or --version are provided, skip the required 
options list outside this option group".

> Needs "standalone" options that can be used even if required options are not 
> set
> 
>
> Key: CLI-179
> URL: https://issues.apache.org/jira/browse/CLI-179
> Project: Commons CLI
>  Issue Type: Improvement
>  Components: Parser
>Affects Versions: 1.2
>Reporter: Joël Royer
> Attachments: CLI-179.patch
>
>
> it is currently impossible to have options like "help" or "version" if we 
> also have some required options. The parsing results in an error "Missing 
> parameters".
> But for an "help" or "version" option, it would be usefull to display the 
> wanted information, even if required options are not set.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)