harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Myers <am2...@gmail.com>
Subject Re: Jar tool?
Date Thu, 30 Jul 2009 10:02:52 GMT
Hi Oliver,

Thanks for the feedback.

I suspect the reason it is returning -1 is because I am not calling the
setSize method on the ZipEntry when I create it.  There's a few other
setters I think I need to call that I'm not, such as

setCompressedSize
setMethod

and probably some others

If anyone can give me a hand with this I would very much appreciate a nudge
in the right direction.

I'll fix the other issue with the buffering - that one I do know how to do
:-)

Andrew.

2009/7/30 Oliver Deakin <oliver.deakin@googlemail.com>

> Hi Andrew,
>
> I've applied the patch from HARMONY-6255 now and it's looking good. The
> only slightly strange thing I've noticed is that when I create an archive
> with a command line something like:
>
> jar -cf foo.jar HelloWorld.class
>
> and then list it's contents with "jar -tvf foo.jar", I get -1 as the size
> of the ZipEntry for some reason:
>
> >target\hdk\jdk\bin\jar -tf foo.jar
>   -1 Thu Jul 30 09:46:38 GMT+01:00 2009 HelloWorld.class
>
> However, if I run with jar from the RI it displays the ZipEntry size
> correctly:
>  717 Thu Jul 30 09:46:38 BST 2009 HelloWorld.class
>
> In the listJar() method we use ze.getSize() to get the ZipEntry size to
> display, which works for jars not packed by our own jar tool. Any idea why
> it wouldn't work for jars packed by our jar?
>
>
> Just a quick note on the processFile() method - I notice that it reads the
> entire file to be packed into a buffer and then writes it all out again in
> one go. This is ok for small files, but I could see a problem when we get to
> packing files which are very large - do you think it would be better to have
> a predefined buffer size here (say 1000 bytes) and read/write in a loop, one
> chunk at a time? We can use the return value from FileInputStream.read() to
> tell us how many bytes have been read and then pass this value to
> ZipOutputStream.write().
>
> Regards,
> Oliver
>
>
> Oliver Deakin wrote:
>
>> No problem Andrew :)
>>
>> Regards,
>> Oliver
>>
>> Andrew Myers wrote:
>>
>>> I might have worked this out myself.  Sorry I'm so slow with this - but I
>>> am
>>> progressing.  I will have something to show tomorrow I hope.
>>>
>>> 2009/6/16 Oliver Deakin <oliver.deakin@googlemail.com>
>>>
>>>
>>>
>>>> Hi Andrew,
>>>>
>>>> Great to hear you've got back into the jar tool! I think the best thing
>>>> is
>>>> to direct your questions to the dev@ list, however simple or complex
>>>> they
>>>> may be. Everyone here is happy to help, and you'll receive answers
>>>> quicker
>>>> and get more ideas/opinions when the whole list can see your mails.
>>>>
>>>> Regards,
>>>> Oliver
>>>>
>>>> Andrew Myers wrote:
>>>>
>>>>
>>>>
>>>>> Hi Oliver,
>>>>>
>>>>> Just letting you know that I've commenced work on the Jar Tool again.
>>>>>
>>>>> It's a bit more complicated than I first expected (processing wildcards
>>>>> and
>>>>> nested directories in particular).  I wouldn't mind a bit of a hand
>>>>> with
>>>>> this, if anyone is willing to assist.  My questions might be a little
>>>>> "newbie-ish" so I wasn't sure whether to ask on the list or take it
>>>>> off-list
>>>>> with some nice person(s) who are willing to help out.  What's the
>>>>> protocol
>>>>> here?
>>>>>
>>>>> Thanks!
>>>>> Andrew.
>>>>>
>>>>> 2009/5/12 Oliver Deakin <oliver.deakin@googlemail.com>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi Andrew,
>>>>>>
>>>>>> Did you get the paperwork completed ok? Is there anything we can
give
>>>>>> you
>>>>>> a
>>>>>> hand with?
>>>>>>
>>>>>> Regards,
>>>>>> Oliver
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Oliver Deakin
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>>> 741598. Registered office: PO Box 41, North Harbour, Portsmouth,
>>>> Hampshire
>>>> PO6 3AU
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
> --
> Oliver Deakin
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
> PO6 3AU
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message