Hello Karl-Heinz On 2018-03-13, Karl Heinz Marbaise wrote:
> Is there an option to have a callback function / listener which can be > used to produce a kind of progress during decompressing archives > (zip's, tar, gz, etc.) ? No, there isn't. There is an enhancement request to add something like that for the decompression algorithms https://issues.apache.org/jira/browse/COMPRESS-207 (actually the request was for bzip2 specifically) and I even implemented a branch containing a possible solution https://github.com/apache/commons-compress/blob/COMPRESS-207/src/main/java/org/apache/commons/compress/compressors/CompressionProgressListener.java but development never completed for one reason or the other. For the archiving formats we haven't even ever thought of adding something like that. One problem with progress indicators is you need to have an idea of how close you are to done. In the case of the compression formats you surprisingly often don't know the decompressed size at all until you are done decompressing. Likewise you have no idea how many files an archive contains until you've read it completely for many formats (ZipFile and 7z are the main exceptions because we rely on random access and their central directory). Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
