Source:
public void propertyChange(PropertyChangeEvent event) { if (((AutopsyEvent) event).getSourceType() != AutopsyEvent.SourceType.LOCAL) { return; } ImageGalleryController currentController; try { currentController = getController(); } catch (TskCoreException ex) { logger.log(Level.SEVERE, String.format("Failed to handle %s event", event.getPropertyName()), ex); return; } String eventType = event.getPropertyName(); switch (IngestManager.IngestModuleEvent.valueOf(eventType)) { case FILE_DONE: AbstractFile file = (AbstractFile) event.getNewValue(); if (!file.isFile()) { return; } if (currentController.isListeningEnabled()) { try { if (isDrawableAndNotKnown(file)) { currentController.queueDBTask(new ImageGalleryController.UpdateFileTask(file, currentController.getDatabase())); } } catch (FileTypeDetector.FileTypeDetectorInitException ex) { logger.log(Level.SEVERE, String.format("Failed to determine if file is of interest to the image gallery module, ignoring file (obj_id=%d)", file.getId()), ex); } } break; case DATA_ADDED: ModuleDataEvent artifactAddedEvent = (ModuleDataEvent) event.getOldValue(); if (artifactAddedEvent.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID()) { DrawableDB drawableDB = currentController.getDatabase(); if (artifactAddedEvent.getArtifacts() != null) { for (BlackboardArtifact art : artifactAddedEvent.getArtifacts()) { drawableDB.addExifCache(art.getObjectID()); } } } else if (artifactAddedEvent.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) { DrawableDB drawableDB = currentController.getDatabase(); if (artifactAddedEvent.getArtifacts() != null) { for (BlackboardArtifact art : artifactAddedEvent.getArtifacts()) { drawableDB.addHashSetCache(art.getObjectID()); } } } break; default: break; } }

Target:
public void propertyChange(PropertyChangeEvent event) { if (((AutopsyEvent) event).getSourceType() != AutopsyEvent.SourceType.LOCAL) { return; } ImageGalleryController currentController; try { currentController = getController(); } catch (TskCoreException ex) { logger.log(Level.SEVERE, String.format("Failed to handle %s event", event.getPropertyName()), ex); return; } String eventType = event.getPropertyName(); switch (IngestManager.IngestModuleEvent.valueOf(eventType)) { case FILE_DONE: AbstractFile file = (AbstractFile) event.getNewValue(); if (!file.isFile()) { return; } if (currentController.isListeningEnabled()) { try { if (isDrawableAndNotKnown(file)) { currentController.queueDBTask(new ImageGalleryController.UpdateFileTask(file, currentController.getDatabase())); } } catch (FileTypeDetector.FileTypeDetectorInitException ex) { logger.log(Level.SEVERE, String.format("Failed to determine if file is of interest to the image gallery module, ignoring file (obj_id=%d)", file.getId()), ex); } } break; case DATA_ADDED: ModuleDataEvent artifactAddedEvent = (ModuleDataEvent) event.getOldValue(); if (CollectionUtils.isNotEmpty(artifactAddedEvent.getArtifacts())) { DrawableDB drawableDB = currentController.getDatabase(); for (BlackboardArtifact art : artifactAddedEvent.getArtifacts()) { if (artifactAddedEvent.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID()) { drawableDB.addExifCache(art.getObjectID()); } else if (artifactAddedEvent.getBlackboardArtifactType().getTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) { drawableDB.addHashSetCache(art.getObjectID()); } } } break; default: break; } }