Re: [compress] Draft 6

2006-05-13 Thread Torsten Curdt
if (.zip.equals(extension)) - ArchiveType.ZIP.newInstance(); if (.rar.equals(extension)) - ArchiveType.RAR.newInstance(); ... in you code - which is cumbersome IMO. In that situation you'd use: ArchiveType.valueOf(extension).newInstance() ...so what's the benefit over the usual factory +

Re: [compress] Draft 6

2006-05-13 Thread C. Grobmeier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 will pugh wrote: Yeah. I agree valueOf would work just fine, but unless I'm missing something, the current implementation doesn't have this. The purpose of my comments was to say that I thought it should have something along those lines. The

Re: [compress] Draft 6

2006-05-13 Thread C. Grobmeier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ...so what's the benefit over the usual factory + constructor instantiation then? Archive arch = new TarArchive(new File(my.tar)); Archive arch = ArchiveFactory.newInstance(new File(my.tar); Archive arch = ArchiveFactory.newInstance(tar); i

Re: [compress] Draft 6

2006-05-13 Thread Torsten Curdt
i have read your suggestion but i was not sure why i should accept strings for choosing an archive. This can also be convenient if the method comes from a configuration. Common practise for factories. I like the idea ArchiveFactory identifys archives by it's header. So, thanks for making this

[compress] Draft 6

2006-05-12 Thread C. Grobmeier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, here is a new draft: http://www.grobmeier.de/commons-compress-draft-6.zip I have changed a lot of things discussed with draft 5. The API is easier now. Everything what seems to be unnecessary has been deleted. Compress is working with Files

Re: [compress] Draft 6

2006-05-12 Thread Torsten Curdt
here is a new draft: http://www.grobmeier.de/commons-compress-draft-6.zip I have changed a lot of things discussed with draft 5. The API is easier now. Everything what seems to be unnecessary has been deleted. Compress is working with Files and InputStreams only, no more String-params

Re: [compress] Draft 6

2006-05-12 Thread Sandy McArthur
On 5/12/06, Torsten Curdt [EMAIL PROTECTED] wrote: here is a new draft: http://www.grobmeier.de/commons-compress-draft-6.zip I have changed a lot of things discussed with draft 5. The API is easier now. Everything what seems to be unnecessary has been deleted. Compress is working

Re: [compress] Draft 6

2006-05-12 Thread will pugh
reflection (and cleaner than special casing every Archiver type) --Will Sandy McArthur wrote: On 5/12/06, Torsten Curdt [EMAIL PROTECTED] wrote: here is a new draft: http://www.grobmeier.de/commons-compress-draft-6.zip I have changed a lot of things discussed with draft 5. The API

Re: [compress] Draft 6

2006-05-12 Thread Sandy McArthur
] wrote: here is a new draft: http://www.grobmeier.de/commons-compress-draft-6.zip I have changed a lot of things discussed with draft 5. The API is easier now. Everything what seems to be unnecessary has been deleted. Compress is working with Files and InputStreams only, no more String

Re: [compress] Draft 6

2006-05-12 Thread Torsten Curdt
the small problem with that or any factory is the use of a String to request a behavior means the compiler cannot know for sure if that code will work. And this is a problem why? I think it would be great to be able to just pass in a file object into the factory that will look e.g. at the file

Re: [compress] Draft 6

2006-05-12 Thread will pugh
: On 5/12/06, Torsten Curdt [EMAIL PROTECTED] wrote: here is a new draft: http://www.grobmeier.de/commons-compress-draft-6.zip I have changed a lot of things discussed with draft 5. The API is easier now. Everything what seems to be unnecessary has been deleted. Compress is working

Re: [compress] Draft 6

2006-05-12 Thread Sandy McArthur
On 5/12/06, Torsten Curdt [EMAIL PROTECTED] wrote: the small problem with that or any factory is the use of a String to request a behavior means the compiler cannot know for sure if that code will work. And this is a problem why? I think it would be great to be able to just pass in a file