/** * Creates an EZBArchive object for the given object. * @param url the url that this factory can manage. * @return a new EZBArchive instance or null if it's not an archive */ public IArchive create(final URL url) { // Test if url is a pointer to a file archive, and in this case, redirect to an other implementation if ("file".equals(url.getProtocol())) { return new DefaultArchiveFactory().create(URLUtils.urlToFile(url)); } try { return new URLArchiveImpl(url); } catch (IOException e) { throw new IllegalArgumentException(e); } }
/** * Creates an EZBArchive object for the given object. * @param url the url that this factory can manage. * @return a new EZBArchive instance or null if it's not an archive */ public IArchive create(final URL url) { // Test if url is a pointer to a file archive, and in this case, redirect to an other implementation if ("file".equals(url.getProtocol())) { return new DefaultArchiveFactory().create(URLUtils.urlToFile(url)); } try { return new URLArchiveImpl(url); } catch (IOException e) { throw new IllegalArgumentException(e); } }
/** * Private constructor as only one instance is built. */ private ArchiveManager() { addFactory(new DefaultArchiveFactory()); addFactory(new URLArchiveFactory()); }
/** * Private constructor as only one instance is built. */ private ArchiveManager() { addFactory(new DefaultArchiveFactory()); addFactory(new URLArchiveFactory()); }