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 +
-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
-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
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
-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
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
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
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
] 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
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
:
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
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
12 matches
Mail list logo