From af72dbab34d15811bc4171a4439e480eeeaa3266 Mon Sep 17 00:00:00 2001 From: momo Date: Wed, 9 Sep 2015 09:42:35 -0400 Subject: [PATCH 1/5] adding underscore between file name and item index --- .../modules/embeddedfileextractor/SevenZipExtractor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index 6ffa1df07e..ffcdc5b34b 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -459,7 +459,7 @@ class SevenZipExtractor { } } - final String uniqueExtractedName = uniqueArchiveFileName + File.separator + (item.getItemIndex() / 1000) + File.separator + item.getItemIndex() + new File(pathInArchive).getName(); + final String uniqueExtractedName = uniqueArchiveFileName + File.separator + (item.getItemIndex() / 1000) + File.separator + item.getItemIndex() + "_" + new File(pathInArchive).getName(); //final String localRelPath = unpackDir + File.separator + localFileRelPath; final String localRelPath = moduleDirRelative + File.separator + uniqueExtractedName; From 9151c241b99ea1cabb99b62073fee7b455ed944b Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 10 Sep 2015 13:27:14 -0400 Subject: [PATCH 2/5] Adding manual save and load to UserPreferences --- .../autopsy/core/UserPreferences.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java index 80699487ed..cb14b55594 100755 --- a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java +++ b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java @@ -57,6 +57,26 @@ public final class UserPreferences { // Prevent instantiation. private UserPreferences() { } + + /** + * Reload all preferences from disk. + * This is only needed if the preferences file is being directly modified on disk + * while Viking is running. + * @throws Exception + */ + public static void reloadFromStorage() throws Exception { + preferences.sync(); + } + + /** + * Saves the current preferences to storage. + * This is only needed if the preferences files are going to be copied + * to another location while Viking is running. + * @throws Exception + */ + public static void saveToStorage() throws Exception { + preferences.flush(); + } public static void addChangeListener(PreferenceChangeListener listener) { preferences.addPreferenceChangeListener(listener); From e7f6fe01b389bcfbc032c79790de83b98667b20a Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 10 Sep 2015 13:45:24 -0400 Subject: [PATCH 3/5] Cleanup --- .../autopsy/core/UserPreferences.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java index cb14b55594..5b7a5b705c 100755 --- a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java +++ b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java @@ -57,22 +57,23 @@ public final class UserPreferences { // Prevent instantiation. private UserPreferences() { } - + /** - * Reload all preferences from disk. - * This is only needed if the preferences file is being directly modified on disk - * while Viking is running. - * @throws Exception + * Reload all preferences from disk. This is only needed if the preferences + * file is being directly modified on disk while Autopsy is running. + * + * @throws Exception */ public static void reloadFromStorage() throws Exception { preferences.sync(); } - + /** - * Saves the current preferences to storage. - * This is only needed if the preferences files are going to be copied - * to another location while Viking is running. - * @throws Exception + * Saves the current preferences to storage. This is only needed if the + * preferences files are going to be copied to another location while + * Autopsy is running. + * + * @throws Exception */ public static void saveToStorage() throws Exception { preferences.flush(); From 414df9fd77db61c00f93194772a7c2b67899bf9b Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 10 Sep 2015 13:48:24 -0400 Subject: [PATCH 4/5] Cleanup --- .../modules/embeddedfileextractor/SevenZipExtractor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index ffcdc5b34b..6ffa1df07e 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -459,7 +459,7 @@ class SevenZipExtractor { } } - final String uniqueExtractedName = uniqueArchiveFileName + File.separator + (item.getItemIndex() / 1000) + File.separator + item.getItemIndex() + "_" + new File(pathInArchive).getName(); + final String uniqueExtractedName = uniqueArchiveFileName + File.separator + (item.getItemIndex() / 1000) + File.separator + item.getItemIndex() + new File(pathInArchive).getName(); //final String localRelPath = unpackDir + File.separator + localFileRelPath; final String localRelPath = moduleDirRelative + File.separator + uniqueExtractedName; From 3a4456b9453c555dedb74099f1961c222cbe1c64 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 10 Sep 2015 16:23:12 -0400 Subject: [PATCH 5/5] Changed exception type --- Core/src/org/sleuthkit/autopsy/core/UserPreferences.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java index 5b7a5b705c..2f1c6a5ae5 100755 --- a/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java +++ b/Core/src/org/sleuthkit/autopsy/core/UserPreferences.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.core; +import java.util.prefs.BackingStoreException; import org.sleuthkit.autopsy.events.MessageServiceConnectionInfo; import java.util.prefs.PreferenceChangeListener; import java.util.prefs.Preferences; @@ -62,9 +63,9 @@ public final class UserPreferences { * Reload all preferences from disk. This is only needed if the preferences * file is being directly modified on disk while Autopsy is running. * - * @throws Exception + * @throws BackingStoreException */ - public static void reloadFromStorage() throws Exception { + public static void reloadFromStorage() throws BackingStoreException { preferences.sync(); } @@ -73,9 +74,9 @@ public final class UserPreferences { * preferences files are going to be copied to another location while * Autopsy is running. * - * @throws Exception + * @throws BackingStoreException */ - public static void saveToStorage() throws Exception { + public static void saveToStorage() throws BackingStoreException { preferences.flush(); }