diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index c39f10d476..af9b1f214e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -816,7 +816,7 @@ public class Case { * Invoke the creation of startup dialog window. */ static public void invokeStartupDialog() { - StartupWindow.getInstance().open(); + StartupWindowProvider.getInstance().open(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index 64e34e7f40..1a3eacffb4 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -86,7 +86,7 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese EventQueue.invokeLater(new Runnable() { @Override public void run() { - StartupWindow.getInstance().open(); + StartupWindowProvider.getInstance().open(); } }); } catch (Exception ex) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index 41b1d8eb24..26dfb3b821 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -85,7 +85,7 @@ public final class CaseOpenAction implements ActionListener { } else { // try to close Startup window if there's one try { - StartupWindow.getInstance().close(); + StartupWindowProvider.getInstance().close(); } catch (Exception ex) { // no need to show the error message to the user. logger.log(Level.WARNING, "Error closing startup window.", ex); @@ -97,7 +97,7 @@ public final class CaseOpenAction implements ActionListener { + ": " + ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); logger.log(Level.WARNING, "Error opening case in folder " + path, ex); - StartupWindow.getInstance().open(); + StartupWindowProvider.getInstance().open(); } } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java index ab9af0ed5e..73a9ae671b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java @@ -291,7 +291,7 @@ class NewCaseWizardPanel1 implements WizardDescriptor.ValidatingPanel sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.casemodule; + +/** + * Interface for startup window implementations + */ +public interface StartupWindowInterface { + + /** + * Shows and makes active the startup window + */ + public void open(); + + /** + * Closes the startup window + */ + public void close(); +} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java new file mode 100644 index 0000000000..4cfa6f3b1c --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java @@ -0,0 +1,103 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2013 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.casemodule; + +import java.util.Collection; +import java.util.Iterator; +import java.util.logging.Level; +import org.openide.util.Lookup; +import org.sleuthkit.autopsy.coreutils.Logger; + +/** + * Provides the start up window to rest of the application. It may return the + * main / default startup window, or a custom one if it has been discovered. + * + * All that is required to create a custom startup window in a module and active it, + * is to implement StartupWindowInterface and register it with lookup as a ServiceProvider. + * The custom startup window is automatically chosen over the default one, given it is the only external module custom startup window. + */ +public class StartupWindowProvider implements StartupWindowInterface { + + private static volatile StartupWindowProvider instance; + private static final Logger logger = Logger.getLogger(StartupWindowProvider.class.getName()); + private volatile StartupWindowInterface startupWindowToUse; + + public static StartupWindowProvider getInstance() { + if (instance == null) { + synchronized (StartupWindowProvider.class) { + if (instance == null) { + instance = new StartupWindowProvider(); + instance.init(); + } + } + } + + return instance; + } + + private void init() { + if (startupWindowToUse == null) { + //discover the registered windows + Collection startupWindows = + Lookup.getDefault().lookupAll(StartupWindowInterface.class); + + int windowsCount = startupWindows.size(); + if (windowsCount > 2) { + logger.log(Level.WARNING, "More than 2 (" + windowsCount + ") start up windows discovered, will use the first custom one"); + } else if (windowsCount == 1) { + startupWindowToUse = startupWindows.iterator().next(); + logger.log(Level.INFO, "Will use the default startup window: " + startupWindowToUse.toString()); + } else { + //pick the non default one + Iterator it = startupWindows.iterator(); + while (it.hasNext()) { + StartupWindowInterface window = it.next(); + if (!org.sleuthkit.autopsy.casemodule.StartupWindow.class.isInstance(window)) { + startupWindowToUse = window; + logger.log(Level.INFO, "Will use the custom startup window: " + startupWindowToUse.toString()); + break; + + } + } + + if (startupWindowToUse == null) { + logger.log(Level.SEVERE, "Unexpected error, no custom startup window found, using the default"); + startupWindowToUse = new org.sleuthkit.autopsy.casemodule.StartupWindow(); + } + + } + + + } + } + + @Override + public void open() { + if (startupWindowToUse != null) { + startupWindowToUse.open(); + } + } + + @Override + public void close() { + if (startupWindowToUse != null) { + startupWindowToUse.close(); + } + } +} diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index fc791743fc..218c00c3aa 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -124,7 +124,7 @@ public class Installer extends ModuleInstall { javaFxInit = false; final String msg = "Error initializing JavaFX. "; final String details = " Some features will not be available. " - + " Check that you have the right JRE installed (Sun JRE > 1.7.10). "; + + " Check that you have the right JRE installed (Oracle JRE > 1.7.10). "; logger.log(Level.SEVERE, msg + details, e); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java index a9698df5ed..b8519b9878 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java @@ -578,22 +578,21 @@ class IngestScheduler { * of skipped * @return true if should be enqueued, false otherwise */ - private static boolean shouldEnqueueTask(ProcessTask processTask) { + private static boolean shouldEnqueueTask(final ProcessTask processTask) { final AbstractFile aFile = processTask.file; //if it's unalloc file, skip if so scheduled - if (processTask.context.isProcessUnalloc() == false) { - if (aFile.isVirtual() == true) { + if (processTask.context.isProcessUnalloc() == false + && aFile.getType().equals(TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS //unalloc files + ) ) { return false; - } } String fileName = aFile.getName(); if (fileName.equals(".") || fileName.equals("..")) { return false; } - if (aFile.isVirtual() == false && aFile.isFile() == true - && aFile.getType() == TSK_DB_FILES_TYPE_ENUM.FS) { + else if (aFile instanceof org.sleuthkit.datamodel.File ) { final org.sleuthkit.datamodel.File f = (File) aFile; //skip files in root dir, starting with $, containing : (not default attributes) diff --git a/NEWS.txt b/NEWS.txt index 8c3785a29a..757ef95b35 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -7,6 +7,7 @@ Improvements: Bugfixes: - Keyword Search: fix when Solr does not cleanly shutdown +- fix for "Process Unallocated Space" option doesn't do anything