Hi Stefan,
On 14/03/18 09:03, Stefan Bodewig wrote:
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).
First thanks for your answer and to be honest I exaclty had expected
such kind of answer ;-) (except for the part COMPRESS-207)..
I understand the issues related to the reference point on which you say
you have for example 20% done (of what?)...
What about simply saying to make the reference on the whole file size
and how much you already have read.
This is of course not representing a progress related to number of files
or compressed/decompressed size etc. but could give a good impression
where you currently are...
And on the other hand I think it would work for all archive formats...
Kind regards
Karl Heinz Marbaise
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]