From b78b6ec34574bde0af902e3dc6c04edb24c4715e Mon Sep 17 00:00:00 2001 From: jmillman Date: Mon, 4 Jan 2016 15:26:12 -0500 Subject: [PATCH] replace usage of removed ImageUtils.logContentError in IG --- .../imagegallery/datamodel/DrawableFile.java | 18 ++++++++++++++++++ .../gui/drawableviews/SlideShowView.java | 3 +-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 9a52245bca..0f8db63ae3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -322,4 +322,22 @@ public abstract class DrawableFile extends AbstractFile return Collections.emptySet(); } } + + /** + * Get the unique path for this DrawableFile, or if that fails, just return + * the name. + * + * @param content + * + * @return + */ + public String getContentPathSafe() { + try { + return this.getUniquePath(); + } catch (TskCoreException tskCoreException) { + String contentName = this.getName(); + LOGGER.log(Level.SEVERE, "Failed to get unique path for " + contentName, tskCoreException); //NOI18N + return contentName; + } + } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java index 5440f49ad2..1e8c98117f 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/SlideShowView.java @@ -43,7 +43,6 @@ import javafx.scene.media.MediaException; import javafx.scene.media.MediaPlayer; import org.controlsfx.control.MaskerPane; import org.openide.util.NbBundle; -import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.autopsy.coreutils.ThreadConfined.ThreadType; @@ -325,7 +324,7 @@ public class SlideShowView extends DrawableTileBase { final Media media = file.getMedia(); return new VideoPlayer(new MediaPlayer(media), file); } catch (MediaException | IOException | OutOfMemoryError ex) { - ImageUtils.logContentError(LOGGER, Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file); + LOGGER.log(Level.WARNING, "Failed to initialize VideoPlayer for {0} : " + ex.toString(), file.getContentPathSafe()); return doReadImageTask(file); } }