this.monitorMap.put(file.getName(), new FileMonitorAgent(this, file));
this.fireAllCreate(child); this.fireAllCreate(element);
private void check() this.refresh(); this.checkForNewChildren();
this.fireAllCreate(child); for (final FileObject element : newChildren) { this.children.put(element.getName(), new Object()); // null? this.fireAllCreate(element);
for (final FileObject element : newChildren) fireAllCreate(element);
private void check() { this.refresh(); this.checkForNewChildren();
private void check() { this.refresh(); this.checkForNewChildren();
this.fireAllCreate(child); this.fireAllCreate(element);
this.fireAllCreate(child); this.fireAllCreate(element);
private void check() { this.refresh(); this.checkForNewChildren();
/** * 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); } }
/** * Adds a file to be monitored. * * @param file The FileObject to add. */ private void doAddFile(final FileObject file) { synchronized (this.monitorMap) { if (this.monitorMap.get(file.getName()) == null) { this.monitorMap.put(file.getName(), new FileMonitorAgent(this, file)); try { if (this.listener != null) { file.getFileSystem().addListener(file, this.listener); } if (file.getType().hasChildren() && this.recursive) { // Traverse the children final FileObject[] children = file.getChildren(); for (final FileObject element : children) { this.addFile(element); // Add depth first } } } 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); } }
/** * Adds a file to be monitored. * * @param file The FileObject to add. */ private void doAddFile(final FileObject file) { synchronized (this.monitorMap) { if (this.monitorMap.get(file.getName()) == null) { this.monitorMap.put(file.getName(), new FileMonitorAgent(this, file)); try { if (this.listener != null) { file.getFileSystem().addListener(file, this.listener); } if (file.getType().hasChildren() && this.recursive) { // Traverse the children final FileObject[] children = file.getChildren(); for (final FileObject element : children) { this.addFile(element); // Add depth first } } } catch (final FileSystemException fse) { LOG.error(fse.getLocalizedMessage(), fse); } } } }
/** * Adds a file to be monitored. * * @param file The FileObject to add. */ private void doAddFile(final FileObject file) { synchronized (this.monitorMap) { if (this.monitorMap.get(file.getName()) == null) { this.monitorMap.put(file.getName(), new FileMonitorAgent(this, file)); try { if (this.listener != null) { file.getFileSystem().addListener(file, this.listener); } if (file.getType().hasChildren() && this.recursive) { // Traverse the children final FileObject[] children = file.getChildren(); for (final FileObject element : children) { this.addFile(element); // Add depth first } } } catch (final FileSystemException fse) { LOG.error(fse.getLocalizedMessage(), fse); } } } }
private FileMonitorAgent(final DefaultFileMonitor fm, final FileObject file) { this.fm = fm; this.file = file; this.refresh(); this.resetChildrenList(); try { this.exists = this.file.exists(); } catch (final FileSystemException fse) { this.exists = false; this.timestamp = -1; } if (this.exists) { try { this.timestamp = this.file.getContent().getLastModifiedTime(true); } catch (final FileSystemException fse) { this.timestamp = -1; } } }
private FileMonitorAgent(final DefaultFileMonitor fm, final FileObject file) { this.fm = fm; this.file = file; this.refresh(); this.resetChildrenList(); try { this.exists = this.file.exists(); } catch (final FileSystemException fse) { this.exists = false; this.timestamp = -1; } if (this.exists) { try { this.timestamp = this.file.getContent().getLastModifiedTime(); } catch (final FileSystemException fse) { this.timestamp = -1; } } }
private FileMonitorAgent(final DefaultFileMonitor fm, final FileObject file) { this.fm = fm; this.file = file; this.refresh(); this.resetChildrenList(); try { this.exists = this.file.exists(); } catch (final FileSystemException fse) { this.exists = false; this.timestamp = -1; } if (this.exists) { try { this.timestamp = this.file.getContent().getLastModifiedTime(); } catch (final FileSystemException fse) { this.timestamp = -1; } } }
private FileMonitorAgent(final DefaultFileMonitor fm, final FileObject file) { this.fm = fm; this.file = file; this.refresh(); this.resetChildrenList(); try { this.exists = this.file.exists(); } catch (final FileSystemException fse) { this.exists = false; this.timestamp = -1; } if (this.exists) { try { this.timestamp = this.file.getContent().getLastModifiedTime(); } catch (final FileSystemException fse) { this.timestamp = -1; } } }