/** * Called when this file is created. Updates cached info and notifies the parent and file system. * * @param newType The type of the file. * @throws Exception if an error occurs. */ protected void handleCreate(final FileType newType) throws Exception { synchronized (fs) { if (attached) { // Fix up state injectType(newType); removeChildrenCache(); // Notify subclass onChange(); } // Notify parent that its child list may no longer be valid notifyParent(this.getName(), newType); // Notify the file system fs.fireFileCreated(this); } }
/** * Called when this file is created. Updates cached info and notifies the parent and file system. * * @param newType The type of the file. * @throws Exception if an error occurs. */ protected void handleCreate(final FileType newType) throws Exception { synchronized (fileSystem) { if (attached) { // Fix up state injectType(newType); removeChildrenCache(); // Notify subclass onChange(); } // Notify parent that its child list may no longer be valid notifyParent(this.getName(), newType); // Notify the file system fileSystem.fireFileCreated(this); } }
/** * Called when this file is created. Updates cached info and notifies * the parent and file system. * * @param newType The type of the file. * @throws Exception if an error occurs. */ protected void handleCreate(final FileType newType) throws Exception { synchronized (fs) { if (attached) { // Fix up state injectType(newType); removeChildrenCache(); // Notify subclass onChange(); } // Notify parent that its child list may no longer be valid notifyParent(this.getName(), newType); // Notify the file system fs.fireFileCreated(this); } }
/** * Called when this file is created. Updates cached info and notifies the parent and file system. * * @param newType The type of the file. * @throws Exception if an error occurs. */ protected void handleCreate(final FileType newType) throws Exception { synchronized (monitorLock) { if (isAttached()) { // Fix up state injectType(newType); removeChildrenCache(); // Notify subclass onChange(); } // Notify parent that its child list may no longer be valid notifyParent(this.getName(), newType); // Notify the file system fs.fireFileCreated(this); } }
/** * 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); } }
((AbstractFileSystem) child.getFileSystem()).fireFileCreated(child);
((AbstractFileSystem) this.file.getFileSystem()).fireFileCreated(this.file);
((AbstractFileSystem) this.file.getFileSystem()).fireFileCreated(this.file);
((AbstractFileSystem) this.file.getFileSystem()).fireFileCreated(this.file);
this.file.getFileSystem()).fireFileCreated(this.file);