@Override public synchronized void close() throws IOException { if (this.closed) { LOG.error("filesystem is already closed"); throw new IllegalStateException("filesystem is already closed"); } // call handler super.raiseOnBeforeDestroyEvent(); // close all open files for (SyndicateFSInputStream is : this.openInputStream) { try { is.close(); } catch (IOException ex) { LOG.error("exception occurred", ex); } } for (OutputStream os : this.openOutputStream) { try { os.close(); } catch (IOException ex) { LOG.error("exception occurred", ex); } } this.filestatusCache.clear(); this.client.close(); super.close(); super.raiseOnAfterDestroyEvent(); }
@Override protected void initialize(SyndicateFSConfiguration conf) throws InstantiationException { if (conf == null) { LOG.error("FileSystem Initialize failed : configuration is null"); throw new IllegalArgumentException( "Can not initialize the filesystem from null configuration"); } super.raiseOnBeforeCreateEvent(); super.initialize(conf); this.client = new SyndicateUGHttpClient(conf.getHost(), conf.getPort()); super.raiseOnAfterCreateEvent(); }