Re: [compress] Discussing compress

2006-03-07 Thread C. Grobmeier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have updated: http://grobmeier.de/commons-compress-draft-2.zip + input/output streams are all in finally-blocks + Examples for the old tar/bzip2 way included + Patch in Bug 30494 included: fixes these examples :-) Cheers, Chris C. Grobmeier wrote:

Re: [compress] Discussing compress

2006-03-06 Thread C. Grobmeier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > 1) Please take care to always close your input/output streams. ie. do > this in a finally() block so that in any case (excpetion) the streams > were closed OK, i will check this tonight or tomorrow evening :-) > 2) you cant handle directories now,

Re: [compress] Discussing compress

2006-03-06 Thread Mario Ivankovits
Hi! > > I have done something and uploaded a draft: > http://grobmeier.de/commons-compress-draft.zip I've looked at it a little bit. 1) Please take care to always close your input/output streams. ie. do this in a finally() block so that in any case (excpetion) the streams were closed 2) you cant

Re: [compress] Discussing compress

2006-03-06 Thread C. Grobmeier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi, > I actually think commons-archiver is a better name (the library I have > used is plexus-archiver [1], which is derived from the same code and I > want to merge them here). > Note that there is also the unpack/decompress portion as well. +1 to

Re: [compress] Discussing compress

2006-03-04 Thread Brett Porter
Replying to a few of these things. Sorry for neglecting the thread so long. C. Grobmeier wrote: > I noticed, that compress ist divided into three different APIs, one for > every compression algorithm: Zip, BZip2, Tar. Tar isn't a compression algorithm. I actually think commons-archiver is a bett

Re: [compress] Discussing compress

2006-02-14 Thread C. Grobmeier
How do you delete a file and shrink the archive? I thought about reading the zip spec and cutting out the bytes i don't need. I am not aware of a file operation which allows you to cut out a number of bytes from a file. I think there exists a "cut from end", but AFAIK this is not available in ja

Re: [compress] Discussing compress

2006-02-14 Thread Mario Ivankovits
Hi! >> How do you change a file? > > Replacement would be not so good. I think a modify is a: delete and > add operation. ok >> How do you delete a file and shrink the archive? > > I thought about reading the zip spec and cutting out the bytes i don't > need. I am not aware of a file operation whi

Re: [compress] Discussing compress

2006-02-14 Thread C. Grobmeier
Hello again :-) How do you change a file? Replacement would be not so good. I think a modify is a: delete and add operation. How do you delete a file and shrink the archive? I thought about reading the zip spec and cutting out the bytes i don't need. And all this heavily depends on t

Re: [compress] Discussing compress

2006-02-14 Thread Mario Ivankovits
Hi! > Can you explain a bit more, why i should use streams only in public > instead of a byte-manipulation like with RandomAccessFile. Any link or > comment here is appreciated. I just thought it is not possible to change a archive that way. While I can image that it might work to add a file ... Ho

Re: [compress] Discussing compress

2006-02-14 Thread C. Grobmeier
but be sure to only work with streams in your public API. So you might have to decompress and recompress the archive in a local temp folder to make those operations work. I think in your local temp directory you should NOT use the original filenames of the archive as they might contain invalid

Re: [compress] Discussing compress

2006-02-14 Thread Mario Ivankovits
Hi! > How do i proceed then? Sending it to this list? Creating an bugzilla > issue? Lets start with an bugzilla issue. Somone participating in compress will have a look at it then. Beside the api cleanup, if you manage to get all the add/update/delete file stuff in place my motivation might be VER

Re: [compress] Discussing compress

2006-02-14 Thread C. Grobmeier
Mario Ivankovits wrote: Hi! Compress.getInstance(String compressorType); +1 or even better Compress.getInstance(CompressorType compressorType); Yes, better. Thanks So, from my point of view compress should avoid having a configuration at all and should concentrate to be a compact library.

Re: [compress] Discussing compress

2006-02-14 Thread Mario Ivankovits
Hi! > Compress.getInstance(String compressorType); +1 or even better Compress.getInstance(CompressorType compressorType); > Compress.getInstance(File compressedFile); > > which loads a compressed file with the correct Compressor. For this to work you need a configuration file, and later it might b

Re: [compress] Discussing compress

2006-02-14 Thread C. Grobmeier
I was thinking that something like Compress.getInstance(String compressorType); like Crypto would be nice. This way you can get a unique "entry point" for every compression algorithm that can provide its own methods to compress/decompress/add files etc etc. you are speaking of a factory method.

Re: [compress] Discussing compress

2006-02-14 Thread Piero Ottuzzi
Hi Chris, I was thinking that something like Compress.getInstance(String compressorType); like Crypto would be nice. This way you can get a unique "entry point" for every compression algorithm that can provide its own methods to compress/decompress/add files etc etc. Bye Piero Alle 10:58, marte

[compress] Discussing compress

2006-02-14 Thread C. Grobmeier
Hello, not knowing how to start best, i would like to kick off an discussion about the goals of [compress]. As i wrote in an email before ages, i have allready started to check out the existing lib and want to see this component working. I noticed, that compress ist divided into three differe