/** * Removes the listener associated with the provided file from the currently set rootFile. */ public void remove(FileObject fileToRemove, FileListener listener){ filesystem.removeListener(fileToRemove, listener); } }
void doIt() { beingWatched.getFileSystem().removeListener(beingWatched, this); try { watcher.propertiesChanged(); } catch (final RuntimeException rte) { LOGGER.error("Failed processing notification that a properties file changed.", rte); } } }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of * listeners. * * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will * remove itself from the list of listeners. * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of * listeners. * * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * returns the wrapped listener. If it is gone, the WeakRefFileListener wrapper will remove itself from the list of * listeners. * * @return The FileListener. * @throws Exception if an error occurs. */ protected FileListener getListener() throws Exception { final FileListener listener = this.listener.get(); if (listener == null) { final FileObject file = fs.resolveFile(name); file.getFileSystem().removeListener(file, this); } return listener; }
/** * Recursively fires create events for all children if recursive descent is enabled. Otherwise the create event * is only fired for the initial FileObject. * * @param child The child to add. */ private void fireAllCreate(final FileObject child) { // Add listener so that it can be triggered if (this.fm.getFileListener() != null) { child.getFileSystem().addListener(child, this.fm.getFileListener()); } ((AbstractFileSystem) child.getFileSystem()).fireFileCreated(child); // Remove it because a listener is added in the queueAddFile if (this.fm.getFileListener() != null) { child.getFileSystem().removeListener(child, this.fm.getFileListener()); } this.fm.queueAddFile(child); // Add try { if (this.fm.isRecursive() && child.getType().hasChildren()) { final FileObject[] newChildren = child.getChildren(); for (final FileObject element : newChildren) { fireAllCreate(element); } } } catch (final FileSystemException fse) { LOG.error(fse.getLocalizedMessage(), fse); } }
/** * Recursively fires create events for all children if recursive descent is enabled. Otherwise the create event * is only fired for the initial FileObject. * * @param child The child to add. */ private void fireAllCreate(final FileObject child) { // Add listener so that it can be triggered if (this.fm.getFileListener() != null) { child.getFileSystem().addListener(child, this.fm.getFileListener()); } ((AbstractFileSystem) child.getFileSystem()).fireFileCreated(child); // Remove it because a listener is added in the queueAddFile if (this.fm.getFileListener() != null) { child.getFileSystem().removeListener(child, this.fm.getFileListener()); } this.fm.queueAddFile(child); // Add try { if (this.fm.isRecursive() && child.getType().hasChildren()) { final FileObject[] newChildren = child.getChildren(); for (final FileObject element : newChildren) { fireAllCreate(element); } } } catch (final FileSystemException fse) { LOG.error(fse.getLocalizedMessage(), fse); } }
/** * Recursively fires create events for all children if recursive descent is enabled. Otherwise the create event * is only fired for the initial FileObject. * * @param child The child to add. */ private void fireAllCreate(final FileObject child) { // Add listener so that it can be triggered if (this.fm.getFileListener() != null) { child.getFileSystem().addListener(child, this.fm.getFileListener()); } ((AbstractFileSystem) child.getFileSystem()).fireFileCreated(child); // Remove it because a listener is added in the queueAddFile if (this.fm.getFileListener() != null) { child.getFileSystem().removeListener(child, this.fm.getFileListener()); } this.fm.queueAddFile(child); // Add try { if (this.fm.isRecursive() && child.getType().hasChildren()) { final FileObject[] newChildren = child.getChildren(); for (final FileObject element : newChildren) { fireAllCreate(element); } } } catch (final FileSystemException fse) { LOG.error(fse.getLocalizedMessage(), fse); } }
child.getFileSystem().removeListener(child, this.fm.getFileListener());
this.file.getFileSystem().removeListener(this.file, this.fm.getFileListener());
this.file.getFileSystem().removeListener(this.file, this.fm.getFileListener());
this.file.getFileSystem().removeListener(this.file, this.fm.getFileListener());
this.file.getFileSystem().removeListener(this.file, this.fm.getFileListener());
fs.removeListener(child, listener);
fs.removeListener(child, listener);
fs.removeListener(child, listener);}