diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java index e22eb75488..a9d3042e5b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ThumbnailCache.java @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.imagegallery; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; +import com.google.common.util.concurrent.UncheckedExecutionException; import java.awt.image.BufferedImage; import java.io.BufferedInputStream; import java.io.File; @@ -89,7 +90,7 @@ public enum ThumbnailCache { public final void clearCache() { cache.invalidateAll(); } - + /** get the cached thumbnail for the given file or generate a new one if * needed * @@ -101,8 +102,8 @@ public enum ThumbnailCache { public Image get(DrawableFile file) { try { return cache.get(file.getId(), () -> load(file)).orElse(null); - } catch (CacheLoader.InvalidCacheLoadException | ExecutionException ex) { - LOGGER.log(Level.WARNING, "failed to load icon for file: " + file.getName(), ex); + } catch (UncheckedExecutionException | CacheLoader.InvalidCacheLoadException | ExecutionException ex) { + LOGGER.log(Level.WARNING, "failed to load icon for file: " + file.getName(), ex.getCause()); return null; } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java index 75e24d3070..880cb023d3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java @@ -85,6 +85,7 @@ import javafx.scene.paint.Color; import javafx.util.Duration; import javax.swing.Action; import javax.swing.SwingUtilities; +import static org.apache.commons.lang3.StringUtils.defaultIfBlank; import org.controlsfx.control.GridCell; import org.controlsfx.control.GridView; import org.controlsfx.control.SegmentedButton; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SingleDrawableViewBase.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SingleDrawableViewBase.java index 37b0e78d15..61e5611415 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SingleDrawableViewBase.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/SingleDrawableViewBase.java @@ -60,7 +60,6 @@ import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.coreutils.ThreadConfined.ThreadType; import org.sleuthkit.autopsy.datamodel.FileNode; -import org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent; import org.sleuthkit.autopsy.directorytree.ExternalViewerAction; import org.sleuthkit.autopsy.directorytree.ExtractAction; import org.sleuthkit.autopsy.directorytree.NewWindowViewAction; @@ -76,6 +75,9 @@ import org.sleuthkit.autopsy.imagegallery.datamodel.Category; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableAttribute; import org.sleuthkit.autopsy.imagegallery.datamodel.DrawableFile; import org.sleuthkit.autopsy.imagegallery.grouping.GroupKey; +import org.sleuthkit.autopsy.ingest.IngestServices; +import org.sleuthkit.autopsy.ingest.ModuleDataEvent; +import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.ContentTag; import org.sleuthkit.datamodel.TagName; import org.sleuthkit.datamodel.TskCoreException; @@ -260,7 +262,7 @@ public abstract class SingleDrawableViewBase extends AnchorPane implements Drawa try { AddDrawableTagAction.getInstance().addTag(TagUtils.getFollowUpTagName(), ""); } catch (TskCoreException ex) { - Exceptions.printStackTrace(ex); + LOGGER.log(Level.SEVERE, "Failed to add follow up tag. Could not load TagName.", ex); } } else { //TODO: convert this to an action! @@ -273,13 +275,12 @@ public abstract class SingleDrawableViewBase extends AnchorPane implements Drawa for (ContentTag ct : contentTagsByContent) { if (ct.getName().getDisplayName().equals(TagUtils.getFollowUpTagName().getDisplayName())) { Case.getCurrentCase().getServices().getTagsManager().deleteContentTag(ct); - SwingUtilities.invokeLater(() -> DirectoryTreeTopComponent.findInstance().refreshContentTreeSafe()); } } - + IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent("TagAction", BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE)); //NON-NLS controller.getGroupManager().handleFileUpdate(FileUpdateEvent.newUpdateEvent(Collections.singleton(fileID), DrawableAttribute.TAGS)); } catch (TskCoreException ex) { - Exceptions.printStackTrace(ex); + LOGGER.log(Level.SEVERE, "Failed to delete follow up tag.", ex); } } });