You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Bear Giles <bg...@coyotesong.com> on 2015/12/13 18:28:41 UTC

[COMPRESS] PKWare header questions

1. I created the PKWareExtraHeader as a marker - it should make it clear
that the headers will only be present in PKWare-created files and everyone
else can ignore them. This is in contract to other headers that are much
more standard. It was an oversight if this got lost when I had to refork
the project.

2. ExtraFieldUtils and Tests - I'm not that familiar with the code since
I'm more focused on the crypto than the general functionality. The former
is an oversight. The latter is something that stumped me. During
development I had System.out statements that verified I was reading the
expected values but we obviously don't want to leave that in the final
code. Is there a way to read a file and then inspect all of the headers
within the test framework?

Bear

Re: [COMPRESS] PKWare header questions

Posted by Stefan Bodewig <bo...@apache.org>.
On 2015-12-13, Bear Giles wrote:

> 1. I created the PKWareExtraHeader as a marker - it should make it clear
> that the headers will only be present in PKWare-created files and everyone
> else can ignore them.

OK, understood. I'll add a few sentences as javadocs.

> 2. ExtraFieldUtils and Tests - I'm not that familiar with the code since
> I'm more focused on the crypto than the general functionality. The former
> is an oversight.

OK, easily fixed ;-)

> The latter is something that stumped me. During development I had
> System.out statements that verified I was reading the expected values
> but we obviously don't want to leave that in the final code. Is there
> a way to read a file and then inspect all of the headers within the
> test framework?

I wouldn't call our tests a framework, they've somewhat grown into
existence. You may want to look at the existing extra field tests. Some
of then mainly parse byte[] and try to verify roudtrips work (if they
can be read and written). Some are accompanied by small ZIP archives
that get read.  X5455_ExtendedTimestampTest is an example that performs
both kinds of tests.

If you've got an archive to share that exhibits all the headers we now
can parse thanks to your code, then it should be straight forward to
assert their contents mich the same way
X5455_ExtendedTimestampTest#testSampleFile works.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org