zip filesystem provider
Xueming Shen
xueming.shen at oracle.com
Tue Oct 5 11:15:17 PDT 2010
On 10/05/2010 04:55 AM, Ulf Zibis wrote:
> Sherman,
>
> thanks for that great work.
>
> Maybe you now could acknowledge:
> Bug ID: 6818737 Provide NIO channel access for zip/jar entry
> <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6818737>
> and look forward for:
> Bug ID: 6818736 Provide NIO channel access for resources from class
> Class <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6818736>
>
> I'm wondering how much work had to be done in java code. I would have
> expected, most should be provided by libzip.
>
You can now access the zip/jar entry by using the NIO channel already
with the zip filesystem provider:-) See
Demo.java
<http://cr.openjdk.java.net/%7Esherman/zipfs/webrev/test/demo/zipfs/Demo.java.html>#checkEqual(Path
src, Path dst)
SeekableByteChannel chSrc = src.newByteChannel();
OK, that is cheating:-) you just get a channel built on top of a stream.
We need a pair of Inflater/DeflaterByteChannel and a little update at
native, but
probably don't need to touch the libzip (if not too ambitious)
I guess I have some code somewhere, but need time to clean them out.
-Sherman
> -Ulf
>
>
> Am 05.10.2010 09:36, schrieb Xueming Shen:
>> Here is the webrev for nio filesystem provider for zip {1]
>>
>> http://cr.openjdk.java.net/~sherman/zipfs/webrev
>>
>> We are targeting for b114 for the first drop, if we can address
>> some integration logistic issues. If not, it should be in b116.
>>
>> Since most of the code are so "young" (2-3 weeks), it would be
>> appreciated if you guys can help review the code and/or try
>> it out, any feedback is welcome. And don't be surprised if you
>> find the webrev is being updated constantly:-)
>>
>> Demo.java <http://cr.openjdk.java.net/%7Esherman/zipfs/webrev/test/demo/zipfs/Demo.java.html> shows how to use the NIO2 filesystem APIs to access
>> a zip file via the zip filesystem provider, with couple lines
>> of code you can copy, rename, move, list, walk a zip file just like
>> access a normal file system. The most fun part of the past couple
>> weeks is to convert my test case into this Demo:-) Myself is
>> a little surprised how easy it is to use Alan's nio fs to access
>> a zip file.
>>
>> I put a copy ofzipfs.jar <http://cr.openjdk.java.net/%7Esherman/zipfs/> on the cr website for your convenience,
>> in case you want to try it out first. Just copy the zipfs.jar into
>> the ext directory or add it into your classpath.
>>
>> -Sherman
>>
>> [1]NIO.2 filesystem provider for zip/jar archives <http://openjdk.java.net/projects/jdk7/features/#fa537814>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20101005/6f1bfdbd/attachment.html
More information about the nio-dev
mailing list