> 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 + constructor
instantiation then?

Archive arch = new TarArchive(new File("my.tar"));
Archive arch = ArchiveFactory.newInstance(new File("my.tar");
Archive arch = ArchiveFactory.newInstance("tar");

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to