From 1b1ed215b5957fca852077903e9d2ef1ab67a717 Mon Sep 17 00:00:00 2001 From: esaunders Date: Wed, 18 Apr 2018 13:11:20 -0400 Subject: [PATCH 01/44] Get node status from remote AINs. --- .../autoingest/AutoIngestDashboard.java | 28 ++-- .../autoingest/AutoIngestManager.java | 77 ++++++++-- .../autoingest/AutoIngestMonitor.java | 136 +++++++++++------- .../autoingest/AutoIngestNodeStateEvent.java | 46 ++++++ .../AutoIngestRequestNodeStateEvent.java | 34 +++++ 5 files changed, 246 insertions(+), 75 deletions(-) create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStateEvent.java create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java index 3389a64a03..63434fba1c 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java @@ -47,7 +47,7 @@ import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.core.ServicesMonitor; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; -import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.JobsSnapshot; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.AutoIngestNodeStateSnapshot; import org.sleuthkit.autopsy.guiutils.DurationCellRenderer; import org.sleuthkit.autopsy.guiutils.LongDateCellRenderer; import org.sleuthkit.autopsy.guiutils.StatusIconCellRenderer; @@ -474,19 +474,19 @@ final class AutoIngestDashboard extends JPanel implements Observer { @Override public void update(Observable observable, Object arg) { - EventQueue.invokeLater(new RefreshComponentsTask((JobsSnapshot) arg)); + EventQueue.invokeLater(new RefreshComponentsTask((AutoIngestNodeStateSnapshot) arg)); } /** * Reloads the table models using a jobs snapshot and refreshes the JTables * that use the models. * - * @param jobsSnapshot The jobs snapshot. + * @param nodeStateSnapshot The jobs snapshot. */ - private void refreshTables(JobsSnapshot jobsSnapshot) { - List pendingJobs = jobsSnapshot.getPendingJobs(); - List runningJobs = jobsSnapshot.getRunningJobs(); - List completedJobs = jobsSnapshot.getCompletedJobs(); + private void refreshTables(AutoIngestNodeStateSnapshot nodeStateSnapshot) { + List pendingJobs = nodeStateSnapshot.getPendingJobs(); + List runningJobs = nodeStateSnapshot.getRunningJobs(); + List completedJobs = nodeStateSnapshot.getCompletedJobs(); pendingJobs.sort(new AutoIngestJob.PriorityComparator()); runningJobs.sort(new AutoIngestJob.DataSourceFileNameComparator()); completedJobs.sort(new AutoIngestJob.CompletedDateDescendingComparator()); @@ -637,7 +637,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { */ private class RefreshComponentsTask implements Runnable { - private final JobsSnapshot jobsSnapshot; + private final AutoIngestNodeStateSnapshot jobsSnapshot; /** * Constructs a task that refreshes the UI components on this panel to @@ -646,7 +646,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { * * @param jobsSnapshot The jobs snapshot. */ - RefreshComponentsTask(JobsSnapshot jobsSnapshot) { + RefreshComponentsTask(AutoIngestNodeStateSnapshot jobsSnapshot) { this.jobsSnapshot = jobsSnapshot; } @@ -913,7 +913,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { */ private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - JobsSnapshot jobsSnapshot = autoIngestMonitor.refreshJobsSnapshot(); + AutoIngestNodeStateSnapshot jobsSnapshot = autoIngestMonitor.refreshJobsSnapshot(); refreshTables(jobsSnapshot); setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }//GEN-LAST:event_refreshButtonActionPerformed @@ -923,7 +923,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); AutoIngestJob job = (AutoIngestJob) (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.JOB.ordinal())); - JobsSnapshot jobsSnapshot; + AutoIngestNodeStateSnapshot jobsSnapshot; try { jobsSnapshot = autoIngestMonitor.prioritizeJob(job); refreshTables(jobsSnapshot); @@ -941,7 +941,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); String caseName = (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.CASE.ordinal())).toString(); - JobsSnapshot jobsSnapshot; + AutoIngestNodeStateSnapshot jobsSnapshot; try { jobsSnapshot = autoIngestMonitor.prioritizeCase(caseName); refreshTables(jobsSnapshot); @@ -963,7 +963,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); AutoIngestJob job = (AutoIngestJob) (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.JOB.ordinal())); - JobsSnapshot jobsSnapshot; + AutoIngestNodeStateSnapshot jobsSnapshot; try { jobsSnapshot = autoIngestMonitor.deprioritizeJob(job); refreshTables(jobsSnapshot); @@ -981,7 +981,7 @@ final class AutoIngestDashboard extends JPanel implements Observer { if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); String caseName = (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.CASE.ordinal())).toString(); - JobsSnapshot jobsSnapshot; + AutoIngestNodeStateSnapshot jobsSnapshot; try { jobsSnapshot = autoIngestMonitor.deprioritizeCase(caseName); refreshTables(jobsSnapshot); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index cc162494ae..264a6553a1 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -164,6 +164,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private volatile State state; private volatile ErrorState errorState; + private volatile AutoIngestNodeStateEvent lastPublishedStateEvent; + /** * Gets a singleton auto ingest manager responsible for processing auto * ingest jobs defined by manifest files that can be added to any level of a @@ -187,6 +189,9 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen SYS_LOGGER.log(Level.INFO, "Initializing auto ingest"); state = State.IDLE; eventPublisher = new AutopsyEventPublisher(); + // TODO: I would have liked to publish a STARTING_UP event here but + // the event channel isn't opened until startup() below. +// eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.STARTING_UP, LOCAL_HOST_NAME)); scanMonitor = new Object(); inputScanSchedulingExecutor = new ScheduledThreadPoolExecutor(NUM_INPUT_SCAN_SCHEDULING_THREADS, new ThreadFactoryBuilder().setNameFormat(INPUT_SCAN_SCHEDULER_THREAD_NAME).build()); inputScanExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(INPUT_SCAN_THREAD_NAME).build()); @@ -234,6 +239,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen jobStatusPublishingExecutor.scheduleWithFixedDelay(new PeriodicJobStatusEventTask(), JOB_STATUS_EVENT_INTERVAL_SECONDS, JOB_STATUS_EVENT_INTERVAL_SECONDS, TimeUnit.SECONDS); eventPublisher.addSubscriber(EVENT_LIST, instance); state = State.RUNNING; + + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.RUNNING, LOCAL_HOST_NAME)); errorState = ErrorState.NONE; } @@ -274,6 +281,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen handleRemoteCasePrioritizationEvent((AutoIngestCasePrioritizedEvent) event); } else if (event instanceof AutoIngestCaseDeletedEvent) { handleRemoteCaseDeletedEvent((AutoIngestCaseDeletedEvent) event); + } else if (event instanceof AutoIngestRequestNodeStateEvent) { + handleRemoteRequestNodeStateEvent(); } } } @@ -376,7 +385,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } /** - * Processes a case deletin event from another node by triggering an + * Processes a case deletion event from another node by triggering an * immediate input directory scan. * * @param event A case deleted event from another auto ingest node. @@ -389,6 +398,14 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen notifyObservers(Event.CASE_DELETED); } + /** + * Handle a request for current state by re-sending the last state event. + */ + private void handleRemoteRequestNodeStateEvent() { + // Re-publish last state event. + eventPublisher.publishRemotely(lastPublishedStateEvent); + } + /** * Shuts down auto ingest. */ @@ -399,6 +416,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen SYS_LOGGER.log(Level.INFO, "Auto ingest shutting down"); state = State.SHUTTING_DOWN; try { + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.SHUTTING_DOWN, AutoIngestManager.LOCAL_HOST_NAME)); eventPublisher.removeSubscriber(EVENT_LIST, instance); stopInputFolderScans(); stopJobProcessing(); @@ -1680,6 +1698,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ setChanged(); notifyObservers(Event.PAUSED_BY_REQUEST); + + /** + * Publish an event to let remote listeners know that the + * node has been paused. + */ + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.PAUSED_BY_REQUEST, AutoIngestManager.LOCAL_HOST_NAME)); } } } @@ -1703,6 +1727,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ setChanged(); notifyObservers(Event.RESUMED); + + /** + * Publish an event to let remote listeners know that the + * node has been resumed. + */ + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.RESUMED, AutoIngestManager.LOCAL_HOST_NAME)); } pauseLock.notifyAll(); } @@ -1723,10 +1753,23 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen pauseRequested = false; setChanged(); notifyObservers(Event.PAUSED_BY_REQUEST); + + /** + * Publish an event to let remote listeners know that the + * node has been paused. + */ + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.PAUSED_BY_REQUEST, AutoIngestManager.LOCAL_HOST_NAME)); + pauseLock.wait(); SYS_LOGGER.log(Level.INFO, "Job processing resumed after pause request"); setChanged(); notifyObservers(Event.RESUMED); + + /** + * Publish an event to let remote listeners know that the + * node has been resumed. + */ + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.RESUMED, AutoIngestManager.LOCAL_HOST_NAME)); } } } @@ -1743,11 +1786,24 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen SYS_LOGGER.log(Level.SEVERE, "Job processing paused for system error"); setChanged(); notifyObservers(Event.PAUSED_FOR_SYSTEM_ERROR); + + /** + * Publish an event to let remote listeners know that the node + * has been paused. + */ + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.PAUSED_FOR_SYSTEM_ERROR, AutoIngestManager.LOCAL_HOST_NAME)); + pauseLock.wait(); errorState = ErrorState.NONE; SYS_LOGGER.log(Level.INFO, "Job processing resumed after system error"); setChanged(); notifyObservers(Event.RESUMED); + + /** + * Publish an event to let remote listeners know that the node + * has been resumed. + */ + eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.RESUMED, AutoIngestManager.LOCAL_HOST_NAME)); } } @@ -2254,13 +2310,13 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen Case.openAsCurrentCase(metadataFilePath.toString()); } else { caseDirectoryPath = PathUtils.createCaseFolderPath(rootOutputDirectory, caseName); - + // Create the case directory now in case it is needed by selectSolrServerForCase Case.createCaseDirectory(caseDirectoryPath.toString(), CaseType.MULTI_USER_CASE); - + // If a list of servers exists, choose one to use for this case Server.selectSolrServerForCase(rootOutputDirectory, caseDirectoryPath); - + CaseDetails caseDetails = new CaseDetails(caseName); Case.createAsCurrentCase(CaseType.MULTI_USER_CASE, caseDirectoryPath.toString(), caseDetails); /* @@ -2281,8 +2337,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen throw new CaseManagementException(String.format("Error creating or opening case %s for %s", caseName, manifest.getFilePath()), ex); } catch (NoCurrentCaseException ex) { /* - * Deal with the unfortunate fact that - * Case.getOpenCase throws NoCurrentCaseException. + * Deal with the unfortunate fact that Case.getOpenCase + * throws NoCurrentCaseException. */ throw new CaseManagementException(String.format("Error getting current case %s for %s", caseName, manifest.getFilePath()), ex); } @@ -2489,7 +2545,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen SYS_LOGGER.log(Level.INFO, "Identified data source type for {0} as {1}", new Object[]{manifestPath, selectedProcessor.getDataSourceType()}); selectedProcessor.process(dataSource.getDeviceId(), dataSource.getPath(), progressMonitor, callBack); ingestLock.wait(); - + // at this point we got the content object(s) from the current DSP. // check whether the data source was processed successfully if ((dataSource.getResultDataSourceProcessorResultCode() == CRITICAL_ERRORS) @@ -2499,7 +2555,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen logDataSourceProcessorResult(dataSource); continue; } - + logDataSourceProcessorResult(dataSource); return; } @@ -3015,7 +3071,10 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen CASE_DELETED, PAUSED_BY_REQUEST, PAUSED_FOR_SYSTEM_ERROR, - RESUMED + RESUMED, + STARTING_UP, + RUNNING, + SHUTTING_DOWN } /** diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java index b8c5fcf23a..4d873ddb89 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java @@ -23,6 +23,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Observable; @@ -56,13 +57,19 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen AutoIngestManager.Event.JOB_STATUS_UPDATED.toString(), AutoIngestManager.Event.JOB_COMPLETED.toString(), AutoIngestManager.Event.CASE_PRIORITIZED.toString(), - AutoIngestManager.Event.JOB_STARTED.toString()})); + AutoIngestManager.Event.JOB_STARTED.toString(), + AutoIngestManager.Event.RUNNING.toString(), + AutoIngestManager.Event.PAUSED_BY_REQUEST.toString(), + AutoIngestManager.Event.PAUSED_FOR_SYSTEM_ERROR.toString(), + AutoIngestManager.Event.STARTING_UP.toString(), + AutoIngestManager.Event.SHUTTING_DOWN.toString(), + AutoIngestManager.Event.RESUMED.toString()})); private final AutopsyEventPublisher eventPublisher; private CoordinationService coordinationService; private final ScheduledThreadPoolExecutor coordSvcQueryExecutor; - private final Object jobsLock; - @GuardedBy("jobsLock") - private JobsSnapshot jobsSnapshot; + private final Object nodeStateLock; + @GuardedBy("nodeStateLock") + private AutoIngestNodeStateSnapshot nodeStateSnapshot; /** * Constructs an auto ingest monitor responsible for monitoring and @@ -71,8 +78,8 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen AutoIngestMonitor() { eventPublisher = new AutopsyEventPublisher(); coordSvcQueryExecutor = new ScheduledThreadPoolExecutor(NUM_COORD_SVC_QUERY_THREADS, new ThreadFactoryBuilder().setNameFormat(COORD_SVC_QUERY_THREAD_NAME).build()); - jobsLock = new Object(); - jobsSnapshot = new JobsSnapshot(); + nodeStateLock = new Object(); + nodeStateSnapshot = new AutoIngestNodeStateSnapshot(); } /** @@ -94,6 +101,9 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen } coordSvcQueryExecutor.scheduleWithFixedDelay(new CoordinationServiceQueryTask(), 0, CORRD_SVC_QUERY_INERVAL_MINS, TimeUnit.MINUTES); eventPublisher.addSubscriber(EVENT_LIST, this); + + // Publish an event that asks running nodes to send their state. + eventPublisher.publishRemotely(new AutoIngestRequestNodeStateEvent()); } /** @@ -130,6 +140,8 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen handleCasePrioritizationEvent((AutoIngestCasePrioritizedEvent) event); } else if (event instanceof AutoIngestCaseDeletedEvent) { handleCaseDeletedEvent((AutoIngestCaseDeletedEvent) event); + } else if (event instanceof AutoIngestNodeStateEvent) { + handleAutoIngestNodeStateEvent((AutoIngestNodeStateEvent) event); } } @@ -139,11 +151,11 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * @param event A auto ingest job started event. */ private void handleJobStartedEvent(AutoIngestJobStartedEvent event) { - synchronized (jobsLock) { - jobsSnapshot.removePendingJob(event.getJob()); - jobsSnapshot.addOrReplaceRunningJob(event.getJob()); + synchronized (nodeStateLock) { + nodeStateSnapshot.removePendingJob(event.getJob()); + nodeStateSnapshot.addOrReplaceRunningJob(event.getJob()); setChanged(); - notifyObservers(jobsSnapshot); + notifyObservers(nodeStateSnapshot); } } @@ -153,15 +165,15 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * @param event A auto ingest job status event. */ private void handleJobStatusEvent(AutoIngestJobStatusEvent event) { - synchronized (jobsLock) { + synchronized (nodeStateLock) { /* * Currently this event is only published for running jobs. */ AutoIngestJob job = event.getJob(); - jobsSnapshot.removePendingJob(job); - jobsSnapshot.addOrReplaceRunningJob(job); + nodeStateSnapshot.removePendingJob(job); + nodeStateSnapshot.addOrReplaceRunningJob(job); setChanged(); - notifyObservers(jobsSnapshot); + notifyObservers(nodeStateSnapshot); } } @@ -171,13 +183,13 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * @param event A auto ingest job completed event. */ private void handleJobCompletedEvent(AutoIngestJobCompletedEvent event) { - synchronized (jobsLock) { + synchronized (nodeStateLock) { AutoIngestJob job = event.getJob(); - jobsSnapshot.removePendingJob(job); - jobsSnapshot.removeRunningJob(job); - jobsSnapshot.addOrReplaceCompletedJob(job); + nodeStateSnapshot.removePendingJob(job); + nodeStateSnapshot.removeRunningJob(job); + nodeStateSnapshot.addOrReplaceCompletedJob(job); setChanged(); - notifyObservers(jobsSnapshot); + notifyObservers(nodeStateSnapshot); } } @@ -193,12 +205,30 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen /** * Handles a case deletion event. * - * @param event A job/case prioritization event. + * @param event A job/case deletion event. */ private void handleCaseDeletedEvent(AutoIngestCaseDeletedEvent event) { coordSvcQueryExecutor.submit(new CoordinationServiceQueryTask()); } + /** + * Handles an auto ingest node state change event. + * + * @param event A node state change event. + */ + private void handleAutoIngestNodeStateEvent(AutoIngestNodeStateEvent event) { + if (event.getEventType() == AutoIngestManager.Event.SHUTTING_DOWN) { + // Remove node from collection. + nodeStateSnapshot.nodeState.remove(event.getNodeName()); + } else { + // Otherwise either create an entry for the given node name or update + // an existing entry in the map. + nodeStateSnapshot.nodeState.put(event.getNodeName(), event.getEventType()); + } + setChanged(); + notifyObservers(nodeStateSnapshot); + } + /** * Gets the auto ingest monitor's current snapshot of the pending jobs * queue, running jobs list, and completed jobs list for an auto ingest @@ -206,9 +236,9 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The snapshot. */ - JobsSnapshot getJobsSnapshot() { - synchronized (jobsLock) { - return jobsSnapshot; + AutoIngestNodeStateSnapshot getNodeStateSnapshot() { + synchronized (nodeStateLock) { + return nodeStateSnapshot; } } @@ -219,10 +249,10 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The refreshed snapshot. */ - JobsSnapshot refreshJobsSnapshot() { - synchronized (jobsLock) { - jobsSnapshot = queryCoordinationService(); - return jobsSnapshot; + AutoIngestNodeStateSnapshot refreshJobsSnapshot() { + synchronized (nodeStateLock) { + nodeStateSnapshot = queryCoordinationService(); + return nodeStateSnapshot; } } @@ -232,9 +262,9 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The snapshot. */ - private JobsSnapshot queryCoordinationService() { + private AutoIngestNodeStateSnapshot queryCoordinationService() { try { - JobsSnapshot newJobsSnapshot = new JobsSnapshot(); + AutoIngestNodeStateSnapshot newJobsSnapshot = new AutoIngestNodeStateSnapshot(); List nodeList = coordinationService.getNodeList(CoordinationService.CategoryNode.MANIFESTS); for (String node : nodeList) { try { @@ -277,7 +307,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen } catch (CoordinationServiceException ex) { LOGGER.log(Level.SEVERE, "Failed to get node list from coordination service", ex); - return new JobsSnapshot(); + return new AutoIngestNodeStateSnapshot(); } } @@ -292,11 +322,11 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The latest jobs snapshot. */ - JobsSnapshot deprioritizeCase(final String caseName) throws AutoIngestMonitorException { + AutoIngestNodeStateSnapshot deprioritizeCase(final String caseName) throws AutoIngestMonitorException { List jobsToDeprioritize = new ArrayList<>(); - synchronized (jobsLock) { - for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) { + synchronized (nodeStateLock) { + for (AutoIngestJob pendingJob : nodeStateSnapshot.getPendingJobs()) { if (pendingJob.getManifest().getCaseName().equals(caseName)) { jobsToDeprioritize.add(pendingJob); } @@ -321,7 +351,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName)); }).start(); } - return jobsSnapshot; + return nodeStateSnapshot; } } @@ -335,11 +365,11 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The latest jobs snapshot. */ - JobsSnapshot prioritizeCase(final String caseName) throws AutoIngestMonitorException { + AutoIngestNodeStateSnapshot prioritizeCase(final String caseName) throws AutoIngestMonitorException { List jobsToPrioritize = new ArrayList<>(); int highestPriority = 0; - synchronized (jobsLock) { - for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) { + synchronized (nodeStateLock) { + for (AutoIngestJob pendingJob : nodeStateSnapshot.getPendingJobs()) { if (pendingJob.getPriority() > highestPriority) { highestPriority = pendingJob.getPriority(); } @@ -368,7 +398,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName)); }).start(); } - return jobsSnapshot; + return nodeStateSnapshot; } } @@ -382,13 +412,13 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The latest jobs snapshot. */ - JobsSnapshot deprioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException { - synchronized (jobsLock) { + AutoIngestNodeStateSnapshot deprioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException { + synchronized (nodeStateLock) { AutoIngestJob jobToDeprioritize = null; /* * Make sure the job is still in the pending jobs queue. */ - for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) { + for (AutoIngestJob pendingJob : nodeStateSnapshot.getPendingJobs()) { if (pendingJob.equals(job)) { jobToDeprioritize = job; break; @@ -419,7 +449,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen }).start(); } - return jobsSnapshot; + return nodeStateSnapshot; } } @@ -433,15 +463,15 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen * * @return The latest jobs snapshot. */ - JobsSnapshot prioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException { - synchronized (jobsLock) { + AutoIngestNodeStateSnapshot prioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException { + synchronized (nodeStateLock) { int highestPriority = 0; AutoIngestJob jobToPrioritize = null; /* * Get the highest known priority and make sure the job is still in * the pending jobs queue. */ - for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) { + for (AutoIngestJob pendingJob : nodeStateSnapshot.getPendingJobs()) { if (pendingJob.getPriority() > highestPriority) { highestPriority = pendingJob.getPriority(); } @@ -475,7 +505,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen }).start(); } - return jobsSnapshot; + return nodeStateSnapshot; } } @@ -494,10 +524,10 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen @Override public void run() { if (!Thread.currentThread().isInterrupted()) { - synchronized (jobsLock) { - jobsSnapshot = queryCoordinationService(); + synchronized (nodeStateLock) { + nodeStateSnapshot = queryCoordinationService(); setChanged(); - notifyObservers(jobsSnapshot); + notifyObservers(nodeStateSnapshot); } } } @@ -505,15 +535,17 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen } /** - * A snapshot of the pending jobs queue, running jobs list, and completed - * jobs list for an auto ingest cluster. + * A snapshot of the pending jobs queue, running jobs list, completed + * jobs list and node state for an auto ingest cluster. */ - static final class JobsSnapshot { + static final class AutoIngestNodeStateSnapshot { private final Set pendingJobs = new HashSet<>(); private final Set runningJobs = new HashSet<>(); private final Set completedJobs = new HashSet<>(); + private HashMap nodeState = new HashMap<>(); + /** * Gets the snapshot of the pending jobs queue for an auto ingest * cluster. diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStateEvent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStateEvent.java new file mode 100644 index 0000000000..d1a71c3c0a --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStateEvent.java @@ -0,0 +1,46 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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.experimental.autoingest; + +import java.io.Serializable; +import org.sleuthkit.autopsy.events.AutopsyEvent; + +/** + * Event published when an auto ingest node is started, paused, + * resumed or shutdown. + */ +public final class AutoIngestNodeStateEvent extends AutopsyEvent implements Serializable { + private static final long serialVersionUID = 1L; + private final AutoIngestManager.Event eventType; + private final String nodeName; + + public AutoIngestNodeStateEvent(AutoIngestManager.Event eventType, String nodeName) { + super(eventType.toString(), null, null); + this.eventType = eventType; + this.nodeName = nodeName; + } + + public AutoIngestManager.Event getEventType() { + return this.eventType; + } + + public String getNodeName() { + return this.nodeName; + } +} diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java new file mode 100644 index 0000000000..a18411b1a9 --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java @@ -0,0 +1,34 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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.experimental.autoingest; + +import java.io.Serializable; +import org.sleuthkit.autopsy.events.AutopsyEvent; + +/** + * Event published to request that auto ingest nodes send their current state. + * This event is sent on auto ingest dashboard startup. + */ +public class AutoIngestRequestNodeStateEvent extends AutopsyEvent implements Serializable { + private static final long serialVersionUID = 1L; + + public AutoIngestRequestNodeStateEvent() { + super("", null, null); + } +} From 6df54afd5030b76e82d2393f1369ecc3f2cb4980 Mon Sep 17 00:00:00 2001 From: esaunders Date: Wed, 18 Apr 2018 14:30:53 -0400 Subject: [PATCH 02/44] Fix for AIN state request event. --- .../autopsy/experimental/autoingest/AutoIngestManager.java | 6 ++++-- .../autopsy/experimental/autoingest/AutoIngestMonitor.java | 2 +- .../autoingest/AutoIngestRequestNodeStateEvent.java | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index 264a6553a1..2efbe5ca91 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -132,7 +132,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen Event.JOB_STATUS_UPDATED.toString(), Event.JOB_COMPLETED.toString(), Event.CASE_PRIORITIZED.toString(), - Event.JOB_STARTED.toString()})); + Event.JOB_STARTED.toString(), + Event.REPORT_STATE.toString()})); private static final long JOB_STATUS_EVENT_INTERVAL_SECONDS = 10; private static final String JOB_STATUS_PUBLISHING_THREAD_NAME = "AIM-job-status-event-publisher-%d"; private static final long MAX_MISSED_JOB_STATUS_UPDATES = 10; @@ -3074,7 +3075,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen RESUMED, STARTING_UP, RUNNING, - SHUTTING_DOWN + SHUTTING_DOWN, + REPORT_STATE } /** diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java index 4d873ddb89..810b92b826 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java @@ -103,7 +103,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen eventPublisher.addSubscriber(EVENT_LIST, this); // Publish an event that asks running nodes to send their state. - eventPublisher.publishRemotely(new AutoIngestRequestNodeStateEvent()); + eventPublisher.publishRemotely(new AutoIngestRequestNodeStateEvent(AutoIngestManager.Event.REPORT_STATE)); } /** diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java index a18411b1a9..d756020520 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestRequestNodeStateEvent.java @@ -28,7 +28,7 @@ import org.sleuthkit.autopsy.events.AutopsyEvent; public class AutoIngestRequestNodeStateEvent extends AutopsyEvent implements Serializable { private static final long serialVersionUID = 1L; - public AutoIngestRequestNodeStateEvent() { - super("", null, null); + public AutoIngestRequestNodeStateEvent(AutoIngestManager.Event eventType) { + super(eventType.toString(), null, null); } } From d316c350c09a3a7ec1f8087a4218d725a14ff092 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 19 Apr 2018 12:09:24 -0400 Subject: [PATCH 03/44] 3753 Auto Ingest node status tab added for admin mode --- .../autoingest/AinStatusNode.java | 130 ++++++++++++++ .../autoingest/AutoIngestDashboard.java | 21 ++- .../AutoIngestDashboardOpenAction.java | 14 +- .../AutoIngestDashboardTopComponent.java | 13 +- .../autoingest/AutoIngestJobsNode.java | 5 +- .../autoingest/AutoIngestNodeStatus.form | 127 ++++++++++++++ .../autoingest/AutoIngestNodeStatus.java | 139 +++++++++++++++ .../AutoIngestNodeStatusTopComponent.form | 28 +++ .../AutoIngestNodeStatusTopComponent.java | 142 +++++++++++++++ .../autoingest/AutoIngestNodesPanel.form | 18 ++ .../autoingest/AutoIngestNodesPanel.java | 162 ++++++++++++++++++ .../experimental/autoingest/Bundle.properties | 6 + 12 files changed, 786 insertions(+), 19 deletions(-) create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.form create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.form create mode 100644 Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java new file mode 100644 index 0000000000..833b67e5b3 --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java @@ -0,0 +1,130 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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.experimental.autoingest; + + +import javax.swing.Action; + +import java.util.ArrayList; + +import java.util.List; + +import org.openide.nodes.AbstractNode; +import org.openide.nodes.ChildFactory; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.nodes.Sheet; + +import org.sleuthkit.autopsy.datamodel.NodeProperty; + + +/** + * A node which represents all AutoIngestJobs of a given AutoIngestJobStatus. + * Each job with the specified status will have a child node representing it. + */ +final class AinStatusNode extends AbstractNode { + /** + * Construct a new AutoIngestJobsNode. + */ + AinStatusNode(AutoIngestMonitor monitor) { + super(Children.create(new AinStatusChildren(monitor), false)); + } + + /** + * A ChildFactory for generating JobNodes. + */ + static class AinStatusChildren extends ChildFactory { + + private final AutoIngestMonitor monitor; + + /** + * Create children nodes for the AutoIngestJobsNode which will each + * represent a single AutoIngestJob + * + * @param autoIngestMonitor the monitor which contains the AutoIngestJobs + */ + AinStatusChildren(AutoIngestMonitor autoIngestMonitor) { + monitor = autoIngestMonitor; + } + + @Override + protected boolean createKeys(List list) { + //get keys from monitor + //add keys to List + list.addAll(monitor.getJobsSnapshot().getPendingJobs()); + return true; + } + + @Override + protected Node createNodeForKey(AutoIngestJob key) { + return new StatusNode(key); + } + + } + + /** + * A node which represents a single auto ingest job. + */ + static final class StatusNode extends AbstractNode { + + private final AutoIngestJob autoIngestJob; + + /** + * Construct a new JobNode to represent an AutoIngestJob and its status. + * + * @param job - the AutoIngestJob being represented by this node + */ + StatusNode(AutoIngestJob job) { + super(Children.LEAF); + autoIngestJob = job; + } + + /** + * Get the AutoIngestJob which this node represents. + * + * @return autoIngestJob + */ + AutoIngestJob getAutoIngestJob() { + return autoIngestJob; + } + + @Override + protected Sheet createSheet() { + Sheet s = super.createSheet(); + Sheet.Set ss = s.get(Sheet.PROPERTIES); + if (ss == null) { + ss = Sheet.createPropertiesSet(); + s.put(ss); + } + ss.put(new NodeProperty<>("Host Name", "Host Name", "Host Name", //host name + "TODO - ADD HOST NAME")); + ss.put(new NodeProperty<>("Status","Status","Status","TODO - ADD NODE STATUS")); + return s; + } + + @Override + public Action[] getActions(boolean context) { + List actions = new ArrayList<>(); + if (AutoIngestDashboard.isAdminAutoIngestDashboard()) { + //Add actions + } + return actions.toArray(new Action[actions.size()]); + } + } +} diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java index 482742d7de..1325d29c8f 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java @@ -26,12 +26,17 @@ import java.awt.Color; import java.awt.EventQueue; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.File; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import javax.swing.Action; import javax.swing.JPanel; import javax.swing.SwingWorker; import javax.swing.UIManager; +import org.openide.modules.Places; import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.core.ServicesMonitor; @@ -41,7 +46,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; * A dashboard for monitoring an automated ingest cluster. */ final class AutoIngestDashboard extends JPanel implements Observer { - + + private final static String ADMIN_ACCESS_FILE_NAME = "adminAccess"; + private final static String ADMIN_ACCESS_FILE_PATH = Places.getUserDirectory().getAbsolutePath() + File.separator + ADMIN_ACCESS_FILE_NAME; private static final long serialVersionUID = 1L; private static final Logger LOGGER = Logger.getLogger(AutoIngestDashboard.class.getName()); private AutoIngestMonitor autoIngestMonitor; @@ -224,11 +231,10 @@ final class AutoIngestDashboard extends JPanel implements Observer { autoIngestMonitor.addObserver(this); new Thread(() -> { try { - autoIngestMonitor.startUp(); - } - catch (AutoIngestMonitor.AutoIngestMonitorException ex) { + autoIngestMonitor.startUp(); + } catch (AutoIngestMonitor.AutoIngestMonitorException ex) { LOGGER.log(Level.SEVERE, "Unable to start up Auto Ingest Monitor", ex); - } + } }).start(); } @@ -282,6 +288,11 @@ final class AutoIngestDashboard extends JPanel implements Observer { } + static boolean isAdminAutoIngestDashboard() { + File f = new File(ADMIN_ACCESS_FILE_PATH); + return f.exists(); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java index 45563a4f4b..4aa6b2685e 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java @@ -32,33 +32,33 @@ import org.sleuthkit.autopsy.coreutils.Logger; @ActionRegistration(displayName = "#CTL_AutoIngestDashboardOpenAction", lazy = false) @Messages({"CTL_AutoIngestDashboardOpenAction=Auto Ingest Dashboard"}) public final class AutoIngestDashboardOpenAction extends CallableSystemAction { - + private static final Logger LOGGER = Logger.getLogger(AutoIngestDashboardOpenAction.class.getName()); private static final String DISPLAY_NAME = Bundle.CTL_AutoIngestDashboardOpenAction(); - + @Override public boolean isEnabled() { return (UserPreferences.getIsMultiUserModeEnabled()); } - + @Override @SuppressWarnings("fallthrough") public void performAction() { AutoIngestDashboardTopComponent.openTopComponent(); } - + @Override public String getName() { return DISPLAY_NAME; } - + @Override public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } - + @Override public boolean asynchronous() { return false; // run on edt } -} \ No newline at end of file +} diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java index 9a5553519c..231f210c3a 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.experimental.autoingest; import java.awt.Component; +import java.awt.EventQueue; import java.util.List; import java.util.logging.Level; import java.util.stream.Collectors; @@ -39,8 +40,8 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; ) @TopComponent.Registration(mode = "dashboard", openAtStartup = false) @Messages({ - "CTL_AutoIngestDashboardAction=Auto Ingest Dashboard", - "CTL_AutoIngestDashboardTopComponent=Auto Ingest Dashboard"}) + "CTL_AutoIngestDashboardAction=Auto Ingest Jobs", + "CTL_AutoIngestDashboardTopComponent=Auto Ingest Jobs"}) public final class AutoIngestDashboardTopComponent extends TopComponent { private static final long serialVersionUID = 1L; @@ -75,8 +76,14 @@ public final class AutoIngestDashboardTopComponent extends TopComponent { AutoIngestDashboard dashboard = AutoIngestDashboard.createDashboard(); tc.add(dashboard); dashboard.setSize(dashboard.getPreferredSize()); - + //if the user has administrator access enabled open the Node Status top component as well + if (AutoIngestDashboard.isAdminAutoIngestDashboard()) { + EventQueue.invokeLater(() -> { + AutoIngestNodeStatusTopComponent.openTopComponent(dashboard.getMonitor()); + }); + } tc.open(); + } tc.toFront(); tc.requestActive(); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java index b623a2281f..1293c6393a 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java @@ -41,8 +41,6 @@ import org.sleuthkit.autopsy.guiutils.StatusIconCellRenderer; * Each job with the specified status will have a child node representing it. */ final class AutoIngestJobsNode extends AbstractNode { - private final static String ADMIN_ACCESS_FILE_NAME = "adminAccess"; - private final static String ADMIN_ACCESS_FILE_PATH = Places.getUserDirectory().getAbsolutePath() + File.separator + ADMIN_ACCESS_FILE_NAME; @Messages({ "AutoIngestJobsNode.caseName.text=Case Name", @@ -193,8 +191,7 @@ final class AutoIngestJobsNode extends AbstractNode { @Override public Action[] getActions(boolean context) { List actions = new ArrayList<>(); - File f = new File(ADMIN_ACCESS_FILE_PATH); - if (f.exists()) { + if (AutoIngestDashboard.isAdminAutoIngestDashboard()) { switch (jobStatus) { case PENDING_JOB: actions.add(new PrioritizationAction.PrioritizeJobAction(autoIngestJob)); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form new file mode 100644 index 0000000000..0cb5b3f2e2 --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form @@ -0,0 +1,127 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java new file mode 100644 index 0000000000..68d6e89b94 --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java @@ -0,0 +1,139 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.sleuthkit.autopsy.experimental.autoingest; + +import java.awt.Cursor; + +/** + * + * @author wschaefer + */ +public class AutoIngestNodeStatus extends javax.swing.JPanel { + + private final AutoIngestMonitor autoIngestMonitor; + private final AutoIngestNodesPanel nodesPanel; + /** + * Creates new form AutoIngestNodeStatus + */ + public AutoIngestNodeStatus(AutoIngestMonitor monitor) { + initComponents(); + super.setName("Auto Ingest Nodes"); + autoIngestMonitor = monitor; + nodesPanel = new AutoIngestNodesPanel(); + nodesPanel.setSize(nodesPanel.getSize()); + jScrollPane1.add(nodesPanel); + jScrollPane1.setViewportView(nodesPanel); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + refreshButton = new javax.swing.JButton(); + lbServicesStatus = new javax.swing.JLabel(); + tbServicesStatusMessage = new javax.swing.JTextField(); + clusterMetricsButton = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + jLabel1 = new javax.swing.JLabel(); + + org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.refreshButton.text")); // NOI18N + refreshButton.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.refreshButton.toolTipText")); // NOI18N + refreshButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + refreshButtonActionPerformed(evt); + } + }); + + lbServicesStatus.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(lbServicesStatus, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.lbServicesStatus.text")); // NOI18N + + tbServicesStatusMessage.setEditable(false); + tbServicesStatusMessage.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N + tbServicesStatusMessage.setText(org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.tbServicesStatusMessage.text")); // NOI18N + tbServicesStatusMessage.setBorder(null); + + org.openide.awt.Mnemonics.setLocalizedText(clusterMetricsButton, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.clusterMetricsButton.text")); // NOI18N + clusterMetricsButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + clusterMetricsButtonActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.jLabel1.text")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1) + .addGroup(layout.createSequentialGroup() + .addComponent(lbServicesStatus) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(tbServicesStatusMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 861, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(clusterMetricsButton))) + .addContainerGap()) + ); + + layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {clusterMetricsButton, refreshButton}); + + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lbServicesStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(tbServicesStatusMessage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(382, 382, 382) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(refreshButton) + .addComponent(clusterMetricsButton)) + .addContainerGap()) + ); + }// //GEN-END:initComponents + + private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + refreshTables(); + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + }//GEN-LAST:event_refreshButtonActionPerformed + + private void refreshTables(){ + nodesPanel.refresh(autoIngestMonitor); + } + + private void clusterMetricsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clusterMetricsButtonActionPerformed + new AutoIngestMetricsDialog(this.getTopLevelAncestor()); + }//GEN-LAST:event_clusterMetricsButtonActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton clusterMetricsButton; + private javax.swing.JLabel jLabel1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JLabel lbServicesStatus; + private javax.swing.JButton refreshButton; + private javax.swing.JTextField tbServicesStatusMessage; + // End of variables declaration//GEN-END:variables +} diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.form new file mode 100644 index 0000000000..5f3eab1a5f --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.form @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java new file mode 100644 index 0000000000..dc38b2fba8 --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java @@ -0,0 +1,142 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2011-2018 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.experimental.autoingest; + +import java.awt.Component; +import java.util.List; +import java.util.logging.Level; +import java.util.stream.Collectors; +import org.openide.util.NbBundle.Messages; +import org.openide.windows.Mode; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; + +/** + * Top component which displays the Auto Ingest Dashboard interface. + */ +@TopComponent.Description( + preferredID = "AutoIngestNodeStatusTopComponent", + //iconBase="SET/PATH/TO/ICON/HERE", + persistenceType = TopComponent.PERSISTENCE_NEVER +) +@TopComponent.Registration(mode = "nodeStatus", openAtStartup = false) +@Messages({ + "CTL_AutoIngestNodeStatusAction=Auto Ingest Nodes", + "CTL_AutoIngestNodeStatusTopComponent=Auto Ingest Nodes"}) +public final class AutoIngestNodeStatusTopComponent extends TopComponent { + + private static final long serialVersionUID = 1L; + public final static String PREFERRED_ID = "AutoIngestNodeStatusTopComponent"; // NON-NLS + private static final Logger logger = Logger.getLogger(AutoIngestNodeStatusTopComponent.class.getName()); + private static boolean topComponentInitialized = false; + + @Messages({ + "AutoIngestNodeStatusTopComponent.exceptionMessage.failedToCreateDashboard=Failed to create Auto Ingest Dashboard.",}) + public static void openTopComponent(AutoIngestMonitor monitor) { + final AutoIngestNodeStatusTopComponent tc = (AutoIngestNodeStatusTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); + if (tc != null) { + topComponentInitialized = true; + WindowManager.getDefault().isTopComponentFloating(tc); + + if (tc.isOpened() == false) { + Mode mode = WindowManager.getDefault().findMode("nodeStatus"); // NON-NLS + if (mode != null) { + mode.dockInto(tc); + } + /* + * Make sure we have a clean-slate before attaching a new + * dashboard instance so we don't accumulate them. + */ + tc.removeAll(); + + /* + * Create a new dashboard instance to ensure we're using the + * most recent configuration. + */ + AutoIngestNodeStatus nodeTab = new AutoIngestNodeStatus(monitor); + nodeTab.setSize(nodeTab.getPreferredSize()); + tc.add(nodeTab); + tc.open(); + } + tc.toFront(); + tc.requestActive(); + } + } + + public static void closeTopComponent() { + if (topComponentInitialized) { + final TopComponent tc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + if (tc != null) { + try { + tc.close(); + } catch (Exception e) { + logger.log(Level.SEVERE, "Failed to close " + PREFERRED_ID, e); // NON-NLS + } + } + } + } + + public AutoIngestNodeStatusTopComponent() { + initComponents(); + setName(Bundle.CTL_AutoIngestNodeStatusTopComponent()); + } + + + @Override + public List availableModes(List modes) { + /* + * This looks like the right thing to do, but online discussions seems + * to indicate this method is effectively deprecated. A break point + * placed here was never hit. + */ + return modes.stream().filter(mode -> mode.getName().equals("nodeStatus") || mode.getName().equals("ImageGallery")) + .collect(Collectors.toList()); + } + + @Override + public void componentOpened() { + super.componentOpened(); + WindowManager.getDefault().setTopComponentFloating(this, true); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.form new file mode 100644 index 0000000000..bde4db4324 --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.form @@ -0,0 +1,18 @@ + + +
+ + + + + + + + + + + + + + + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java new file mode 100644 index 0000000000..350e9b1c8a --- /dev/null +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java @@ -0,0 +1,162 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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.experimental.autoingest; + +import java.awt.Dimension; +import java.beans.PropertyVetoException; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListSelectionListener; +import org.netbeans.swing.outline.DefaultOutlineModel; +import org.netbeans.swing.outline.Outline; +import org.openide.explorer.ExplorerManager; +import org.openide.nodes.Node; +import org.openide.util.NbBundle.Messages; +import org.sleuthkit.autopsy.datamodel.EmptyNode; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJobsNode.AutoIngestJobStatus; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJobsNode.JobNode; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.JobsSnapshot; + +/** + * A panel which displays an outline view with all jobs for a specified status. + */ +final class AutoIngestNodesPanel extends javax.swing.JPanel implements ExplorerManager.Provider { + + private static final long serialVersionUID = 1L; + private static final int INITIAL_CASENAME_WIDTH = 170; + private static final int INITIAL_DATASOURCE_WIDTH = 270; + private static final int INITIAL_PRIORITIZED_WIDTH = 20; + private static final int INITIAL_STATUS_WIDTH = 20; + private static final int INVALID_INDEX = -1; + private final org.openide.explorer.view.OutlineView outlineView; + private final Outline outline; + private ExplorerManager explorerManager; + + /** + * Creates a new AutoIngestJobsPanel of the specified jobStatus + * + * @param jobStatus the status of the jbos to be displayed on this panel + */ + AutoIngestNodesPanel() { + initComponents(); + outlineView = new org.openide.explorer.view.OutlineView(); + outline = outlineView.getOutline(); + customize(); + } + + /** + * Set up the AutoIngestJobsPanel's so that its outlineView is displaying + * the correct columns for the specified AutoIngestJobStatus + */ + void customize() { + ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Host Name"); + outline.setRowSelectionAllowed(false); //rows will be made selectable after table has been populated + outline.setFocusable(false); //table will be made focusable after table has been populated + if (null == explorerManager) { + explorerManager = new ExplorerManager(); + } + + outlineView.setPropertyColumns( + "Status", "Status"); + outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + outline.setRootVisible(false); + add(outlineView, java.awt.BorderLayout.CENTER); + } + + private int getColumnIndexByName(String columnName) { + for (int index = 0; index < outline.getColumnModel().getColumnCount(); index++) { + if (outline.getColumnModel().getColumn(index).getHeaderValue().toString().equals(columnName)) { + return index; + } + } + return INVALID_INDEX; + } + + @Override + public void setSize(Dimension d) { + super.setSize(d); + outlineView.setMaximumSize(new Dimension(400, 100)); + outline.setPreferredScrollableViewportSize(new Dimension(400, 100)); + } + + /** + * Add a list selection listener to the selection model of the outline being + * used in this panel. + * + * @param listener the ListSelectionListener to add + */ + void addListSelectionListener(ListSelectionListener listener) { + outline.getSelectionModel().addListSelectionListener(listener); + } + + @Override + public ExplorerManager getExplorerManager() { + return explorerManager; + } + + /** + * Update the contents of this AutoIngestJobsPanel while retaining currently + * selected node. + * + * @param jobsSnapshot - the JobsSnapshot which will provide the new + * contents + */ + void refresh(AutoIngestMonitor monitor) { + outline.setRowSelectionAllowed(false); + Node[] selectedNodes = explorerManager.getSelectedNodes(); + AinStatusNode autoIngestNode = new AinStatusNode(monitor); + explorerManager.setRootContext(autoIngestNode); + outline.setRowSelectionAllowed(true); + if (selectedNodes.length > 0 && outline.isFocusable()) { //don't allow saved selections of empty nodes to be restored + try { + explorerManager.setSelectedNodes(new Node[]{autoIngestNode.getChildren().findChild(selectedNodes[0].getName())}); + } catch (PropertyVetoException ignore) { + //Unable to select previously selected node + } + } + outline.setFocusable(true); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + setLayout(new java.awt.BorderLayout()); + }// //GEN-END:initComponents + + /** + * Get the AutoIngestJob for the currently selected node of this panel. + * + * @return AutoIngestJob which is currently selected in this panel + */ + AutoIngestJob getSelectedAutoIngestJob() { + Node[] selectedRows = explorerManager.getSelectedNodes(); + if (selectedRows.length == 1) { + return ((JobNode) selectedRows[0]).getAutoIngestJob(); + } + return null; + } + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + +} diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties index 6194815f69..5e6cae223b 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties @@ -258,3 +258,9 @@ AutoIngestControlPanel.bnPrioritizeJob.toolTipText=Move this folder to the top o AutoIngestControlPanel.bnPrioritizeCase.toolTipText=Move all images associated with a case to top of Pending queue. AutoIngestControlPanel.bnPrioritizeJob.actionCommand=Prioritize Job AutoIngestControlPanel.bnDeprioritizeJob.actionCommand=Deprioritize Job +AutoIngestNodeStatus.clusterMetricsButton.text=Auto Ingest &Metrics +AutoIngestNodeStatus.tbServicesStatusMessage.text=Connecting... +AutoIngestNodeStatus.lbServicesStatus.text=Services Status: +AutoIngestNodeStatus.refreshButton.toolTipText=Refresh displayed tables +AutoIngestNodeStatus.refreshButton.text=&Refresh +AutoIngestNodeStatus.jLabel1.text=Auto Ingest Nodes From 3f0c2095721d060f5e50639a9260d5759c5bb938 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 19 Apr 2018 13:43:07 -0400 Subject: [PATCH 04/44] 3753 clean up auto ingest node status dashboard --- ...odeStatus.form => AinStatusDashboard.form} | 12 ++-- ...odeStatus.java => AinStatusDashboard.java} | 54 +++++++++------- ...rm => AinStatusDashboardTopComponent.form} | 0 ...va => AinStatusDashboardTopComponent.java} | 26 ++++---- .../autoingest/AinStatusNode.java | 47 +++++++------- ...estNodesPanel.form => AinStatusPanel.form} | 0 ...estNodesPanel.java => AinStatusPanel.java} | 26 ++------ .../autoingest/AutoIngestAdminActions.java | 63 ++++++++++++++++++- .../autoingest/AutoIngestDashboard.java | 3 - .../AutoIngestDashboardTopComponent.java | 2 +- .../autoingest/AutoIngestJobsNode.java | 3 - .../experimental/autoingest/Bundle.properties | 12 ++-- 12 files changed, 147 insertions(+), 101 deletions(-) rename Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/{AutoIngestNodeStatus.form => AinStatusDashboard.form} (86%) rename Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/{AutoIngestNodeStatus.java => AinStatusDashboard.java} (78%) rename Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/{AutoIngestNodeStatusTopComponent.form => AinStatusDashboardTopComponent.form} (100%) rename Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/{AutoIngestNodeStatusTopComponent.java => AinStatusDashboardTopComponent.java} (81%) rename Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/{AutoIngestNodesPanel.form => AinStatusPanel.form} (100%) rename Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/{AutoIngestNodesPanel.java => AinStatusPanel.java} (82%) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form similarity index 86% rename from Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form rename to Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form index 0cb5b3f2e2..58554e49f3 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.form +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form @@ -65,10 +65,10 @@ - + - + @@ -81,7 +81,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -119,7 +119,7 @@ - + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java similarity index 78% rename from Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java rename to Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java index 68d6e89b94..aee8306323 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatus.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java @@ -1,31 +1,41 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2018 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.experimental.autoingest; import java.awt.Cursor; -/** - * - * @author wschaefer - */ -public class AutoIngestNodeStatus extends javax.swing.JPanel { +public class AinStatusDashboard extends javax.swing.JPanel { + + private final AutoIngestMonitor autoIngestMonitor; + private final AinStatusPanel nodesPanel; - private final AutoIngestMonitor autoIngestMonitor; - private final AutoIngestNodesPanel nodesPanel; /** * Creates new form AutoIngestNodeStatus */ - public AutoIngestNodeStatus(AutoIngestMonitor monitor) { + public AinStatusDashboard(AutoIngestMonitor monitor) { initComponents(); - super.setName("Auto Ingest Nodes"); autoIngestMonitor = monitor; - nodesPanel = new AutoIngestNodesPanel(); - nodesPanel.setSize(nodesPanel.getSize()); + nodesPanel = new AinStatusPanel(); + nodesPanel.setSize(nodesPanel.getSize()); jScrollPane1.add(nodesPanel); jScrollPane1.setViewportView(nodesPanel); + nodesPanel.refresh(autoIngestMonitor); } /** @@ -44,8 +54,8 @@ public class AutoIngestNodeStatus extends javax.swing.JPanel { jScrollPane1 = new javax.swing.JScrollPane(); jLabel1 = new javax.swing.JLabel(); - org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.refreshButton.text")); // NOI18N - refreshButton.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.refreshButton.toolTipText")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.refreshButton.text")); // NOI18N + refreshButton.setToolTipText(org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.refreshButton.toolTipText")); // NOI18N refreshButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { refreshButtonActionPerformed(evt); @@ -53,14 +63,14 @@ public class AutoIngestNodeStatus extends javax.swing.JPanel { }); lbServicesStatus.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(lbServicesStatus, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.lbServicesStatus.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(lbServicesStatus, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.lbServicesStatus.text")); // NOI18N tbServicesStatusMessage.setEditable(false); tbServicesStatusMessage.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N - tbServicesStatusMessage.setText(org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.tbServicesStatusMessage.text")); // NOI18N + tbServicesStatusMessage.setText(org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.tbServicesStatusMessage.text")); // NOI18N tbServicesStatusMessage.setBorder(null); - org.openide.awt.Mnemonics.setLocalizedText(clusterMetricsButton, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.clusterMetricsButton.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(clusterMetricsButton, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.clusterMetricsButton.text")); // NOI18N clusterMetricsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clusterMetricsButtonActionPerformed(evt); @@ -68,7 +78,7 @@ public class AutoIngestNodeStatus extends javax.swing.JPanel { }); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AutoIngestNodeStatus.class, "AutoIngestNodeStatus.jLabel1.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.jLabel1.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -119,10 +129,10 @@ public class AutoIngestNodeStatus extends javax.swing.JPanel { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }//GEN-LAST:event_refreshButtonActionPerformed - private void refreshTables(){ + private void refreshTables() { nodesPanel.refresh(autoIngestMonitor); } - + private void clusterMetricsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clusterMetricsButtonActionPerformed new AutoIngestMetricsDialog(this.getTopLevelAncestor()); }//GEN-LAST:event_clusterMetricsButtonActionPerformed diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.form similarity index 100% rename from Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.form rename to Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.form diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java similarity index 81% rename from Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java rename to Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java index dc38b2fba8..c10534e5fa 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodeStatusTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.experimental.autoingest; -import java.awt.Component; import java.util.List; import java.util.logging.Level; import java.util.stream.Collectors; @@ -27,31 +26,30 @@ import org.openide.windows.Mode; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; /** - * Top component which displays the Auto Ingest Dashboard interface. + * Top component which displays the Auto Ingest Node Status Dashboard interface. */ @TopComponent.Description( - preferredID = "AutoIngestNodeStatusTopComponent", + preferredID = "AinStatusDashboardTopComponent", //iconBase="SET/PATH/TO/ICON/HERE", persistenceType = TopComponent.PERSISTENCE_NEVER ) @TopComponent.Registration(mode = "nodeStatus", openAtStartup = false) @Messages({ - "CTL_AutoIngestNodeStatusAction=Auto Ingest Nodes", - "CTL_AutoIngestNodeStatusTopComponent=Auto Ingest Nodes"}) -public final class AutoIngestNodeStatusTopComponent extends TopComponent { + "CTL_AinStatusDashboardAction=Auto Ingest Nodes", + "CTL_AinStatusDashboardTopComponent=Auto Ingest Nodes"}) +public final class AinStatusDashboardTopComponent extends TopComponent { private static final long serialVersionUID = 1L; - public final static String PREFERRED_ID = "AutoIngestNodeStatusTopComponent"; // NON-NLS - private static final Logger logger = Logger.getLogger(AutoIngestNodeStatusTopComponent.class.getName()); + public final static String PREFERRED_ID = "AinStatusDashboardTopComponent"; // NON-NLS + private static final Logger logger = Logger.getLogger(AinStatusDashboardTopComponent.class.getName()); private static boolean topComponentInitialized = false; @Messages({ - "AutoIngestNodeStatusTopComponent.exceptionMessage.failedToCreateDashboard=Failed to create Auto Ingest Dashboard.",}) + "AinStatusDashboardTopComponent.exceptionMessage.failedToCreateDashboard=Failed to create Auto Ingest Node Status Dashboard.",}) public static void openTopComponent(AutoIngestMonitor monitor) { - final AutoIngestNodeStatusTopComponent tc = (AutoIngestNodeStatusTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); + final AinStatusDashboardTopComponent tc = (AinStatusDashboardTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (tc != null) { topComponentInitialized = true; WindowManager.getDefault().isTopComponentFloating(tc); @@ -71,7 +69,7 @@ public final class AutoIngestNodeStatusTopComponent extends TopComponent { * Create a new dashboard instance to ensure we're using the * most recent configuration. */ - AutoIngestNodeStatus nodeTab = new AutoIngestNodeStatus(monitor); + AinStatusDashboard nodeTab = new AinStatusDashboard(monitor); nodeTab.setSize(nodeTab.getPreferredSize()); tc.add(nodeTab); tc.open(); @@ -94,7 +92,7 @@ public final class AutoIngestNodeStatusTopComponent extends TopComponent { } } - public AutoIngestNodeStatusTopComponent() { + public AinStatusDashboardTopComponent() { initComponents(); setName(Bundle.CTL_AutoIngestNodeStatusTopComponent()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java index 833b67e5b3..671c434a97 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java @@ -18,27 +18,23 @@ */ package org.sleuthkit.autopsy.experimental.autoingest; - import javax.swing.Action; - import java.util.ArrayList; - import java.util.List; - import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.nodes.Sheet; - +import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.datamodel.NodeProperty; - /** * A node which represents all AutoIngestJobs of a given AutoIngestJobStatus. * Each job with the specified status will have a child node representing it. */ final class AinStatusNode extends AbstractNode { + /** * Construct a new AutoIngestJobsNode. */ @@ -57,7 +53,8 @@ final class AinStatusNode extends AbstractNode { * Create children nodes for the AutoIngestJobsNode which will each * represent a single AutoIngestJob * - * @param autoIngestMonitor the monitor which contains the AutoIngestJobs + * @param autoIngestMonitor the monitor which contains the + * AutoIngestJobs */ AinStatusChildren(AutoIngestMonitor autoIngestMonitor) { monitor = autoIngestMonitor; @@ -83,28 +80,25 @@ final class AinStatusNode extends AbstractNode { */ static final class StatusNode extends AbstractNode { - private final AutoIngestJob autoIngestJob; + private final String hostName; + private final String status; /** * Construct a new JobNode to represent an AutoIngestJob and its status. * - * @param job - the AutoIngestJob being represented by this node + * @param job - the AutoIngestJob being represented by this node */ StatusNode(AutoIngestJob job) { super(Children.LEAF); - autoIngestJob = job; - } - - /** - * Get the AutoIngestJob which this node represents. - * - * @return autoIngestJob - */ - AutoIngestJob getAutoIngestJob() { - return autoIngestJob; + hostName = "TODO - ADD HOST NAME"; + status = "TODO - ADD NODE STATUS"; + setName(hostName); + setDisplayName(hostName); } @Override + @Messages({"AinStatusNode.hostName.title=Host Name", + "AinStatusNode.status.title=Status"}) protected Sheet createSheet() { Sheet s = super.createSheet(); Sheet.Set ss = s.get(Sheet.PROPERTIES); @@ -112,9 +106,10 @@ final class AinStatusNode extends AbstractNode { ss = Sheet.createPropertiesSet(); s.put(ss); } - ss.put(new NodeProperty<>("Host Name", "Host Name", "Host Name", //host name - "TODO - ADD HOST NAME")); - ss.put(new NodeProperty<>("Status","Status","Status","TODO - ADD NODE STATUS")); + ss.put(new NodeProperty<>(Bundle.AinStatusNode_hostName_title(), Bundle.AinStatusNode_hostName_title(), Bundle.AinStatusNode_hostName_title(), + hostName)); + ss.put(new NodeProperty<>(Bundle.AinStatusNode_status_title(), Bundle.AinStatusNode_status_title(), Bundle.AinStatusNode_status_title(), + status)); return s; } @@ -122,9 +117,15 @@ final class AinStatusNode extends AbstractNode { public Action[] getActions(boolean context) { List actions = new ArrayList<>(); if (AutoIngestDashboard.isAdminAutoIngestDashboard()) { - //Add actions +// if (status.equals("Paused")) { +// actions.add(new AutoIngestAdminActions.ResumeAction()); +// } else if (status.equals("Running")){ +// actions.add(new AutoIngestAdminActions.PauseAction()); +// } + actions.add(new AutoIngestAdminActions.ShutdownAction()); } return actions.toArray(new Action[actions.size()]); } } + } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.form similarity index 100% rename from Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.form rename to Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.form diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java similarity index 82% rename from Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java rename to Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java index 350e9b1c8a..feb4da9b30 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestNodesPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java @@ -26,23 +26,14 @@ import org.netbeans.swing.outline.DefaultOutlineModel; import org.netbeans.swing.outline.Outline; import org.openide.explorer.ExplorerManager; import org.openide.nodes.Node; -import org.openide.util.NbBundle.Messages; -import org.sleuthkit.autopsy.datamodel.EmptyNode; -import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJobsNode.AutoIngestJobStatus; import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJobsNode.JobNode; -import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.JobsSnapshot; /** * A panel which displays an outline view with all jobs for a specified status. */ -final class AutoIngestNodesPanel extends javax.swing.JPanel implements ExplorerManager.Provider { +final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager.Provider { private static final long serialVersionUID = 1L; - private static final int INITIAL_CASENAME_WIDTH = 170; - private static final int INITIAL_DATASOURCE_WIDTH = 270; - private static final int INITIAL_PRIORITIZED_WIDTH = 20; - private static final int INITIAL_STATUS_WIDTH = 20; - private static final int INVALID_INDEX = -1; private final org.openide.explorer.view.OutlineView outlineView; private final Outline outline; private ExplorerManager explorerManager; @@ -52,7 +43,7 @@ final class AutoIngestNodesPanel extends javax.swing.JPanel implements ExplorerM * * @param jobStatus the status of the jbos to be displayed on this panel */ - AutoIngestNodesPanel() { + AinStatusPanel() { initComponents(); outlineView = new org.openide.explorer.view.OutlineView(); outline = outlineView.getOutline(); @@ -64,7 +55,7 @@ final class AutoIngestNodesPanel extends javax.swing.JPanel implements ExplorerM * the correct columns for the specified AutoIngestJobStatus */ void customize() { - ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel("Host Name"); + ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AinStatusNode_hostName_title()); outline.setRowSelectionAllowed(false); //rows will be made selectable after table has been populated outline.setFocusable(false); //table will be made focusable after table has been populated if (null == explorerManager) { @@ -72,21 +63,12 @@ final class AutoIngestNodesPanel extends javax.swing.JPanel implements ExplorerM } outlineView.setPropertyColumns( - "Status", "Status"); + Bundle.AinStatusNode_status_title(), Bundle.AinStatusNode_status_title()); outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); outline.setRootVisible(false); add(outlineView, java.awt.BorderLayout.CENTER); } - private int getColumnIndexByName(String columnName) { - for (int index = 0; index < outline.getColumnModel().getColumnCount(); index++) { - if (outline.getColumnModel().getColumn(index).getHeaderValue().toString().equals(columnName)) { - return index; - } - } - return INVALID_INDEX; - } - @Override public void setSize(Dimension d) { super.setSize(d); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestAdminActions.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestAdminActions.java index 15374f22ee..1a5f2657b6 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestAdminActions.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestAdminActions.java @@ -25,7 +25,7 @@ import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.ingest.IngestProgressSnapshotDialog; final class AutoIngestAdminActions { - + @NbBundle.Messages({"AutoIngestAdminActions.progressDialogAction.title=Ingest Progress"}) static final class ProgressDialogAction extends AbstractAction { @@ -152,4 +152,65 @@ final class AutoIngestAdminActions { return super.clone(); //To change body of generated methods, choose Tools | Templates. } } + + @NbBundle.Messages({"AutoIngestAdminActions.pause.title=Pause Node"}) + static final class PauseAction extends AbstractAction { + + private static final long serialVersionUID = 1L; + + PauseAction() { + super(Bundle.AutoIngestAdminActions_pause_title()); + } + + @Override + public void actionPerformed(ActionEvent e) { + //TODO JIRA- + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); //To change body of generated methods, choose Tools | Templates. + } + } + + @NbBundle.Messages({"AutoIngestAdminActions.resume.title=Resume Node"}) + static final class ResumeAction extends AbstractAction { + + private static final long serialVersionUID = 1L; + + ResumeAction() { + super(Bundle.AutoIngestAdminActions_resume_title()); + } + + @Override + public void actionPerformed(ActionEvent e) { + //TODO JIRA- + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); //To change body of generated methods, choose Tools | Templates. + } + } + + @NbBundle.Messages({"AutoIngestAdminActions.shutdown.title=Shutdown Node"}) + static final class ShutdownAction extends AbstractAction { + + private static final long serialVersionUID = 1L; + + ShutdownAction() { + super(Bundle.AutoIngestAdminActions_shutdown_title()); + } + + @Override + public void actionPerformed(ActionEvent e) { + //TODO JIRA- + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); //To change body of generated methods, choose Tools | Templates. + } + } + } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java index 1325d29c8f..e4c9018bc4 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java @@ -27,12 +27,9 @@ import java.awt.EventQueue; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import javax.swing.Action; import javax.swing.JPanel; import javax.swing.SwingWorker; import javax.swing.UIManager; diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java index 231f210c3a..58470eaeab 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardTopComponent.java @@ -79,7 +79,7 @@ public final class AutoIngestDashboardTopComponent extends TopComponent { //if the user has administrator access enabled open the Node Status top component as well if (AutoIngestDashboard.isAdminAutoIngestDashboard()) { EventQueue.invokeLater(() -> { - AutoIngestNodeStatusTopComponent.openTopComponent(dashboard.getMonitor()); + AinStatusDashboardTopComponent.openTopComponent(dashboard.getMonitor()); }); } tc.open(); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java index 1293c6393a..60f84e566c 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJobsNode.java @@ -18,13 +18,11 @@ */ package org.sleuthkit.autopsy.experimental.autoingest; -import java.io.File; import javax.swing.Action; import java.time.Instant; import java.util.ArrayList; import java.util.Date; import java.util.List; -import org.openide.modules.Places; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; @@ -130,7 +128,6 @@ final class AutoIngestJobsNode extends AbstractNode { super(Children.LEAF); jobStatus = status; autoIngestJob = job; - super.setName(autoIngestJob.getManifest().getCaseName()); setName(autoIngestJob.getManifest().getCaseName()); setDisplayName(autoIngestJob.getManifest().getCaseName()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties index 5e6cae223b..f4cdb75860 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties @@ -258,9 +258,9 @@ AutoIngestControlPanel.bnPrioritizeJob.toolTipText=Move this folder to the top o AutoIngestControlPanel.bnPrioritizeCase.toolTipText=Move all images associated with a case to top of Pending queue. AutoIngestControlPanel.bnPrioritizeJob.actionCommand=Prioritize Job AutoIngestControlPanel.bnDeprioritizeJob.actionCommand=Deprioritize Job -AutoIngestNodeStatus.clusterMetricsButton.text=Auto Ingest &Metrics -AutoIngestNodeStatus.tbServicesStatusMessage.text=Connecting... -AutoIngestNodeStatus.lbServicesStatus.text=Services Status: -AutoIngestNodeStatus.refreshButton.toolTipText=Refresh displayed tables -AutoIngestNodeStatus.refreshButton.text=&Refresh -AutoIngestNodeStatus.jLabel1.text=Auto Ingest Nodes +AinStatusDashboard.tbServicesStatusMessage.text=Connecting... +AinStatusDashboard.lbServicesStatus.text=Services Status: +AinStatusDashboard.refreshButton.toolTipText=Refresh displayed tables +AinStatusDashboard.refreshButton.text=&Refresh +AinStatusDashboard.jLabel1.text=Auto Ingest Nodes +AinStatusDashboard.clusterMetricsButton.text=Auto Ingest &Metrics From 61f4a80849951cde47cde0f03852f60a09d7021b Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 19 Apr 2018 13:46:07 -0400 Subject: [PATCH 05/44] 3753 undo accidental changes in whitespace to DashboardOpenAction --- .../autoingest/AutoIngestDashboardOpenAction.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java index 4aa6b2685e..45563a4f4b 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java @@ -32,33 +32,33 @@ import org.sleuthkit.autopsy.coreutils.Logger; @ActionRegistration(displayName = "#CTL_AutoIngestDashboardOpenAction", lazy = false) @Messages({"CTL_AutoIngestDashboardOpenAction=Auto Ingest Dashboard"}) public final class AutoIngestDashboardOpenAction extends CallableSystemAction { - + private static final Logger LOGGER = Logger.getLogger(AutoIngestDashboardOpenAction.class.getName()); private static final String DISPLAY_NAME = Bundle.CTL_AutoIngestDashboardOpenAction(); - + @Override public boolean isEnabled() { return (UserPreferences.getIsMultiUserModeEnabled()); } - + @Override @SuppressWarnings("fallthrough") public void performAction() { AutoIngestDashboardTopComponent.openTopComponent(); } - + @Override public String getName() { return DISPLAY_NAME; } - + @Override public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } - + @Override public boolean asynchronous() { return false; // run on edt } -} +} \ No newline at end of file From 96490f7005599e77e90b8ed3d8bf2f8a66a20827 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Thu, 19 Apr 2018 14:24:23 -0400 Subject: [PATCH 06/44] 3753 clean up Auto Ingest Node Status dashboard --- .../autoingest/AinStatusDashboard.form | 44 +++--------------- .../autoingest/AinStatusDashboard.java | 45 ++++++------------- .../AinStatusDashboardTopComponent.java | 11 +++-- .../autoingest/AinStatusNode.java | 14 +++--- .../autoingest/AinStatusPanel.java | 11 ++--- .../experimental/autoingest/Bundle.properties | 2 - 6 files changed, 36 insertions(+), 91 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form index 58554e49f3..4631034971 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form @@ -19,19 +19,14 @@ - - - - - - + - + @@ -42,15 +37,10 @@ - - - - - - + - + @@ -75,30 +65,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -109,7 +75,7 @@ - + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java index aee8306323..88fa6a7a9c 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java @@ -20,7 +20,10 @@ package org.sleuthkit.autopsy.experimental.autoingest; import java.awt.Cursor; -public class AinStatusDashboard extends javax.swing.JPanel { +/** + * A dashboard for monitoring the existing AutoIngestNodes and their status. + */ +final class AinStatusDashboard extends javax.swing.JPanel { private final AutoIngestMonitor autoIngestMonitor; private final AinStatusPanel nodesPanel; @@ -28,14 +31,14 @@ public class AinStatusDashboard extends javax.swing.JPanel { /** * Creates new form AutoIngestNodeStatus */ - public AinStatusDashboard(AutoIngestMonitor monitor) { + AinStatusDashboard(AutoIngestMonitor monitor) { initComponents(); autoIngestMonitor = monitor; nodesPanel = new AinStatusPanel(); nodesPanel.setSize(nodesPanel.getSize()); - jScrollPane1.add(nodesPanel); - jScrollPane1.setViewportView(nodesPanel); - nodesPanel.refresh(autoIngestMonitor); + nodeStatusScrollPane.add(nodesPanel); + nodeStatusScrollPane.setViewportView(nodesPanel); + refreshTables(); } /** @@ -48,10 +51,8 @@ public class AinStatusDashboard extends javax.swing.JPanel { private void initComponents() { refreshButton = new javax.swing.JButton(); - lbServicesStatus = new javax.swing.JLabel(); - tbServicesStatusMessage = new javax.swing.JTextField(); clusterMetricsButton = new javax.swing.JButton(); - jScrollPane1 = new javax.swing.JScrollPane(); + nodeStatusScrollPane = new javax.swing.JScrollPane(); jLabel1 = new javax.swing.JLabel(); org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.refreshButton.text")); // NOI18N @@ -62,14 +63,6 @@ public class AinStatusDashboard extends javax.swing.JPanel { } }); - lbServicesStatus.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(lbServicesStatus, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.lbServicesStatus.text")); // NOI18N - - tbServicesStatusMessage.setEditable(false); - tbServicesStatusMessage.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N - tbServicesStatusMessage.setText(org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.tbServicesStatusMessage.text")); // NOI18N - tbServicesStatusMessage.setBorder(null); - org.openide.awt.Mnemonics.setLocalizedText(clusterMetricsButton, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.clusterMetricsButton.text")); // NOI18N clusterMetricsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -87,17 +80,13 @@ public class AinStatusDashboard extends javax.swing.JPanel { .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1) - .addGroup(layout.createSequentialGroup() - .addComponent(lbServicesStatus) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(tbServicesStatusMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 861, Short.MAX_VALUE)) + .addComponent(nodeStatusScrollPane) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 715, Short.MAX_VALUE) .addComponent(clusterMetricsButton))) .addContainerGap()) ); @@ -107,14 +96,10 @@ public class AinStatusDashboard extends javax.swing.JPanel { layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lbServicesStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(tbServicesStatusMessage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGap(40, 40, 40) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(nodeStatusScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(382, 382, 382) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(refreshButton) @@ -141,9 +126,7 @@ public class AinStatusDashboard extends javax.swing.JPanel { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton clusterMetricsButton; private javax.swing.JLabel jLabel1; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JLabel lbServicesStatus; + private javax.swing.JScrollPane nodeStatusScrollPane; private javax.swing.JButton refreshButton; - private javax.swing.JTextField tbServicesStatusMessage; // End of variables declaration//GEN-END:variables } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java index c10534e5fa..b34947d222 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java @@ -32,14 +32,13 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ @TopComponent.Description( preferredID = "AinStatusDashboardTopComponent", - //iconBase="SET/PATH/TO/ICON/HERE", persistenceType = TopComponent.PERSISTENCE_NEVER ) @TopComponent.Registration(mode = "nodeStatus", openAtStartup = false) @Messages({ "CTL_AinStatusDashboardAction=Auto Ingest Nodes", "CTL_AinStatusDashboardTopComponent=Auto Ingest Nodes"}) -public final class AinStatusDashboardTopComponent extends TopComponent { +final class AinStatusDashboardTopComponent extends TopComponent { private static final long serialVersionUID = 1L; public final static String PREFERRED_ID = "AinStatusDashboardTopComponent"; // NON-NLS @@ -48,7 +47,7 @@ public final class AinStatusDashboardTopComponent extends TopComponent { @Messages({ "AinStatusDashboardTopComponent.exceptionMessage.failedToCreateDashboard=Failed to create Auto Ingest Node Status Dashboard.",}) - public static void openTopComponent(AutoIngestMonitor monitor) { + static void openTopComponent(AutoIngestMonitor monitor) { final AinStatusDashboardTopComponent tc = (AinStatusDashboardTopComponent) WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (tc != null) { topComponentInitialized = true; @@ -79,7 +78,7 @@ public final class AinStatusDashboardTopComponent extends TopComponent { } } - public static void closeTopComponent() { + static void closeTopComponent() { if (topComponentInitialized) { final TopComponent tc = WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (tc != null) { @@ -92,9 +91,9 @@ public final class AinStatusDashboardTopComponent extends TopComponent { } } - public AinStatusDashboardTopComponent() { + AinStatusDashboardTopComponent() { initComponents(); - setName(Bundle.CTL_AutoIngestNodeStatusTopComponent()); + setName(Bundle.CTL_AinStatusDashboardTopComponent()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java index 671c434a97..36f7bcdb88 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java @@ -30,20 +30,20 @@ import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.datamodel.NodeProperty; /** - * A node which represents all AutoIngestJobs of a given AutoIngestJobStatus. - * Each job with the specified status will have a child node representing it. + * A node which represents all AutoIngestNodes . + * Each AuotIngestNode will have a child node representing it and its status. */ final class AinStatusNode extends AbstractNode { /** - * Construct a new AutoIngestJobsNode. + * Construct a new AinStatusNode. */ AinStatusNode(AutoIngestMonitor monitor) { super(Children.create(new AinStatusChildren(monitor), false)); } /** - * A ChildFactory for generating JobNodes. + * A ChildFactory for generating StatusNodes. */ static class AinStatusChildren extends ChildFactory { @@ -64,6 +64,8 @@ final class AinStatusNode extends AbstractNode { protected boolean createKeys(List list) { //get keys from monitor //add keys to List + //TODO replace getting of pending jobs with getting of AINs + //TODO change appropriate contructors to accomidate AINs instead of AutoIngestJobs list.addAll(monitor.getJobsSnapshot().getPendingJobs()); return true; } @@ -76,7 +78,7 @@ final class AinStatusNode extends AbstractNode { } /** - * A node which represents a single auto ingest job. + * A node which represents a single AutoIngestNode and its status. */ static final class StatusNode extends AbstractNode { @@ -84,7 +86,7 @@ final class AinStatusNode extends AbstractNode { private final String status; /** - * Construct a new JobNode to represent an AutoIngestJob and its status. + * Construct a new StatusNode to represent an AutoIngestNode and its status. * * @param job - the AutoIngestJob being represented by this node */ diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java index feb4da9b30..e429fd6f33 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java @@ -29,7 +29,7 @@ import org.openide.nodes.Node; import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJobsNode.JobNode; /** - * A panel which displays an outline view with all jobs for a specified status. + * A panel which displays an outline view with all auto ingest nodes and their status. */ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager.Provider { @@ -39,9 +39,7 @@ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager private ExplorerManager explorerManager; /** - * Creates a new AutoIngestJobsPanel of the specified jobStatus - * - * @param jobStatus the status of the jbos to be displayed on this panel + * Creates a new AinStatusPanel */ AinStatusPanel() { initComponents(); @@ -51,8 +49,8 @@ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager } /** - * Set up the AutoIngestJobsPanel's so that its outlineView is displaying - * the correct columns for the specified AutoIngestJobStatus + * Set up the AinStatusPanel's so that its outlineView is displaying + * the host name and the node status. */ void customize() { ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AinStatusNode_hostName_title()); @@ -61,7 +59,6 @@ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager if (null == explorerManager) { explorerManager = new ExplorerManager(); } - outlineView.setPropertyColumns( Bundle.AinStatusNode_status_title(), Bundle.AinStatusNode_status_title()); outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties index f4cdb75860..304e6b385a 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties @@ -258,8 +258,6 @@ AutoIngestControlPanel.bnPrioritizeJob.toolTipText=Move this folder to the top o AutoIngestControlPanel.bnPrioritizeCase.toolTipText=Move all images associated with a case to top of Pending queue. AutoIngestControlPanel.bnPrioritizeJob.actionCommand=Prioritize Job AutoIngestControlPanel.bnDeprioritizeJob.actionCommand=Deprioritize Job -AinStatusDashboard.tbServicesStatusMessage.text=Connecting... -AinStatusDashboard.lbServicesStatus.text=Services Status: AinStatusDashboard.refreshButton.toolTipText=Refresh displayed tables AinStatusDashboard.refreshButton.text=&Refresh AinStatusDashboard.jLabel1.text=Auto Ingest Nodes From a24f8e45e2456ad65e8717b104f5fa4da6f01d20 Mon Sep 17 00:00:00 2001 From: esaunders Date: Mon, 23 Apr 2018 15:15:06 -0400 Subject: [PATCH 07/44] Integrated UI work. --- .../autoingest/AinStatusDashboard.java | 21 ++++- .../AinStatusDashboardTopComponent.java | 1 + .../autoingest/AinStatusNode.java | 85 ++++++++++++------- .../autoingest/AinStatusPanel.java | 15 ++-- .../autoingest/AutoIngestDashboard.java | 9 +- .../autoingest/AutoIngestMonitor.java | 82 ++++++++++++++++-- 6 files changed, 162 insertions(+), 51 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java index 88fa6a7a9c..638c0dc6dc 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java @@ -19,11 +19,15 @@ package org.sleuthkit.autopsy.experimental.autoingest; import java.awt.Cursor; +import java.awt.EventQueue; +import java.util.Observable; +import java.util.Observer; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.AutoIngestNodeState; /** * A dashboard for monitoring the existing AutoIngestNodes and their status. */ -final class AinStatusDashboard extends javax.swing.JPanel { +final class AinStatusDashboard extends javax.swing.JPanel implements Observer { private final AutoIngestMonitor autoIngestMonitor; private final AinStatusPanel nodesPanel; @@ -41,6 +45,13 @@ final class AinStatusDashboard extends javax.swing.JPanel { refreshTables(); } + /** + * Adds this panel as an observer of AutoIngestMonitor. + */ + void startUp() { + autoIngestMonitor.addObserver(this); + } + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -129,4 +140,12 @@ final class AinStatusDashboard extends javax.swing.JPanel { private javax.swing.JScrollPane nodeStatusScrollPane; private javax.swing.JButton refreshButton; // End of variables declaration//GEN-END:variables + + @Override + public void update(Observable o, Object arg) { + if (arg instanceof AutoIngestNodeState) + EventQueue.invokeLater(() -> { + refreshTables(); + }); + } } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java index b34947d222..1ab19b4a77 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboardTopComponent.java @@ -69,6 +69,7 @@ final class AinStatusDashboardTopComponent extends TopComponent { * most recent configuration. */ AinStatusDashboard nodeTab = new AinStatusDashboard(monitor); + nodeTab.startUp(); nodeTab.setSize(nodeTab.getPreferredSize()); tc.add(nodeTab); tc.open(); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java index 36f7bcdb88..444a6fce8b 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusNode.java @@ -28,10 +28,11 @@ import org.openide.nodes.Node; import org.openide.nodes.Sheet; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.datamodel.NodeProperty; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.AutoIngestNodeState; /** - * A node which represents all AutoIngestNodes . - * Each AuotIngestNode will have a child node representing it and its status. + * A node which represents all AutoIngestNodes. Each AutoIngestNode will have a + * child node representing it and its status. */ final class AinStatusNode extends AbstractNode { @@ -45,36 +46,30 @@ final class AinStatusNode extends AbstractNode { /** * A ChildFactory for generating StatusNodes. */ - static class AinStatusChildren extends ChildFactory { + static class AinStatusChildren extends ChildFactory { private final AutoIngestMonitor monitor; /** - * Create children nodes for the AutoIngestJobsNode which will each - * represent a single AutoIngestJob + * Create children nodes for the AutoIngestNodeState which will each + * represent a single node state * - * @param autoIngestMonitor the monitor which contains the - * AutoIngestJobs + * @param autoIngestMonitor the monitor which contains the node states */ AinStatusChildren(AutoIngestMonitor autoIngestMonitor) { monitor = autoIngestMonitor; } @Override - protected boolean createKeys(List list) { - //get keys from monitor - //add keys to List - //TODO replace getting of pending jobs with getting of AINs - //TODO change appropriate contructors to accomidate AINs instead of AutoIngestJobs - list.addAll(monitor.getJobsSnapshot().getPendingJobs()); + protected boolean createKeys(List list) { + list.addAll(monitor.getNodeStates()); return true; } @Override - protected Node createNodeForKey(AutoIngestJob key) { + protected Node createNodeForKey(AutoIngestNodeState key) { return new StatusNode(key); } - } /** @@ -82,25 +77,32 @@ final class AinStatusNode extends AbstractNode { */ static final class StatusNode extends AbstractNode { - private final String hostName; - private final String status; + private final AutoIngestNodeState nodeState; /** - * Construct a new StatusNode to represent an AutoIngestNode and its status. + * Construct a new StatusNode to represent an AutoIngestNode and its + * status. * - * @param job - the AutoIngestJob being represented by this node + * @param nodeState - the AutoIngestNodeState being represented by this + * node */ - StatusNode(AutoIngestJob job) { + StatusNode(AutoIngestNodeState nodeState) { super(Children.LEAF); - hostName = "TODO - ADD HOST NAME"; - status = "TODO - ADD NODE STATUS"; - setName(hostName); - setDisplayName(hostName); + this.nodeState = nodeState; + setName(nodeState.getName()); + setDisplayName(nodeState.getName()); } @Override @Messages({"AinStatusNode.hostName.title=Host Name", - "AinStatusNode.status.title=Status"}) + "AinStatusNode.status.title=Status", + "AinStatusNode.status.running=Running", + "AinStatusNode.status.pausedByUser=Paused By User", + "AinStatusNode.status.pausedForError=Paused Due to System Error", + "AinStatusNode.status.startingup=Starting Up", + "AinStatusNode.status.shuttingdown=Shutting Down", + "AinStatusNode.status.unknown=Unknown" + }) protected Sheet createSheet() { Sheet s = super.createSheet(); Sheet.Set ss = s.get(Sheet.PROPERTIES); @@ -109,7 +111,27 @@ final class AinStatusNode extends AbstractNode { s.put(ss); } ss.put(new NodeProperty<>(Bundle.AinStatusNode_hostName_title(), Bundle.AinStatusNode_hostName_title(), Bundle.AinStatusNode_hostName_title(), - hostName)); + nodeState.getName())); + String status = Bundle.AinStatusNode_status_unknown(); + switch (nodeState.getState()) { + case RUNNING: + status = Bundle.AinStatusNode_status_running(); + break; + case STARTING_UP: + status = Bundle.AinStatusNode_status_startingup(); + break; + case SHUTTING_DOWN: + status = Bundle.AinStatusNode_status_shuttingdown(); + break; + case PAUSED_BY_REQUEST: + status = Bundle.AinStatusNode_status_pausedByUser(); + break; + case PAUSED_DUE_TO_SYSTEM_ERROR: + status = Bundle.AinStatusNode_status_pausedForError(); + break; + default: + break; + } ss.put(new NodeProperty<>(Bundle.AinStatusNode_status_title(), Bundle.AinStatusNode_status_title(), Bundle.AinStatusNode_status_title(), status)); return s; @@ -119,11 +141,12 @@ final class AinStatusNode extends AbstractNode { public Action[] getActions(boolean context) { List actions = new ArrayList<>(); if (AutoIngestDashboard.isAdminAutoIngestDashboard()) { -// if (status.equals("Paused")) { -// actions.add(new AutoIngestAdminActions.ResumeAction()); -// } else if (status.equals("Running")){ -// actions.add(new AutoIngestAdminActions.PauseAction()); -// } + if (nodeState.getState() == AutoIngestNodeState.State.PAUSED_BY_REQUEST + || nodeState.getState() == AutoIngestNodeState.State.PAUSED_DUE_TO_SYSTEM_ERROR) { + actions.add(new AutoIngestAdminActions.ResumeAction()); + } else if (nodeState.getState() == AutoIngestNodeState.State.RUNNING){ + actions.add(new AutoIngestAdminActions.PauseAction()); + } actions.add(new AutoIngestAdminActions.ShutdownAction()); } return actions.toArray(new Action[actions.size()]); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java index e429fd6f33..095badff9a 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusPanel.java @@ -29,7 +29,8 @@ import org.openide.nodes.Node; import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJobsNode.JobNode; /** - * A panel which displays an outline view with all auto ingest nodes and their status. + * A panel which displays an outline view with all auto ingest nodes and their + * status. */ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager.Provider { @@ -49,8 +50,8 @@ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager } /** - * Set up the AinStatusPanel's so that its outlineView is displaying - * the host name and the node status. + * Set up the AinStatusPanel's so that its outlineView is displaying the + * host name and the node status. */ void customize() { ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AinStatusNode_hostName_title()); @@ -89,11 +90,11 @@ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager } /** - * Update the contents of this AutoIngestJobsPanel while retaining currently + * Update the contents of this AinStatusPanel while retaining currently * selected node. * - * @param jobsSnapshot - the JobsSnapshot which will provide the new - * contents + * @param monitor - the AutoIngestMonitor which will provide the new + * contents */ void refresh(AutoIngestMonitor monitor) { outline.setRowSelectionAllowed(false); @@ -101,7 +102,7 @@ final class AinStatusPanel extends javax.swing.JPanel implements ExplorerManager AinStatusNode autoIngestNode = new AinStatusNode(monitor); explorerManager.setRootContext(autoIngestNode); outline.setRowSelectionAllowed(true); - if (selectedNodes.length > 0 && outline.isFocusable()) { //don't allow saved selections of empty nodes to be restored + if (selectedNodes.length > 0 && autoIngestNode.getChildren().findChild(selectedNodes[0].getName()) != null && outline.isFocusable()) { //don't allow saved selections of empty nodes to be restored try { explorerManager.setSelectedNodes(new Node[]{autoIngestNode.getChildren().findChild(selectedNodes[0].getName())}); } catch (PropertyVetoException ignore) { diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java index f4eb942d4b..ab92b65373 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java @@ -38,6 +38,7 @@ import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.core.ServicesMonitor; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.JobsSnapshot; /** * A dashboard for monitoring an automated ingest cluster. @@ -237,9 +238,11 @@ final class AutoIngestDashboard extends JPanel implements Observer { @Override public void update(Observable observable, Object arg) { - EventQueue.invokeLater(() -> { - refreshTables(); - }); + if (arg instanceof JobsSnapshot) { + EventQueue.invokeLater(() -> { + refreshTables(); + }); + } } /** diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java index 1e2a4a20b0..726da3e9a5 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java @@ -23,14 +23,16 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Observable; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.logging.Level; +import java.util.stream.Collectors; import javax.annotation.concurrent.GuardedBy; import org.sleuthkit.autopsy.coordinationservice.CoordinationService; import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationServiceException; @@ -39,7 +41,7 @@ import org.sleuthkit.autopsy.coreutils.NetworkUtils; import org.sleuthkit.autopsy.events.AutopsyEventException; import org.sleuthkit.autopsy.events.AutopsyEventPublisher; import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJob.ProcessingStatus; - +import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestManager.Event; /** * An auto ingest monitor responsible for monitoring and reporting the * processing of auto ingest jobs. @@ -71,6 +73,8 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen @GuardedBy("jobsLock") private JobsSnapshot jobsSnapshot; + private Map nodeStates = new ConcurrentHashMap<>(); + /** * Constructs an auto ingest monitor responsible for monitoring and * reporting the processing of auto ingest jobs. @@ -219,14 +223,15 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen private void handleAutoIngestNodeStateEvent(AutoIngestNodeStateEvent event) { if (event.getEventType() == AutoIngestManager.Event.SHUTTING_DOWN) { // Remove node from collection. - jobsSnapshot.nodeState.remove(event.getNodeName()); + nodeStates.remove(event.getNodeName()); } else { // Otherwise either create an entry for the given node name or update // an existing entry in the map. - jobsSnapshot.nodeState.put(event.getNodeName(), event.getEventType()); + nodeStates.put(event.getNodeName(), new AutoIngestNodeState(event.getNodeName(), event.getEventType())); } setChanged(); - notifyObservers(jobsSnapshot); + // Trigger a dashboard refresh. + notifyObservers(nodeStates.get(event.getNodeName())); } /** @@ -242,6 +247,14 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen } } + /** + * Gets the current state of known AIN's in the system. + * @return + */ + List getNodeStates() { + return nodeStates.values().stream().collect(Collectors.toList()); + } + /** * Makes the auto ingest monitor's refresh its current snapshot of the * pending jobs queue, running jobs list, and completed jobs list for an @@ -535,8 +548,8 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen } /** - * A snapshot of the pending jobs queue, running jobs list, completed - * jobs list and node state for an auto ingest cluster. + * A snapshot of the pending jobs queue, running jobs list and completed jobs + * list for an auto ingest cluster. */ static final class JobsSnapshot { @@ -544,8 +557,6 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen private final Set runningJobs = new HashSet<>(); private final Set completedJobs = new HashSet<>(); - private HashMap nodeState = new HashMap<>(); - /** * Gets the snapshot of the pending jobs queue for an auto ingest * cluster. @@ -654,6 +665,59 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen } + /** + * Class that represents the state of an AIN for the dashboard. + */ + static final class AutoIngestNodeState { + + enum State { + STARTING_UP, + SHUTTING_DOWN, + RUNNING, + PAUSED_BY_REQUEST, + PAUSED_DUE_TO_SYSTEM_ERROR, + UNKNOWN + } + + private final String nodeName; + private final State nodeState; + + AutoIngestNodeState(String name, Event event) { + nodeName = name; + switch (event) { + case STARTING_UP: + nodeState = State.STARTING_UP; + break; + case SHUTTING_DOWN: + nodeState = State.SHUTTING_DOWN; + break; + case RUNNING: + nodeState = State.RUNNING; + break; + case PAUSED_BY_REQUEST: + nodeState = State.PAUSED_BY_REQUEST; + break; + case PAUSED_FOR_SYSTEM_ERROR: + nodeState = State.PAUSED_DUE_TO_SYSTEM_ERROR; + break; + case RESUMED: + nodeState = State.RUNNING; + break; + default: + nodeState = State.UNKNOWN; + break; + } + } + + String getName() { + return nodeName; + } + + State getState() { + return nodeState; + } + } + /** * Exception type thrown when there is an error completing an auto ingest * monitor operation. From bf875fbb3220a24a2fd5269b96bc0401c1aa525a Mon Sep 17 00:00:00 2001 From: esaunders Date: Mon, 23 Apr 2018 15:20:24 -0400 Subject: [PATCH 08/44] Removed TODO --- .../autopsy/experimental/autoingest/AutoIngestManager.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index 2efbe5ca91..2b8ff0409a 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -190,9 +190,6 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen SYS_LOGGER.log(Level.INFO, "Initializing auto ingest"); state = State.IDLE; eventPublisher = new AutopsyEventPublisher(); - // TODO: I would have liked to publish a STARTING_UP event here but - // the event channel isn't opened until startup() below. -// eventPublisher.publishRemotely(lastPublishedStateEvent = new AutoIngestNodeStateEvent(Event.STARTING_UP, LOCAL_HOST_NAME)); scanMonitor = new Object(); inputScanSchedulingExecutor = new ScheduledThreadPoolExecutor(NUM_INPUT_SCAN_SCHEDULING_THREADS, new ThreadFactoryBuilder().setNameFormat(INPUT_SCAN_SCHEDULER_THREAD_NAME).build()); inputScanExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(INPUT_SCAN_THREAD_NAME).build()); From 926e0b6a84fea3b96036c583a542c455323ffa59 Mon Sep 17 00:00:00 2001 From: esaunders Date: Mon, 23 Apr 2018 15:45:56 -0400 Subject: [PATCH 09/44] Fix some lunacy stuff. --- .../autopsy/experimental/autoingest/AutoIngestMonitor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java index 726da3e9a5..229128dae1 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMonitor.java @@ -73,7 +73,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen @GuardedBy("jobsLock") private JobsSnapshot jobsSnapshot; - private Map nodeStates = new ConcurrentHashMap<>(); + private final Map nodeStates = new ConcurrentHashMap<>(); /** * Constructs an auto ingest monitor responsible for monitoring and @@ -670,6 +670,9 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen */ static final class AutoIngestNodeState { + /** + * The set of AIN states. + */ enum State { STARTING_UP, SHUTTING_DOWN, From 3ed6ea4add6029b723518ebb01194a815ed3bf53 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 25 Apr 2018 14:39:55 -0400 Subject: [PATCH 10/44] Access database password detection added. --- Core/nbproject/project.properties | 3 + Core/nbproject/project.xml | 12 ++++ .../EncryptionDetectionFileIngestModule.java | 64 +++++++++++++++++-- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/Core/nbproject/project.properties b/Core/nbproject/project.properties index 958cf79f90..059fac0231 100644 --- a/Core/nbproject/project.properties +++ b/Core/nbproject/project.properties @@ -19,6 +19,9 @@ file.reference.sevenzipjbinding.jar=release/modules/ext/sevenzipjbinding.jar file.reference.sqlite-jdbc-3.8.11.jar=release/modules/ext/sqlite-jdbc-3.8.11.jar file.reference.StixLib.jar=release/modules/ext/StixLib.jar file.reference.sleuthkit-postgresql-4.6.0.jar=release/modules/ext/sleuthkit-postgresql-4.6.0.jar +file.reference.bcprov-jdk15on-1.54.jar=release/modules/ext/bcprov-jdk15on-1.54.jar +file.reference.jackcess-2.1.8.jar=release/modules/ext/jackcess-2.1.8.jar +file.reference.jackcess-encrypt-2.1.2.jar=release/modules/ext/jackcess-encrypt-2.1.2.jar file.reference.jempbox-1.8.13.jar=release/modules/ext/jempbox-1.8.13.jar file.reference.javax.ws.rs-api-2.0.1.jar=release/modules/ext/javax.ws.rs-api-2.0.1.jar file.reference.cxf-core-3.0.16.jar=release/modules/ext/cxf-core-3.0.16.jar diff --git a/Core/nbproject/project.xml b/Core/nbproject/project.xml index 77141b5d33..9583ec208d 100644 --- a/Core/nbproject/project.xml +++ b/Core/nbproject/project.xml @@ -411,6 +411,18 @@ ext/curator-client-2.8.0.jar release/modules/ext/curator-client-2.8.0.jar + + ext/bcprov-jdk15on-1.54.jar + release/modules/ext/bcprov-jdk15on-1.54.jar + + + ext/jackcess-2.1.8.jar + release/modules/ext/jackcess-2.1.8.jar + + + ext/jackcess-encrypt-2.1.2.jar + release/modules/ext/jackcess-encrypt-2.1.2.jar + ext/jempbox-1.8.13.jar release/modules/ext/jempbox-1.8.13.jar diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java index cb92b59718..5d55db9351 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java @@ -18,6 +18,13 @@ */ package org.sleuthkit.autopsy.modules.encryptiondetection; +import com.healthmarketscience.jackcess.CryptCodecProvider; +import com.healthmarketscience.jackcess.Database; +import com.healthmarketscience.jackcess.DatabaseBuilder; +import com.healthmarketscience.jackcess.InvalidCredentialsException; +import com.healthmarketscience.jackcess.impl.CodecProvider; +import com.healthmarketscience.jackcess.impl.UnsupportedCodecException; +import com.healthmarketscience.jackcess.util.MemFileChannel; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; @@ -137,7 +144,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter } } } - } catch (ReadContentInputStreamException | SAXException | TikaException ex) { + } catch (ReadContentInputStreamException | SAXException | TikaException | UnsupportedCodecException ex) { logger.log(Level.WARNING, String.format("Unable to read file '%s'", file.getParentPath() + file.getName()), ex); return IngestModule.ProcessResult.ERROR; } catch (IOException ex) { @@ -232,12 +239,16 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter * file with Tika. * @throws TikaException If there was an issue parsing the * file with Tika. + * @throws UnsupportedCodecException If an Access database could not + * be opened by Jackcess due to + * unsupported encoding. */ - private boolean isFilePasswordProtected(AbstractFile file) throws ReadContentInputStreamException, IOException, SAXException, TikaException { + private boolean isFilePasswordProtected(AbstractFile file) throws ReadContentInputStreamException, IOException, SAXException, TikaException, UnsupportedCodecException { boolean passwordProtected = false; - switch (file.getMIMEType()) { + String mimeType = file.getMIMEType(); + switch (mimeType) { case "application/x-ooxml-protected": /* * Office Open XML files that are password protected can be @@ -249,7 +260,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter case "application/msword": case "application/vnd.ms-excel": case "application/vnd.ms-powerpoint": - case "application/pdf": + case "application/pdf": { /* * A file of one of these types will be determined to be * password protected or not by attempting to parse it via Tika. @@ -278,6 +289,51 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter bin.close(); } } + break; + } + + case "application/x-msaccess": { + /* + * Access databases are determined to be password protected + * using Jackcess. If the database can be opened, the password + * is read from it to see if it's null. If the database can not + * be opened due to an InvalidCredentialException being thrown, + * it is automatically determined to be password protected. + */ + InputStream in = null; + BufferedInputStream bin = null; + + try { + in = new ReadContentInputStream(file); + bin = new BufferedInputStream(in); + MemFileChannel memFileChannel = MemFileChannel.newChannel(bin); + CodecProvider codecProvider = new CryptCodecProvider(); + DatabaseBuilder databaseBuilder = new DatabaseBuilder(); + databaseBuilder.setChannel(memFileChannel); + databaseBuilder.setCodecProvider(codecProvider); + Database accessDatabase = databaseBuilder.open(); + /* + * No exception has been thrown at this point, so the file + * is either a JET database, or an unprotected ACE database. + * Read the password from the database to see if it exists. + */ + if (accessDatabase.getDatabasePassword() != null) { + passwordProtected = true; + } + } catch (InvalidCredentialsException ex) { + /* + * The ACE database is determined to be password protected. + */ + passwordProtected = true; + } finally { + if (in != null) { + in.close(); + } + if (bin != null) { + bin.close(); + } + } + } } return passwordProtected; From a0dc448bf23e29a0f1a427a192bf3a2024d872f5 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 25 Apr 2018 14:53:49 -0400 Subject: [PATCH 11/44] Using String constants for MIME types. --- .../EncryptionDetectionFileIngestModule.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java index 5d55db9351..d01eaf93fd 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java @@ -74,6 +74,13 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter private static final int FILE_SIZE_MODULUS = 512; private static final double ONE_OVER_LOG2 = 1.4426950408889634073599246810019; // (1 / log(2)) private static final int BYTE_OCCURENCES_BUFFER_SIZE = 256; + + private static final String MIME_TYPE_OOXML_PROTECTED = "application/x-ooxml-protected"; + private static final String MIME_TYPE_MSWORD = "application/msword"; + private static final String MIME_TYPE_MSEXCEL = "application/vnd.ms-excel"; + private static final String MIME_TYPE_MSPOWERPOINT = "application/vnd.ms-powerpoint"; + private static final String MIME_TYPE_MSACCESS = "application/x-msaccess"; + private static final String MIME_TYPE_PDF = "application/pdf"; private final IngestServices services = IngestServices.getInstance(); private final Logger logger = services.getLogger(EncryptionDetectionModuleFactory.getModuleName()); @@ -247,9 +254,8 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter boolean passwordProtected = false; - String mimeType = file.getMIMEType(); - switch (mimeType) { - case "application/x-ooxml-protected": + switch (file.getMIMEType()) { + case MIME_TYPE_OOXML_PROTECTED: /* * Office Open XML files that are password protected can be * determined so simply by checking the MIME type. @@ -257,10 +263,10 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter passwordProtected = true; break; - case "application/msword": - case "application/vnd.ms-excel": - case "application/vnd.ms-powerpoint": - case "application/pdf": { + case MIME_TYPE_MSWORD: + case MIME_TYPE_MSEXCEL: + case MIME_TYPE_MSPOWERPOINT: + case MIME_TYPE_PDF: { /* * A file of one of these types will be determined to be * password protected or not by attempting to parse it via Tika. @@ -292,7 +298,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter break; } - case "application/x-msaccess": { + case MIME_TYPE_MSACCESS: { /* * Access databases are determined to be password protected * using Jackcess. If the database can be opened, the password From 88f781d24703061da7dc2ed302c4e6d44ca15197 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Fri, 27 Apr 2018 13:30:54 -0400 Subject: [PATCH 12/44] Completed functional test. --- .../EncryptionDetectionTest.java | 96 +++++-------------- .../autopsy/testutils/CaseUtils.java | 40 ++++++-- .../autopsy/testutils/IngestUtils.java | 53 +++++++--- 3 files changed, 94 insertions(+), 95 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java index 4b11fe37fc..5b3d2ec7d3 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java @@ -19,38 +19,28 @@ package org.sleuthkit.autopsy.modules.encryptiondetection; import java.io.File; -import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; -import static junit.framework.Assert.assertFalse; import org.netbeans.junit.NbModuleSuite; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.casemodule.CaseActionException; -import org.sleuthkit.autopsy.casemodule.CaseDetails; import junit.framework.Test; -import org.apache.commons.io.FileUtils; import org.netbeans.junit.NbTestCase; import org.openide.util.Exceptions; import org.python.icu.impl.Assert; import org.sleuthkit.autopsy.casemodule.ImageDSProcessor; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; -import org.sleuthkit.autopsy.casemodule.services.Blackboard; import org.sleuthkit.autopsy.casemodule.services.FileManager; -import org.sleuthkit.autopsy.datasourceprocessors.AutoIngestDataSourceProcessor; import org.sleuthkit.autopsy.ingest.IngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestJobSettings.IngestType; -import org.sleuthkit.autopsy.ingest.IngestModuleError; import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestModuleTemplate; -import org.sleuthkit.autopsy.testutils.DataSourceProcessorRunner; -import org.sleuthkit.autopsy.testutils.DataSourceProcessorRunner.ProcessorCallback; -import org.sleuthkit.autopsy.testutils.IngestJobRunner; +import org.sleuthkit.autopsy.testutils.CaseUtils; +import org.sleuthkit.autopsy.testutils.IngestUtils; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; @@ -58,7 +48,6 @@ public class EncryptionDetectionTest extends NbTestCase { private static final String CASE_NAME = "EncryptionDetectionTest"; private static final Path CASE_DIRECTORY_PATH = Paths.get(System.getProperty("java.io.tmpdir"), CASE_NAME); - private static final File CASE_DIR = new File(CASE_DIRECTORY_PATH.toString()); private final Path IMAGE_PATH = Paths.get(this.getDataDir().toString(), "password_detection_test.img"); public static Test suite() { @@ -74,51 +63,14 @@ public class EncryptionDetectionTest extends NbTestCase { @Override public void setUp() { - // Delete the test directory, if it exists - if (CASE_DIRECTORY_PATH.toFile().exists()) { - try { - FileUtils.deleteDirectory(CASE_DIRECTORY_PATH.toFile()); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - } - assertFalse(String.format("Unable to delete existing test directory '%s'.", CASE_DIRECTORY_PATH.toString()), CASE_DIRECTORY_PATH.toFile().exists()); - - // Create the test directory - CASE_DIRECTORY_PATH.toFile().mkdirs(); - assertTrue(String.format("Unable to create test directory '%s'.", CASE_DIRECTORY_PATH.toString()), CASE_DIRECTORY_PATH.toFile().exists()); - - try { - Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, CASE_DIRECTORY_PATH.toString(), new CaseDetails(CASE_NAME)); - } catch (CaseActionException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - assertTrue(CASE_DIR.exists()); + CaseUtils.createCase(CASE_DIRECTORY_PATH, CASE_NAME); ImageDSProcessor dataSourceProcessor = new ImageDSProcessor(); - try { - ProcessorCallback callBack = DataSourceProcessorRunner.runDataSourceProcessor(dataSourceProcessor, IMAGE_PATH); - List dataSourceContentList = callBack.getDataSourceContent(); - String errorMessage = String.format("The data source processor callback should produce 1 data source Content object, but the actual count was %d.", dataSourceContentList.size()); - assertEquals(errorMessage, 1, dataSourceContentList.size()); - List callbackErrorMessageList = callBack.getErrorMessages(); - errorMessage = String.format("The data source processor callback produced %d error messages.", callbackErrorMessageList.size()); - assertEquals(errorMessage, 0, callbackErrorMessageList.size()); - } catch (AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException | InterruptedException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - - } + IngestUtils.addDataSource(dataSourceProcessor, IMAGE_PATH); } @Override public void tearDown() { - try { - Case.closeCurrentCase(); - } catch (CaseActionException ex) { - Exceptions.printStackTrace(ex); - } + CaseUtils.closeCase(); } /** @@ -127,12 +79,28 @@ public class EncryptionDetectionTest extends NbTestCase { public void testPasswordProtection() { try { Case openCase = Case.getOpenCase(); - runIngestJob(openCase.getDataSources(), new EncryptionDetectionModuleFactory()); + + /* + * Create ingest job settings. + */ + IngestModuleFactory ingestModuleFactory = new EncryptionDetectionModuleFactory(); + IngestModuleIngestJobSettings settings = ingestModuleFactory.getDefaultIngestJobSettings(); + IngestModuleTemplate template = new IngestModuleTemplate(ingestModuleFactory, settings); + template.setEnabled(true); + List templates = new ArrayList<>(); + templates.add(template); + IngestJobSettings ingestJobSettings = new IngestJobSettings(EncryptionDetectionTest.class.getCanonicalName(), IngestType.FILES_ONLY, templates); + IngestUtils.runIngestJob(openCase.getDataSources(), ingestJobSettings); + + /* + * Purge specific files to be tested. + */ FileManager fileManager = openCase.getServices().getFileManager(); - Blackboard bb = openCase.getServices().getBlackboard(); List results = fileManager.findFiles("%%", "ole2"); results.addAll(fileManager.findFiles("%%", "ooxml")); results.addAll(fileManager.findFiles("%%", "pdf")); + results.addAll(fileManager.findFiles("%%", "mdb")); + results.addAll(fileManager.findFiles("%%", "accdb")); for (AbstractFile file : results) { /* @@ -172,22 +140,4 @@ public class EncryptionDetectionTest extends NbTestCase { Assert.fail(ex); } } - - private void runIngestJob(List datasources, IngestModuleFactory factory) { - IngestModuleIngestJobSettings settings = factory.getDefaultIngestJobSettings(); - IngestModuleTemplate template = new IngestModuleTemplate(factory, settings); - template.setEnabled(true); - ArrayList templates = new ArrayList<>(); - templates.add(template); - IngestJobSettings ingestJobSettings = new IngestJobSettings(EncryptionDetectionTest.class.getCanonicalName(), IngestType.FILES_ONLY, templates); - try { - List ingestModuleErrorsList = IngestJobRunner.runIngestJob(datasources, ingestJobSettings); - String errorMessage = String.format("The ingest job runner produced %d error messages.", ingestModuleErrorsList.size()); - assertEquals(errorMessage, 0, ingestModuleErrorsList.size()); - } catch (InterruptedException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - } - } diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/CaseUtils.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/CaseUtils.java index dad3f6d142..5eecf425bd 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/CaseUtils.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/CaseUtils.java @@ -29,29 +29,46 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.CaseActionException; import org.sleuthkit.autopsy.casemodule.CaseDetails; +/** + * Common case utility methods. + */ public final class CaseUtils { - + + /** + * CaseUtils constructor. Since this class is not meant to allow for + * instantiation, this constructor is 'private'. + */ private CaseUtils() { } - - public static void createCase(Path caseDirectoryPath) { + + /** + * Create a new case. If the case already exists at the specified path, the + * existing case will be removed prior to creation of the new case. + * + * @param caseDirectoryPath The path to the case data. + * @param caseDisplayName The display name for the case. + */ + public static void createCase(Path caseDirectoryPath, String caseDisplayName) { //Make sure the test is starting with a clean state. So delete the test directory, if it exists. deleteCaseDir(caseDirectoryPath); assertFalse("Unable to delete existing test directory", caseDirectoryPath.toFile().exists()); - + // Create the test directory caseDirectoryPath.toFile().mkdirs(); assertTrue("Unable to create test directory", caseDirectoryPath.toFile().exists()); try { - Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, caseDirectoryPath.toString(), new CaseDetails("IngestFiltersTest")); + Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, caseDirectoryPath.toString(), new CaseDetails(caseDisplayName)); } catch (CaseActionException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } + } assertTrue(caseDirectoryPath.toFile().exists()); } - + + /** + * Close the currently opened case. + */ public static void closeCase() { try { Case.closeCurrentCase(); @@ -64,9 +81,14 @@ public final class CaseUtils { } catch (CaseActionException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } + } } - + + /** + * Delete a case at the specified path. + * + * @param caseDirectoryPath The path to the case to be removed. + */ public static void deleteCaseDir(Path caseDirectoryPath) { if (!caseDirectoryPath.toFile().exists()) { return; diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/IngestUtils.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/IngestUtils.java index 893f2d8cb2..fba62cdbde 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/IngestUtils.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/testutils/IngestUtils.java @@ -16,7 +16,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.sleuthkit.autopsy.testutils; import java.nio.file.Path; @@ -32,41 +31,69 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestModuleTemplate; import org.sleuthkit.datamodel.Content; +/** + * Common image utility methods. + */ public final class IngestUtils { - + + /** + * IngestUtils constructor. Since this class is not meant to allow for + * instantiation, this constructor is 'private'. + */ private IngestUtils() { } - + + /** + * Add a data source for the data source processor. + * + * @param dataSourceProcessor The data source processor. + * @param dataSourcePath The path to the data source to be added. + */ public static void addDataSource(AutoIngestDataSourceProcessor dataSourceProcessor, Path dataSourcePath) { try { DataSourceProcessorRunner.ProcessorCallback callBack = DataSourceProcessorRunner.runDataSourceProcessor(dataSourceProcessor, dataSourcePath); - List errorMessages = callBack.getErrorMessages(); - assertEquals(0, errorMessages.size()); + List callbackErrorMessageList = callBack.getErrorMessages(); + String errorMessage = String.format("The data source processor callback produced %d error messages.", callbackErrorMessageList.size()); + assertEquals(errorMessage, 0, callbackErrorMessageList.size()); } catch (AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException | InterruptedException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - - } + + } } - public static void runIngestJob(List datasources, IngestJobSettings ingestJobSettings) { + /** + * Run an ingest job. + * + * @param dataSourceList The list of data sources to process. + * @param ingestJobSettings The ingest job settings to use for ingest. + */ + public static void runIngestJob(List dataSourceList, IngestJobSettings ingestJobSettings) { try { - List errs = IngestJobRunner.runIngestJob(datasources, ingestJobSettings); - for (IngestModuleError err : errs) { + List ingestModuleErrorsList = IngestJobRunner.runIngestJob(dataSourceList, ingestJobSettings); + for (IngestModuleError err : ingestModuleErrorsList) { System.out.println(String.format("Error: %s: %s.", err.getModuleDisplayName(), err.toString())); } - assertEquals(0, errs.size()); + String errorMessage = String.format("The ingest job runner produced %d error messages.", ingestModuleErrorsList.size()); + assertEquals(errorMessage, 0, ingestModuleErrorsList.size()); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } + } } + /** + * Build a new ingest module template based on the given factory. + * + * @param factory The ingest module factory. + * + * @return The ingest module template. + */ public static IngestModuleTemplate getIngestModuleTemplate(IngestModuleFactoryAdapter factory) { IngestModuleIngestJobSettings settings = factory.getDefaultIngestJobSettings(); IngestModuleTemplate template = new IngestModuleTemplate(factory, settings); template.setEnabled(true); return template; } - + } From e03f1086b90654f3c3ab5ae7c1771787aa828bd3 Mon Sep 17 00:00:00 2001 From: esaunders Date: Mon, 30 Apr 2018 12:34:46 -0400 Subject: [PATCH 13/44] Changed node status table title label. --- .../experimental/autoingest/AinStatusDashboard.form | 8 ++++---- .../experimental/autoingest/AinStatusDashboard.java | 12 ++++++------ .../experimental/autoingest/Bundle.properties | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form index 4631034971..9f0ddc84c8 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.form @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -79,13 +79,13 @@ - + - + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java index 638c0dc6dc..b68553039d 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AinStatusDashboard.java @@ -64,7 +64,7 @@ final class AinStatusDashboard extends javax.swing.JPanel implements Observer { refreshButton = new javax.swing.JButton(); clusterMetricsButton = new javax.swing.JButton(); nodeStatusScrollPane = new javax.swing.JScrollPane(); - jLabel1 = new javax.swing.JLabel(); + nodeStatusTableTitle = new javax.swing.JLabel(); org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.refreshButton.text")); // NOI18N refreshButton.setToolTipText(org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.refreshButton.toolTipText")); // NOI18N @@ -81,8 +81,8 @@ final class AinStatusDashboard extends javax.swing.JPanel implements Observer { } }); - jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.jLabel1.text")); // NOI18N + nodeStatusTableTitle.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(nodeStatusTableTitle, org.openide.util.NbBundle.getMessage(AinStatusDashboard.class, "AinStatusDashboard.nodeStatusTableTitle.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -93,7 +93,7 @@ final class AinStatusDashboard extends javax.swing.JPanel implements Observer { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(nodeStatusScrollPane) .addGroup(layout.createSequentialGroup() - .addComponent(jLabel1) + .addComponent(nodeStatusTableTitle) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -108,7 +108,7 @@ final class AinStatusDashboard extends javax.swing.JPanel implements Observer { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(40, 40, 40) - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(nodeStatusTableTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(nodeStatusScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(382, 382, 382) @@ -136,8 +136,8 @@ final class AinStatusDashboard extends javax.swing.JPanel implements Observer { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton clusterMetricsButton; - private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane nodeStatusScrollPane; + private javax.swing.JLabel nodeStatusTableTitle; private javax.swing.JButton refreshButton; // End of variables declaration//GEN-END:variables diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties index 304e6b385a..e4fe649e18 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties @@ -260,5 +260,5 @@ AutoIngestControlPanel.bnPrioritizeJob.actionCommand=Prioritize Job AutoIngestControlPanel.bnDeprioritizeJob.actionCommand=Deprioritize Job AinStatusDashboard.refreshButton.toolTipText=Refresh displayed tables AinStatusDashboard.refreshButton.text=&Refresh -AinStatusDashboard.jLabel1.text=Auto Ingest Nodes AinStatusDashboard.clusterMetricsButton.text=Auto Ingest &Metrics +AinStatusDashboard.nodeStatusTableTitle.text=Auto Ingest Nodes From 47ebd238e85df7ab6b9425f0ca2884ce0a070895 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Tue, 1 May 2018 12:19:23 -0400 Subject: [PATCH 14/44] updated unix_setup for new TSK version --- unix_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix_setup.sh b/unix_setup.sh index a1e2f6215b..8283efcac8 100755 --- a/unix_setup.sh +++ b/unix_setup.sh @@ -2,7 +2,7 @@ # Verifies programs are installed and copies native code into the Autopsy folder structure -TSK_VERSION=4.6.0 +TSK_VERSION=4.6.1 # Verify PhotoRec was installed photorec_filepath=/usr/bin/photorec From 46d9659ef573a45b4dbbfd9768d101070ce41316 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Tue, 1 May 2018 12:27:40 -0400 Subject: [PATCH 15/44] do not error if file is not there --- unix_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix_setup.sh b/unix_setup.sh index 8283efcac8..970c35a5c2 100755 --- a/unix_setup.sh +++ b/unix_setup.sh @@ -44,7 +44,7 @@ ext_jar_filepath=$PWD/autopsy/modules/ext/sleuthkit-postgresql-$TSK_VERSION.jar; if [ -f "$sleuthkit_jar_filepath" ]; then echo "$sleuthkit_jar_filepath found" echo "Copying into the Autopsy directory" - rm $ext_jar_filepath; + rm -f $ext_jar_filepath; if [ "$?" -gt 0 ]; then #checking if remove operation failed echo "exiting .." exit 1 From 00a49e84f28ca2d06f2ce77e90909da2ef52f94d Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 1 May 2018 12:33:47 -0400 Subject: [PATCH 16/44] 3804 rename search feature for ui from quick search to ui quick search in docs --- docs/doxygen-user/case_management.dox | 2 +- docs/doxygen-user/communications.dox | 2 +- docs/doxygen-user/main.dox | 2 +- docs/doxygen-user/quick_start_guide.dox | 2 +- docs/doxygen-user/timeline.dox | 2 +- docs/doxygen-user/{quick_search.dox => ui_quick_search.dox} | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) rename docs/doxygen-user/{quick_search.dox => ui_quick_search.dox} (54%) diff --git a/docs/doxygen-user/case_management.dox b/docs/doxygen-user/case_management.dox index 48e2fbc2fa..b4d9d0daba 100644 --- a/docs/doxygen-user/case_management.dox +++ b/docs/doxygen-user/case_management.dox @@ -34,7 +34,7 @@ To open a case, either: "Open Recent Case" will always bring up a screen allowing you to select one of the recently opened cases. "Open Case" will do one of two things; - If multi-user cases are not enabled, it will bring up a file chooser that can be used to browse to the ".aut" file in the case directory of the desired case -- If multi-user cases are enabled, it will bring up the multi-user case selection screen. This uses the coordination services to find a list of multi-user cases. If needed, the "Open Single-User Case" button can be used to bring up the normal file chooser. The multi-user case selection screen has a \ref quick_search feature which can be used to quickly find a case in the table. The following shows the multi-user case selection screen: +- If multi-user cases are enabled, it will bring up the multi-user case selection screen. This uses the coordination services to find a list of multi-user cases. If needed, the "Open Single-User Case" button can be used to bring up the normal file chooser. The multi-user case selection screen has a \ref ui_quick_search feature which can be used to quickly find a case in the table. The following shows the multi-user case selection screen: \image html multi_user_case_select.png diff --git a/docs/doxygen-user/communications.dox b/docs/doxygen-user/communications.dox index 2080f910e5..ced0a044d3 100644 --- a/docs/doxygen-user/communications.dox +++ b/docs/doxygen-user/communications.dox @@ -20,7 +20,7 @@ The middle column displays each account, its device and type, and the number of Selecting an account in the middle column will bring up the messages for that account in the right hand column. Here data about each message is displayed in the top section, and the messages itself can be seen in the bottom section (if applicable). -The middle column and the right hand column both have a \ref quick_search feature which can be used to quickly find a visible item in their section's table. +The middle column and the right hand column both have a \ref ui_quick_search feature which can be used to quickly find a visible item in their section's table. \image html cvt_messages.png diff --git a/docs/doxygen-user/main.dox b/docs/doxygen-user/main.dox index f03ad68041..8aabf7a03b 100644 --- a/docs/doxygen-user/main.dox +++ b/docs/doxygen-user/main.dox @@ -39,7 +39,7 @@ The following topics are available here: - \subpage tree_viewer_page - \subpage result_viewer_page - \subpage content_viewer_page - - \subpage quick_search + - \subpage ui_quick_search - \subpage image_gallery_page - \subpage file_search_page - \subpage ad_hoc_keyword_search_page diff --git a/docs/doxygen-user/quick_start_guide.dox b/docs/doxygen-user/quick_start_guide.dox index e1bece678b..b12c65c2a3 100644 --- a/docs/doxygen-user/quick_start_guide.dox +++ b/docs/doxygen-user/quick_start_guide.dox @@ -59,7 +59,7 @@ If you are viewing files from the Views and Results nodes, you can right-click o If you want to search for single keywords, then you can use the search box in the upper right of the program. The results will be shown in a table in the upper right. -The tree on the left as well as the table on the right have a \ref quick_search feature which can be used to quickly find a visible node. +The tree on the left as well as the table on the right have a \ref ui_quick_search feature which can be used to quickly find a visible node. You can tag (bookmark) arbitrary files so that you can more quickly find them later or so that you can include them specifically in a report. diff --git a/docs/doxygen-user/timeline.dox b/docs/doxygen-user/timeline.dox index f992c57d26..d55f9a43bf 100644 --- a/docs/doxygen-user/timeline.dox +++ b/docs/doxygen-user/timeline.dox @@ -69,7 +69,7 @@ The __Counts View__ shows a stacked bar chart. Use this type of graph to show ho The __Details View__ shows individual or groups of related events. Date/time is represented horizontally along the x-axis, but the vertical axis does not represent any specific units. You would use this interface to answer questions about what specific events happened in a given time frame or what events occurred before or after a given event. You would generally use this type of interface after using the Counts View to identify a period of time that you wanted details on. There can be a lot of details in this view and we have introduced zooming concepts, as described in the next section, to help with this. -The table on the bottom left hand side of the panel has a \ref quick_search feature which can be used to quickly find a node in the table. +The table on the bottom left hand side of the panel has a \ref ui_quick_search feature which can be used to quickly find a node in the table. Visualization settings ---------------------- diff --git a/docs/doxygen-user/quick_search.dox b/docs/doxygen-user/ui_quick_search.dox similarity index 54% rename from docs/doxygen-user/quick_search.dox rename to docs/doxygen-user/ui_quick_search.dox index e1bb65248a..901427243e 100644 --- a/docs/doxygen-user/quick_search.dox +++ b/docs/doxygen-user/ui_quick_search.dox @@ -1,10 +1,10 @@ -/*! \page quick_search Quick Search +/*! \page ui_quick_search UI Quick Search -The quick search feature allows you to search within the data on a panel for a given string, it will not search data in hidden columns or collapsed nodes. +The user interface quick search feature allows you to search within the data on a panel for a given string, it will not search data in hidden columns or collapsed nodes. How to use it ----- -In order to use the search you need to select any item in the area you wish to search, and start typing. If quick search is available in the area you have selected a search field will appear in the bottom left hand corner of the area. As you type the string you are searching for it will auto-update to select one of the results which matches your string. You can switch between the results which match the string you have typed with the up and down keys. The search does not support the use of regular expressions but will match against any sub-sting in the fields it searches, not just at the beginning of the field. +In order to use the search you need to select any item in the area you wish to search, and start typing. If user interface quick search is available in the area you have selected a search field will appear in the bottom left hand corner of the area. As you type the string you are searching for it will auto-update to select one of the results which matches your string. You can switch between the results which match the string you have typed with the up and down keys. The search does not support the use of regular expressions but will match against any sub-sting in the fields it searches, not just at the beginning of the field. \image html quick_search_result.PNG Configuration From 4234d636d12b0ebc03d1a9e0d70eba9000ec6b93 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Tue, 1 May 2018 18:08:51 -0400 Subject: [PATCH 17/44] Change build so that ZIP file has version in root folder --- build.xml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/build.xml b/build.xml index 0995b07e10..8381cec295 100644 --- a/build.xml +++ b/build.xml @@ -144,9 +144,9 @@ - + - + @@ -285,9 +285,20 @@ - + + + + + + - + + + + + + + From 10661321b64082e658ce2edfc41b510a0e50148e Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Tue, 1 May 2018 18:13:52 -0400 Subject: [PATCH 18/44] Added Linux / OS X instructions --- Running_Linux_OSX.txt | 41 +++++++++++++++++++++++++++++++++++++++++ build.xml | 1 + 2 files changed, 42 insertions(+) create mode 100644 Running_Linux_OSX.txt diff --git a/Running_Linux_OSX.txt b/Running_Linux_OSX.txt new file mode 100644 index 0000000000..dc9c29a51a --- /dev/null +++ b/Running_Linux_OSX.txt @@ -0,0 +1,41 @@ +This document outlines how to run a packaged version of Autopsy on Linux or OS X. It does not cover how to compile it from source or the Windows installer. + + +* Prerequisites * + +The following need to be done at least once. They do not need to be repeated for each Autopsy release. + +- Install testdisk for photorec functionality +-- Linux: % sudo apt-get install testdisk +-- OS X: % brew install testdisk + +- Install Oracle Java and set JAVA_HOME. +-- Linux: Use the instructions here: https://medium.com/coderscorner/installing-oracle-java-8-in-ubuntu-16-10-845507b13343 +-- OS X: Use The Oracle website: https://www.java.com/ + Set JAVA_HOME with something like: export JAVA_HOME=`/usr/libexec/java_home` in .bash_profile + + +* Install The Sleuth Kit Java Bindings * + +Autopsy depends on a specific version of The Sleuth Kit. You need the Java libraries of The Sleuth Kit installed, which is not part of all packages. + +- Linux: Install the sleuthkit-java.deb file that you can download from github.com/sleuthkit/sleuthkit/releases. This will install libewf, etc. +-- % sudo apt install ./sleuthkit-java_4.6.0-1_amd64.deb + +- OS X: Install The Sleuth Kit from brew. +-- % brew install sleuthkit + + +* Install Autopsy * + +- Extract the contents of the Autopsy ZIP file to a folder. +- Open a terminal and cd into the Autopsy folder. +- Run the unix_setup.sh script to configure Autopsy + % sh unix_setup.sh + + +* Running Autopsy * + +- In a terminal, change to the ‘bin’ directory in the Autopsy folder. +- Run Autopsy + % ./autopsy \ No newline at end of file diff --git a/build.xml b/build.xml index 8381cec295..a1ff9d665a 100644 --- a/build.xml +++ b/build.xml @@ -91,6 +91,7 @@ + From fef6c5f510280842aca867596c79f021c8129c5a Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 10:28:48 -0400 Subject: [PATCH 19/44] Public API adjustments for application content viewer and ingest services --- .../contentviewers/EpochTimeCellRenderer.java | 2 +- .../contentviewers/MediaFileViewer.java | 2 +- .../contentviewers/MediaViewImagePanel.java | 5 +- .../contentviewers/MediaViewVideoPanel.java | 4 +- .../contentviewers/MessageContentViewer.java | 2 +- .../contentviewers/PListRowFactory.java | 3 +- .../autopsy/contentviewers/PListViewer.java | 2 +- .../contentviewers/SQLiteTableRowFactory.java | 3 +- .../autopsy/contentviewers/SQLiteViewer.java | 2 +- .../autopsy/ingest/IngestServices.java | 129 +++++++++++------- 10 files changed, 93 insertions(+), 61 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/EpochTimeCellRenderer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/EpochTimeCellRenderer.java index 723c1ef0f3..7f618c0754 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/EpochTimeCellRenderer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/EpochTimeCellRenderer.java @@ -33,7 +33,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; * Custom Cell renderer to display a SQLite column cell as readable Epoch date/time * */ -public class EpochTimeCellRenderer extends DefaultTableCellRenderer { +class EpochTimeCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = 1L; private static final Logger LOGGER = Logger.getLogger(FileViewer.class.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java index 1d9695712b..afb5152c14 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java @@ -31,7 +31,7 @@ import org.sleuthkit.datamodel.AbstractFile; /** * Media content viewer for videos, sounds and images. */ -public class MediaFileViewer extends javax.swing.JPanel implements FileTypeViewer { +class MediaFileViewer extends javax.swing.JPanel implements FileTypeViewer { private static final Logger LOGGER = Logger.getLogger(MediaFileViewer.class.getName()); private AbstractFile lastFile; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewImagePanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewImagePanel.java index b6505544ba..b04473990c 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewImagePanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewImagePanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,7 +47,6 @@ import org.controlsfx.control.MaskerPane; import org.openide.util.NbBundle; import org.python.google.common.collect.Lists; import org.sleuthkit.autopsy.casemodule.Case; -//import org.sleuthkit.autopsy.corecomponents.Bundle; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.FileNode; @@ -61,7 +60,7 @@ import org.sleuthkit.datamodel.AbstractFile; @NbBundle.Messages({"MediaViewImagePanel.externalViewerButton.text=Open in External Viewer", "MediaViewImagePanel.errorLabel.text=Could not load file into Media View.", "MediaViewImagePanel.errorLabel.OOMText=Could not load file into Media View: insufficent memory."}) -public class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPanel { +class MediaViewImagePanel extends JPanel implements MediaFileViewer.MediaViewPanel { private static final Image EXTERNAL = new Image(MediaViewImagePanel.class.getResource("/org/sleuthkit/autopsy/images/external.png").toExternalForm()); diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewVideoPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewVideoPanel.java index 8848164683..0a203a0909 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaViewVideoPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013 Basis Technology Corp. + * Copyright 2013-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,7 +35,7 @@ import org.sleuthkit.datamodel.AbstractFile; * Video viewer part of the Media View layered pane. Uses different engines * depending on platform. */ -public abstract class MediaViewVideoPanel extends JPanel implements FrameCapture, MediaFileViewer.MediaViewPanel { +abstract class MediaViewVideoPanel extends JPanel implements FrameCapture, MediaFileViewer.MediaViewPanel { private static final Set AUDIO_EXTENSIONS = new TreeSet<>(Arrays.asList(".mp3", ".wav", ".wma")); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageContentViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageContentViewer.java index ce2721e647..b1c44b819b 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MessageContentViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MessageContentViewer.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2017-18 Basis Technology Corp. + * Copyright 2017-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/PListRowFactory.java b/Core/src/org/sleuthkit/autopsy/contentviewers/PListRowFactory.java index 75b2970ecb..f0bc0a95bc 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/PListRowFactory.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/PListRowFactory.java @@ -33,7 +33,8 @@ import org.sleuthkit.autopsy.datamodel.NodeProperty; /** * Factory class to create nodes for Plist table view */ -public class PListRowFactory extends ChildFactory { + +class PListRowFactory extends ChildFactory { private final List rows; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java index f3d630eaf3..0d310c30fc 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java @@ -64,7 +64,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.FileTypeViewer; * PListViewer - a file viewer for binary plist files. * */ -public class PListViewer extends javax.swing.JPanel implements FileTypeViewer, ExplorerManager.Provider { +class PListViewer extends javax.swing.JPanel implements FileTypeViewer, ExplorerManager.Provider { private static final long serialVersionUID = 1L; private static final String[] MIMETYPES = new String[]{"application/x-bplist"}; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java index 02a08f7037..afaf3ae398 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java @@ -34,7 +34,8 @@ import org.sleuthkit.autopsy.datamodel.NodeProperty; /** * Factory class to generate nodes for SQLite table rows */ -public class SQLiteTableRowFactory extends ChildFactory { + +class SQLiteTableRowFactory extends ChildFactory { private final List> rows; private final List colActions; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index 4a4ee95a90..5dd6ee8141 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -56,7 +56,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; /** * A file content viewer for SQLite database files. */ -public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { +class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { private static final long serialVersionUID = 1L; public static final String[] SUPPORTED_MIMETYPES = new String[]{"application/x-sqlite3"}; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java index f70c9b0813..94db5ad51e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * - * Copyright 2011-2014 Basis Technology Corp. + * + * Copyright 2012-2018 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. @@ -26,20 +26,25 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.datamodel.SleuthkitCase; /** - * Singleton class that provides services for ingest modules. These exist to - * make it easier to write modules. Use the getDefault() method to get the - * singleton instance. + * Ingest services provides convenience methods for ingest modules to use during + * to access the Autopsy case, the case database, fire events, etc. */ public final class IngestServices { private static IngestServices instance = null; - private final IngestManager manager = IngestManager.getInstance(); + /** + * Constructs an ingest services object that provides convenience methods + * for ingest modules to use to access the Autopsy case, the case database, + * fire events, etc. + */ private IngestServices() { } /** - * Get the ingest services. + * Gets the ingest services singleton that provides convenience methods for + * ingest modules to use to access the Autopsy case, the case database, fire + * events, * * @return The ingest services singleton. */ @@ -51,123 +56,149 @@ public final class IngestServices { } /** - * Get the current Autopsy case. + * Gets the current open Autopsy case. + * + * @return The current open case. * - * @return The current case. * @throws NoCurrentCaseException if there is no open case. */ - public Case getOpenCase() throws NoCurrentCaseException { + public Case getCase() throws NoCurrentCaseException { return Case.getOpenCase(); } /** - * Get the current SleuthKit case. The SleuthKit case is the case database. + * Gets the case database of the current open Autopsy case. * * @return The current case database. + * * @throws NoCurrentCaseException if there is no open case. */ - public SleuthkitCase getCurrentSleuthkitCaseDb() throws NoCurrentCaseException { + public SleuthkitCase getCaseDatabase() throws NoCurrentCaseException { return Case.getOpenCase().getSleuthkitCase(); } /** - * Get a logger that incorporates the display name of an ingest module in + * Gets a logger that incorporates the display name of an ingest module in * messages written to the Autopsy log files. * * @param moduleDisplayName The display name of the ingest module. * - * @return The custom logger for the ingest module. + * @return A logger for the ingest module. */ public Logger getLogger(String moduleDisplayName) { return Logger.getLogger(moduleDisplayName); } /** - * Post message to the ingest messages in box. + * Posts a message to the ingest messages in box. * * @param message An ingest message */ public void postMessage(final IngestMessage message) { - manager.postIngestMessage(message); + IngestManager.getInstance().postIngestMessage(message); } /** - * Fire module data event to notify registered module data event listeners - * that there is new data of a given type from a module. + * Fires an event to notify registered listeners that a new artifact has + * been posted to the blackboard. * - * @param moduleDataEvent module data event, encapsulating blackboard - * artifact data + * @param moduleDataEvent A module data event, i.e., an event that + * encapsulates artifact data. */ public void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) { IngestManager.getInstance().fireIngestModuleDataEvent(moduleDataEvent); } /** - * Fire module content event to notify registered module content event - * listeners that there is new content (from ZIP file contents, carving, - * etc.) + * Fires an event to notify registered listeners that there is new content + * (e.g., files extracted from an archive file, carved files, etc.) * - * @param moduleContentEvent module content event, encapsulating content - * changed + * @param moduleContentEvent A module content event, i.e., an event that + * encapsulates new content data. */ public void fireModuleContentEvent(ModuleContentEvent moduleContentEvent) { IngestManager.getInstance().fireIngestModuleContentEvent(moduleContentEvent); } /** - * Get free disk space of a drive where ingest data are written to That - * drive is being monitored by IngestMonitor thread when ingest is running. + * Gets the free disk space of the drive where data is written during + * ingest. Can be used by ingest modules to determine if there is enough + * disk space before writing data is attmepted. * - * @return amount of disk space, -1 if unknown + * @return Amount of free disk space, in bytes, or -1 if unknown. */ public long getFreeDiskSpace() { - return manager.getFreeDiskSpace(); + return IngestManager.getInstance().getFreeDiskSpace(); } /** - * Gets a specific name/value configuration setting for a module + * Gets a global configuration setting for an ingest module. * - * @param moduleName moduleName identifier unique to that module - * @param settingName setting name to retrieve + * @param moduleName A unique identifier for the module. + * @param settingName The name of the setting. * - * @return setting value for the module / setting name, or null if not found + * @return setting The value of the setting, or null if not found. */ public String getConfigSetting(String moduleName, String settingName) { return ModuleSettings.getConfigSetting(moduleName, settingName); } /** - * Sets a specific name/value configuration setting for a module + * Sets a global configuration setting for an ingest module. * - * @param moduleName moduleName identifier unique to that module - * @param settingName setting name to set - * @param settingVal setting value to set + * @param moduleName A unique identifier for the module. + * @param settingName The name of the setting. + * @param setting The value of the setting. */ - public void setConfigSetting(String moduleName, String settingName, String settingVal) { - ModuleSettings.setConfigSetting(moduleName, settingName, settingVal); + public void setConfigSetting(String moduleName, String settingName, String setting) { + ModuleSettings.setConfigSetting(moduleName, settingName, setting); } /** - * Gets all name/value configuration settings for a module + * Gets all of the global configuration settings for an ingest module. * - * @param moduleName moduleName identifier unique to that module + * @param moduleName A unique identifier for the module. * - * @return settings for the module / setting name + * @return A mapping of setting names to setting values. */ public Map getConfigSettings(String moduleName) { return ModuleSettings.getConfigSettings(moduleName); } /** - * Sets all name/value configuration setting for a module. Names not in the - * list will have settings preserved. + * Sets all of the global configuration settings for an ingest module. + * + * @param moduleName A unique identifier for the module. * * @param moduleName moduleName identifier unique to that module - * @param settings settings to set and replace old settings, keeping - * settings not specified in the map. + * @param settings A mapping of setting names to setting values. * */ public void setConfigSettings(String moduleName, Map settings) { ModuleSettings.setConfigSettings(moduleName, settings); } + + /** + * Gets the current SleuthKit case. The SleuthKit case is the case database. + * + * @return The current case database. + * + * @deprecated Use getCaseDatabase instead. + */ + @Deprecated + public SleuthkitCase getCurrentSleuthkitCaseDb() { + return Case.getCurrentCase().getSleuthkitCase(); + } + + /** + * Get the current open case. + * + * @return The current case. + * + * @deprecated Use getCase instead. + */ + public Case getCurrentCase() { + return Case.getCurrentCase(); + } + } From e766068fe51121e712b63d6403a382db0aee788a Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 2 May 2018 14:42:19 -0400 Subject: [PATCH 20/44] Handle counts. --- .../EncryptionDetectionTest.java | 80 ++++++++++++------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java index 5b3d2ec7d3..b1963c3fd0 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.modules.encryptiondetection; -import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -96,42 +95,61 @@ public class EncryptionDetectionTest extends NbTestCase { * Purge specific files to be tested. */ FileManager fileManager = openCase.getServices().getFileManager(); - List results = fileManager.findFiles("%%", "ole2"); - results.addAll(fileManager.findFiles("%%", "ooxml")); - results.addAll(fileManager.findFiles("%%", "pdf")); - results.addAll(fileManager.findFiles("%%", "mdb")); - results.addAll(fileManager.findFiles("%%", "accdb")); + List> allResults = new ArrayList<>(0); + + List ole2Results = fileManager.findFiles("%%", "ole2"); + assertEquals("Unexpected number of OLE2 results.", 11, ole2Results.size()); + + List ooxmlResults = fileManager.findFiles("%%", "ooxml"); + assertEquals("Unexpected number of OOXML results.", 13, ooxmlResults.size()); + + List pdfResults = fileManager.findFiles("%%", "pdf"); + assertEquals("Unexpected number of PDF results.", 6, pdfResults.size()); + + List mdbResults = fileManager.findFiles("%%", "mdb"); + assertEquals("Unexpected number of MDB results.", 25, mdbResults.size()); + + List accdbResults = fileManager.findFiles("%%", "accdb"); + assertEquals("Unexpected number of ACCDB results.", 10, accdbResults.size()); + + allResults.add(ole2Results); + allResults.add(ooxmlResults); + allResults.add(pdfResults); + allResults.add(mdbResults); + allResults.add(accdbResults); - for (AbstractFile file : results) { - /* - * Process only non-slack files. - */ - if (file.isFile() && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)) { + for (List results : allResults) { + for (AbstractFile file : results) { /* - * Determine which assertions to use for the file based on - * its name. + * Process only non-slack files. */ - boolean fileProtected = file.getName().split("\\.")[0].endsWith("-protected"); - List artifactsList = file.getAllArtifacts(); - if (fileProtected) { + if (file.isFile() && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)) { /* - * Check that the protected file has one - * TSK_ENCRYPTION_DETECTED artifact. + * Determine which assertions to use for the file based on + * its name. */ - int artifactsListSize = artifactsList.size(); - String errorMessage = String.format("File '%s' (objId=%d) has %d artifacts, but 1 was expected.", file.getName(), file.getId(), artifactsListSize); - assertEquals(errorMessage, 1, artifactsListSize); + boolean fileProtected = file.getName().split("\\.")[0].endsWith("-protected"); + List artifactsList = file.getAllArtifacts(); + if (fileProtected) { + /* + * Check that the protected file has one + * TSK_ENCRYPTION_DETECTED artifact. + */ + int artifactsListSize = artifactsList.size(); + String errorMessage = String.format("File '%s' (objId=%d) has %d artifacts, but 1 was expected.", file.getName(), file.getId(), artifactsListSize); + assertEquals(errorMessage, 1, artifactsListSize); - String artifactTypeName = artifactsList.get(0).getArtifactTypeName(); - errorMessage = String.format("File '%s' (objId=%d) has an unexpected '%s' artifact.", file.getName(), file.getId(), artifactTypeName); - assertEquals(errorMessage, BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.toString(), artifactTypeName); - } else { - /* - * Check that the unprotected file has no artifacts. - */ - int artifactsListSize = artifactsList.size(); - String errorMessage = String.format("File '%s' (objId=%d) has %d artifacts, but none were expected.", file.getName(), file.getId(), artifactsListSize); - assertEquals(errorMessage, 0, artifactsListSize); + String artifactTypeName = artifactsList.get(0).getArtifactTypeName(); + errorMessage = String.format("File '%s' (objId=%d) has an unexpected '%s' artifact.", file.getName(), file.getId(), artifactTypeName); + assertEquals(errorMessage, BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.toString(), artifactTypeName); + } else { + /* + * Check that the unprotected file has no artifacts. + */ + int artifactsListSize = artifactsList.size(); + String errorMessage = String.format("File '%s' (objId=%d) has %d artifacts, but none were expected.", file.getName(), file.getId(), artifactsListSize); + assertEquals(errorMessage, 0, artifactsListSize); + } } } } From bee4d28c145d702f9ffeb7b4f0610df7c7445229 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 17:37:11 -0400 Subject: [PATCH 21/44] Public API fixes/removes for release 4.7.0 --- .../casemodule/services/Blackboard.java | 8 +- .../FileTypeViewer.java | 9 +- .../autopsy/contentviewers/FileViewer.java | 1 - .../contentviewers/MediaFileViewer.java | 1 - .../autopsy/contentviewers/PListViewer.java | 1 - .../autopsy/contentviewers/SQLiteViewer.java | 1 - .../autopsy/ingest/IngestServices.java | 1 + .../keywordsearch/SolrSearchService.java | 139 ++++++++++++------ 8 files changed, 102 insertions(+), 59 deletions(-) rename Core/src/org/sleuthkit/autopsy/{corecomponentinterfaces => contentviewers}/FileTypeViewer.java (77%) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java index 70b10b0f0e..58b4f41d6e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java @@ -1,14 +1,14 @@ /* - * Sleuth Kit Data Model + * Autopsy Forensic Browser * - * Copyright 2011-2016 Basis Technology Corp. + * Copyright 2015-2018 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 + * 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, @@ -65,7 +65,7 @@ public final class Blackboard implements Closeable { throw new BlackboardException("Keyword search service not found"); } try { - searchService.indexArtifact(artifact); + searchService.index(artifact); } catch (TskCoreException ex) { throw new BlackboardException("Error indexing artifact", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/FileTypeViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/FileTypeViewer.java similarity index 77% rename from Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/FileTypeViewer.java rename to Core/src/org/sleuthkit/autopsy/contentviewers/FileTypeViewer.java index b3ae7210a2..a2096dd2d9 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/FileTypeViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/FileTypeViewer.java @@ -16,7 +16,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.sleuthkit.autopsy.corecomponentinterfaces; +package org.sleuthkit.autopsy.contentviewers; import java.awt.Component; import java.util.List; @@ -26,7 +26,7 @@ import org.sleuthkit.datamodel.AbstractFile; * Defines an interface for application specific content viewer * */ -public interface FileTypeViewer { +interface FileTypeViewer { /** * Returns list of MIME types supported by this viewer @@ -45,6 +45,11 @@ public interface FileTypeViewer { /** * Clears the data in the panel + * + * IMPORTANT IF MAKING THIS PUBLIC: I (RC) am not sure that this method + * belongs in this interface. If we are not going to use setFile(null) as a + * reset method as in DataContentViewer and DataResultViewer, then this is + * fine. Otherwise, it is ambiguous. */ void resetComponent(); } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java index 98cee5bc59..53be8ddbcd 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/FileViewer.java @@ -31,7 +31,6 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector; import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.autopsy.corecomponentinterfaces.FileTypeViewer; /** * Generic Application content viewer diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java index afb5152c14..92da0733d8 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/MediaFileViewer.java @@ -24,7 +24,6 @@ import java.awt.Dimension; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import org.sleuthkit.autopsy.corecomponentinterfaces.FileTypeViewer; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.AbstractFile; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java index 0d310c30fc..bf69817c2c 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java @@ -58,7 +58,6 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.TskCoreException; import org.xml.sax.SAXException; -import org.sleuthkit.autopsy.corecomponentinterfaces.FileTypeViewer; /** * PListViewer - a file viewer for binary plist files. diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index 5dd6ee8141..7cc6980f0c 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -50,7 +50,6 @@ import org.sleuthkit.autopsy.datamodel.ContentUtils; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.autopsy.corecomponentinterfaces.FileTypeViewer; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java index 94db5ad51e..630102f674 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -197,6 +197,7 @@ public final class IngestServices { * * @deprecated Use getCase instead. */ + @Deprecated public Case getCurrentCase() { return Case.getCurrentCase(); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java index 3fea1a51ee..186bf19e15 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2015-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -68,63 +68,70 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { private static final Logger logger = Logger.getLogger(SolrSearchService.class.getName()); /** - * Adds an artifact to the keyword search text index as a concantenation of - * all of its attributes. + * Indexes the given content for keyword search. * - * @param artifact The artifact to index. + * IMPORTANT: Currently, there are two correct uses for this code: + * + * 1) Indexing an artifact created during while either the file level ingest + * module pipeline or the first stage data source level ingest module + * pipeline of an ingest job is running. + * + * 2) Indexing a report. * - * @throws org.sleuthkit.datamodel.TskCoreException - */ - @Override - public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException { - if (artifact == null) { - return; - } - - // We only support artifact indexing for Autopsy versions that use - // the negative range for artifact ids. - if (artifact.getArtifactID() > 0) { - return; - } - final Ingester ingester = Ingester.getDefault(); - - try { - ingester.indexMetaDataOnly(artifact); - ingester.indexText(new ArtifactTextExtractor(), artifact, null); - } catch (Ingester.IngesterException ex) { - throw new TskCoreException(ex.getCause().getMessage(), ex); - } - } - - /** - * Add the given Content object to the text index. * @param content The content to index. - * @throws TskCoreException + * + * @throws TskCoreException If there is a problem indexing the content. */ @Override public void index(Content content) throws TskCoreException { + /* + * TODO (JIRA-1099): The following code has some issues that need to be + * resolved. For artifacts, it is assumed that the posting of artifacts + * is only occuring during an ingest job with an enabled keyword search + * ingest module handling index commits; it also assumes that the + * artifacts are only posted by modules in the either the file level + * ingest pipeline or the first stage data source level ingest pipeline, + * so that the artifacts will be searched during a periodic or final + * keyword search. It also assumes that the only other type of Content + * for which this API will be called are Reports generated at a time + * when doing a commit is required and desirable, i.e., in a context + * other than an ingest job. + */ if (content == null) { return; } final Ingester ingester = Ingester.getDefault(); - - try { - ingester.indexText(new TikaTextExtractor(), content, null); - } catch (Ingester.IngesterException ex) { + if (content instanceof BlackboardArtifact) { + BlackboardArtifact artifact = (BlackboardArtifact) content; + if (artifact.getArtifactID() > 0) { + /* + * Artifact indexing is only supported for artifacts that use + * negative artifact ids to avoid overlapping with the object + * ids of other types of Content. + */ + return; + } try { - // Try the StringsTextExtractor if Tika extractions fails. - ingester.indexText(new StringsTextExtractor(), content, null); - } catch (Ingester.IngesterException ex1) { - throw new TskCoreException(ex.getCause().getMessage(), ex1); - } + ingester.indexMetaDataOnly(artifact); + ingester.indexText(new ArtifactTextExtractor(), artifact, null); + } catch (Ingester.IngesterException ex) { + throw new TskCoreException(ex.getCause().getMessage(), ex); + } + } else { + try { + ingester.indexText(new TikaTextExtractor(), content, null); + } catch (Ingester.IngesterException ex) { + try { + // Try the StringsTextExtractor if Tika extractions fails. + ingester.indexText(new StringsTextExtractor(), content, null); + } catch (Ingester.IngesterException ex1) { + throw new TskCoreException(ex.getCause().getMessage(), ex1); + } + } + ingester.commit(); } - - // TODO: Review whether this is the right thing to do. We typically use - // a combination of autoCommit and the SearchRunner to ensure that data - // is committed but that might not be sufficient for reports (or artifacts). - ingester.commit(); } - + /** * Tries to connect to the keyword search service. * @@ -205,7 +212,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { */ KeywordSearch.getServer().deleteCore(index.getIndexName(), metadata); if (!FileUtil.deleteDir(new File(index.getIndexPath()).getParentFile())) { - throw new KeywordSearchServiceException(Bundle.SolrSearchService_exceptionMessage_failedToDeleteIndexFiles(index.getIndexPath())); + throw new KeywordSearchServiceException(Bundle.SolrSearchService_exceptionMessage_failedToDeleteIndexFiles(index.getIndexPath())); } } return; //only one core exists for each combination of solr and schema version @@ -213,9 +220,9 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { //this code this code will only execute if an index for the current core was not found logger.log(Level.WARNING, NbBundle.getMessage(SolrSearchService.class, - "SolrSearchService.exceptionMessage.noCurrentSolrCore")); + "SolrSearchService.exceptionMessage.noCurrentSolrCore")); throw new KeywordSearchServiceException(NbBundle.getMessage(SolrSearchService.class, - "SolrSearchService.exceptionMessage.noCurrentSolrCore")); + "SolrSearchService.exceptionMessage.noCurrentSolrCore")); } @Override @@ -231,6 +238,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { * Creates/opens the Solr core/text index for a case * * @param context The case context. + * * @throws * org.sleuthkit.autopsy.appservices.AutopsyService.AutopsyServiceException */ @@ -366,7 +374,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { } else { progress.switchToIndeterminate(Bundle.SolrSearch_openGiantCore_msg()); } - + KeywordSearch.getServer().openCoreForCase(theCase, currentVersionIndex); } catch (KeywordSearchModuleException ex) { throw new AutopsyServiceException(String.format("Failed to open or create core for %s", caseDirPath), ex); @@ -379,6 +387,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { * Closes the open core. * * @param context + * * @throws * org.sleuthkit.autopsy.appservices.AutopsyService.AutopsyServiceException */ @@ -403,4 +412,36 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { throw new AutopsyServiceException(String.format("Failed to close core for %s", context.getCase().getCaseDirectory()), ex); } } + + /** + * Adds an artifact to the keyword search text index as a concantenation of + * all of its attributes. + * + * @param artifact The artifact to index. + * + * @throws org.sleuthkit.datamodel.TskCoreException + * @deprecated Call index(Content) instead. + */ + @Deprecated + @Override + public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException { + if (artifact == null) { + return; + } + + // We only support artifact indexing for Autopsy versions that use + // the negative range for artifact ids. + if (artifact.getArtifactID() > 0) { + return; + } + final Ingester ingester = Ingester.getDefault(); + + try { + ingester.indexMetaDataOnly(artifact); + ingester.indexText(new ArtifactTextExtractor(), artifact, null); + } catch (Ingester.IngesterException ex) { + throw new TskCoreException(ex.getCause().getMessage(), ex); + } + } + } From 9b47c3b579c7d6e3c1688948917854211e483cdc Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 18:06:22 -0400 Subject: [PATCH 22/44] Remove corecomponents.Installer setUIFont from public API --- Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java index 9394234e4d..5bcd68a03b 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -121,7 +121,7 @@ public class Installer extends ModuleInstall { }); } - public static void setUIFont (javax.swing.plaf.FontUIResource f){ + private static void setUIFont (javax.swing.plaf.FontUIResource f){ java.util.Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); From 4b14339b7d9c2a7fe0d4b397e6e0c76b2b77c9d5 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 18:44:19 -0400 Subject: [PATCH 23/44] Case.getOpenCase => Case.getCurrentOpenCase for consistency --- .../AddBlackboardArtifactTagAction.java | 2 +- .../autopsy/actions/AddBookmarkTagAction.java | 2 +- .../autopsy/actions/AddContentTagAction.java | 2 +- .../autopsy/actions/AddTagAction.java | 4 +- .../DeleteBlackboardArtifactTagAction.java | 2 +- .../actions/DeleteContentTagAction.java | 2 +- ...DeleteFileBlackboardArtifactTagAction.java | 6 +-- .../actions/DeleteFileContentTagAction.java | 6 +-- .../actions/GetTagNameAndCommentDialog.java | 2 +- .../autopsy/actions/GetTagNameDialog.java | 6 +-- .../autopsy/actions/OpenLogFolderAction.java | 2 +- .../actions/OpenOutputFolderAction.java | 2 +- .../autopsy/casemodule/AddImageTask.java | 2 +- .../AddImageWizardAddingProgressPanel.java | 6 +-- .../AddImageWizardSelectDspVisual.java | 4 +- .../autopsy/casemodule/AddLocalFilesTask.java | 2 +- .../sleuthkit/autopsy/casemodule/Case.java | 48 +++++++++---------- .../autopsy/casemodule/CaseDeleteAction.java | 2 +- .../casemodule/CaseInformationPanel.java | 2 +- .../casemodule/CasePropertiesPanel.java | 2 +- .../autopsy/casemodule/ImageDSProcessor.java | 2 +- .../autopsy/casemodule/ImageFilePanel.java | 2 +- .../casemodule/IngestJobInfoPanel.java | 4 +- .../autopsy/casemodule/LocalDiskPanel.java | 2 +- .../casemodule/LocalFilesDSProcessor.java | 2 +- .../autopsy/casemodule/LocalFilesPanel.java | 2 +- .../casemodule/LogicalEvidenceFilePanel.java | 2 +- .../casemodule/NewCaseWizardAction.java | 4 +- .../OptionalCasePropertiesPanel.java | 8 ++-- .../autopsy/casemodule/RecentCases.java | 4 +- .../BlackBoardArtifactTagAddedEvent.java | 2 +- .../events/ContentTagAddedEvent.java | 2 +- .../events/DataSourceAddedEvent.java | 2 +- .../casemodule/events/ReportAddedEvent.java | 2 +- .../services/TagNameDefinition.java | 2 +- .../casemodule/services/TagOptionsPanel.java | 2 +- .../casemodule/services/TagsManager.java | 10 ++-- .../DataContentViewerOtherCases.java | 8 ++-- .../datamodel/CorrelationDataSource.java | 2 +- .../datamodel/EamArtifactUtil.java | 12 ++--- .../eventlisteners/CaseEventListener.java | 18 +++---- .../eventlisteners/IngestEventsListener.java | 2 +- .../ingestmodule/IngestModule.java | 4 +- .../AccountDeviceInstanceKey.java | 2 +- .../communications/AccountsBrowser.java | 2 +- .../autopsy/communications/FiltersPanel.java | 4 +- .../communications/VisualizationPanel.java | 2 +- .../autopsy/contentviewers/PListViewer.java | 2 +- .../autopsy/contentviewers/SQLiteViewer.java | 4 +- .../DataContentTopComponent.java | 2 +- .../corecomponents/DataResultPanel.java | 4 +- .../DataResultTopComponent.java | 2 +- .../autopsy/coreutils/ImageUtils.java | 2 +- .../autopsy/coreutils/VideoUtils.java | 2 +- .../datamodel/AbstractAbstractFileNode.java | 2 +- .../datamodel/AbstractContentNode.java | 2 +- .../datamodel/BlackboardArtifactNode.java | 8 ++-- .../autopsy/datamodel/DataSourcesNode.java | 2 +- .../autopsy/datamodel/DeletedContent.java | 4 +- .../autopsy/datamodel/EmailExtracted.java | 4 +- .../autopsy/datamodel/ExtractedContent.java | 8 ++-- .../sleuthkit/autopsy/datamodel/FileSize.java | 4 +- .../datamodel/FileTypesByExtension.java | 2 +- .../datamodel/FileTypesByMimeType.java | 2 +- .../autopsy/datamodel/HashsetHits.java | 4 +- .../autopsy/datamodel/ImageNode.java | 2 +- .../autopsy/datamodel/InterestingHits.java | 4 +- .../autopsy/datamodel/KeywordHits.java | 4 +- .../sleuthkit/autopsy/datamodel/Reports.java | 6 +-- .../org/sleuthkit/autopsy/datamodel/Tags.java | 16 +++---- .../datamodel/VirtualDirectoryNode.java | 4 +- .../autopsy/datamodel/accounts/Accounts.java | 20 ++++---- .../datasourceprocessors/AddRawImageTask.java | 2 +- .../datasourceprocessors/RawDSInputPanel.java | 2 +- .../autopsy/diagnostics/PerformancePanel.java | 6 +-- .../DirectoryTreeTopComponent.java | 6 +-- .../directorytree/ExternalViewerAction.java | 2 +- .../autopsy/directorytree/ExtractAction.java | 4 +- .../directorytree/ExtractUnallocAction.java | 6 +-- .../ViewSourceArtifactAction.java | 2 +- .../SampleDataSourceIngestModule.java | 2 +- .../autopsy/filesearch/DateSearchFilter.java | 4 +- .../autopsy/filesearch/FileSearchPanel.java | 2 +- .../autopsy/imagewriter/ImageWriter.java | 4 +- .../autopsy/ingest/DataSourceIngestJob.java | 4 +- .../autopsy/ingest/GetFilesCountVisitor.java | 2 +- .../ingest/IngestJobSettingsPanel.java | 2 +- .../autopsy/ingest/IngestManager.java | 6 +-- .../ingest/IngestMessageDetailsPanel.java | 2 +- .../autopsy/ingest/IngestMonitor.java | 4 +- .../autopsy/ingest/IngestServices.java | 4 +- .../autopsy/ingest/RunIngestAction.java | 2 +- .../autopsy/ingest/RunIngestSubMenu.java | 2 +- .../ingest/events/BlackboardPostEvent.java | 2 +- .../ingest/events/ContentChangedEvent.java | 2 +- .../events/DataSourceAnalysisEvent.java | 2 +- .../ingest/events/FileAnalyzedEvent.java | 2 +- .../menuactions/DataContentDynamicMenu.java | 2 +- .../menuactions/DataExplorerDynamicMenu.java | 2 +- .../EmbeddedFileExtractorIngestModule.java | 2 +- .../ExtractArchiveWithPasswordAction.java | 4 +- .../MSOfficeEmbeddedContentExtractor.java | 2 +- .../SevenZipExtractor.java | 6 +-- .../EncryptionDetectionFileIngestModule.java | 2 +- .../exif/ExifParserFileIngestModule.java | 2 +- .../FileExtMismatchIngestModule.java | 2 +- .../filetypeid/FileTypeIdIngestModule.java | 2 +- .../hashdatabase/HashDbIngestModule.java | 4 +- .../modules/hashdatabase/HashDbSearcher.java | 6 +-- .../autopsy/modules/iOS/CallLogAnalyzer.java | 6 +-- .../autopsy/modules/iOS/ContactAnalyzer.java | 4 +- .../modules/iOS/TextMessageAnalyzer.java | 6 +-- .../FilesIdentifierIngestModule.java | 2 +- .../PhotoRecCarverFileIngestModule.java | 2 +- .../PhotoRecCarverOutputParser.java | 2 +- .../autopsy/modules/stix/EvalAccountObj.java | 2 +- .../autopsy/modules/stix/EvalAddressObj.java | 2 +- .../autopsy/modules/stix/EvalDomainObj.java | 2 +- .../autopsy/modules/stix/EvalFileObj.java | 2 +- .../modules/stix/EvalNetworkShareObj.java | 2 +- .../autopsy/modules/stix/EvalRegistryObj.java | 4 +- .../autopsy/modules/stix/EvalSystemObj.java | 2 +- .../autopsy/modules/stix/EvalURIObj.java | 2 +- .../modules/stix/EvalURLHistoryObj.java | 4 +- .../modules/stix/EvaluatableObject.java | 2 +- .../modules/stix/STIXReportModule.java | 2 +- .../modules/stix/StixArtifactData.java | 4 +- .../vmextractor/VMExtractorIngestModule.java | 10 ++-- .../report/ArtifactSelectionDialog.java | 2 +- .../autopsy/report/FileReportText.java | 2 +- .../autopsy/report/ReportBodyFile.java | 4 +- .../sleuthkit/autopsy/report/ReportExcel.java | 4 +- .../autopsy/report/ReportGenerator.java | 4 +- .../sleuthkit/autopsy/report/ReportHTML.java | 4 +- .../sleuthkit/autopsy/report/ReportKML.java | 4 +- .../autopsy/report/ReportVisualPanel2.java | 4 +- .../autopsy/report/TableReportGenerator.java | 24 +++++----- .../taggedhashes/AddTaggedHashesToHashDb.java | 2 +- .../AddTaggedHashesToHashDbConfigPanel.java | 2 +- .../autopsy/test/CustomArtifactType.java | 2 +- ...nterestingArtifactCreatorIngestModule.java | 4 +- .../autopsy/timeline/OpenTimelineAction.java | 6 +-- .../autopsy/timeline/TimeLineController.java | 2 +- .../actions/SaveSnapshotAsReport.java | 2 +- .../timeline/explorernodes/EventNode.java | 2 +- .../datamodel/CentralRepoDatamodelTest.java | 4 +- .../autopsy/ingest/IngestFileFiltersTest.java | 2 +- .../autoingest/AddArchiveTask.java | 2 +- .../autoingest/ArchiveFilePanel.java | 2 +- .../autoingest/AutoIngestManager.java | 4 +- .../autoingest/FileExportRuleSet.java | 4 +- .../experimental/autoingest/FileExporter.java | 4 +- .../autoingest/FileExporterSettingsPanel.java | 4 +- .../volatilityDSP/AddMemoryImageTask.java | 2 +- .../volatilityDSP/MemoryDSInputPanel.java | 2 +- .../volatilityDSP/VolatilityProcessor.java | 2 +- .../imagegallery/ImageGalleryController.java | 4 +- .../ImageGalleryOptionsPanel.java | 4 +- .../imagegallery/actions/DeleteTagAction.java | 2 +- .../imagegallery/actions/OpenAction.java | 6 +-- .../imagegallery/datamodel/DrawableFile.java | 2 +- .../keywordsearch/ArtifactTextExtractor.java | 4 +- .../keywordsearch/ExtractedContentViewer.java | 2 +- .../autopsy/keywordsearch/KeywordHit.java | 2 +- .../KeywordSearchIngestModule.java | 2 +- .../KeywordSearchResultFactory.java | 2 +- .../autopsy/keywordsearch/QueryResults.java | 2 +- .../autopsy/keywordsearch/RegexQuery.java | 2 +- .../keywordsearch/TermsComponentQuery.java | 2 +- .../autopsy/recentactivity/Extract.java | 4 +- .../autopsy/recentactivity/ExtractIE.java | 2 +- .../autopsy/recentactivity/Util.java | 2 +- .../ThunderbirdMboxFileIngestModule.java | 12 ++--- 173 files changed, 334 insertions(+), 336 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java index 47bd201ec1..f4cd7e82d6 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java @@ -84,7 +84,7 @@ public class AddBlackboardArtifactTagAction extends AddTagAction { new Thread(() -> { for (BlackboardArtifact artifact : selectedArtifacts) { try { - Case.getOpenCase().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment); + Case.getCurrentOpenCase().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS SwingUtilities.invokeLater(() -> { diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java index 9e99922775..d4c7b8adfe 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java @@ -45,7 +45,7 @@ public class AddBookmarkTagAction extends AbstractAction { @Override public void actionPerformed(ActionEvent e) { try { - Map tagNamesMap = Case.getOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap(); + Map tagNamesMap = Case.getCurrentOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap(); TagName bookmarkTagName = tagNamesMap.get(BOOKMARK); /* diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java index dad777585f..de8f5838fd 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java @@ -140,7 +140,7 @@ public class AddContentTagAction extends AddTagAction { } } - Case.getOpenCase().getServices().getTagsManager().addContentTag(file, tagName, comment); + Case.getCurrentOpenCase().getServices().getTagsManager().addContentTag(file, tagName, comment); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS AbstractFile fileCopy = file; diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java index 12e23bdb30..d489183032 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java @@ -93,7 +93,7 @@ abstract class AddTagAction extends AbstractAction implements Presenter.Popup { // Get the current set of tag names. Map tagNamesMap = null; try { - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS @@ -170,7 +170,7 @@ abstract class AddTagAction extends AbstractAction implements Presenter.Popup { private void getAndAddTag(String tagDisplayName, TagName tagName, String comment) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); // NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java index 28aa03bed8..569a8c6694 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java @@ -73,7 +73,7 @@ public class DeleteBlackboardArtifactTagAction extends AbstractAction { new Thread(() -> { for (BlackboardArtifactTag tag : selectedTags) { try { - Case.getOpenCase().getServices().getTagsManager().deleteBlackboardArtifactTag(tag); + Case.getCurrentOpenCase().getServices().getTagsManager().deleteBlackboardArtifactTag(tag); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(DeleteBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS SwingUtilities.invokeLater(() -> { diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java index 065a023c2f..01c981d7bc 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java @@ -72,7 +72,7 @@ public class DeleteContentTagAction extends AbstractAction { new Thread(() -> { for (ContentTag tag : selectedTags) { try { - Case.getOpenCase().getServices().getTagsManager().deleteContentTag(tag); + Case.getCurrentOpenCase().getServices().getTagsManager().deleteContentTag(tag); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(DeleteContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS SwingUtilities.invokeLater(() -> { diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java index ce99fb1ec4..1e2be550bf 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java @@ -98,7 +98,7 @@ public class DeleteFileBlackboardArtifactTagAction extends AbstractAction implem protected Void doInBackground() throws Exception { TagsManager tagsManager; try { - tagsManager = Case.getOpenCase().getServices().getTagsManager(); + tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Error untagging artifact. No open case found.", ex); //NON-NLS Platform.runLater(() @@ -155,7 +155,7 @@ public class DeleteFileBlackboardArtifactTagAction extends AbstractAction implem Map tagNamesMap = null; try { // Get the current set of tag names. - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -168,7 +168,7 @@ public class DeleteFileBlackboardArtifactTagAction extends AbstractAction implem if (null != tagNamesMap && !tagNamesMap.isEmpty()) { try { List existingTagsList - = Case.getOpenCase().getServices().getTagsManager() + = Case.getCurrentOpenCase().getServices().getTagsManager() .getBlackboardArtifactTagsByArtifact(artifact); for (Map.Entry entry : tagNamesMap.entrySet()) { diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java index abc316b33f..88253181d7 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java @@ -98,7 +98,7 @@ public class DeleteFileContentTagAction extends AbstractAction implements Presen protected Void doInBackground() throws Exception { TagsManager tagsManager; try { - tagsManager = Case.getOpenCase().getServices().getTagsManager(); + tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Error untagging file. No open case found.", ex); //NON-NLS Platform.runLater(() -> @@ -152,7 +152,7 @@ public class DeleteFileContentTagAction extends AbstractAction implements Presen Map tagNamesMap = null; try { // Get the current set of tag names. - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -165,7 +165,7 @@ public class DeleteFileContentTagAction extends AbstractAction implements Presen if (null != tagNamesMap && !tagNamesMap.isEmpty()) { try { List existingTagsList = - Case.getOpenCase().getServices().getTagsManager() + Case.getCurrentOpenCase().getServices().getTagsManager() .getContentTagsByContent(file); for (Map.Entry entry : tagNamesMap.entrySet()) { diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java index f295a613a5..d106f3c300 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java +++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java @@ -139,7 +139,7 @@ public class GetTagNameAndCommentDialog extends JDialog { // Tag name DTOs may be null (user tag names that have not been used do // not exist in the database). try { - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); tagNamesSet.addAll(tagsManager.getAllTagNames()); } catch (TskCoreException | NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java index 4bdbf0bd29..ed421d086a 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java +++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java @@ -110,7 +110,7 @@ public class GetTagNameDialog extends JDialog { // Get the current set of tag names and hash them for a speedy lookup in // case the user chooses an existing tag name from the tag names table. try { - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); tagNamesMap.putAll(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(GetTagNameDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS @@ -348,7 +348,7 @@ public class GetTagNameDialog extends JDialog { if (tagName == null) { try { - tagName = Case.getOpenCase().getServices().getTagsManager().addTagName(tagDisplayName, userTagDescription, TagName.HTML_COLOR.NONE, status); + tagName = Case.getCurrentOpenCase().getServices().getTagsManager().addTagName(tagDisplayName, userTagDescription, TagName.HTML_COLOR.NONE, status); dispose(); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS @@ -361,7 +361,7 @@ public class GetTagNameDialog extends JDialog { tagName = null; } catch (TagsManager.TagNameAlreadyExistsException ex) { try { - tagName = Case.getOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(tagDisplayName); + tagName = Case.getCurrentOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(tagDisplayName); } catch (TskCoreException | NoCurrentCaseException ex1) { Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, tagDisplayName + " exists in database but an error occurred in retrieving it.", ex1); //NON-NLS JOptionPane.showMessageDialog(this, diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java index 021ecd6278..06287ea65a 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java @@ -58,7 +58,7 @@ public final class OpenLogFolderAction implements ActionListener { /* * Open the log directory for the case. */ - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); logDir = new File(currentCase.getLogDirectoryPath()); } catch (NoCurrentCaseException ex) { /* diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java index c79a559b2d..1cbeb50d64 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java @@ -57,7 +57,7 @@ public final class OpenOutputFolderAction extends CallableSystemAction { public void performAction() { File outputDir; try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); outputDir = new File(currentCase.getOutputDirectory()); if (outputDir.exists()) { try { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 21a7bca103..8b92eab6fe 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -109,7 +109,7 @@ class AddImageTask implements Runnable { public void run() { Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java index 23a963bf6a..8023384190 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java @@ -345,7 +345,7 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel { new Thread(() -> { try { - Case.getOpenCase().notifyAddingDataSource(dataSourceId); + Case.getCurrentOpenCase().notifyAddingDataSource(dataSourceId); } catch (NoCurrentCaseException ex) { Logger.getLogger(AddImageWizardAddingProgressVisual.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS } @@ -417,9 +417,9 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel { new Thread(() -> { try { if (!contents.isEmpty()) { - Case.getOpenCase().notifyDataSourceAdded(contents.get(0), dataSourceId); + Case.getCurrentOpenCase().notifyDataSourceAdded(contents.get(0), dataSourceId); } else { - Case.getOpenCase().notifyFailedAddingDataSource(dataSourceId); + Case.getCurrentOpenCase().notifyFailedAddingDataSource(dataSourceId); } } catch (NoCurrentCaseException ex) { Logger.getLogger(AddImageWizardAddingProgressVisual.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java index e01773a79c..bb7c8fceb1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java @@ -59,7 +59,7 @@ final class AddImageWizardSelectDspVisual extends JPanel { selectedDsp = lastDspUsed; //if the last selected DSP was the Local Disk DSP and it would be disabled then we want to select a different DSP try { - if ((Case.getOpenCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) && selectedDsp.equals(LocalDiskDSProcessor.getType())) { + if ((Case.getCurrentOpenCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) && selectedDsp.equals(LocalDiskDSProcessor.getType())) { selectedDsp = ImageDSProcessor.getType(); } createDataSourceProcessorButtons(); @@ -131,7 +131,7 @@ final class AddImageWizardSelectDspVisual extends JPanel { //Add the button JToggleButton dspButton = createDspButton(dspType); dspButton.addActionListener(cbActionListener); - if ((Case.getOpenCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) && dspType.equals(LocalDiskDSProcessor.getType())){ + if ((Case.getCurrentOpenCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) && dspType.equals(LocalDiskDSProcessor.getType())){ dspButton.setEnabled(false); //disable the button for local disk DSP when this is a multi user case dspButton.setSelected(false); shouldAddMultiUserWarning = true; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java index e7e3702600..cb12b2a5f3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java @@ -87,7 +87,7 @@ class AddLocalFilesTask implements Runnable { List errors = new ArrayList<>(); try { progress.setIndeterminate(true); - FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); LocalFilesDataSource newDataSource = fileManager.addLocalFilesDataSource(deviceId, rootVirtualDirectoryName, "", localFilePaths, new ProgressUpdater()); newDataSources.add(newDataSource); } catch (TskDataException | TskCoreException | NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 11f3fa90fd..776c3e8f0c 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -582,30 +582,6 @@ public class Case { return currentCase != null; } - /** - * Deprecated. Use getOpenCase() instead. - * - * Gets the current case, if there is one, at the time of the call. - * - * @return The current case. - * - * @throws IllegalStateException if there is no current case. - * - * @deprecated. Use getOpenCase() instead. - */ - @Deprecated - public static Case getCurrentCase() { - /* - * Throwing an unchecked exception is a bad idea here. - * - */ - try { - return getOpenCase(); - } catch (NoCurrentCaseException ex) { - throw new IllegalStateException(NbBundle.getMessage(Case.class, "Case.getCurCase.exception.noneOpen"), ex); - } - } - /** * Gets the current open case, if there is one, at the time of the call. * @@ -613,7 +589,7 @@ public class Case { * * @throws NoCurrentCaseException if there is no open case. */ - public static Case getOpenCase() throws NoCurrentCaseException { + public static Case getCurrentOpenCase() throws NoCurrentCaseException { Case openCase = currentCase; if (openCase == null) { throw new NoCurrentCaseException(NbBundle.getMessage(Case.class, "Case.getCurCase.exception.noneOpen")); @@ -2747,4 +2723,26 @@ public class Case { deleteReports(reports); } + /** + * Gets the current case, if there is one, at the time of the call. + * + * @return The current case. + * + * @throws IllegalStateException if there is no current case. + * + * @deprecated Use getOpenCase() instead. + */ + @Deprecated + public static Case getCurrentCase() { + /* + * Throwing an unchecked exception is a bad idea here. + * + */ + try { + return getCurrentOpenCase(); + } catch (NoCurrentCaseException ex) { + throw new IllegalStateException(NbBundle.getMessage(Case.class, "Case.getCurCase.exception.noneOpen"), ex); + } + } + } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java index 2b333e2bdc..a55ac143cb 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java @@ -66,7 +66,7 @@ final class CaseDeleteAction extends CallableSystemAction { "# {0} - exception message", "Case.deleteCaseFailureMessageBox.message=Error deleting case: {0}",}) public void actionPerformed(ActionEvent e) { try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); String caseName = currentCase.getName(); String caseDirectory = currentCase.getCaseDirectory(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 76c280f6b2..73b61c2c7a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -54,7 +54,7 @@ class CaseInformationPanel extends javax.swing.JPanel { }) private void customizeComponents() { try { - propertiesPanel = new CasePropertiesPanel(Case.getOpenCase()); + propertiesPanel = new CasePropertiesPanel(Case.getCurrentOpenCase()); } catch (NoCurrentCaseException ex) { Logger.getLogger(CaseInformationPanel.class.getName()).log(Level.INFO, "Exception while getting open case.", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java index c020e7b033..b19eca4469 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java @@ -50,7 +50,7 @@ final class CasePropertiesPanel extends javax.swing.JPanel { void updateCaseInfo() { try { - theCase = Case.getOpenCase(); + theCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index be7905e010..2e8d0cff11 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -264,7 +264,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour try { // verify that the image has a file system that TSK can process - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); if (!DataSourceUtils.imageHasFileSystem(dataSourcePath)) { // image does not have a file system that TSK can process return 0; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java index 6fa73b7ff7..a6e777ccf6 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java @@ -319,7 +319,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { // Display warning if there is one (but don't disable "next" button) try { - if (false == PathValidator.isValid(path, Case.getOpenCase().getCaseType())) { + if (false == PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { pathErrorLabel.setVisible(true); pathErrorLabel.setText(Bundle.ImageFilePanel_pathValidation_dataSourceOnCDriveError()); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 8a496d8fac..d117e8e12e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -76,7 +76,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel { private void refresh() { try { - SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); List ingestJobs = skCase.getIngestJobs(); this.ingestJobs = ingestJobs; this.repaint(); @@ -116,7 +116,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel { IngestJobInfo currIngestJob = ingestJobs.get(rowIndex); if (columnIndex == 0) { try { - SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); return skCase.getContentById(currIngestJob.getObjectId()).getName(); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get content from db", ex); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index b22f858b63..51be317e5d 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -382,7 +382,7 @@ final class LocalDiskPanel extends JPanel { } private static String getDefaultImageWriterFolder() throws NoCurrentCaseException { - return Paths.get(Case.getOpenCase().getModuleDirectory(), "Image Writer").toString(); + return Paths.get(Case.getCurrentOpenCase().getModuleDirectory(), "Image Writer").toString(); } private void setPotentialImageWriterPath(LocalDisk disk) throws NoCurrentCaseException { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java index 63b255113b..e344e3a399 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java @@ -198,7 +198,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat command.add("-f"); command.add("files"); command.add("-t"); - File l01Dir = new File(Case.getOpenCase().getModuleDirectory(), L01_EXTRACTION_DIR); //WJS-TODO change to getOpenCase() when that method exists + File l01Dir = new File(Case.getCurrentOpenCase().getModuleDirectory(), L01_EXTRACTION_DIR); //WJS-TODO change to getOpenCase() when that method exists if (!l01Dir.exists()) { l01Dir.mkdirs(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java index ecfafd7844..ba4bb9685a 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java @@ -283,7 +283,7 @@ final class LocalFilesPanel extends javax.swing.JPanel { errorLabel.setVisible(false); try { - final Case.CaseType currentCaseType = Case.getOpenCase().getCaseType(); + final Case.CaseType currentCaseType = Case.getCurrentOpenCase().getCaseType(); for (String currentPath : pathsList) { if (!PathValidator.isValid(currentPath, currentCaseType)) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java index 4e70d4b248..e4b8677426 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java @@ -191,7 +191,7 @@ final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements Docum } // display warning if there is one (but don't disable "next" button) try { - if (!PathValidator.isValid(path, Case.getOpenCase().getCaseType())) { + if (!PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_dataSourceOnCDriveError()); return false; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 2f806bcecc..2f3f947366 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -91,9 +91,9 @@ final class NewCaseWizardAction extends CallableSystemAction { if (EamDb.isEnabled()) { //if the eam is enabled we need to save the case organization information now EamDb dbManager = EamDb.getInstance(); if (dbManager != null) { - CorrelationCase cRCase = dbManager.getCase(Case.getOpenCase()); + CorrelationCase cRCase = dbManager.getCase(Case.getCurrentOpenCase()); if (cRCase == null) { - cRCase = dbManager.newCase(Case.getOpenCase()); + cRCase = dbManager.newCase(Case.getCurrentOpenCase()); } if (!organizationName.isEmpty()) { for (EamOrganization org : dbManager.getOrganizations()) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java index 0dae889f5b..129aca5a78 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java @@ -64,7 +64,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { if (editCurrentCase) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -94,7 +94,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { private void setUpOrganizationData() { if (EamDb.isEnabled()) { try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); if (currentCase != null) { EamDb dbManager = EamDb.getInstance(); selectedOrg = dbManager.getCase(currentCase).getOrg(); @@ -567,7 +567,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { private void updateCaseDetails() throws NoCurrentCaseException { if (caseDisplayNameTextField.isVisible()) { try { - Case.getOpenCase().updateCaseDetails(new CaseDetails( + Case.getCurrentOpenCase().updateCaseDetails(new CaseDetails( caseDisplayNameTextField.getText(), caseNumberTextField.getText(), examinerTextField.getText(), tfExaminerPhoneText.getText(), tfExaminerEmailText.getText(), taNotesText.getText())); @@ -586,7 +586,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { if (EamDb.isEnabled()) { try { EamDb dbManager = EamDb.getInstance(); - CorrelationCase correlationCase = dbManager.getCase(Case.getOpenCase()); + CorrelationCase correlationCase = dbManager.getCase(Case.getCurrentOpenCase()); if (caseDisplayNameTextField.isVisible()) { correlationCase.setDisplayName(caseDisplayNameTextField.getText()); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java index 6aeb3338d4..ecad0b7450 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java @@ -374,7 +374,7 @@ final class RecentCases extends CallableSystemAction implements Presenter.Menu { int i = 0; String currentCaseName = null; try { - currentCaseName = Case.getOpenCase().getDisplayName(); + currentCaseName = Case.getCurrentOpenCase().getDisplayName(); } catch (NoCurrentCaseException ex) { // in case there is no current case. } @@ -407,7 +407,7 @@ final class RecentCases extends CallableSystemAction implements Presenter.Menu { String[] casePaths = new String[LENGTH]; String currentCasePath = null; try { - currentCasePath = Case.getOpenCase().getMetadata().getFilePath().toString(); + currentCasePath = Case.getCurrentOpenCase().getMetadata().getFilePath().toString(); } catch (NoCurrentCaseException ex) { /* * There may be no current case. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java index ad08e643fd..71a77de147 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java @@ -47,6 +47,6 @@ public class BlackBoardArtifactTagAddedEvent extends TagAddedEvent implements S * @throws TskCoreException */ ContentTag getTagByID() throws NoCurrentCaseException, TskCoreException { - return Case.getOpenCase().getServices().getTagsManager().getContentTagByTagID(getTagID()); + return Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagByTagID(getTagID()); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java index dcf575a5dc..721d3ac3b5 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java @@ -79,7 +79,7 @@ public final class DataSourceAddedEvent extends AutopsyEvent implements Serializ } try { long id = (Long) super.getNewValue(); - dataSource = Case.getOpenCase().getSleuthkitCase().getContentById(id); + dataSource = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(id); return dataSource; } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java index 2fe152d32e..72947aa170 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java @@ -70,7 +70,7 @@ public final class ReportAddedEvent extends AutopsyEvent implements Serializable } try { long id = (Long) super.getNewValue(); - List reports = Case.getOpenCase().getSleuthkitCase().getAllReports(); + List reports = Case.getCurrentOpenCase().getSleuthkitCase().getAllReports(); for (Report thisReport : reports) { if (thisReport.getId() == id) { report = thisReport; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java index 5c978f6378..9e9b671d2e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java @@ -297,7 +297,7 @@ final class TagNameDefinition implements Comparable { } setting.append(tagName.toSettingsFormat()); try { - SleuthkitCase caseDb = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase caseDb = Case.getCurrentOpenCase().getSleuthkitCase(); tagName.saveToCase(caseDb); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java index 5073f4110b..b65d7ac03f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java @@ -425,7 +425,7 @@ final class TagOptionsPanel extends javax.swing.JPanel implements OptionsPanel { for (String modifiedTagDisplayName : updatedStatusTags) { //if user closes their case after options have been changed but before application of them is complete don't notify try { - Case.getOpenCase().notifyTagDefinitionChanged(modifiedTagDisplayName); + Case.getCurrentOpenCase().notifyTagDefinitionChanged(modifiedTagDisplayName); } catch (NoCurrentCaseException ex) { Logger.getLogger(TagOptionsPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java index b38165ef5c..ef3a61a186 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java @@ -99,7 +99,7 @@ public class TagsManager implements Closeable { tagDisplayNames.add(tagType.getDisplayName()); }); try { - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); for (TagName tagName : tagsManager.getAllTagNames()) { tagDisplayNames.add(tagName.getDisplayName()); } @@ -340,7 +340,7 @@ public class TagsManager implements Closeable { ContentTag tag; tag = caseDb.addContentTag(content, tagName, comment, beginByteOffset, endByteOffset); try { - Case.getOpenCase().notifyContentTagAdded(tag); + Case.getCurrentOpenCase().notifyContentTagAdded(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Added a tag to a closed case", ex); } @@ -358,7 +358,7 @@ public class TagsManager implements Closeable { public void deleteContentTag(ContentTag tag) throws TskCoreException { caseDb.deleteContentTag(tag); try { - Case.getOpenCase().notifyContentTagDeleted(tag); + Case.getCurrentOpenCase().notifyContentTagDeleted(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Deleted a tag from a closed case", ex); } @@ -470,7 +470,7 @@ public class TagsManager implements Closeable { public BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException { BlackboardArtifactTag tag = caseDb.addBlackboardArtifactTag(artifact, tagName, comment); try { - Case.getOpenCase().notifyBlackBoardArtifactTagAdded(tag); + Case.getCurrentOpenCase().notifyBlackBoardArtifactTagAdded(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Added a tag to a closed case", ex); } @@ -488,7 +488,7 @@ public class TagsManager implements Closeable { public void deleteBlackboardArtifactTag(BlackboardArtifactTag tag) throws TskCoreException { caseDb.deleteBlackboardArtifactTag(tag); try { - Case.getOpenCase().notifyBlackBoardArtifactTagDeleted(tag); + Case.getCurrentOpenCase().notifyBlackBoardArtifactTagDeleted(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Deleted a tag from a closed case", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java b/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java index c16d16d70c..9da8d804a4 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java @@ -169,7 +169,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D private void showCaseDetails(int selectedRowViewIdx) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { JOptionPane.showConfirmDialog(showCaseDetailsMenuItem, Bundle.DataContentViewerOtherCases_noOpenCase_errMsg(), @@ -225,7 +225,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D if (0 != otherCasesTable.getSelectedRowCount()) { Calendar now = Calendar.getInstance(); String fileName = String.format("%1$tY%1$tm%1$te%1$tI%1$tM%1$tS_other_data_sources.csv", now); - CSVFileChooser.setCurrentDirectory(new File(Case.getOpenCase().getExportDirectory())); + CSVFileChooser.setCurrentDirectory(new File(Case.getCurrentOpenCase().getExportDirectory())); CSVFileChooser.setSelectedFile(new File(fileName)); CSVFileChooser.setFileFilter(new FileNameExtensionFilter("csv file", "csv")); @@ -434,7 +434,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D private Collection getCorrelatedInstances(CorrelationAttribute corAttr, String dataSourceName, String deviceId) { // @@@ Check exception try { - String caseUUID = Case.getOpenCase().getName(); + String caseUUID = Case.getCurrentOpenCase().getName(); EamDb dbManager = EamDb.getInstance(); Collection artifactInstances = dbManager.getArtifactInstancesByTypeValue(corAttr.getCorrelationType(), corAttr.getCorrelationValue()).stream() .filter(artifactInstance -> !artifactInstance.getCorrelationCase().getCaseUUID().equals(caseUUID) @@ -491,7 +491,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D if (af != null) { Content dataSource = af.getDataSource(); dataSourceName = dataSource.getName(); - deviceId = Case.getOpenCase().getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId(); + deviceId = Case.getCurrentOpenCase().getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId(); } } catch (TskException | NoCurrentCaseException ex) { // do nothing. diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java index cba529954e..597826d11e 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java @@ -74,7 +74,7 @@ public class CorrelationDataSource implements Serializable { public static CorrelationDataSource fromTSKDataSource(CorrelationCase correlationCase, Content dataSource) throws EamDbException { Case curCase; try { - curCase = Case.getOpenCase(); + curCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { throw new EamDbException("Autopsy case is closed"); } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java index 43812eeebf..4d6c0675f7 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java @@ -90,7 +90,7 @@ public class EamArtifactUtil { // if they asked for it, add the instance details associated with this occurance. if (!eamArtifacts.isEmpty() && addInstanceDetails) { try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); AbstractFile bbSourceFile = currentCase.getSleuthkitCase().getAbstractFileById(bbArtifact.getObjectID()); if (null == bbSourceFile) { //@@@ Log this @@ -98,9 +98,9 @@ public class EamArtifactUtil { } // make an instance for the BB source file - CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getOpenCase()); + CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentOpenCase()); if (null == correlationCase) { - correlationCase = EamDb.getInstance().newCase(Case.getOpenCase()); + correlationCase = EamDb.getInstance().newCase(Case.getCurrentOpenCase()); } CorrelationAttributeInstance eamInstance = new CorrelationAttributeInstance( correlationCase, @@ -146,7 +146,7 @@ public class EamArtifactUtil { // Get the associated artifact BlackboardAttribute attribute = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT)); if (attribute != null) { - BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); + BlackboardArtifact associatedArtifact = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); return EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(correlationType, associatedArtifact); } @@ -254,9 +254,9 @@ public class EamArtifactUtil { try { CorrelationAttribute.Type filesType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); eamArtifact = new CorrelationAttribute(filesType, af.getMd5Hash()); - CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getOpenCase()); + CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentOpenCase()); if (null == correlationCase) { - correlationCase = EamDb.getInstance().newCase(Case.getOpenCase()); + correlationCase = EamDb.getInstance().newCase(Case.getCurrentOpenCase()); } CorrelationAttributeInstance cei = new CorrelationAttributeInstance( correlationCase, diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java index da11671a08..94457004cb 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java @@ -163,8 +163,8 @@ final class CaseEventListener implements PropertyChangeListener { try { // Get the remaining tags on the content object - Content content = Case.getOpenCase().getSleuthkitCase().getContentById(contentID); - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + Content content = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(contentID); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); List tags = tagsManager.getContentTagsByContent(content); if (tags.stream() @@ -244,7 +244,7 @@ final class CaseEventListener implements PropertyChangeListener { } else { //BLACKBOARD_ARTIFACT_TAG_DELETED Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -327,10 +327,10 @@ final class CaseEventListener implements PropertyChangeListener { * that are tagged with the given tag name. */ try { - TagName tagName = Case.getOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(modifiedTagName); + TagName tagName = Case.getCurrentOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(modifiedTagName); //First update the artifacts //Get all BlackboardArtifactTags with this tag name - List artifactTags = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifactTagsByTagName(tagName); + List artifactTags = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifactTagsByTagName(tagName); for (BlackboardArtifactTag bbTag : artifactTags) { //start with assumption that none of the other tags applied to this Correlation Attribute will prevent it's status from being changed boolean hasTagWithConflictingKnownStatus = false; @@ -346,7 +346,7 @@ final class CaseEventListener implements PropertyChangeListener { } //Get the BlackboardArtifact which this BlackboardArtifactTag has been applied to. BlackboardArtifact bbArtifact = bbTag.getArtifact(); - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); List tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact); //get all tags which are on this blackboard artifact for (BlackboardArtifactTag t : tags) { @@ -374,7 +374,7 @@ final class CaseEventListener implements PropertyChangeListener { } // Next update the files - List fileTags = Case.getOpenCase().getSleuthkitCase().getContentTagsByTagName(tagName); + List fileTags = Case.getCurrentOpenCase().getSleuthkitCase().getContentTagsByTagName(tagName); //Get all ContentTags with this tag name for (ContentTag contentTag : fileTags) { //start with assumption that none of the other tags applied to this ContentTag will prevent it's status from being changed @@ -384,7 +384,7 @@ final class CaseEventListener implements PropertyChangeListener { // the status of the file in the central repository if (tagName.getKnownStatus() == TskData.FileKnown.UNKNOWN) { Content content = contentTag.getContent(); - TagsManager tagsManager = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); List tags = tagsManager.getContentTagsByContent(content); //get all tags which are on this file for (ContentTag t : tags) { @@ -436,7 +436,7 @@ final class CaseEventListener implements PropertyChangeListener { } Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java index 508798f02b..8aee7ef319 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java @@ -163,7 +163,7 @@ public class IngestEventsListener { tifArtifact.addAttributes(attributes); try { // index the artifact for keyword search - Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); blackboard.indexArtifact(tifArtifact); } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java index 991da1ad58..64899be83d 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java @@ -94,7 +94,7 @@ final class IngestModule implements FileIngestModule { } try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return ProcessResult.ERROR; @@ -233,7 +233,7 @@ final class IngestModule implements FileIngestModule { } Case autopsyCase; try { - autopsyCase = Case.getOpenCase(); + autopsyCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); throw new IngestModuleException("Exception while getting open case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java index 244838d8ef..089d0a2fa1 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java @@ -104,7 +104,7 @@ final class AccountDeviceInstanceKey { private static String getDataSourceName(AccountDeviceInstance accountDeviceInstance) { try { - SleuthkitCase db = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase db = Case.getCurrentOpenCase().getSleuthkitCase(); for (DataSource dataSource : db.getDataSources()) { if (dataSource.getDeviceId().equals(accountDeviceInstance.getDeviceId())) { return db.getContentById(dataSource.getId()).getName(); diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java index 534da9d557..2fbf37d768 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java @@ -121,7 +121,7 @@ public final class AccountsBrowser extends JPanel implements ExplorerManager.Pro @Subscribe public void handleFilterEvent(CVTEvents.FilterChangeEvent filterChangeEvent) { try { - final CommunicationsManager commsManager = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager(); + final CommunicationsManager commsManager = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager(); accountsTableEM.setRootContext(new AbstractNode(Children.create(new AccountDeviceInstanceNodeFactory(commsManager, filterChangeEvent.getNewFilter()), true))); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "There was an error getting the CommunicationsManager for the current case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index c3d69ed28d..2c941b771f 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -209,7 +209,7 @@ final public class FiltersPanel extends JPanel { //TODO: something like this commented code could be used to show only //the account types that are found: - //final CommunicationsManager communicationsManager = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager(); + //final CommunicationsManager communicationsManager = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager(); //List accountTypesInUse = communicationsManager.getAccountTypesInUse(); //accountTypesInUSe.forEach(...) Account.Type.PREDEFINED_ACCOUNT_TYPES.forEach(type -> { @@ -240,7 +240,7 @@ final public class FiltersPanel extends JPanel { */ private void updateDeviceFilter(boolean initialState) { try { - final SleuthkitCase sleuthkitCase = Case.getOpenCase().getSleuthkitCase(); + final SleuthkitCase sleuthkitCase = Case.getCurrentOpenCase().getSleuthkitCase(); for (DataSource dataSource : sleuthkitCase.getDataSources()) { String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName(); diff --git a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java index 4f6b53ae39..5abebf6cab 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java @@ -300,7 +300,7 @@ final public class VisualizationPanel extends JPanel implements Lookup.Provider windowAncestor = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); try { - commsManager = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager(); + commsManager = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager(); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error getting CommunicationsManager for the current case.", ex); } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java index bf69817c2c..d12ecc99f8 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java @@ -191,7 +191,7 @@ class PListViewer extends javax.swing.JPanel implements FileTypeViewer, Explorer Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { JOptionPane.showMessageDialog(this, "Failed to export plist file.", diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index 7cc6980f0c..65c317269d 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -319,7 +319,7 @@ class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { // Copy the file to temp folder String tmpDBPathName; try { - tmpDBPathName = Case.getOpenCase().getTempDirectory() + File.separator + sqliteDbFile.getName(); + tmpDBPathName = Case.getCurrentOpenCase().getTempDirectory() + File.separator + sqliteDbFile.getName(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Current case has been closed", ex); //NON-NLS MessageNotifyUtil.Message.error(Bundle.SQLiteViewer_errorMessage_noCurrentCase()); @@ -372,7 +372,7 @@ class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { * @param metaFileName name of meta file to look for */ private void findAndCopySQLiteMetaFile(AbstractFile sqliteFile, String metaFileName) throws NoCurrentCaseException, TskCoreException, IOException { - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = openCase.getSleuthkitCase(); Services services = new Services(sleuthkitCase); FileManager fileManager = services.getFileManager(); diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java index abe3876ae2..e545115b62 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java @@ -184,7 +184,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC */ Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return true; } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 9751bb024a..641691bae8 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -489,7 +489,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C */ Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return true; } @@ -535,7 +535,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C @Override public void propertyChange(PropertyChangeEvent evt) { try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return; } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java index 4a5d265a2c..d95c222089 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java @@ -350,7 +350,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, */ Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return true; } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index 2e517db0bb..d8f2bb2d4b 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -385,7 +385,7 @@ public class ImageUtils { private static File getCachedThumbnailLocation(long fileID) { return cacheFileMap.computeIfAbsent(fileID, id -> { try { - String cacheDirectory = Case.getOpenCase().getCacheDirectory(); + String cacheDirectory = Case.getCurrentOpenCase().getCacheDirectory(); return Paths.get(cacheDirectory, "thumbnails", fileID + ".png").toFile(); //NON-NLS } catch (NoCurrentCaseException e) { LOGGER.log(Level.WARNING, "Could not get cached thumbnail location. No case is open."); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java index 59d16ac5f3..b2f84c87ff 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java @@ -92,7 +92,7 @@ public class VideoUtils { } public static File getTempVideoFile(AbstractFile file) throws NoCurrentCaseException { - return Paths.get(Case.getOpenCase().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); //NON-NLS + return Paths.get(Case.getCurrentOpenCase().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); //NON-NLS } public static boolean isVideoThumbnailSupported(AbstractFile file) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java index 1404ca4950..d8632e6674 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java @@ -264,7 +264,7 @@ public abstract class AbstractAbstractFileNode extends A protected void addTagProperty(Sheet.Set ss) { List tags = new ArrayList<>(); try { - tags.addAll(Case.getOpenCase().getServices().getTagsManager().getContentTagsByContent(content)); + tags.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByContent(content)); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get tags for content " + content.getName(), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java index 8750d57f30..dca42b22cb 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java @@ -120,7 +120,7 @@ public abstract class AbstractContentNode extends ContentNode + " AND type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + ") AS OBJECT_IDS"; //NON-NLS; - try (SleuthkitCase.CaseDbQuery dbQuery = Case.getOpenCase().getSleuthkitCase().executeQuery(query)) { + try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery(query)) { ResultSet resultSet = dbQuery.getResultSet(); if(resultSet.next()){ return (0 < resultSet.getInt("count")); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index e042c196a4..6f0fd1306c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -266,7 +266,7 @@ public class BlackboardArtifactNode extends AbstractContentNode(NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.name"), NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.displayName"), NO_DESCR, @@ -469,8 +469,8 @@ public class BlackboardArtifactNode extends AbstractContentNode tags = new ArrayList<>(); try { - tags.addAll(Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact)); - tags.addAll(Case.getOpenCase().getServices().getTagsManager().getContentTagsByContent(associated)); + tags.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact)); + tags.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByContent(associated)); } catch (TskCoreException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Failed to get tags for artifact " + artifact.getDisplayName(), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java index 0833b87b43..698834058a 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java @@ -103,7 +103,7 @@ public class DataSourcesNode extends DisplayableItemNode { private void reloadKeys() { try { - currentKeys = Case.getOpenCase().getDataSources(); + currentKeys = Case.getCurrentOpenCase().getDataSources(); setKeys(currentKeys); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Error getting data sources: {0}", ex.getMessage()); // NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java index 816105d080..912c00bb6f 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java @@ -207,7 +207,7 @@ public class DeletedContent implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); // new file was added // @@@ COULD CHECK If the new file is deleted before notifying... update(); @@ -226,7 +226,7 @@ public class DeletedContent implements AutopsyVisitableItem { * received for a case that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index 935aec9c62..f617aa53b6 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -241,7 +241,7 @@ public class EmailExtracted implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -266,7 +266,7 @@ public class EmailExtracted implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); emailResults.update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index 3e001b097d..a52a8bb7e4 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -211,7 +211,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * may be received for a case that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Due to some unresolved issues with how cases are closed, * it is possible for the event to have a null oldValue if @@ -234,7 +234,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * may be received for a case that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { /** @@ -402,7 +402,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -427,7 +427,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java index 0a9321e4d5..cfb9ddab95 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java @@ -202,7 +202,7 @@ public class FileSize implements AutopsyVisitableItem { try { // new file was added // @@@ could check the size here and only fire off updates if we know the file meets the min size criteria - Case.getOpenCase(); + Case.getCurrentOpenCase(); update(); } catch (NoCurrentCaseException notUsed) { /** @@ -219,7 +219,7 @@ public class FileSize implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java index 2d8cc564d2..9df3af7a09 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java @@ -94,7 +94,7 @@ public final class FileTypesByExtension implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); typesRoot.updateShowCounts(); update(); } catch (NoCurrentCaseException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java index e7af90fab7..3062a1a1b1 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java @@ -164,7 +164,7 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi * already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); typesRoot.updateShowCounts(); populateHashMap(); } catch (NoCurrentCaseException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index a1b9cf9963..2ae84768bd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -209,7 +209,7 @@ public class HashsetHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Due to some unresolved issues with how cases are * closed, it is possible for the event to have a null @@ -233,7 +233,7 @@ public class HashsetHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); hashsetResults.update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index 7c06fb7afb..e7c9f9c97e 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -171,7 +171,7 @@ public class ImageNode extends AbstractContentNode { Bundle.ImageNode_createSheet_timezone_desc(), this.content.getTimeZone())); - try (CaseDbQuery query = Case.getOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { + try (CaseDbQuery query = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { ResultSet deviceIdSet = query.getResultSet(); if (deviceIdSet.next()) { ss.put(new NodeProperty<>(Bundle.ImageNode_createSheet_deviceId_name(), diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java index 435fa75023..e857ff6760 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java @@ -200,7 +200,7 @@ public class InterestingHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -226,7 +226,7 @@ public class InterestingHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); interestingResults.update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index dbe3dc371b..9a31841570 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -412,7 +412,7 @@ public class KeywordHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -435,7 +435,7 @@ public class KeywordHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); keywordResults.update(); } catch (NoCurrentCaseException notUsed) { // Case is closed, do nothing. diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java index bda7a9cf08..f635b0da08 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java @@ -115,7 +115,7 @@ public final class Reports implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); ReportNodeFactory.this.refresh(true); } catch (NoCurrentCaseException notUsed) { /** @@ -129,7 +129,7 @@ public final class Reports implements AutopsyVisitableItem { @Override protected boolean createKeys(List keys) { try { - keys.addAll(Case.getOpenCase().getAllReports()); + keys.addAll(Case.getCurrentOpenCase().getAllReports()); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(Reports.ReportNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get reports", ex); //NON-NLS } @@ -266,7 +266,7 @@ public final class Reports implements AutopsyVisitableItem { NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.title"), JOptionPane.YES_NO_OPTION)) { try { - Case.getOpenCase().deleteReports(selectedReportsCollection); + Case.getCurrentOpenCase().deleteReports(selectedReportsCollection); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(DeleteReportAction.class.getName()).log(Level.SEVERE, "Error deleting reports", ex); // NON-NLS MessageNotifyUtil.Message.error(Bundle.DeleteReportAction_showConfirmDialog_errorMsg()); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java index 57fd35beba..7773672c75 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java @@ -142,7 +142,7 @@ public class Tags implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); tagResults.update(); } catch (NoCurrentCaseException notUsed) { @@ -159,7 +159,7 @@ public class Tags implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); tagResults.update(); } catch (NoCurrentCaseException notUsed) { @@ -196,7 +196,7 @@ public class Tags implements AutopsyVisitableItem { @Override protected boolean createKeys(List keys) { try { - List tagNamesInUse = Case.getOpenCase().getServices().getTagsManager().getTagNamesInUse(); + List tagNamesInUse = Case.getCurrentOpenCase().getServices().getTagsManager().getTagNamesInUse(); Collections.sort(tagNamesInUse); keys.addAll(tagNamesInUse); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -243,7 +243,7 @@ public class Tags implements AutopsyVisitableItem { private void updateDisplayName() { long tagsCount = 0; try { - TagsManager tm = Case.getOpenCase().getServices().getTagsManager(); + TagsManager tm = Case.getCurrentOpenCase().getServices().getTagsManager(); tagsCount = tm.getContentTagsCountByTagName(tagName); tagsCount += tm.getBlackboardArtifactTagsCountByTagName(tagName); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -348,7 +348,7 @@ public class Tags implements AutopsyVisitableItem { private void updateDisplayName() { long tagsCount = 0; try { - tagsCount = Case.getOpenCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName); + tagsCount = Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(ContentTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get content tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } @@ -403,7 +403,7 @@ public class Tags implements AutopsyVisitableItem { protected boolean createKeys(List keys) { // Use the content tags bearing the specified tag name as the keys. try { - keys.addAll(Case.getOpenCase().getServices().getTagsManager().getContentTagsByTagName(tagName)); + keys.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByTagName(tagName)); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(ContentTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } @@ -447,7 +447,7 @@ public class Tags implements AutopsyVisitableItem { private void updateDisplayName() { long tagsCount = 0; try { - tagsCount = Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName); + tagsCount = Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(BlackboardArtifactTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get blackboard artifact tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } @@ -502,7 +502,7 @@ public class Tags implements AutopsyVisitableItem { protected boolean createKeys(List keys) { try { // Use the blackboard artifact tags bearing the specified tag name as the keys. - keys.addAll(Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName)); + keys.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName)); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java index 312e6a8da0..9a1ae4297c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java @@ -106,7 +106,7 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode { Bundle.VirtualDirectoryNode_createSheet_size_displayName(), Bundle.VirtualDirectoryNode_createSheet_size_desc(), this.content.getSize())); - try (SleuthkitCase.CaseDbQuery query = Case.getOpenCase().getSleuthkitCase().executeQuery("SELECT time_zone FROM data_source_info WHERE obj_id = " + this.content.getId())) { + try (SleuthkitCase.CaseDbQuery query = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery("SELECT time_zone FROM data_source_info WHERE obj_id = " + this.content.getId())) { ResultSet timeZoneSet = query.getResultSet(); if (timeZoneSet.next()) { ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_timezone_name(), @@ -117,7 +117,7 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode { } catch (SQLException | TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get time zone for the following image: " + this.content.getId(), ex); } - try (SleuthkitCase.CaseDbQuery query = Case.getOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { + try (SleuthkitCase.CaseDbQuery query = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { ResultSet deviceIdSet = query.getResultSet(); if (deviceIdSet.next()) { ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_deviceId_name(), diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java index 3b6878ce23..702de27090 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java @@ -238,7 +238,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -262,7 +262,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { // Case is closed, do nothing. @@ -364,7 +364,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -388,7 +388,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { @@ -513,7 +513,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -537,7 +537,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { @@ -647,7 +647,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -671,7 +671,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { @@ -858,7 +858,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -882,7 +882,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); refresh(true); } catch (NoCurrentCaseException notUsed) { //NOPMD empy catch clause diff --git a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java index a65e32c8a6..f283a26a66 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java @@ -127,7 +127,7 @@ final class AddRawImageTask implements Runnable { private void addImageToCase(List dataSources, List errorMessages) { SleuthkitCase caseDatabase; try { - caseDatabase = Case.getOpenCase().getSleuthkitCase(); + caseDatabase = Case.getCurrentOpenCase().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { errorMessages.add(Bundle.AddRawImageTask_noOpenCase_errMsg()); logger.log(Level.SEVERE, Bundle.AddRawImageTask_noOpenCase_errMsg(), ex); diff --git a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java index a8572a4664..320a6a6880 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java @@ -301,7 +301,7 @@ final class RawDSInputPanel extends JPanel implements DocumentListener { "RawDSInputPanel.noOpenCase.errMsg=Exception while getting open case."}) private void warnIfPathIsInvalid(String path) { try { - if (!PathValidator.isValid(path, Case.getOpenCase().getCaseType())) { + if (!PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.RawDSInputPanel_error_text()); } diff --git a/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java b/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java index 1525958390..57385244df 100644 --- a/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java +++ b/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java @@ -299,7 +299,7 @@ public class PerformancePanel extends javax.swing.JDialog { Case curCase; try { - curCase = Case.getOpenCase(); + curCase = Case.getCurrentOpenCase(); } catch (Exception e) { setImgLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text")); setStatusMsg(""); @@ -380,7 +380,7 @@ public class PerformancePanel extends javax.swing.JDialog { Case curCase; try { - curCase = Case.getOpenCase(); + curCase = Case.getCurrentOpenCase(); } catch (Exception e) { setFileReadLabel( NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text")); @@ -472,7 +472,7 @@ public class PerformancePanel extends javax.swing.JDialog { Case curCase; try { - curCase = Case.getOpenCase(); + curCase = Case.getCurrentOpenCase(); } catch (Exception e) { setDbLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text")); return; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 13219f863d..c431f03b23 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -364,7 +364,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Case currentCase = null; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { // No open case. } @@ -526,7 +526,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat * sources. */ try { - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentOpenCase(); return openCase.hasData() == false; } catch (NoCurrentCaseException ex) { return true; @@ -619,7 +619,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat * already closed. */ try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); // We only need to trigger openCoreWindows() when the // first data source is added. if (currentCase.getDataSources().size() == 1) { diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java index 991b554c63..137fe1224a 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java @@ -89,7 +89,7 @@ public class ExternalViewerAction extends AbstractAction { // Get the temp folder path of the case Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java index 28a8bac071..7392454f35 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java @@ -101,7 +101,7 @@ public final class ExtractAction extends AbstractAction { private void extractFile(ActionEvent e, AbstractFile selectedFile) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { JOptionPane.showMessageDialog((Component) e.getSource(), Bundle.ExtractAction_noOpenCase_errMsg()); logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS @@ -127,7 +127,7 @@ public final class ExtractAction extends AbstractAction { private void extractFiles(ActionEvent e, Collection selectedFiles) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { JOptionPane.showMessageDialog((Component) e.getSource(), Bundle.ExtractAction_noOpenCase_errMsg()); logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java index 893bd94da4..b834471d44 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java @@ -121,7 +121,7 @@ final class ExtractUnallocAction extends AbstractAction { } Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { MessageNotifyUtil.Message.info(Bundle.ExtractAction_noOpenCase_errMsg()); return; @@ -611,7 +611,7 @@ final class ExtractUnallocAction extends AbstractAction { this.imageId = img.getId(); this.imageName = img.getName(); this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + 0 + ".dat"; //NON-NLS - this.fileInstance = new File(Case.getOpenCase().getExportDirectory() + File.separator + this.fileName); + this.fileInstance = new File(Case.getCurrentOpenCase().getExportDirectory() + File.separator + this.fileName); this.sizeInBytes = calcSizeInBytes(); } @@ -633,7 +633,7 @@ final class ExtractUnallocAction extends AbstractAction { this.imageId = 0; } this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + volumeId + ".dat"; //NON-NLS - this.fileInstance = new File(Case.getOpenCase().getExportDirectory() + File.separator + this.fileName); + this.fileInstance = new File(Case.getCurrentOpenCase().getExportDirectory() + File.separator + this.fileName); this.layoutFiles = getUnallocFiles(volume); Collections.sort(layoutFiles, new SortObjId()); this.sizeInBytes = calcSizeInBytes(); diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java index 04a2cccc2c..141d609969 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java @@ -49,7 +49,7 @@ class ViewSourceArtifactAction extends AbstractAction { try { for (BlackboardAttribute attribute : artifact.getAttributes()) { if (attribute.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) { - BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); + BlackboardArtifact associatedArtifact = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); if (associatedArtifact != null) { dirTree.viewArtifact(associatedArtifact); break; diff --git a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java index 8605d33c13..8d2ba6af79 100644 --- a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java @@ -77,7 +77,7 @@ class SampleDataSourceIngestModule implements DataSourceIngestModule { try { // Get count of files with .doc extension. - FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); List docFiles = fileManager.findFiles(dataSource, "%.doc"); long fileCount = 0; diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java index 661e08a542..854375448b 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java @@ -141,7 +141,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { try { // get the latest case - Case currentCase = Case.getOpenCase(); // get the most updated case + Case currentCase = Case.getCurrentOpenCase(); // get the most updated case Set caseTimeZones = currentCase.getTimeZones(); Iterator iterator = caseTimeZones.iterator(); @@ -282,7 +282,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { * that is already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); SwingUtilities.invokeLater(DateSearchFilter.this::updateTimeZoneList); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index ae894f632a..ee30802b5d 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -153,7 +153,7 @@ class FileSearchPanel extends javax.swing.JPanel { String pathText = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.pathText"); // try to get the number of matches first - Case currentCase = Case.getOpenCase(); // get the most updated case + Case currentCase = Case.getCurrentOpenCase(); // get the most updated case long totalMatches = 0; List contentList = null; try { diff --git a/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java b/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java index b7d064aa44..e1178d8104 100644 --- a/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java +++ b/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java @@ -83,7 +83,7 @@ class ImageWriter implements PropertyChangeListener{ // null before Image Writer finishes. The user can still elect to wait for image writer // (in ImageWriterService.closeCaseResources) even though the case is closing. try{ - caseDb = Case.getOpenCase().getSleuthkitCase(); + caseDb = Case.getCurrentOpenCase().getSleuthkitCase(); } catch (NoCurrentCaseException ex){ logger.log(Level.SEVERE, "Unable to load case. Image writer will be cancelled."); this.isCancelled = true; @@ -152,7 +152,7 @@ class ImageWriter implements PropertyChangeListener{ Image image; try{ - image = Case.getOpenCase().getSleuthkitCase().getImageById(dataSourceId); + image = Case.getCurrentOpenCase().getSleuthkitCase().getImageById(dataSourceId); imageHandle = image.getImageHandle(); } catch (NoCurrentCaseException ex){ // This exception means that getOpenCase() failed because no case was open. diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java index fe9535916e..2d301aed09 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java @@ -277,7 +277,7 @@ final class DataSourceIngestJob { Thread.currentThread().interrupt(); } try { - SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); this.addIngestModules(firstStageDataSourceModuleTemplates, IngestModuleType.DATA_SOURCE_LEVEL, skCase); this.addIngestModules(fileIngestModuleTemplates, IngestModuleType.FILE_LEVEL, skCase); this.addIngestModules(secondStageDataSourceModuleTemplates, IngestModuleType.DATA_SOURCE_LEVEL, skCase); @@ -415,7 +415,7 @@ final class DataSourceIngestJob { List errors = startUpIngestPipelines(); if (errors.isEmpty()) { try { - this.ingestJob = Case.getOpenCase().getSleuthkitCase().addIngestJob(dataSource, NetworkUtils.getLocalHostName(), ingestModules, new Date(this.createTime), new Date(0), IngestJobStatusType.STARTED, ""); + this.ingestJob = Case.getCurrentOpenCase().getSleuthkitCase().addIngestJob(dataSource, NetworkUtils.getLocalHostName(), ingestModules, new Date(this.createTime), new Date(0), IngestJobStatusType.STARTED, ""); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to add ingest job to database.", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java index 94b9b2a93b..64c7ae1941 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java @@ -47,7 +47,7 @@ final class GetFilesCountVisitor extends ContentVisitor.Default { //case of a real fs, query all files for it SleuthkitCase sc; try { - sc = Case.getOpenCase().getSleuthkitCase(); + sc = Case.getCurrentOpenCase().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return 0L; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index b5aef4ad0b..b67e7b3318 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -98,7 +98,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { this.settings = settings; this.dataSources.addAll(dataSources); try { - SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); ingestJobs.addAll(skCase.getIngestJobs()); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "No open case", ex); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 6511a6693e..9ed5a6fd27 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -191,7 +191,7 @@ public class IngestManager { * only necessary for multi-user cases. */ try { - if (Case.getOpenCase().getCaseType() != Case.CaseType.MULTI_USER_CASE) { + if (Case.getCurrentOpenCase().getCaseType() != Case.CaseType.MULTI_USER_CASE) { return; } } catch (NoCurrentCaseException noCaseOpenException) { @@ -252,7 +252,7 @@ public class IngestManager { caseIsOpen = true; clearIngestMessageBox(); try { - Case openedCase = Case.getOpenCase(); + Case openedCase = Case.getCurrentOpenCase(); String channelPrefix = openedCase.getName(); if (Case.CaseType.MULTI_USER_CASE == openedCase.getCaseType()) { jobEventPublisher.openRemoteEventChannel(String.format(INGEST_JOB_EVENT_CHANNEL_NAME, channelPrefix)); @@ -369,7 +369,7 @@ public class IngestManager { List errors = null; Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return new IngestJobStartResult(null, new IngestManagerException("Exception while getting open case.", ex), Collections.emptyList()); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java index 52698415d3..3be012765c 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java @@ -248,7 +248,7 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { long objId = artifact.getObjectID(); AbstractFile file = null; try { - file = Case.getOpenCase().getSleuthkitCase().getAbstractFileById(objId); + file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(objId); } catch (TskException | NoCurrentCaseException ex) { } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index e4c5c41340..842b7474f7 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -145,11 +145,11 @@ public final class IngestMonitor { */ private void findRootDirectoryForCurrentCase() { try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); findRootDirectoryForCurrentCase(currentCase); } catch (NoCurrentCaseException unused) { /* - * Case.getOpenCase() throws NoCurrentCaseException when there + * Case.getCurrentOpenCase() throws NoCurrentCaseException when there * is no case. */ root = new File(File.separator); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java index 630102f674..43c82ac686 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -63,7 +63,7 @@ public final class IngestServices { * @throws NoCurrentCaseException if there is no open case. */ public Case getCase() throws NoCurrentCaseException { - return Case.getOpenCase(); + return Case.getCurrentOpenCase(); } /** @@ -74,7 +74,7 @@ public final class IngestServices { * @throws NoCurrentCaseException if there is no open case. */ public SleuthkitCase getCaseDatabase() throws NoCurrentCaseException { - return Case.getOpenCase().getSleuthkitCase(); + return Case.getCurrentOpenCase().getSleuthkitCase(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java index 72bc963fe7..d5e0b36703 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java @@ -84,7 +84,7 @@ public final class RunIngestAction extends CallableSystemAction implements Prese @Override public boolean isEnabled() { try { - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentOpenCase(); return openCase.hasData(); } catch (NoCurrentCaseException ex) { return false; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java index d58c57da72..b8d18e4288 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java @@ -49,7 +49,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent { List dataSources = new ArrayList<>(); try { - dataSources = Case.getOpenCase().getDataSources(); + dataSources = Case.getCurrentOpenCase().getDataSources(); } catch (IllegalStateException ex) { // No open Cases, create a disabled empty menu return getEmpty(); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java index 9e05d538de..d8055f05a6 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java @@ -94,7 +94,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa SerializableEventData data = (SerializableEventData) super.getOldValue(); Collection artifacts = new ArrayList<>(); for (Long id : data.artifactIds) { - artifacts.add(Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(id)); + artifacts.add(Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(id)); } eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null); return eventData; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java index d22cefb5ac..4d555147a1 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java @@ -86,7 +86,7 @@ public final class ContentChangedEvent extends AutopsyEvent implements Serializa } try { SerializableEventData data = (SerializableEventData) super.getOldValue(); - Content content = Case.getOpenCase().getSleuthkitCase().getContentById(data.contentId); + Content content = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(data.contentId); eventData = new ModuleContentEvent(data.moduleName, content); return eventData; } catch (NoCurrentCaseException | TskCoreException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java index 100db13067..d3b4c6277d 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java @@ -97,7 +97,7 @@ public abstract class DataSourceAnalysisEvent extends AutopsyEvent implements Se } try { long id = (Long) super.getNewValue(); - dataSource = Case.getOpenCase().getSleuthkitCase().getContentById(id); + dataSource = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(id); return dataSource; } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java index 6845fcf391..0c8f7f5b7c 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java @@ -77,7 +77,7 @@ public final class FileAnalyzedEvent extends AutopsyEvent implements Serializabl } try { long id = (Long) super.getOldValue(); - file = Case.getOpenCase().getSleuthkitCase().getAbstractFileById(id); + file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(id); return file; } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java b/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java index a677f8042a..8bb509fc27 100644 --- a/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java +++ b/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java @@ -52,7 +52,7 @@ class DataContentDynamicMenu extends JMenuItem implements DynamicMenuContent { defaultItem.addActionListener(new OpenTopComponentAction(contentWin)); try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); defaultItem.setEnabled(currentCase.hasData()); } catch (NoCurrentCaseException ex) { defaultItem.setEnabled(false); // disable the menu when no case is opened diff --git a/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java b/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java index 38377d0f28..a196d25d9e 100644 --- a/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java +++ b/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java @@ -55,7 +55,7 @@ class DataExplorerDynamicMenu extends JMenuItem implements DynamicMenuContent { item.addActionListener(new OpenTopComponentAction(explorerWin)); try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); item.setEnabled(currentCase.hasData()); } catch (NoCurrentCaseException ex) { item.setEnabled(false); // disable the menu when no case is opened diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java index 331b6d8830..a906cb84a5 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java @@ -67,7 +67,7 @@ public final class EmbeddedFileExtractorIngestModule extends FileIngestModuleAda * is used to write the extracted (derived) files to local storage. */ try { - final Case currentCase = Case.getOpenCase(); + final Case currentCase = Case.getCurrentOpenCase(); moduleDirRelative = Paths.get(currentCase.getModuleOutputDirectoryRelativePath(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); moduleDirAbsolute = Paths.get(currentCase.getModuleDirectory(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java index bae9570ab5..27c927279c 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java @@ -111,8 +111,8 @@ public class ExtractArchiveWithPasswordAction extends AbstractAction { protected Boolean doInBackground() { boolean done = false; try { - String moduleDirRelative = Paths.get(Case.getOpenCase().getModuleOutputDirectoryRelativePath(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); - String moduleDirAbsolute = Paths.get(Case.getOpenCase().getModuleDirectory(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); + String moduleDirRelative = Paths.get(Case.getCurrentOpenCase().getModuleOutputDirectoryRelativePath(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); + String moduleDirAbsolute = Paths.get(Case.getCurrentOpenCase().getModuleDirectory(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); /* * Construct a file type detector. */ diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java index 23e33dc180..968e47a6b7 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java @@ -118,7 +118,7 @@ class MSOfficeEmbeddedContentExtractor { MSOfficeEmbeddedContentExtractor(IngestJobContext context, FileTypeDetector fileTypeDetector, String moduleDirRelative, String moduleDirAbsolute) throws NoCurrentCaseException { - this.fileManager = Case.getOpenCase().getServices().getFileManager(); + this.fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); this.services = IngestServices.getInstance(); this.context = context; this.fileTypeDetector = fileTypeDetector; diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index 15d933115f..a3799672c6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -284,7 +284,7 @@ class SevenZipExtractor { //check if already has derived files, skip //check if local unpacked dir exists if (archiveFile.hasChildren() && new File(moduleDirAbsolute, EmbeddedFileExtractorIngestModule.getUniqueName(archiveFile)).exists()) { - return Case.getOpenCase().getServices().getFileManager().findFilesByParentPath(getRootArchiveId(archiveFile), archiveFilePath); + return Case.getCurrentOpenCase().getServices().getFileManager().findFilesByParentPath(getRootArchiveId(archiveFile), archiveFilePath); } return new ArrayList<>(); } @@ -494,7 +494,7 @@ class SevenZipExtractor { final long archiveId = archiveFile.getId(); SevenZipExtractor.ArchiveDepthCountTree.Archive parentAr = null; try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS unpackSuccessful = false; @@ -997,7 +997,7 @@ class SevenZipExtractor { * files for the entire hierarchy */ void updateOrAddFileToCaseRec(HashMap statusMap, String archiveFilePath) throws TskCoreException, NoCurrentCaseException { - final FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); + final FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); for (UnpackedNode child : rootNode.children) { updateOrAddFileToCaseRec(child, fileManager, statusMap, archiveFilePath); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java index 7b48606ea0..14302d2014 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java @@ -88,7 +88,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException { try { validateSettings(); - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { throw new IngestModule.IngestModuleException("Failed to create file type detector", ex); diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index f6fc2292ae..1f689d7d05 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -104,7 +104,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule { @Override public ProcessResult process(AbstractFile content) { try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index 1d33730e20..d6174bfab4 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -110,7 +110,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { @Messages({"FileExtMismatchIngestModule.indexError.message=Failed to index file extension mismatch artifact for keyword search."}) public ProcessResult process(AbstractFile abstractFile) { try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index f9cb21434c..e984acbde6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -156,7 +156,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { attributes.add(ruleNameAttribute); artifact.addAttributes(attributes); try { - Case.getOpenCase().getServices().getBlackboard().indexArtifact(artifact); + Case.getCurrentOpenCase().getServices().getBlackboard().indexArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java index 92e2989e64..6c2bbf26fe 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java @@ -90,7 +90,7 @@ public class HashDbIngestModule implements FileIngestModule { HashDbIngestModule(HashLookupModuleSettings settings) throws NoCurrentCaseException { this.settings = settings; - skCase = Case.getOpenCase().getSleuthkitCase(); + skCase = Case.getCurrentOpenCase().getSleuthkitCase(); } @Override @@ -147,7 +147,7 @@ public class HashDbIngestModule implements FileIngestModule { @Override public ProcessResult process(AbstractFile file) { try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java index 213400925f..6286f52b73 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java @@ -46,7 +46,7 @@ class HashDbSearcher { * @return a List of all FsContent with the given hash */ static List findFilesByMd5(String md5Hash) throws NoCurrentCaseException { - final Case currentCase = Case.getOpenCase(); + final Case currentCase = Case.getCurrentOpenCase(); final SleuthkitCase skCase = currentCase.getSleuthkitCase(); return skCase.findFilesByMd5(md5Hash); } @@ -123,7 +123,7 @@ class HashDbSearcher { * @return true if the search feature is ready. */ static boolean allFilesMd5Hashed() throws NoCurrentCaseException { - final Case currentCase = Case.getOpenCase(); + final Case currentCase = Case.getCurrentOpenCase(); final SleuthkitCase skCase = currentCase.getSleuthkitCase(); return skCase.allFilesMd5Hashed(); } @@ -134,7 +134,7 @@ class HashDbSearcher { * @return the number of files with an MD5 */ static int countFilesMd5Hashed() throws NoCurrentCaseException { - final Case currentCase = Case.getOpenCase(); + final Case currentCase = Case.getCurrentOpenCase(); final SleuthkitCase skCase = currentCase.getSleuthkitCase(); return skCase.countFilesMd5Hashed(); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java index 976f8aefac..9ca636bdc9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java @@ -65,7 +65,7 @@ final class CallLogAnalyzer { public void findCallLogs(IngestJobContext context) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -80,7 +80,7 @@ final class CallLogAnalyzer { } for (AbstractFile file : absFiles) { try { - jFile = new java.io.File(Case.getOpenCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); + jFile = new java.io.File(Case.getCurrentOpenCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); dbPath = jFile.toString(); //path of file as string fileId = file.getId(); ContentUtils.writeToFile(file, jFile, context::dataSourceIngestIsCancelled); @@ -117,7 +117,7 @@ final class CallLogAnalyzer { Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java index 9346b10acb..3a33b6d6fe 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java @@ -71,7 +71,7 @@ final class ContactAnalyzer { public void findContacts(IngestJobContext context) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -116,7 +116,7 @@ final class ContactAnalyzer { } Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java index dd3cc14d5b..5256dba188 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java @@ -68,7 +68,7 @@ class TextMessageAnalyzer { void findTexts(IngestJobContext context) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -82,7 +82,7 @@ class TextMessageAnalyzer { } for (AbstractFile file : absFiles) { try { - jFile = new java.io.File(Case.getOpenCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); + jFile = new java.io.File(Case.getCurrentOpenCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); dbPath = jFile.toString(); //path of file as string fileId = file.getId(); ContentUtils.writeToFile(file, jFile, context::dataSourceIngestIsCancelled); @@ -112,7 +112,7 @@ class TextMessageAnalyzer { } Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java index 8ae1db3dc5..ed3083fcea 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java @@ -107,7 +107,7 @@ final class FilesIdentifierIngestModule implements FileIngestModule { @Messages({"FilesIdentifierIngestModule.indexError.message=Failed to index interesting file hit artifact for keyword search."}) public ProcessResult process(AbstractFile file) { try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java index 446da55940..41f33020f6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java @@ -427,7 +427,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule { synchronized Path createModuleOutputDirectoryForCase() throws IngestModule.IngestModuleException { Path path; try { - path = Paths.get(Case.getOpenCase().getModuleDirectory(), PhotoRecCarverIngestModuleFactory.getModuleName()); + path = Paths.get(Case.getCurrentOpenCase().getModuleDirectory(), PhotoRecCarverIngestModuleFactory.getModuleName()); } catch (NoCurrentCaseException ex) { throw new IngestModule.IngestModuleException(Bundle.cannotCreateOutputDir_message(ex.getLocalizedMessage()), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java index 6c1975f5a8..a30dba3c4e 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java @@ -100,7 +100,7 @@ class PhotoRecCarverOutputParser { NodeList fileRanges; Element entry; Path filePath; - FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); // create and initialize the list to put into the database List carvedFiles = new ArrayList<>(); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java index 5174e479eb..b234e98e86 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java @@ -105,7 +105,7 @@ class EvalAccountObj extends EvaluatableObject { try { List finalHits = new ArrayList(); - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_ACCOUNT); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java index 4141ba874f..5dec0ed7c6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java @@ -57,7 +57,7 @@ class EvalAddressObj extends EvaluatableObject { Case case1; try { - case1 = Case.getOpenCase(); + case1 = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case.", //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java index d06c5a19e0..fcb52141a8 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java @@ -55,7 +55,7 @@ class EvalDomainObj extends EvaluatableObject { Case case1; try { - case1 = Case.getOpenCase(); + case1 = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case.", //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java index e99f34fe06..d0064ba5b8 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java @@ -62,7 +62,7 @@ class EvalFileObj extends EvaluatableObject { Case case1; try { - case1 = Case.getOpenCase(); + case1 = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case.", //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java index 7c1379e75f..a82ce9ea7f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java @@ -89,7 +89,7 @@ class EvalNetworkShareObj extends EvaluatableObject { try { List finalHits = new ArrayList(); - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_REMOTE_DRIVE); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java index 6040ea66e5..45ddd3f8bf 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java @@ -348,7 +348,7 @@ class EvalRegistryObj extends EvaluatableObject { // Make the temp directory String tmpDir; try { - tmpDir = Case.getOpenCase().getTempDirectory() + File.separator + "STIX"; //NON-NLS + tmpDir = Case.getCurrentOpenCase().getTempDirectory() + File.separator + "STIX"; //NON-NLS } catch (NoCurrentCaseException ex) { throw new TskCoreException(ex.getLocalizedMessage()); } @@ -385,7 +385,7 @@ class EvalRegistryObj extends EvaluatableObject { List registryFiles = new ArrayList(); Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { throw new TskCoreException(ex.getLocalizedMessage()); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java index bcfc5bc88e..43df781ad1 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java @@ -136,7 +136,7 @@ class EvalSystemObj extends EvaluatableObject { setUnsupportedFieldWarnings(); try { - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List osInfoList = OSUtility.getOSInfo(sleuthkitCase); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java index 123468041d..607d1c2367 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java @@ -56,7 +56,7 @@ class EvalURIObj extends EvaluatableObject { Case case1; try { - case1 = Case.getOpenCase(); + case1 = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case: " + ex.getLocalizedMessage(), //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java index 5cfa2adcec..bac1d40f9a 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java @@ -139,7 +139,7 @@ class EvalURLHistoryObj extends EvaluatableObject { } try { - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY); @@ -232,7 +232,7 @@ class EvalURLHistoryObj extends EvaluatableObject { // It doesn't seem too useful, but we can just search for the browser name // if there aren't any URL entries try { - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java index 5c3a4cc75a..a4775aac92 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java @@ -101,7 +101,7 @@ abstract class EvaluatableObject { List hits = null; try { - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); String[] parts = item.getValue().toString().split("##comma##"); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java index 3f295b5cd7..ff00ffc109 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java @@ -186,7 +186,7 @@ public class STIXReportModule implements GeneralReportModule { // Set the progress bar to done. If any errors occurred along the way, modify // the "complete" message to indicate this. - Case.getOpenCase().addReport(reportPath, Bundle.STIXReportModule_srcModuleName_text(), ""); + Case.getCurrentOpenCase().addReport(reportPath, Bundle.STIXReportModule_srcModuleName_text(), ""); if (hadErrors) { progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java index cf4c4a3aea..39642a9cb8 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java @@ -51,7 +51,7 @@ class StixArtifactData { public StixArtifactData(long a_objId, String a_observableId, String a_objType) { try { - Case case1 = Case.getOpenCase(); + Case case1 = Case.getCurrentOpenCase(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); file = sleuthkitCase.getAbstractFileById(a_objId); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -66,7 +66,7 @@ class StixArtifactData { public void createArtifact(String a_title) throws TskCoreException { Blackboard blackboard; try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_noOpenCase_errMsg(), ex.getLocalizedMessage()); diff --git a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java index a6d22b4d6b..10d3dcb9a7 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java @@ -81,7 +81,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { this.context = context; long dataSourceObjId = context.getDataSource().getId(); try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); SleuthkitCase caseDb = currentCase.getSleuthkitCase(); DataSource dataSource = caseDb.getDataSource(dataSourceObjId); parentDeviceId = dataSource.getDeviceId(); @@ -234,7 +234,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { List vmFiles = new ArrayList<>(); for (String vmExtension : GeneralFilter.VIRTUAL_MACHINE_EXTS) { String searchString = "%" + vmExtension; // want a search string that looks like this "%.vmdk" - vmFiles.addAll(Case.getOpenCase().getServices().getFileManager().findFiles(dataSource, searchString)); + vmFiles.addAll(Case.getCurrentOpenCase().getServices().getFileManager().findFiles(dataSource, searchString)); } return vmFiles; } @@ -275,7 +275,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { * Try to add the virtual machine file to the case as a data source. */ UUID taskId = UUID.randomUUID(); - Case.getOpenCase().notifyAddingDataSource(taskId); + Case.getCurrentOpenCase().notifyAddingDataSource(taskId); ImageDSProcessor dataSourceProcessor = new ImageDSProcessor(); AddDataSourceCallback dspCallback = new AddDataSourceCallback(vmFile); synchronized (this) { @@ -291,7 +291,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { * ingest context. */ if (!dspCallback.vmDataSources.isEmpty()) { - Case.getOpenCase().notifyDataSourceAdded(dspCallback.vmDataSources.get(0), taskId); + Case.getCurrentOpenCase().notifyDataSourceAdded(dspCallback.vmDataSources.get(0), taskId); List dataSourceContent = new ArrayList<>(dspCallback.vmDataSources); IngestJobSettings ingestJobSettings = new IngestJobSettings(context.getExecutionContext()); for (String warning : ingestJobSettings.getWarnings()) { @@ -302,7 +302,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.addedVirtualMachineImage.message", vmFile.toString()))); IngestManager.getInstance().queueIngestJob(dataSourceContent, ingestJobSettings); } else { - Case.getOpenCase().notifyFailedAddingDataSource(taskId); + Case.getCurrentOpenCase().notifyFailedAddingDataSource(taskId); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java index 300a810def..fc88f17389 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java +++ b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java @@ -75,7 +75,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog { BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getLabel(), BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getDisplayName())); // output is too unstructured for table review - artifactTypes = Case.getOpenCase().getSleuthkitCase().getArtifactTypesInUse(); + artifactTypes = Case.getCurrentOpenCase().getSleuthkitCase().getArtifactTypesInUse(); artifactTypes.removeAll(doNotReport); Collections.sort(artifactTypes, new Comparator() { @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java index 71cccf96ed..1dfef3622a 100644 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java @@ -72,7 +72,7 @@ class FileReportText implements FileReportModule { if (out != null) { try { out.close(); - Case.getOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), + Case.getCurrentOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), "FileReportText.getName.text"), ""); } catch (IOException ex) { logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java index 3a601fdd7f..afe551d9ed 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java @@ -75,7 +75,7 @@ class ReportBodyFile implements GeneralReportModule { public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { // Start the progress bar and setup the report try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -161,7 +161,7 @@ class ReportBodyFile implements GeneralReportModule { if (out != null) { out.flush(); out.close(); - Case.getOpenCase().addReport(reportPath, + Case.getCurrentOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), "ReportBodyFile.generateReport.srcModuleName.text"), ""); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index b28ac5ade2..7b7907f3bf 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -113,7 +113,7 @@ class ReportExcel implements TableReportModule { try { out = new FileOutputStream(reportPath); wb.write(out); - Case.getOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), + Case.getCurrentOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), "ReportExcel.endReport.srcModuleName.text"), ""); } catch (IOException ex) { logger.log(Level.SEVERE, "Failed to write Excel report.", ex); //NON-NLS @@ -305,7 +305,7 @@ class ReportExcel implements TableReportModule { private void writeSummaryWorksheet() { Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 127f537df4..d2b4228f91 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -228,7 +228,7 @@ class ReportGenerator { private List getFiles() { List absFiles; try { - SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); absFiles = skCase.findAllFilesWhere("meta_type != " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()); //NON-NLS return absFiles; } catch (TskCoreException | NoCurrentCaseException ex) { @@ -253,7 +253,7 @@ class ReportGenerator { private static String createReportDirectory(ReportModule module) throws IOException { Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { throw new IOException("Exception while getting open case.", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index fdc0457b1c..65ccb6d795 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -104,7 +104,7 @@ class ReportHTML implements TableReportModule { // Refesh the member variables private void refresh() throws NoCurrentCaseException { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); skCase = currentCase.getSleuthkitCase(); dataTypes = new TreeMap<>(); @@ -890,7 +890,7 @@ class ReportHTML implements TableReportModule { String indexFilePath = path + "report.html"; //NON-NLS Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index c5c57eccb8..a286384e19 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -101,7 +101,7 @@ class ReportKML implements GeneralReportModule { @Override public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -387,7 +387,7 @@ class ReportKML implements GeneralReportModule { if (result == ReportProgressPanel.ReportStatus.ERROR) { prependedStatus = "Incomplete "; } - Case.getOpenCase().addReport(kmlFileFullPath, + Case.getCurrentOpenCase().addReport(kmlFileFullPath, NbBundle.getMessage(this.getClass(), "ReportKML.genReport.srcModuleName.text"), prependedStatus + NbBundle.getMessage(this.getClass(), "ReportKML.genReport.reportName")); } catch (IOException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java index 5790a34de4..1b8d5d585c 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java @@ -98,7 +98,7 @@ final class ReportVisualPanel2 extends JPanel { private void initTags() { List tagNamesInUse; try { - tagNamesInUse = Case.getOpenCase().getServices().getTagsManager().getTagNamesInUse(); + tagNamesInUse = Case.getCurrentOpenCase().getServices().getTagsManager().getTagNamesInUse(); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS return; @@ -137,7 +137,7 @@ final class ReportVisualPanel2 extends JPanel { private void initArtifactTypes() { try { - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentOpenCase(); ArrayList doNotReport = new ArrayList<>(); doNotReport.add(new BlackboardArtifact.Type(BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getTypeID(), BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getLabel(), diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 673d5fa3d4..1bcb6fecba 100644 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -182,7 +182,7 @@ class TableReportGenerator { String accountDisplayname = accountTypeStr; if (accountTypeStr != null) { try { - Account.Type acctType = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager().getAccountType(accountTypeStr); + Account.Type acctType = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager().getAccountType(accountTypeStr); if (acctType != null) { accountDisplayname = acctType.getDisplayName(); } @@ -268,7 +268,7 @@ class TableReportGenerator { // Get the content tags. List tags; try { - tags = Case.getOpenCase().getServices().getTagsManager().getAllContentTags(); + tags = Case.getCurrentOpenCase().getServices().getTagsManager().getAllContentTags(); } catch (TskCoreException | NoCurrentCaseException ex) { errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags")); logger.log(Level.SEVERE, "failed to get content tags", ex); //NON-NLS @@ -361,7 +361,7 @@ class TableReportGenerator { List tags; try { - tags = Case.getOpenCase().getServices().getTagsManager().getAllBlackboardArtifactTags(); + tags = Case.getCurrentOpenCase().getServices().getTagsManager().getAllBlackboardArtifactTags(); } catch (TskCoreException | NoCurrentCaseException ex) { errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifactTags")); logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); //NON-NLS @@ -453,7 +453,7 @@ class TableReportGenerator { private void checkIfTagHasImage(BlackboardArtifactTag artifactTag) { AbstractFile file; try { - file = Case.getOpenCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID()); + file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID()); } catch (TskCoreException | NoCurrentCaseException ex) { errorList.add( NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.errGetContentFromBBArtifact")); @@ -532,7 +532,7 @@ class TableReportGenerator { String orderByClause; Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { errorList.add(Bundle.ReportGenerator_errList_noOpenCase()); logger.log(Level.SEVERE, "Exception while getting open case: ", ex); //NON-NLS @@ -697,7 +697,7 @@ class TableReportGenerator { String orderByClause; Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { errorList.add(Bundle.ReportGenerator_errList_noOpenCase()); logger.log(Level.SEVERE, "Exception while getting open case: ", ex); //NON-NLS @@ -852,7 +852,7 @@ class TableReportGenerator { this.attributes = attrs; this.tags = tags; try { - this.content = Case.getOpenCase().getSleuthkitCase().getContentById(artifact.getObjectID()); + this.content = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(artifact.getObjectID()); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Could not get content from database", ex); } @@ -990,7 +990,7 @@ class TableReportGenerator { HashSet allTags = getTags(); try { - List contentTags = Case.getOpenCase().getServices().getTagsManager().getContentTagsByContent(content); + List contentTags = Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByContent(content); for (ContentTag ct : contentTags) { String notableString = ct.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : ""; allTags.add(ct.getName().getDisplayName() + notableString); @@ -1026,8 +1026,8 @@ class TableReportGenerator { private List getFilteredArtifacts(BlackboardArtifact.Type type, HashSet tagNamesFilter) { List artifacts = new ArrayList<>(); try { - for (BlackboardArtifact artifact : Case.getOpenCase().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) { - List tags = Case.getOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact); + for (BlackboardArtifact artifact : Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) { + List tags = Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact); HashSet uniqueTagNames = new HashSet<>(); for (BlackboardArtifactTag tag : tags) { String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : ""; @@ -1037,7 +1037,7 @@ class TableReportGenerator { continue; } try { - artifacts.add(new ArtifactData(artifact, Case.getOpenCase().getSleuthkitCase().getBlackboardAttributes(artifact), uniqueTagNames)); + artifacts.add(new ArtifactData(artifact, Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardAttributes(artifact), uniqueTagNames)); } catch (TskCoreException ex) { errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBAttribs")); logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); //NON-NLS @@ -1627,7 +1627,7 @@ class TableReportGenerator { + //NON-NLS "WHERE tn.tag_name_id = bat.tag_name_id AND bat.artifact_id = " + artifactId; //NON-NLS - try (SleuthkitCase.CaseDbQuery dbQuery = Case.getOpenCase().getSleuthkitCase().executeQuery(query)) { + try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery(query)) { ResultSet tagNameRows = dbQuery.getResultSet(); while (tagNameRows.next()) { uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java index f64a14306f..7829d0eedf 100644 --- a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java +++ b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java @@ -69,7 +69,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule { public void generateReport(String reportPath, ReportProgressPanel progressPanel) { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "No open Case", "Exception while getting open case.", JOptionPane.ERROR_MESSAGE); diff --git a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java index 44e0f93d75..e49c597414 100644 --- a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java @@ -68,7 +68,7 @@ class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel { private void populateTagNameComponents() { // Get the tag names in use for the current case. try { - tagNames = Case.getOpenCase().getServices().getTagsManager().getTagNamesInUse(); + tagNames = Case.getCurrentOpenCase().getServices().getTagsManager().getTagNamesInUse(); } catch (TskCoreException ex) { Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE); diff --git a/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java b/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java index adb366878c..9284ae888b 100644 --- a/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java +++ b/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java @@ -65,7 +65,7 @@ final class CustomArtifactType { * @throws BlackboardException If there is an error adding any of the types. */ static void addToCaseDatabase() throws Blackboard.BlackboardException, NoCurrentCaseException { - Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); artifactType = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAME, ARTIFACT_DISPLAY_NAME); intAttrType = blackboard.getOrAddAttributeType(INT_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER, INT_ATTR_DISPLAY_NAME); doubleAttrType = blackboard.getOrAddAttributeType(DOUBLE_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE, DOUBLE_ATTR_DISPLAY_NAME); diff --git a/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java b/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java index f56d4cb043..f4df2242d8 100644 --- a/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java @@ -55,7 +55,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt @Override public void startUp(IngestJobContext context) throws IngestModuleException { try { - Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); artifactType = blackboard.getOrAddArtifactType(INT_ARTIFACT_TYPE_NAME, INT_ARTIFACT_DISPLAY_NAME); } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.InterestingArtifactCreatorIngestModule_exceptionMessage_errorCreatingCustomType(), ex); @@ -77,7 +77,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt * type. */ int randomArtIndex = (int) (Math.random() * 3); - Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); BlackboardArtifact.Type artifactTypeBase = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAMES[randomArtIndex], ARTIFACT_DISPLAY_NAMES[randomArtIndex]); BlackboardArtifact artifactBase = file.newArtifact(artifactTypeBase.getTypeID()); Collection baseAttributes = new ArrayList<>(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index c6e995c195..9111b205d0 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -81,7 +81,7 @@ public final class OpenTimelineAction extends CallableSystemAction { @Override public boolean isEnabled() { /** - * We used to also check if Case.getOpenCase().hasData() was true. We + * We used to also check if Case.getCurrentOpenCase().hasData() was true. We * disabled that check because if it is executed while a data source is * being added, it blocks the edt. We still do that in ImageGallery. */ @@ -112,7 +112,7 @@ public final class OpenTimelineAction extends CallableSystemAction { "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."}) synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) { try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); if (currentCase.hasData() == false) { MessageNotifyUtil.Message.info(Bundle.OpenTimeLineAction_msgdlg_text()); logger.log(Level.INFO, "Could not create timeline, there are no data sources.");// NON-NLS @@ -213,7 +213,7 @@ public final class OpenTimelineAction extends CallableSystemAction { private boolean tooManyFiles() { try { - return FILE_LIMIT < Case.getOpenCase().getSleuthkitCase().countFilesWhere("1 = 1"); + return FILE_LIMIT < Case.getCurrentOpenCase().getSleuthkitCase().countFilesWhere("1 = 1"); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Can not open timeline with no case open.", ex); } catch (TskCoreException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java index b382814f0d..cd5c7d5ba6 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java @@ -950,7 +950,7 @@ public class TimeLineController { * already closed. */ try { - Case.getOpenCase(); + Case.getCurrentOpenCase(); } catch (NoCurrentCaseException notUsed) { // Case is closed, do nothing. return; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java b/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java index e0b3a3e333..bf16dc32da 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java @@ -153,7 +153,7 @@ public class SaveSnapshotAsReport extends Action { try { //add main file as report to case - Case.getOpenCase().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName); + Case.getCurrentOpenCase().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName); } catch (TskCoreException | NoCurrentCaseException ex) { LOGGER.log(Level.WARNING, "Failed to add " + reportMainFilePath.toString() + " to case as a report", ex); //NON_NLS new Alert(Alert.AlertType.ERROR, Bundle.SaveSnapShotAsReport_FailedToAddReport()).show(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java index d8f0bf9ac3..d7758c6a8d 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java @@ -223,7 +223,7 @@ public class EventNode extends DisplayableItemNode { */ final SingleEvent eventById = eventsModel.getEventById(eventID); - SleuthkitCase sleuthkitCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase sleuthkitCase = Case.getCurrentOpenCase().getSleuthkitCase(); AbstractFile file = sleuthkitCase.getAbstractFileById(eventById.getFileID()); if (eventById.getArtifactID().isPresent()) { diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 105f13146a..e8947f1055 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -2344,7 +2344,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test creating a case from an Autopsy case // The case may already be in the database - the result is the same either way try { - caseB = EamDb.getInstance().newCase(Case.getOpenCase()); + caseB = EamDb.getInstance().newCase(Case.getCurrentOpenCase()); assertTrue("Failed to create correlation case from Autopsy case", caseB != null); } catch (EamDbException | NoCurrentCaseException ex) { Exceptions.printStackTrace(ex); @@ -2413,7 +2413,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting a case from an Autopsy case try { - CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getOpenCase()); + CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentOpenCase()); assertTrue("getCase returned null for current Autopsy case", tempCase != null); } catch (EamDbException | NoCurrentCaseException ex) { Exceptions.printStackTrace(ex); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java index 54b7024790..b52da4a331 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java @@ -134,7 +134,7 @@ public class IngestFileFiltersTest extends NbTestCase { FilesSet Files_Dirs_Unalloc_Ingest_Filter = new FilesSet("Filter", "Filter to find all files in dir1.", false, true, rule); try { - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentOpenCase(); runIngestJob(openCase.getDataSources(), Files_Dirs_Unalloc_Ingest_Filter); FileManager fileManager = openCase.getServices().getFileManager(); List results = fileManager.findFiles("file.jpg", "dir1"); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java index 3baf91b871..e25142fd7c 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java @@ -100,7 +100,7 @@ class AddArchiveTask implements Runnable { // extract the archive and pass the extracted folder as input try { - Case currentCase = Case.getOpenCase(); + Case currentCase = Case.getCurrentOpenCase(); // create folder to extract archive to Path destinationFolder = createDirectoryForFile(archivePath, currentCase.getModuleDirectory()); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java index 449c36dfff..263b600d08 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java @@ -217,7 +217,7 @@ class ArchiveFilePanel extends JPanel implements DocumentListener { // display warning if there is one (but don't disable "next" button) try { - if (false == PathValidator.isValid(path, Case.getOpenCase().getCaseType())) { + if (false == PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.DataSourceOnCDriveError_text()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index cc162494ae..b078f621d0 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -2271,7 +2271,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen Thread.sleep(AutoIngestUserPreferences.getSecondsToSleepBetweenCases() * 1000); } currentJob.setCaseDirectoryPath(caseDirectoryPath); - Case caseForJob = Case.getOpenCase(); + Case caseForJob = Case.getCurrentOpenCase(); SYS_LOGGER.log(Level.INFO, "Opened case {0} for {1}", new Object[]{caseForJob.getName(), manifest.getFilePath()}); return caseForJob; @@ -2282,7 +2282,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } catch (NoCurrentCaseException ex) { /* * Deal with the unfortunate fact that - * Case.getOpenCase throws NoCurrentCaseException. + * Case.getCurrentOpenCase throws NoCurrentCaseException. */ throw new CaseManagementException(String.format("Error getting current case %s for %s", caseName, manifest.getFilePath()), ex); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java index 0029150e3d..a8091c0e2b 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java @@ -375,7 +375,7 @@ final class FileExportRuleSet implements Serializable, Comparable evaluate(long dataSourceId) throws ExportRulesException { try { - SleuthkitCase db = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase db = Case.getCurrentOpenCase().getSleuthkitCase(); try (SleuthkitCase.CaseDbQuery queryResult = db.executeQuery(getQuery(dataSourceId))) { ResultSet resultSet = queryResult.getResultSet(); List fileIds = new ArrayList<>(); @@ -1063,7 +1063,7 @@ final class FileExportRuleSet implements Serializable, Comparable dataSources) throws FileExportException { SleuthkitCase skCase; try { - skCase = Case.getOpenCase().getSleuthkitCase(); + skCase = Case.getCurrentOpenCase().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new FileExportException("Exception while getting open case.", ex); } @@ -341,7 +341,7 @@ final class FileExporter { * storage. */ private void exportFile(Long fileId, List ruleNames, Supplier cancelCheck) throws TskCoreException, IOException, NoCurrentCaseException { - AbstractFile file = Case.getOpenCase().getSleuthkitCase().getAbstractFileById(fileId); + AbstractFile file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(fileId); if (!shouldExportFile(file)) { return; } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java index 62b01b558f..79cee64f07 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java @@ -529,7 +529,7 @@ public final class FileExporterSettingsPanel extends JPanel { void populateArtifacts() { Set artifactTypes = scanRulesForArtifacts(); try { - SleuthkitCase currentCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase currentCase = Case.getCurrentOpenCase().getSleuthkitCase(); for (BlackboardArtifact.Type type : currentCase.getArtifactTypes()) { artifactTypes.add(type.getTypeName()); } @@ -603,7 +603,7 @@ public final class FileExporterSettingsPanel extends JPanel { Set attributeTypes = scanRulesForAttributes(); try { - SleuthkitCase currentCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase currentCase = Case.getCurrentOpenCase().getSleuthkitCase(); for (BlackboardAttribute.Type type : currentCase.getAttributeTypes()) { attributeTypes.add(type.getTypeName()); attributeTypeMap.put(type.getTypeName(), type.getValueType()); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java index e5f67909da..aa7aeabba6 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java @@ -145,7 +145,7 @@ final class AddMemoryImageTask implements Runnable { private Image addImageToCase() throws NoCurrentCaseException, TskCoreException { progressMonitor.setProgressText(Bundle.AddMemoryImageTask_progressMessage_addingImageFile( memoryImagePath)); - SleuthkitCase caseDatabase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase caseDatabase = Case.getCurrentOpenCase().getSleuthkitCase(); caseDatabase.acquireSingleUserCaseWriteLock(); try { /* diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java index 134cdbc914..ce51e1121b 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java @@ -421,7 +421,7 @@ final class MemoryDSInputPanel extends JPanel implements DocumentListener { }) private void warnIfPathIsInvalid(String path) { try { - if (!PathValidator.isValid(path, Case.getOpenCase().getCaseType())) { + if (!PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.MemoryDSInputPanel_errorMsg_dataSourcePathOnCdrive()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java index 9d3fcd15d5..a66c760cf0 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java @@ -108,7 +108,7 @@ class VolatilityProcessor { this.errorMsgs.clear(); try { - this.currentCase = Case.getOpenCase(); + this.currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { throw new VolatilityProcessorException(Bundle.VolatilityProcessor_progressMessage_noCurrentCase(), ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 5c9acf45bf..c21b65962e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -194,7 +194,7 @@ public final class ImageGalleryController { stale.set(b); }); try { - new PerCaseProperties(Case.getOpenCase()).setConfigSetting(ImageGalleryModule.getModuleName(), PerCaseProperties.STALE, b.toString()); + new PerCaseProperties(Case.getCurrentOpenCase()).setConfigSetting(ImageGalleryModule.getModuleName(), PerCaseProperties.STALE, b.toString()); } catch (NoCurrentCaseException ex) { Logger.getLogger(ImageGalleryController.class.getName()).log(Level.WARNING, "Exception while getting open case."); //NON-NLS } @@ -214,7 +214,7 @@ public final class ImageGalleryController { listeningEnabled.addListener((observable, oldValue, newValue) -> { try { //if we just turned on listening and a case is open and that case is not up to date - if (newValue && !oldValue && ImageGalleryModule.isDrawableDBStale(Case.getOpenCase())) { + if (newValue && !oldValue && ImageGalleryModule.isDrawableDBStale(Case.getCurrentOpenCase())) { //populate the db queueDBTask(new CopyAnalyzedFiles(instance, db, sleuthKitCase)); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index b97a116ad8..ab559f5dc1 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -189,7 +189,7 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { try { if (IngestManager.getInstance().isIngestRunning() == false) { enabledForCaseBox.setEnabled(true); - enabledForCaseBox.setSelected(ImageGalleryModule.isEnabledforCase(Case.getOpenCase())); + enabledForCaseBox.setSelected(ImageGalleryModule.isEnabledforCase(Case.getCurrentOpenCase())); } else { enabledForCaseBox.setEnabled(false); enabledForCaseBox.setSelected(enabledByDefaultBox.isSelected()); @@ -204,7 +204,7 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { void store() { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { Logger.getLogger(ImageGalleryOptionsPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java index 2145b76d3f..9e665e4f01 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java @@ -123,7 +123,7 @@ public class DeleteTagAction extends Action { try { List existingTagsList - = Case.getOpenCase().getServices().getTagsManager() + = Case.getCurrentOpenCase().getServices().getTagsManager() .getContentTagsByContent(file); Collection tagNamesList diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index f318b0d44c..359bdf2c57 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -109,7 +109,7 @@ public final class OpenAction extends CallableSystemAction { public boolean isEnabled() { Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { return false; } @@ -154,7 +154,7 @@ public final class OpenAction extends CallableSystemAction { //check case final Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -188,7 +188,7 @@ public final class OpenAction extends CallableSystemAction { private boolean tooManyFiles() { try { - return FILE_LIMIT < Case.getOpenCase().getSleuthkitCase().countFilesWhere("1 = 1"); + return FILE_LIMIT < Case.getCurrentOpenCase().getSleuthkitCase().countFilesWhere("1 = 1"); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Can not open image gallery with no case open.", ex); } catch (TskCoreException ex) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index f62bfd1bc6..620ac5db91 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -75,7 +75,7 @@ public abstract class DrawableFile { } public static DrawableFile create(Long id, boolean analyzed) throws TskCoreException, NoCurrentCaseException { - return create(Case.getOpenCase().getSleuthkitCase().getAbstractFileById(id), analyzed); + return create(Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(id), analyzed); } private SoftReference imageRef; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java index 61b9bb3b20..da1003522a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java @@ -58,9 +58,9 @@ class ArtifactTextExtractor implements TextExtractor { Case currentCase; try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ignore) { - // thorown by Case.getOpenCase() if currentCase is null + // thorown by Case.getCurrentOpenCase() if currentCase is null return null; } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index 62a1837e4d..18729b07b6 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -220,7 +220,7 @@ public class ExtractedContentViewer implements DataContentViewer { BlackboardAttribute attribute = artifact.getAttribute(TSK_ASSOCIATED_ARTIFACT_TYPE); if (attribute != null) { long artifactId = attribute.getValueLong(); - BlackboardArtifact associatedArtifact = Case.getOpenCase().getSleuthkitCase().getBlackboardArtifact(artifactId); + BlackboardArtifact associatedArtifact = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(artifactId); rawArtifactText = new RawText(associatedArtifact, associatedArtifact.getArtifactID()); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java index c45b70c863..b3cebcd979 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java @@ -119,7 +119,7 @@ class KeywordHit implements Comparable { // If the hit was in an artifact, look up the source content for the artifact. SleuthkitCase caseDb; try { - caseDb = Case.getOpenCase().getSleuthkitCase(); + caseDb = Case.getCurrentOpenCase().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Exception while getting open case.", ex); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index 83cdafb88a..c1eb0bb60a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -184,7 +184,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { // if first instance of this module for this job then check the server and existence of keywords Case openCase; try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentOpenCase(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.KeywordSearchIngestModule_noOpenCase_errMsg(), ex); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java index 290fe8b086..061b1c6258 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java @@ -148,7 +148,7 @@ class KeywordSearchResultFactory extends ChildFactory { } SleuthkitCase tskCase; try { - tskCase = Case.getOpenCase().getSleuthkitCase(); + tskCase = Case.getCurrentOpenCase().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "There was no case open.", ex); //NON-NLS return false; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java index b4e07d0d8a..8ceee79062 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java @@ -213,7 +213,7 @@ class QueryResults { */ Content content = null; try { - SleuthkitCase tskCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase tskCase = Case.getCurrentOpenCase().getSleuthkitCase(); content = tskCase.getContentById(hit.getContentID()); } catch (TskCoreException | NoCurrentCaseException tskCoreException) { logger.log(Level.SEVERE, "Failed to get text source object for ", tskCoreException); //NON-NLS diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java index 1ddd06680e..3ab9d2751e 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java @@ -591,7 +591,7 @@ final class RegexQuery implements KeywordSearchQuery { * Create an account instance. */ try { - AccountFileInstance ccAccountInstance = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString() , MODULE_NAME, content); + AccountFileInstance ccAccountInstance = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString() , MODULE_NAME, content); ccAccountInstance.addAttributes(attributes); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java index b2d1ef37e1..7ab63167be 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java @@ -495,7 +495,7 @@ final class TermsComponentQuery implements KeywordSearchQuery { * Create an account. */ try { - AccountFileInstance ccAccountInstance = Case.getOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content); + AccountFileInstance ccAccountInstance = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content); ccAccountInstance.addAttributes(attributes); } catch (TskCoreException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java index 8ae8dc0261..2a40e4270c 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java @@ -53,7 +53,7 @@ abstract class Extract { final void init() throws IngestModuleException { try { - currentCase = Case.getOpenCase(); + currentCase = Case.getCurrentOpenCase(); tskCase = currentCase.getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.Extract_indexError_message(), ex); @@ -126,7 +126,7 @@ abstract class Extract { "Extract.noOpenCase.errMsg=No open case available."}) void indexArtifact(BlackboardArtifact bbart) { try { - Blackboard blackboard = Case.getOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); // index the artifact for keyword search blackboard.indexArtifact(bbart); } catch (Blackboard.BlackboardException ex) { diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java index 3e8bb2d611..5b71823731 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java @@ -75,7 +75,7 @@ class ExtractIE extends Extract { ExtractIE() throws NoCurrentCaseException { moduleName = NbBundle.getMessage(ExtractIE.class, "ExtractIE.moduleName.text"); - moduleTempResultsDir = RAImageIngestModule.getRATempPath(Case.getOpenCase(), "IE") + File.separator + "results"; //NON-NLS + moduleTempResultsDir = RAImageIngestModule.getRATempPath(Case.getCurrentOpenCase(), "IE") + File.separator + "results"; //NON-NLS JAVA_PATH = PlatformUtil.getJavaPath(); } diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java index 9048c57da0..a10ad6f9f4 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java @@ -193,7 +193,7 @@ class Util { parent_path = parent_path.substring(0, index); List files = null; try { - FileManager fileManager = Case.getOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); files = fileManager.findFiles(dataSource, name, parent_path); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.WARNING, "Error fetching 'index.data' files for Internet Explorer history."); //NON-NLS diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java index c6587da68d..77a01139cd 100644 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java @@ -79,7 +79,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { public void startUp(IngestJobContext context) throws IngestModuleException { this.context = context; try { - fileManager = Case.getOpenCase().getServices().getFileManager(); + fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); throw new IngestModuleException(Bundle.ThunderbirdMboxFileIngestModule_noOpenCase_errMsg(), ex); @@ -90,7 +90,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { public ProcessResult process(AbstractFile abstractFile) { try { - blackboard = Case.getOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return ProcessResult.ERROR; @@ -307,7 +307,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { * @return the temporary folder */ static String getTempPath() throws NoCurrentCaseException { - String tmpDir = Case.getOpenCase().getTempDirectory() + File.separator + String tmpDir = Case.getCurrentOpenCase().getTempDirectory() + File.separator + "EmailParser"; //NON-NLS File dir = new File(tmpDir); if (dir.exists() == false) { @@ -323,7 +323,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { * @return the module output folder */ static String getModuleOutputPath() throws NoCurrentCaseException { - String outDir = Case.getOpenCase().getModuleDirectory() + File.separator + String outDir = Case.getCurrentOpenCase().getModuleDirectory() + File.separator + EmailParserModuleFactory.getModuleName(); File dir = new File(outDir); if (dir.exists() == false) { @@ -339,7 +339,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { * @return the relative path of the module output folder */ static String getRelModuleOutputPath() throws NoCurrentCaseException { - return Case.getOpenCase().getModuleOutputDirectoryRelativePath() + File.separator + return Case.getCurrentOpenCase().getModuleOutputDirectoryRelativePath() + File.separator + EmailParserModuleFactory.getModuleName(); } @@ -460,7 +460,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { AccountFileInstance senderAccountInstance = null; - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentOpenCase(); if (senderAddressList.size() == 1) { senderAddress = senderAddressList.get(0); From b459f1ad79e79ac5a098a89e5058f0db0e0c6315 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 19:00:27 -0400 Subject: [PATCH 24/44] Correctly deprecate/replace VideoUtils.getTempVideoFile --- .../autopsy/contentviewers/FXVideoPanel.java | 2 +- .../autopsy/contentviewers/GstVideoPanel.java | 4 +- .../autopsy/coreutils/VideoUtils.java | 38 +++++++++++++++++-- .../imagegallery/datamodel/VideoFile.java | 2 +- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java index ef6acc1fd4..cc5e2008b5 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java @@ -139,7 +139,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { final File tempFile; try { - tempFile = VideoUtils.getTempVideoFile(currentFile); + tempFile = VideoUtils.getVideoFileInTempDir(currentFile); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/GstVideoPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/GstVideoPanel.java index c686471a41..5ebd894517 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/GstVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/GstVideoPanel.java @@ -198,7 +198,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { java.io.File ioFile; try { - ioFile = VideoUtils.getTempVideoFile(file); + ioFile = VideoUtils.getVideoFileInTempDir(file); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS infoLabel.setText(Bundle.GstVideoPanel_noOpenCase_errMsg()); @@ -552,7 +552,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { } else if (state.equals(State.READY)) { final File tempVideoFile; try { - tempVideoFile = VideoUtils.getTempVideoFile(currentFile); + tempVideoFile = VideoUtils.getVideoFileInTempDir(currentFile); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Exception while getting open case."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java index b2f84c87ff..6621f6cab4 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java @@ -45,8 +45,8 @@ import org.sleuthkit.datamodel.AbstractFile; */ public class VideoUtils { - private static final List SUPPORTED_VIDEO_EXTENSIONS = - Arrays.asList("mov", "m4v", "flv", "mp4", "3gp", "avi", "mpg", //NON-NLS + private static final List SUPPORTED_VIDEO_EXTENSIONS + = Arrays.asList("mov", "m4v", "flv", "mp4", "3gp", "avi", "mpg", //NON-NLS "mpeg", "asf", "divx", "rm", "moov", "wmv", "vob", "dat", //NON-NLS "m1v", "m2v", "m4v", "mkv", "mpe", "yop", "vqa", "xmv", //NON-NLS "mve", "wtv", "webm", "vivo", "vc1", "seq", "thp", "san", //NON-NLS @@ -91,7 +91,16 @@ public class VideoUtils { private VideoUtils() { } - public static File getTempVideoFile(AbstractFile file) throws NoCurrentCaseException { + /** + * Gets a File object in the temp directory of the current case for the + * given AbstractFile object. + * + * @param file The AbstractFile object + * + * @return The File object + * + */ + public static File getVideoFileInTempDir(AbstractFile file) throws NoCurrentCaseException { return Paths.get(Case.getCurrentOpenCase().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); //NON-NLS } @@ -104,7 +113,7 @@ public class VideoUtils { static BufferedImage generateVideoThumbnail(AbstractFile file, int iconSize) { java.io.File tempFile; try { - tempFile = getTempVideoFile(file); + tempFile = getVideoFileInTempDir(file); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS return null; @@ -189,4 +198,25 @@ public class VideoUtils { } return bufferedImage == null ? null : ScalrWrapper.resizeFast(bufferedImage, iconSize); } + + /** + * Gets a File object in the temp directory of the current case for the + * given AbstractFile object. + * + * @param file The AbstractFile object + * + * @return The File object + * + * @deprecated Call getVideoFileInTempDir instead. + */ + @Deprecated + public static File getTempVideoFile(AbstractFile file) { + try { + return getVideoFileInTempDir(file); + } catch (NoCurrentCaseException ex) { + // Mimic the old behavior. + throw new IllegalStateException(ex); + } + } + } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java index 81fc907069..5f6f72279e 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/VideoFile.java @@ -91,7 +91,7 @@ public class VideoFile extends DrawableFile { if (media != null) { return media; } - final File cacheFile = VideoUtils.getTempVideoFile(this.getAbstractFile()); + final File cacheFile = VideoUtils.getVideoFileInTempDir(this.getAbstractFile()); if (cacheFile.exists() == false || cacheFile.length() < getAbstractFile().getSize()) { Files.createParentDirs(cacheFile); From 0ad7af158d6c90a4636a00db108320d7ff289b72 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 19:43:11 -0400 Subject: [PATCH 25/44] Update NEWS.txt for 4.7.0 release --- NEWS.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/NEWS.txt b/NEWS.txt index 54e0acb883..de1a1e576e 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,23 @@ +---------------- VERSION 4.7.0 -------------- +New Features: +- A graph visualization was added to the Communications tool to make it easier to find messages and relationships. +- A new Application content viewer provides custom views of media files, SQLite files, and Plists. +- A data source processor that runs Volatility was added to support ingesting memory images. +- Reports (e.g., RegRipper output) generated by ingest modules are now indexed for keyword search. +- Passwords to open password protected archive files can be entered. +- PhotoRec carving module can be configured to keep corrupted files. +- Filters to reduce files processed by ingest modules can have data range conditions. +- L01 files can be imported as data sources. +- Block size can be supplied for local drives and for images for which SleuthKit auto detect fails. +- Assorted small enhancements are included. + +Bug Fixes: +- Memory leaks and other issues revealed by fuzzing the SleuthKit have +been fixed. +- Result views (upper right) and content views (lower right) stay in synch when switching result views. +- Concurrency bugs in the ingest tasks scheduler have been fixed. +- Assorted small bug fixes are included. + ---------------- VERSION 4.6.0 -------------- New Features: - A new Message content viewer was added to make it easier to view email message contents. From 6568c54ae4a09b3665a0b9d949404bc893415f11 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 20:06:37 -0400 Subject: [PATCH 26/44] Update version numbers for rlease 4.7.0 --- Core/manifest.mf | 2 +- Core/nbproject/project.properties | 2 +- .../org/sleuthkit/autopsy/corecomponents/Bundle.properties | 2 +- Experimental/nbproject/project.xml | 4 ++-- ImageGallery/nbproject/project.xml | 2 +- KeywordSearch/manifest.mf | 2 +- KeywordSearch/nbproject/project.properties | 2 +- KeywordSearch/nbproject/project.xml | 2 +- RecentActivity/nbproject/project.xml | 2 +- docs/doxygen-user/Doxyfile | 4 ++-- docs/doxygen/Doxyfile | 4 ++-- nbproject/project.properties | 6 +++--- pythonExamples/README.txt | 2 +- thunderbirdparser/nbproject/project.xml | 4 ++-- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Core/manifest.mf b/Core/manifest.mf index 260c73c542..67d3366e22 100644 --- a/Core/manifest.mf +++ b/Core/manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.sleuthkit.autopsy.core/10 OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/core/Bundle.properties OpenIDE-Module-Layer: org/sleuthkit/autopsy/core/layer.xml -OpenIDE-Module-Implementation-Version: 22 +OpenIDE-Module-Implementation-Version: 23 OpenIDE-Module-Requires: org.openide.windows.WindowManager AutoUpdate-Show-In-Client: true AutoUpdate-Essential-Module: true diff --git a/Core/nbproject/project.properties b/Core/nbproject/project.properties index 334d93ae55..2fab1a97d3 100644 --- a/Core/nbproject/project.properties +++ b/Core/nbproject/project.properties @@ -34,5 +34,5 @@ nbm.homepage=http://www.sleuthkit.org/ nbm.module.author=Brian Carrier nbm.needs.restart=true source.reference.curator-recipes-2.8.0.jar=release/modules/ext/curator-recipes-2.8.0-sources.jar -spec.version.base=10.10 +spec.version.base=10.11 diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties index 245fe1744d..5920c7cfb1 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties @@ -26,7 +26,7 @@ LBL_Description=
Autopsy™ is a digital forensics platform based on The Sleuth Kit™ and other tools.
Copyright © 2003-2018.
URL_ON_IMG=http://www.sleuthkit.org/ -URL_ON_HELP=http://sleuthkit.org/autopsy/docs/user-docs/4.6.0/ +URL_ON_HELP=http://sleuthkit.org/autopsy/docs/user-docs/4.7.0/ FILE_FOR_LOCAL_HELP=file:/// INDEX_FOR_LOCAL_HELP=/docs/index.html LBL_Close=Close diff --git a/Experimental/nbproject/project.xml b/Experimental/nbproject/project.xml index dbd5a31c4c..8515833a6a 100644 --- a/Experimental/nbproject/project.xml +++ b/Experimental/nbproject/project.xml @@ -119,7 +119,7 @@ 10 - 10.10 + 10.11 @@ -137,7 +137,7 @@ 6 - 6.3 + 6.5 diff --git a/ImageGallery/nbproject/project.xml b/ImageGallery/nbproject/project.xml index eb907611cf..0fdad950f2 100644 --- a/ImageGallery/nbproject/project.xml +++ b/ImageGallery/nbproject/project.xml @@ -127,7 +127,7 @@ 10 - 10.10 + 10.11 diff --git a/KeywordSearch/manifest.mf b/KeywordSearch/manifest.mf index 60d5379544..9f3126687e 100644 --- a/KeywordSearch/manifest.mf +++ b/KeywordSearch/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: true OpenIDE-Module: org.sleuthkit.autopsy.keywordsearch/6 -OpenIDE-Module-Implementation-Version: 18 +OpenIDE-Module-Implementation-Version: 19 OpenIDE-Module-Install: org/sleuthkit/autopsy/keywordsearch/Installer.class OpenIDE-Module-Layer: org/sleuthkit/autopsy/keywordsearch/layer.xml OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/keywordsearch/Bundle.properties diff --git a/KeywordSearch/nbproject/project.properties b/KeywordSearch/nbproject/project.properties index 600396fb43..4af4a610bf 100644 --- a/KeywordSearch/nbproject/project.properties +++ b/KeywordSearch/nbproject/project.properties @@ -142,4 +142,4 @@ license.file=../LICENSE-2.0.txt nbm.homepage=http://www.sleuthkit.org/autopsy/ nbm.needs.restart=true source.reference.commons-validator-1.5.1.jar=release/modules/ext/commons-validator-1.5.1-sources.jar -spec.version.base=6.4 +spec.version.base=6.5 diff --git a/KeywordSearch/nbproject/project.xml b/KeywordSearch/nbproject/project.xml index a8b49012cf..25142d8119 100644 --- a/KeywordSearch/nbproject/project.xml +++ b/KeywordSearch/nbproject/project.xml @@ -119,7 +119,7 @@ 10 - 10.10 + 10.11 diff --git a/RecentActivity/nbproject/project.xml b/RecentActivity/nbproject/project.xml index 4b173c70c1..fd72fa7dfe 100644 --- a/RecentActivity/nbproject/project.xml +++ b/RecentActivity/nbproject/project.xml @@ -60,7 +60,7 @@ 10 - 10.10 + 10.11 diff --git a/docs/doxygen-user/Doxyfile b/docs/doxygen-user/Doxyfile index f2f31448a0..84605ac34f 100755 --- a/docs/doxygen-user/Doxyfile +++ b/docs/doxygen-user/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Autopsy User Documentation" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.6.0 +PROJECT_NUMBER = 4.7.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -1025,7 +1025,7 @@ GENERATE_HTML = YES # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_OUTPUT = 4.6.0 +HTML_OUTPUT = 4.7.0 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index 3f4797ace0..5dbdbf1479 100755 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Autopsy" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.6.0 +PROJECT_NUMBER = 4.7.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -1063,7 +1063,7 @@ GENERATE_HTML = YES # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_OUTPUT = api-docs/4.6.0/ +HTML_OUTPUT = api-docs/4.7.0/ # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). diff --git a/nbproject/project.properties b/nbproject/project.properties index 781ec2c83b..beb6c09b6f 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -4,10 +4,10 @@ app.title=Autopsy ### lowercase version of above app.name=${branding.token} ### if left unset, version will default to today's date -app.version=4.6.0 +app.version=4.7.0 ### build.type must be one of: DEVELOPMENT, RELEASE -#build.type=RELEASE -build.type=DEVELOPMENT +build.type=RELEASE +#build.type=DEVELOPMENT project.org.netbeans.progress=org-netbeans-api-progress project.org.sleuthkit.autopsy.experimental=Experimental diff --git a/pythonExamples/README.txt b/pythonExamples/README.txt index 3564182ec9..cbf1d60095 100644 --- a/pythonExamples/README.txt +++ b/pythonExamples/README.txt @@ -5,7 +5,7 @@ your needs. See the developer guide for more details and how to use and load the modules. - http://sleuthkit.org/autopsy/docs/api-docs/4.6.0/index.html + http://sleuthkit.org/autopsy/docs/api-docs/4.7.0/index.html Each module in this folder should have a brief description about what they can do. diff --git a/thunderbirdparser/nbproject/project.xml b/thunderbirdparser/nbproject/project.xml index 2e738ef588..110c3b8ede 100644 --- a/thunderbirdparser/nbproject/project.xml +++ b/thunderbirdparser/nbproject/project.xml @@ -36,7 +36,7 @@ 10 - 10.10 + 10.11 @@ -45,7 +45,7 @@ 6 - 6.3 + 6.5 From 8dcde381bec7520dca5430870347953e000b9e07 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 21:15:15 -0400 Subject: [PATCH 27/44] Fix doxygen error in VisualizationPanel.java --- .../sleuthkit/autopsy/communications/VisualizationPanel.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java index 5abebf6cab..efc5b2b911 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java @@ -208,11 +208,6 @@ final public class VisualizationPanel extends JPanel implements Lookup.Provider applyLayout(fastOrganicLayout); } - /** - * - * @param layoutButton the value of layoutButton - * @param layout the value of layout - */ @Override public Lookup getLookup() { return proxyLookup; From ad228a77a222fe494c9420788e4657014bf08fdb Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 2 May 2018 21:22:41 -0400 Subject: [PATCH 28/44] Add missing image file for user doxygen docs --- docs/doxygen-user/images/case_properties.png | Bin 0 -> 26951 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 docs/doxygen-user/images/case_properties.png diff --git a/docs/doxygen-user/images/case_properties.png b/docs/doxygen-user/images/case_properties.png new file mode 100755 index 0000000000000000000000000000000000000000..75784e1cc6f50249861cc5bdfefc2358f5236953 GIT binary patch literal 26951 zcmb5W1z1#nw+1?NOGrtFN=b=ysvrmm(%quK&|O1I=N}}b6r>q?=uV|WYG@D;hVJI> zLBDgpbI$iX_ug@wJ?y<_?_aI8-u1p~ChV<}ECDVRE(io7cr7Qb3Id@{0RIWFF@Zf) z8$#^B2GdkQRvL7R{P(3PFCN%~V=t%U1OnmRNB&0veNLkUc49fdej|gmgik_5Ousdg zjs*fSfL=>KS9gbR&3Sp7xui?pOy;Q(JuoLh;qGr$jJL#GsbDvG8sJ7vGVC+ALq$s7 zLSmq$IJ=WurpLdmM2qC$YsY`m;&amtpYoOF#mIR%4xW1tuBW*gdYs1JXUs{kD0f;{A|eJJDh)_mM}_AkT{%9LbjDy-mffcApQD6gvWC zoQ;=)Kv|mQ^L0)vCCwLB`VL)W$v69@!lu&52d(}=A??|8c1!!E;d=M|mJ5w+Q%LuN z4~yX(C9Q(KSJc?p(WG}Rz&gFrB3?JDpv`MqQw8aEd9DwpBkx~kxAc*QkqLNYJrcTP z5`DovH=nO9ny$3vo8KRIcR)7)1N-RoR50LJ=R-OMBRkE5yVG;f5rv(2MrZA>$|Sa{ z#)eshYCeYo4-2+v3&B#``Z+o$e&nr3!qE{D(fD_7{|SIu5Khb~V#KMw!1n)ePyFL` zZ->xrjN3%gM&|8t>Af#k2qTldM-(r5*bn3d$ItYSQF;Wg}~AhNM>ae2O%)cTEx z93l0y{m(Fu{gR|*vzF_DEa3_JXcr@+Q?=(AJ{19KzPAtO7o8Wu3yRC!C70L&N0|Y@ zRrZe5u=X!ILPm_v$>=1@2)V`F{KlRm$Mkpd_iPRI7&@C-`Z(rjC z4v|vC#%}t20|i-cDLgyjh|z55{T>pv&^Yy`OcSl*U@uVUqSI_|+gn(|bqK#X^I9b1 ze2y=li>5n%m1S?r&NooOsO*9Azzrq0$Pgx*Ovv?akAbfX+f9>z`Pw7;_Pm=7sz&23 z<(}J)mgbweGuP|Oq!nM^9fewJCqjKTEZdGKyIXR@5squ*TG`|s&&G?z!@CfhlN-<# zxPf=XFp8eKUt12Htgk2!`o?WIj`bJ8Cf~d=%%?&}G~2TGz9>X!JfdU0Cj7-Ww5XGp z5x)DbIhq0;%?oF2Z2eF-@0-3_Z@#_0UwXVJBQp+58K8-qj@jMrmPT7b0WhR3(QTQ&`BLeo z6S)#nKF(#!su&23=Cgvk-ZyQ{uE_apOkAAa)EMA-9I?J%^Bt@9p7POD6R^YEl#Oxy z6qjUBUNZ32=e(=5LvZIzaQ0-6doRFgu!}w#xAC_JwS(t^$`?<{7V+zk?niDR4igj4 zT^53O4QFFSB|Z5DQ{V2{LPF;clo}oSHq(f{(&iDhMwGbIi``aXN%|b6Th$tvT{I(G zrt)F@BZfL5y?=3tkwHbGRjp@-CdZXs1G&-73mVYgDtG7pL{Y%m0mX8@=J@D=UMcP} zfgUs#Pu41Rqj2#>Dr;6Xa*%oOCk#l7&0*n%q*KE!C@(v-7WwwYV`H@TE+i!gb7b!= z7Tk>OHAvEQPv_CM)#+KMpL#5c)}H2REpbv%4?t9|&sJQ$j}UM{yBjUg8HdL2MphHTo4w?+1@9?uh^hkT>7i|0r!-pqQFG6Z8YfxxBa2gd9=m{-+dq< z^)_QS&f8K3ZihV!L0-2?koo<|h3+?6*5lEA`Scgpw`C(InKKSEskdZC7oz!>SIe~S zEAJ~I$uvmI8hO3^d*q{M=mgd>e9{hX<)5I@cwETPyjSOo3i4iZx(&+KJw7k2xg|67 zoqycukct5epUb^!kS^}Rn@@XPPY+Bi?Hii9dS_MTkL-jnWTRuqFL#frV^}!HE?RIlcy_YL{^Ppy0B0^N+T4e6?Lf40qtH)gD%VM_EsEb&{-oK-b z7TarVZRCeh{iNtG(D(Ydcb}ic1ebd$&|eH=`O}-;R_`uH-@*&GcOP3{cZ%71VED;O zL=YNyVC-BiYwhK7Zr0b#2}I7_^2bm}9O!ue?rrHxPx8jFgPTqe241&V2@3e`bGVO@ z!)~LRQ?^#bvR57hMkykERlj$?|8{+y!oW_{Zy}?ZOsna-lxPN`2Jx^s>TuuS!z#O$ zJzZRv)NO3?SIZpNcqLJhR>1HA`=&q`lm99h_Qdgx5p9FB+E}foSovdLjpd!AB&-2p46nU_~;t)%V)>r>Vd^ z8+vD5;MD%H+j6jfgM$L6kmS>t+cv`T(_WN^Rx{1hc#PGst-TPrpOfcK-oGz*M_~{~ z!}DI7&7YC7Yx|OCPG{WYR;5D_iW2ujNd`A5skEZw)sEfv2-QtK$pli%RzxmUBf!B&Uap`UyDutd{nKK+8_ z^s8iF!b3Al(Vd8Mv{wLRV8JRkLAy|1usA5Ds@&ZWrIsZBuxvKsKqKKz3EI2)jxIq? ziv{w2A`*Qn`*?WL7niF*qTIr3?%gkDxWV(!n{dbrXK&Wa5BmVb=YF^bHl3;nbcvBm1$?T${Y`KTjbpLydc>(6b{#=RQJj@`WpZsRe)Gt1DD20X+X^w1u`)`q6-r>iIQ}mhiJ=yi4D5ddT{8 z8QHDBXmexB3h&R31JfbP%f9O`BYC2#S}SBpKPLuOE>Ep&XwU97-^QNkhxk-g+gw~T z^^7{tMx^mcoGk_tB41+eFR2u1W>)MA|6VxLKeF@YQt}vdvhVGNuha>duQ=_!ba-rg zbID61?1&DyindGU`?dMEY>kpnRg7E@7h;w|mK9x6;Sw3y;#Jpaz-6Z1X5x<4*~v!Q z*3?X4)gHZE+>pn>Tesk}f| zH67}+w&1X)!wm}JnZJER-!a+zH1xD(RV?ynqJcfL#5FgB2zz<%_JkeX$bs3uZG6w* z%ZbX>;`Ld)y^YVn_}O=e0QS^gbLlMdQ~Z=EKQk`Ie0wG(_B^i@u(p+GAee5;77$yx z86&6>SK}pzQJ})l2^W)@X5Pp~CPL8O8}Tf0!FQuEC)Y+-d6SE~*Xv70GZ})@J>cD^ zLbgb37~c^*rqsbUKpolVe*QOc!;yy*^!`CKQ7^WY=YihnD8HL>g!{-A~QDwD!KO9$L(y@Yq|H zY{p(_I7Xv%-;_AA`Q7pLBl}kBCGTOsjJuizNvteN`4YMabfG&VT}|k;$fzf^W{-&l zXq&Fht^0YAgWj^4`_;}7d(BU5_>eD@a1wn!rls!Ci?-%$wlXt9b&){9>u~wYVUGKy z(_riA&J`w|uqSEhp}|M!$sr2J_vnL(*vYuB)Nv%|na#rEgrbnWUXDPb7gD{=B`3aD zL{Ycp?-T+1sd{{o38@$9(QS~Sd)H@k5VW%$scKa-GUoeA7++9*SAUMGXdLK#S@&tV z;lqc$R%GjGH3VACh*H>%yi{SlykV_5hvAW6CV%u->I|~=PJXCnJ?*lQFn3GpK zuT}w#u>XX6`DjdeodJ1$+U!TZ6K9_n{;_i< zNz#8BHf^{?jcoUbW1x$gxjV2E8|AB)zSlbLM{}F>Wyi~0$dIfXAuuvbx+}(Wnqi$aOby!w3V$T2v!D%+v##O$$GMxOK-N;RiG(u^Lz z`9jgqiFT*yR75DK^-+9fa(bh**73vyU%s{=^uybIfz4D2Da{Y3t>E%jQ{Z_{y#>|O z;x9w)Ld*qDC%Q%^P9~DQsn)U1#GgQpN{>#Np)=j#;(6`jdi12yYJ74pN7qKj=fQG#eKSc*vE^J{ zw$qvOZ_HWWTY@Q%37y&}C6p&$U38$z@-XGK)mIVRT&8qr?n9DuLBNoYRXG1RS{4TdD z9VT=>EEQJ{womU++e=!Z=w%gpdyYVS4#jhFedgW9hW4rvA9SM;@suP2jq4X~izjx4 zLqAgNmQURDW58H{joh%U-ifH;{-j7r2L?S|pxK_czWuJtSvo^NXh|)B zSzyEwfkmd8evx*K5A@c@=bq$KUBgeUeausOPfT51HN9pdCl~o^JzUAVmUHCn7Vb5O z2kg>_!<&7xB`9GiIN!Cno0U6m(8jGUZ*si(xgax1u{S$zaW|tg_8Uc1LwC-kTqj@|J7D`mu*>D_sgC!VXlc*Dt~bHW()xp`5^u=_2uW!$y3aS` z%!DbciI53%_^s9{gq&XYUFLea;PB5($U^gdNl!3#>2sWNxHE-8L+MQfp=r$NTq_n| zElwKd3#6kgY173Xsq`;~*})nDo}t>KY8jl|F7<#KMc4K=L~UYK^FQe^G8Apnd|)&B z*wVruNa5wSm<@|EIze$cH=u9TNZPiTHM%sXZ%x1D1)ZyK)6hdX>+y`llwT}UHJ*ka z?k9;h7jxlRt6hGDsex-Or&S70EEU`?uU@G6mb5}8y~qkLKUH6&`H7vv_L{bo7GdiG zF?eVKNV_fnpu(0@j4|3Ds7zUMw9@2ee04GG;9`6~Gja*C+k|;}vMss>`LR0}iuXQv zZ;aXqqMvDf-bC%tmS=Oewtgd6y@`5SZ8KB0K31~?cQYEu#76q@`={HI*0o}uN6%&< zOAlCFyQo?#)`@N>7jAi97!^QH$vb@h0epSM)JZd`?DF6y%(4$F~I&%&H$h6X`r z_AJx0?i#XsdyeCC;2WK3wtJFnh;!(%j&#aEXsXvF+v&Qc`Y1hr9DrQ3o=>$AyA~r6 zx8o6Wo}xqc6i@j!ZM1B!lZKplkjHhO&4bT6dod9!b|B>6p@|=sVxtKhrp^Aiht*?U!tKkvq`E?OVU88+zy( z%hJe>IA;)+S_%=-X^Lif< z^h~z>#9>P3H@C>N9e zFCS0_-S@wsW*C>nWNcU*M;e-RQT9v29Yoc9;gO6x4;2Pe3GX{tgP&ZA%oKHpo39}V zwPQ1tO2P75RXdCXZ*n2o!bu1v4{hd>tIM9jKg^x^>xYh|3kl>R44vT7a?8N2&|QMl z^)e80>uZ7`It)79h+rCQ?d!6KpjtF+3o>vjT4-(Y@Z$gm9XeDH{+l(GqdMa-3sDEz zxb<^n0-tq^J*O(q7UY*e!Y6s{GJ`8yL;@_c`fur6B0YaN*K})mm8FhT@$QT-CG`bd zVMvhHgM6oXFS5(7Mi$vA>4^2!o07?g$dNLw5E$YyA^6#Om3w~9)W@AauP!B7*%20VfQ~%*>pgCajBE3MEg>UgAz^KLvANHB6vy%bOhrCf+Rzb{e zph0ya-j8hvY0)0}e!Qab81#@-;QE>(+HT+b#9inS&bW8Bc0A0-j}b%k*3{78)0iG% z=bJtlt~r!xuHKdp>s3#B=vD?V{(GoR0ogWByP=DRP!WUXt?pclPQ#|-ZheS*cDe3g zd9_3-eIQkKd912VypuJd`P)I+rL`fXO+mjVhQlnpigVNlaY6>pguPhRO6?Qltr!yJ z@!LWx4X+hNB3OSs>DHHt1o!ox6MqYESYbnX886qqK#m&)M+N=DweRd>WkHiW3zXVM zgbA$`dNtU&rB_9dUpS z;Dz$7;;5MfAR7Ay+Ne?#DYh)*i4yT3#Ya^;6an|ca?5p3%2DgrQSbqa#37}Bpxz=# z8`0(>{O8`}#iC-9YEH%Jb)=(@DqBCb%Qb6$Rln`$2He^w+}>3aMLlSlcDvR1Pg)s6 z!H^o&6symk!_NIDM9a)ZAWd_CPx9JPaKfQ@1}`4V(GsXuNswHhcGG+`tx@HZb8Qq*og74z z!S9_gc7s4>?wEFQm$0U(VJ*|90(ugEfK){!8)4BjFsD^aBk-#SY&oPaq~yb{uG*@} zd=7t_Y{5M@|M@KXRswy!+R1)z@p<$$jvO%I0aA?}5oE~GGK5)5_$gkuu#Q7{(6FmCpvc_E(HrbvYkpH ztchHn(raz?9ZuH>_TMJB_zR)1|mS)7_-5b`cv z31#H!p;-Or`VUsPbd0)%DN*tkV+XpcRRySEO@0?+=h?9DJ1J|!f|L4nB^nj$?}2=j zfO$*flzNaobiAcxyCrl^0<72Y>bhWCki5Fp6o*-Fx5iDQqgg!RxiGyAZbv)cM>b`f zeyl}%YR*hq-u0l43GCnZqs2zEqaU4`yssa2&6sJgA?c82^4tFsb=O2^{fB^(bN@_N zZX+O7g`rsEY2RypB85l6#+^E)-jCB|65f%Ul`wU~%vZ0lRoiO!Nn^ggez-J=u_E)o z9achNv7`|)IHSfH(>RScbzc|AGf+HtsEw32FEsnEua@&nmC|2Xlu)&ho1u8Z5|9GK(eO?eWND!8MU(CR3z?Yr#ZBR;VIQ^${aC+2wZgK4nxZs3S9l_a!I9G za&6rryhY-kaE3fREhG#eK7&eCh~W(VB>hIx(Gw@t{(0Djwp9$2O)2z@s!N(DTD39t zW*jvS&9)|c-(}{|Z$J>$?OUjaOqTIf=JQtCuHUh?SKEy5*uT0oyanJ{Kj6qD2pU{@ zu}x%I)t5S_r#^U=K=h`r2DzM8|t z+lVBFFB#m7Rfi(M)^#dvC0a#&#hQR+sKj7^4Ge8LZ;v0C?;U#{X7MGxsDDRZs7Co? zvaoqm9g|TkxlsKr7oi#4N+VBQ{n27HQ)z16TmjRQEyhk+)v0vD0SbJ~>kR}{zL+YA zW$}9+!MY6IQky+P$TVbzxcAxG^Q1$S+Bub9V{M+4TKu^Qzi;8OIO$`JW~qeCJE-CH zhl5r~(>=DYDp_Bh`0R4IeNyJ5_WV`0R44z$(fcmzTJl8d@kLdUk2F8ehnJF3fhIj! zCw8HDOL|YpiMUEJedjwl4Hi?qm3v93$FmxkdX6)0T`P~+jGOaZCM?;^W};+>L7k)A z-YlaQn9HSCd8Z`3*0sFQ>;!={csAw{`s3wC9mjw4W={#t2(H|KpOc0x0Gjo1U#ifh z#*d;b7Ac}AXkChhqc)r@2Y1Q4^__eHMOlSd5ZG| zLYjWO1BKy8SranS9gknWwJV~olWU5xN_|Q6!g%zHB;i&Z;^~xpzg}kIQpGDGxkO%F zMaB>sM=lN~i%4@ginMbd>W>N&{s!At|9~AKG~oTXhsD#FtWwwc+0eDI%_^b-2D(Vl zh*;4$(zY9Zz#sDA{dLiGMs!wsUysgq%fN^N1*=`DbE34F!M3(QEa5ZYWa*!30yglV z_Ga1g>3WCPGjlb!Jk~>!O*ZEZ^hL`%ctaNHW_K`5y3gbTx%U8qJ5q^sZV#~G(_ zlLGxz3O0szHkMuZzpIOs&j|pY4|5xExxu{vo1y@oEVK1_>a zFb(hQPo^JET+hZh>v{iqC~Q0?$X4*=ZLW_G`zPFgP+GSshXn(PGY6c#Dt(+Qn-XxB z+elv>z)xt~vrJ}a6A>vX={$AQWI1#mx~lP)OU~^$ zAq2TI)WYj}hc*R1R5+*DRg>hj&$?e@6XxcMr4O}~bqFrM`l`Kbch@m-?L5b*FT;=j1_9ic z$!*C+q5GcW?&xe#tAf(p#CRoX*C8ov(SZF|7~HgJg0ns)^%Q0$a@n8ZY{MJVH1<{~ z8`^NAG0BmnQMopT#*OG4YCbDV*uJU7d#bQj`>}}ZN5^Jy+aJrAlj&qf%*PF{zVVO{ zPUJ-u<5u!+@My~SM=&f~<Q9<@JGMW zMEsMhFioTMEBx?k0LZ$ka4){i2th|qn`&z;1OnK^XQhV zRNTulein+AZL+Wc(eSh31H$KY3YVa*6QZY|h70diCg|8uJ*RTzbyDmRiNiK-oE551 z*+56_i0}Iy^4s$g?i_jW7RMnIFK&(xn^P5P5IG!m>1ep{%&wFny_Ye`sg1<4*lEOE zMa=#-li^ndQNaWpsxcj+dD;co`N-@1 zJobq}ecTP(TlqPGUG?;*%VR^L+v*MiQ}bgr{a;krvld;AXY{wG;6{O8n9a$}CUArf zECE1sq>WiWr3HrR%42i|P)GZ(9%rX+=K!GLIV3Jev-B{O{ITY#Eya5?(+YiTFGz{g znD@Ff(G1o?h~n76PItXo{;A?ueI=&Y-^?@8CJE#9Pu&-qI=nF0Yh66?vH-hF%7L%CFI$&|EUjZ3vA zpUcNU&>?7zvS=>G=p^b+Pc*Yys19E#!n~$&tS`Xcv7p=d@h}$(YetWKBDmJh%FC@! ze7x%4NA(<_7Jj{bP4IEVTkVrU(;LG^HdZPdN!@2VvNUrx3*I|(Knw~V_sO=&6Ki+R z5|4e-_GhtnZW>;X$tT^J>Gq2UOcK(I0`GMFVqEd zx}WstsR;}9*!*4KK?$n3j0`!Q^H`Y{m!YrN{0;P!4Mvp+6A0VtwrOa@++&%&Nqz)# zCev{tcFxMHXENmyk||1-&z7BXlc+XXXo3%6Nca0VRlw$j$wKy&^<3?@?VTB4?WkVP z+sOF}dn$m%!1p;|g1)r?*U8N3+WBUcW2}UdUvXUgh|u&!84-F3ppg+Plde04L5ck@ zgK*4)2}WibO#g9XT6UL{{O?U}{6~_*c4{?E^M${eh2sEx>*I=HuQpPV3Op{yin698 zkI32A{u<+Ki^q2%@Ps_5(orT*sT4EUwr6t9o=GcBP>kH=sxg!eehP%FN0D2+bVbbr zutqv^M91qxC&o%_zFz>6OQ&o@@_xr?KO7%?lE(m^uNCQ?jQM^6fDNWLD66ukM?5Hx z?S-A9i0#U#R2$#)ZJ(Cv6~kBY4^FKq99iUo3LB)0n49O7>e6l7t*zy*Zx_~djR+q@ zgmiqkfKk>gqQ|*W0=O0t-T)U74C%x8z27gOcbUVN&c^z1gKS-Rm3~n*zt%Tu#Ao8a zaloN}V8?%wy66^}A7p8m4V)BdT2qgAwoHpgxbp<)bD<`UsXoK@$@{OY_GxffVVwCqD@`$Tl*87>ho_pW?yYsB}{>N@q<4!Cuh-7*UpPmg( zpl+DP%y+Ds!9FXdnq9gu|C7Jm2Ckn9hqB9SAKH}bZlJ&5X(us`Mu=G_716d^Z&H8p? z;Su3W|NnEF*Hd<2{U#N%O5^@ z-+@&_$JcO<%P+{c_=f4_XM-9iH|XvV5~tB-wo%dM-v3=>qv?yvO8ONazda27YJ&G& zj(U;%VI?aAO3Qd*2_l?fk}A1jN0~JHC44d`Yv1P+zUnaa!#8#5=QZ4^cIZ2uRaAwu zoHLubO#O;1M3kDDq{u+iU;c6H-U_(N7dU0Oy>dV>Yw(&iCoTX@0Ke6rX-(xtIZ^B0 zFi8x+jr3`By4Tf_=-E}WYn^(QiNYtxFI08|M{aZr500ygNbF-;Kd2dftUWfG>@m{Q z6dhvyau#~hr24GI)@yqmNwRxNYKuCteN*UOYFn2#dAN{#e>+%2#-tEnxy2$ai(tG1 zQi8s^5Jmovf`@wz-^EO_uTP*``di)VK@SvJs#@!NSHQh%9oSVi*7t<&k0qyYw+oA* zGj8ogfx1Q;b=wTPBND$gXU)NL?Ta^$?JXB_whqd_wm*3Q^_?y@`s7pQuyn>Y`C^2G54R#UzZ*r(@CuL^_s%%0@*ltUn zVDtDAcFuzue_}<}mS_VQq@%yd*jtHbR5ES5vWz0Sgc2OQJ#c65oP8Qw#w~jxC)Pp1 zH63L|(nZRALLAjL9MY=uaRu=~e`BiGXQ{S!T3{#F%nur+SOt{DdR99fLoIe?gUmeE zUO(RF#sNcHBXc=#JFCnnhB$FTQXUFp3kvDwAy2<|;3bX2wJGJYp8oc?*Ilf51p@6z zNkK{Aw5>`MPc}{eSGHp>8>ftwx_cBC@$(d`mUtkExB^cuUXKz;1i$_83EW>>^?&z3 zErX~VjrfYBd3ppO%-2C)x#g{g2&^{u*>fjK<`XA;D;S%0tGzD{X#g-^pGP zmAZgiQGSuwN6#pBTg0uP^E^xGtQyDQKKLHAHDIFzoj=}dH3*dYW^OR|Ecxpa=xPB_ z*=;xxjYx`%&!U0)&7?l)ha=I6s`m&2%z5X_N!SP z&d`Ss>!ki}Wod-v$Xz7rc_rVw<9ELr&SmeE1tbRu=~cxRtdTu6hR zV3$C8;{BXq9&J4V;H=)&{BOo#|H~Qp<@c!Yi|Ko-@@Q(8OKbts!as6*nJJgd`yYEks!TzAt7?nIZ zIvael*PU=*62FFq8|^9J4MuP%i$4J#UNZJcl1jmyp3(WNf`jJb#RHdxRc}&TH&PF1 zlj3)u7nxhUTDZ&}$J%{B($eMeuW)iUhAh5t&O-kev;9#FAU?!iNQD93+#F!RibM7< z9H9qr{S=$x21+)v&PE{4sa{G%lyyajFHEDA3PzTdj2amAeB*TSIJGGyV4)E><^VGN z&j&v_CY&n07LoY}w`(L^NQ=5>e89a%v-^0#&Fda`CLe-d)3m5Mq~&xwxm^=Ns3?2jikxgaLN2Ub-=R$FQ z3nIbA305v%KI9k{D5IwS<7Cgdv^u?OAe6`mtt6R}qQt->_U+gPT_V+%mh^37g9SXX zEF`wz9Z|*UASvEZ0y$4eUetPNLpJ63JqomY{8Ah;q(^;vY-?s;N^!j;Pr>n8iqSdg zFDsi9M&-U<*8!vgGP!Q6PZC+_&xz%F5Mq_-<5Q-|Pu3m?P)Mr>Jh@O!7f&e-)OwGx z&Fs4R=`bQXd@PdWjFdKKCcmYxU55BiTA;^FVrr~O@tb&|n@nWW5Sd?Pjl9EJ5qx%% zea?*y5+M);>PcAR-K{*?|H5s{9cux7Jn^V-2e$MV_cose*em)I(J3Y#hSuY;;$o%M zVY?1JX`z3atwMU`Lz)k^4k?rtZRE6lWnRJf4t|*Xo26&gZh};9h6VD zZrh`$g<`nxWN~PMjyY4jw(+-nUqptg4?b$_wQi1T>cIWrxg7g7*@S(P}RM#pG~hZv+UTE&Fbkv!jCr32SMUN&JyA6(lp@- zNGY#N37RO6B<2{BB3jL10RG3HR3j^&`Cy}GTkSLE2;I~ylB?O(8}c7 zBAt@nEo)dC6nSP`x|=tl1q(MQ((i7ES6F4YSUu9T(OSq&kng!E>Ga^!)mp%+bV+og z)5{dRh=^2?oHV5YwbJ!|NsDQR-agoRM*gN}?qCw%4&P~fx;pdCA-Ka`UpL02L?j|v z>lB%2r0U;ZR2P?EJ05?C^d$sRnDpT`Dk-&`pLD%Hi(FQ}QRxG$2PJSdje0)Dh9ytX zofp;J@00bHdrPqO3h|f4C;D#|A3=6Z{H+R7_29EK$xZcQmG(mK4-m->!`n+wrs%rO zc|e7eW=F~f*BAe97+EK>j>-NpctzjOx7an3m^7p>Up;qmV+_@l?H+*36UVTpWt>uT zoO^EQ5FV+ib7R#z-hB?#+jc%F>na7kx!|`3AO7HEBLF9F3O#Y9-6%yFTM_Uyc~UKS zZJir&d31$(B^|jG_>Wt#fK{P%Wo)DAf577R zVq}kAy5qPI31ss=-Uk4&EoT{Zi6jp;3!pIc#C}qR-Wwds@&o7|a5ipkD&0sTRCe6T z%aRR3ZQlyLr2-{nSvIuOy~zE?5|2DrL~)V_o&-n*7E9A>)GF&ffH!YLp~hU4B0gmO zs*P>zjtx(UWqlRmypooz*^zDQ!D-O|2)s$D9OcIXMHObgG3SlbwA%=)>-^I;3tvu+ z^O7OvVP^tUppb&}t+(`LbBBlFxP$f<47x+bBfewn+$ezGEt8x^KX;UH#}vJcs2;!K zGrscj1F%jf;RJkk&c+Flc-bO<5wO4IWXw)I-bAEsX#oTrJ6S?sM{>0;^%#Y-Q|ow- zx*DrBLE(NJscW8S&A0)>PV<~n8X(i=JhCu?VfIx;)!~A^~O!504CfpWH!H$$iD74 zn5vFH!O4HRw7wvyy&h+t(W42ZhqbbcGo$BXc;)pgW$vxxCH_XvLOY3q)l@guu3k14 zE6dQ&nVDZlSaE$MaYsfj@X(Gg2oUquGw!??91caRqQXOVe3UAucLY70M#+p`#lygvJ;Tu4Lq_q-5>pdR-YSFExz334mNzA9c_n^|cY2Tw;iy>PVIH%lOxddIoz; zF^b>kXV(&5`(lX`^|;T|)q;satBQ+KG5Ma+_}x;65Y(>*$hk&>p2hTkiLMzN;DLj9F%sh$#2)Dh=&g*7a|0wzD>6rpCIlpwiMoBW&vJ%{3 zq0cksgAY42`xEAGLPv(?o)rV~i@_Bg0LXRO{w+L%I3K9U8&6KCB~^_9rBC*@qF7jj zbic6a*OB6!NYqkd-7t%8YSA3lU7X&($K9#a4K@~DVX8FIW}%@q`U!+2mx}+C8Vn8n zD>ab)JjPVosB8N-DG*92^;deIdmlRzSzoL|c$50$kIbE}sQp(3H~CW#Ed3uhop+_+ z(*I}kPU(MS2yLEo9XbN|5nZG1L6u+<5V&vc{i(B0$$SmZi2$TjqFpDr*QLql9r+Sh zdy~59oAp6zHL4lJphLB}B=k}X(6$k<)z3Bt3&nFg6Q@kM-_58(s;^UNc1>46py@IU zavP($VxV}t)3_-ZNhJMyn&CWj#mre95(`wVxB|gixqXZUgv>TtfV2an<<@tTFH?JSF%s=vFD|9SkHVO0I1KJ|MIoL>1|NC1l=$ zYAgY1O;ory;_%fc&q}9Z{b}_Yy#gn|8jv+PJ8SwLxjd@{1|QJuYsZ`40QGBhs!4Ef zW_yb8W53#|8ziBPRKW+FA=$1CJGXw>MP__6$_U5GmGq*WZJ~RBaDXFAx1kbJorjb? z5PxNlt7~~_VEPd(pPbrF_z3Y}g~q}g((g|3zmdG;SuWP9jUQx^e;UE7MZ9v%egG)u z{KXl7jB#R-Z$Vq+5$}NUf9iaYvU#a3g;cv_ur-W0BWkcs-=(^sLZ?8TXO$S?YYP;s z@t|gIPYtg2?_d+r+IX7O7Q2EO^{0pxW3qo&v;#Hln*b9-7t}O!UHTJNq*v0}h|LrY zn019JN*9SUH|5a+lCh-um!6UFk37DF7P|0UeQzs6T4<{s#y_jC-E(t+v|1t>on#`& z7U4(5Gh0t5C5t12Lj%=Q8hB~2dGlvP6){vn%Z=xIy@I?0dT5B@@vO(OP=8_wQ8n_$2VIpd3~?WDoNF8Rzam zCJI0p#6SLOI;*uEL5T(z!w$dh2G2wKXr|FLI!5cKCOdUSL#B5<=|Y>#3l?z z!%-Z1vfo(K4>h!ENH0~J+fN*&%~Rm~G`(-T+u*FT^5q7fH57}vHPr4nw-^A5$N3qb zaZUd{E|?FaEmgIeYupZR-OG1l_M1c5vcA%R)BcY<%+^W+dP3L)WQS`JdmFdT+tEy! z05WJl624BrNP>lm?$Dz<(ifiM*)xCU=B7)YQ21tEY-raLUHTvrEa*r)=YSRa1j~fG z%Vh=ZeJ|h-54EC%2v5^PmcwQ>KeN|i#(vmWFNiCkhUR@wc+SHWP*0Q}kK=k=*HRs7 zMxICttE&dSd$ynn70~sqvY5TlFZ}thS^(R}?*!+4$M)-q2l6PO;i*x9OE+(#-SRtx zC^0v!DK&kwHr$b5P~d;Wk=yqQICphZuAYA?T^ASI0%?}+$Eus|Vfed?d@p>6WN6*~ zw?1D+^+|8}zd{8I_bAR4>X+3CpG22h4Ca^!U~&E$8DjjBLjq8+DJx$x;nWOyN>%%k z&+m@8|E-YvKXegrFJj{VNHG1~Ir13;LA%}z`Ur_}bViE!`RmAfE?}2&*J%TLX5$&~ z9UHTrI_}mX;QOK(!pOXFlTCCGf|B8Lv9ZFeJ=qR(nh_Rr0upkd>;NFsYS}NhCFw-( zDhYmq&;C?^{byxGx5t;a9H?s3ohxA3 z{qV5anFt^f_|{%nJ&cj>oA5G^X1InYra$6VbXniV>i*sbZr*1n<17}j)tw9{%Ct_H$FeKY` zbd1)*h2j7XkqfBLDSgoaz3e@1hs?qwa9TaM+L50p3C-J0;T*Zf-5BUkE}qsVBB zd3IM7u8Z>@f!5!h{|9IxSNz|d{~4kEfBRsS^vV|Ymc-;{0VU1Up@k!p#rcNWIrR4nPB0rXSa5{K4!D^JA5&cT5oCG2;8|iYhG>j zj^dkJ4QQ3u<(5x9)-kpiMZs)13@{YDe7r^8z;B7Y^z1i74(+o!>3-AElJ{T36^CVd z2T~s!V49CSw;8mr7>O{Da>m((Yh!+0S5-yhut?ZhWp&(~!X0W}%w!bq7`gf+^m!MH zGS$g_x9-DW9SPlybFli;*@DOtjd!BYOIiY`c7jhdz0QV1&Th_M7yeZ1;u>_nC>%`p zeg6GnjbT)EBMupdrN(-NW8?$RCKCiY2qaZDU+}}Jm!qDm%;SE9)iWw6yG1jLcT&-T zxk24|vg1hYPYgW}iG7$E@O%Mo_S(^^kUcMrWpd0*G3k*<6Aq^UNr=~R`sc#7s*3pSE9w+Y z9@v-BK4rPKs==xm{vEv;k*CFwq)F;}rK<-Rzz^1R$~AL@uD)RvH5fiO6;&^NM~XxG z%s^+RreRfTvT~v3n7=gEy!^mTwJFzXIL~1M2LvK2-fav!D^A#izI9_CQ*F}L1}{WT zviJ(;5L8>!?}$$%fuZNr$(f$zUmUIFzcPDKSTxMMdB1XyA=0#ej0r~pf$n8xXN&Ok z;cnlfnD}itc(U>d__v5hfi4=z53T)aH)UVNyU3AI zy~!MZ8neiwt+31L@r{NZuY*i)^`fGpejeaQdtUWUO(hpWy!@e3+&VFWF1u7-mFKNUfp2OHJ@)7y83HI?mqGoy@(qd3DL9mWPy z1VO5_V*v#z(n9D6C?)jXaX@555TpuHr9%p#B+?P31?f!)Bx(oy?5}R<4P<(>7>b* z|A`Ts%0`^aC=7c^8ZSp7sJ#{F4_ON6i`b;)<8L8O)*JbHr-ag_UK{M(AH{`l3y=Ls z&qBTW%p;TxZk=>=EF>TN5?b=h@ayxbpt}9UCZx%;Rp!o;pz;?WH^t}6UtQ@zB*zHa z47-+`wa$Q?$x(e|al$(`SS8HjivL*iH0!1EJZFu`A11kPWmH~DaJ*);tQ0MAM^703 zy2@N9a61{)-qEoJLp{-flU{$c)rhsfZoDNS`eH1jn<`CehM0_$l}!$-{Q_zpn`b!u zvwE}0`C!mCcuudLmjj=L@%+o2X`Dl$1!#9zhd(}BCvduXzL(o*NGC6E-qq5&$0eb? z;+@?Mq;e6f{!K0j!2o?1qQv>dEH~xH=Mp>cA6Q!d@boRz{X*h1R~se zKe#t2pi4FFV5ZW=g*^RPp{buAOIb>Y7nVVdkDKZ_hokfLupQkOe@(A~bFr`}{(f?K z2O1K#o^EuNNMIO9oi=`^E9(1ha%e5=(@NqZTE563prvj>gL5+EB^KXIrYP}f$R8cm z6RyLwOsCW&9>*#434!%g&q@K+(nDByVxP%S>|vFv3$=tMJHzsEOkiU@=i-yMRg)w& zlaTN|D8Zzw$^kRc{EG+&4UZU3v*IRy{sP~?ez%cIm$Ir*Lw%<0q7v3vNmX&NV_W5TS9 z^7x(bnKiw`j`rHxC*d|#4lf+R6>;JhC>uP?gp76bF=Rtk6`O0Zu;y6VM@(A0@h**jt;s`*& zu=JX@w?+8nPIIgaq6W_cF5 z#{nKh0IO)pZ>xpD9Mye$gQPPrNzdu_sq^@R}^v{3v{@XWQS`= zMy#*v(Q#5;qznUs-{=csAfj=CK+!@sHf%_5PK!vBr(f%tr9EI!sVh-W{w$7SMJ!#K znCEv{vT|!Y*4yE#p{m3>+$aukJx17`$3E`9nM{Y%Jc2@zflCini!9?IB`ftS-4W{s z2qaSG?YVa;N$c;osf(9R?5rdwJpe>he+it#C!|@fO_4|Av!Q=N_+v&ExL4lg%#Mx@ z<0fz2gdo8WV?pW2@PSy|q353#5j%cs^G9yM?c&48PavttEPOhPv)P$m1>Q_`Tc4`N zL?hR+3&w!ft^W;% zoR$Ty|(%lDF`0Xq&z&uagKsrnTub z{DN+dk+s2vJFt7>FOnYoD7w9Y#E=zsyHyW_T|v#uz}SJx2)PQq0|X+(PqHGo4CFeyD4VHx8kqy2#2403yJDt72ixr-mVlPQ=&X1|o4d|!3_YI=gG z!g#o)miVu$U1{grQvxh@u1k1aua>qj(ARt8tI^&}I?p;x$B*YG8vZa*re~z_)Eaz8 zi>bd_1<9uNacGG<9o(0i{H%CCxV!#;*LHuYs=r9XZ=&!o((rGKGK8|Zb_=vd`~(o@ ztzBi-b;ZM-LK7R|3Co?f9)!j+urRCPMNEo6Gn3Q4HIJnEARp*`ba>dI4J?swE6_04V8i5 zyHe$MpE>(`fBXp0U$(^DDl?_fTf5fGG(M<8z_p;fSls1&;}RP!>wNc1sPVac_dnwg zf5zR6jb*1AXyZ8g#SG(Mufn=JIW**~G4*fix)x7P!r5%DApuv+$h@5zFa(~4yRq`ty+>QpUMXA|~LC;TR8=(a~Sah$nsNt?l_xhX5~-uYfoURcmIrEN04 z^kS1%?Lc>xo=IgR{IAnO?JX zGqctxj>2g;8oRXUW=mh_z3Ib7Jv_B{8IWn#(6$~oYTS594X%wY8w=Wc#YRRXw5KG+ zLWXf2<3qcZdlEh3xh+=Ff-@&*El??782J2yP7Tvn%_65ro#!IXO0yO-rP zgQ@Sr@C&|kA#iMmVg{AZ7v5CO1e{7vdwYB3N&B$*g(HYkl~d~dgnApU-0;<9V|c); zlp4-nzvic+D>>%?L9y66@V~GX$n+?c?vDhgv6U6L$Go@f-!RZO8~Ghd{FT5CsOzu8 z-|%uDD^5vq!&kXkbSF*FgZ@ciI-ubdE#F*q#j`o`M-CqCU3t*SEmGjAygGR(Y(?xg z&2kv9&nuH6apaV?`DmR44NMwHPRM29h%?Bz8=kyd+j7M~+FcvwG>zB1fqa?X;vb~{ z*g1&9+)}3tW(Kl=^4)dapKHLlQ*Z^+aE4in;avK-D#@X38dvHTlj^0@P?Z6~mI>jH z7de)RG6OayCjxHVuTTx`y1u)*y_8#0sNK=UeQP36o9wOqLxN*etgra0cGCT5S#=?E ztgwaoaU;X3l66L%ht*xhtigjsB?X5QU0Cbdd)G25@|Mdyby0V`c61q#+ibrgc*j|9 z%!g)_$edQ#^fA!r1%pl|w>DHiRa&M>QE}s_{&$?KSt~j?&#pikeat(7($ZaFE|3}?4I%?25dCa^$miSFKyUX%s?sGwCymMl(@c^He{GI!?oec&ycf! z)okTpnzbEdMNDAcnVM{R;xcEPr%G&B4x$|Y^6YH32X)0gE*|1e5@MfJL-A~5y(l9i zIi|@S!*V=#X7xEPHa*LF+o_px-O(lAL}~f(V&B!<-&C-_SC_fsQ!%HdNedZQt0UpS zeLcJ(1i$2QePTYcj|-n4e4*g>N;qN3_$+?3PfxC9@P+A@#FasTETR>SD>I!k%h_|O zbVL?!@${Us<)uCkE?|=IN87xXiybcgbUT`^}rflY#M=CL{+K&dN!_Hv%=y zvP=eGawfZ{(>y`{f-J>@@ng0dK6ZT9q8u7P{Q@b-skI56S=t%vUujigH4G>B*HVq3 zghvnXA!R$^L0$k?U22q3IiOr8n1Mi9BLj~* z`_`2rUY5io=n|i7pqTZ%y2pMj+g>}9sg_@ZFfx_s>}Z-moSRf1Q%C@X z%M6b!{ut}MGkDwIDbO{{*Z;b8&m>-Y1XhldBEF-SWa&V`CG$u?4?0~$MeEuy;R;x| z0NsO>sA`gP@(*qQ5|@VcK2~7K?R^4cEDAb?2~c&!rK}0^BK+ zu(^YCPMh@iiE?euJ18&GHxOc8-@NSpN5JT1dPT~`Q{ZQ_x)(u%en3V_2{*#>gKy^o zt5%1bREj6W1~!#m4!YfmymBM4x=Xe3JB`z6&p=7z z=TXiW6$~L3E0UR9E~g}ps>sXPh^Yi&gZ$~#Rr9GqaP-5lttGVkV&~rc^a~K~N|r*2 zJ4o=kF++$QF5ziyI#r4pj(|uxJWqE%G{jM(33^vazG&e2rN_%uwWUj2by|tcaHp`y z*tQr|Wu+}_!W&`dXul|60ZikQoQ(_Je85W51^gvLm=0&Txu8I;wXb;& zFCvo;=#mg#1SO1ymhMm4J>ug5K!BWsd@s5$R`H%w4f)*c=0`{F&RUHKUl z&T|=g`Qn9CSn&IeR!m=m?^YDVSg@M$_JQC z@mwc21Yi>gMiEExn8jsN!wYS)VEgEp@+l^8gKqHNFqBP79X@Z#l(Du=KFLP0sj&K~ zJ&Yo09#WlL1ox-$njlJg%z=V z5?DRK;85M_?AXBj=Fx#^O?WW$^^qt)rJ{!=CK)GxD>f1BAgkIjb)XI=frln~QA7_6mzMe9>l#jUa+wICi7DitzaO_I1 zzl{!?KG=iY`Qh}{;JZiM|1AwLY{ImYMiI99oOWPN?Yf=2l~%)b77796eB`a9|JE&Kjkg9CQ| zS9Bii7V(*sl}kR0wcVc+Wl_sf+8%E-ThA5e+pi}e%zu!nwA5v z*r~$qN@=`fs_vvg{-ZIJI>xB~x)~K(s04PZQ!?L!RdrIgvKBvu=Pr4@5_oA^CWR8OoQ6{Qh{Bwa`_Pq@aI3D9vvMG zo2Pxb#?Nfg%PwEZ8sPE!TKQXn3-Q7-V}*yRp`xYZ|J%t8d{` zlDnHF>Z1Y88v=}7p?!n3bZfiopp4#iK?Bt7t?KF5#KqWW$ko{8@%9p-sh!xZ{hgSI z0grvcN;k%hu{)>kNcR7fA0s&AsJ6iqwgj`WmjT0Px}XKQXliJ}R*X=1X^dd-?Uj~& zwF=A~@X#z6{N+s8*H1AzKqbWR^T0N*j5ULG0HBcHmM;xj0=P^>YpUA|Osqr`QK(rQ zt14}Z6(Rd_CmhkBBnaN3at8XO%W1yoI63b(_1l1?-7Nfxrcf>d545KExx;2pDp-X& z9$YfvnvD++ZBSFkj!aEL<-d54?9EBef)6!-N;yn%BUcyoZ#h=?U-GMlZm>LFVBnxT z7|y~8*X2b^o(#w4R|?i4S{!MkG@WW^dcu_?xxFOoklv&?gX-zx2S&X)K1X(Bx8Q1w z_cye|=St}PXJ8v>*8!W{C+VA$u%t3akBG&SbH6enhzC}(Ffq6Fz9Kwqu0-9WG}}wN zWv9VhR)6shwJzDGZd}t-ylZvir5>bTNV(X)^V$3-N9$2O!-}PCI3&F86-oqbc{G+g z3Wh`b9kcVpTy`%obhpLJ_XfwwvM<9Jg38p!Dm|m#;%cP2$WG|aiyYGAc)(;nk$X5| zYQs#a;j0Lk$it>?sB)>Xf&k~fHeGu=L3YAtsat)|UYGiq(JUcXV5q#~n({;*XXVN| z(Wx=chZ6f*(NYdR!Pi?`^UR49_8+ksO(yO=LE5w+b1msrIrGLT_s_>u)OWknx87f| z87s=&y&18gOgfaT;F+CVvN^*ir_`IICIp|~P@mu2L2a5!MOgXycw0q~S~e8w!x_Pp z*BlOM7_@%vOhJ&sjCKAm05I0=6sk9}Sq?LVDNuq>X?qyMP zod0}}`oPm%8^~}svghVo?{pt7s`E-r*aVw5W$e=QYcG38g`R%GIHJVbV7_HPts?~M z)5y?mVvLB>C)FGB`4r$|Uf9CiY1w+eo}qsCseyPsd^}(MV94@MOC7tGEdx@U8(88P zo}Sjc1tTu-v_GY{D7b(5&>A$muCR6e3!JdXPaW}MW4d3S(tB-oqMPfy zA-VJ@^~7-MmFW+kEY((95AB`+RqdaR_Rr~gM)~xI>u5TP5Z)kFAh0ucPj#!kWyB^z zx>1rN1KUzocczZ=Nx3oGL0x8Skion7j0VNpTzl~*Z0OJuj7Y2TShLiUF@+e1;3|mj zyz^x#Y0VtN-2_&-VpNNbb?u zGRjpJ8|f59?d;ro_YyT9Vrovb*(Sh(jWm~vER<=zoK|(ZxxKTrtpy)v)#qQ~dRZ?9 zI6R8CO1NU;ib~W~w;K1zq#H=$Uc?42cRtm_I&D*n(J3UkK+7%fu4{vw0z^c+GDh|3 z64}DHNEPLVm=ISckZTN6>p`0G_QKkpgdaHsHQyV-F(e|7yZK;asvVMe=6EwH)^E70 zaXa@nHO6SpSOVoZYQJu8mG5b=OsKg{>gF1k^+0F5!A81f2h>IWrA$HuM5<|3e``g5 zKU!@sdVFi?L-(1ma7&v&#*x@;S(#Z5`rGlAyndAk^X6r8bKdy=ZuM2A0h`^CjcK(p ztCo#@8=>@V7icrezdqQC7~Z%qpo>vX2gu#f3sv6w>bP%-dPyAFDA7mBHLspv~j$(weL0||g3CJaT8Un^9ohe$pPvblu^iyH_(572tXJH4 z7AHsNf%OwPZzf4vzRuGu$Y)pIO-#j;#f|Wot@R$MD+es)mwshziNNV#bHIk4s5+}k zwYJ}Y9ARm=_3z(0_#f;ebI`$2F4sS!hTGTg&j*0u>OFIL Date: Fri, 4 May 2018 12:23:51 -0400 Subject: [PATCH 29/44] Initial changes to Case get case APIs --- .../sleuthkit/autopsy/casemodule/Case.java | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 776c3e8f0c..765d604ce3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -583,11 +583,34 @@ public class Case { } /** - * Gets the current open case, if there is one, at the time of the call. + * Gets the current case. This method should only be called by clients that + * can be sure a case is currently open. Some examples of suitable clients + * are data source processors, ingest modules, and report modules. * - * @return The open case. + * @return The current case. + */ + public static Case getCurrentCase() { + try { + return getCurrentOpenCase(); + } catch (NoCurrentCaseException ex) { + /* + * Throw a runtime exception, since this is a programming error. + */ + throw new IllegalStateException(NbBundle.getMessage(Case.class, "Case.getCurCase.exception.noneOpen"), ex); + } + } + + /** + * Gets the current case, if there is one, or throws an exception. This + * method should only be called by methods known to run in threads other + * than threads that close the current case, where the exception provides + * some protection from the consequences of the race condition between the + * calling thread and the case closing thread, although it is not + * fool-proof. * - * @throws NoCurrentCaseException if there is no open case. + * @return The current case. + * + * @throws NoCurrentCaseException if there is no current case. */ public static Case getCurrentOpenCase() throws NoCurrentCaseException { Case openCase = currentCase; @@ -1541,7 +1564,7 @@ public class Case { String normalizedLocalPath; try { if (localPath.toLowerCase().contains("http:")) { - normalizedLocalPath = localPath; + normalizedLocalPath = localPath; } else { normalizedLocalPath = Paths.get(localPath).normalize().toString(); } @@ -2723,26 +2746,4 @@ public class Case { deleteReports(reports); } - /** - * Gets the current case, if there is one, at the time of the call. - * - * @return The current case. - * - * @throws IllegalStateException if there is no current case. - * - * @deprecated Use getOpenCase() instead. - */ - @Deprecated - public static Case getCurrentCase() { - /* - * Throwing an unchecked exception is a bad idea here. - * - */ - try { - return getCurrentOpenCase(); - } catch (NoCurrentCaseException ex) { - throw new IllegalStateException(NbBundle.getMessage(Case.class, "Case.getCurCase.exception.noneOpen"), ex); - } - } - } From a59649318d1bf3707f5f20fba1e32ad9018acc23 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Fri, 4 May 2018 12:46:18 -0400 Subject: [PATCH 30/44] updated limitations --- Running_Linux_OSX.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Running_Linux_OSX.txt b/Running_Linux_OSX.txt index dc9c29a51a..386c4c5899 100644 --- a/Running_Linux_OSX.txt +++ b/Running_Linux_OSX.txt @@ -38,4 +38,8 @@ Autopsy depends on a specific version of The Sleuth Kit. You need the Java libr - In a terminal, change to the ‘bin’ directory in the Autopsy folder. - Run Autopsy - % ./autopsy \ No newline at end of file + % ./autopsy + +* Limitations (Updated May 2018) * +- Timeline does not work on OS X +- Video thumbnails are not generated (need to get a consistent version of OpenCV) From 5c79f6faf2954945e8f82a9b9bd5481217a00164 Mon Sep 17 00:00:00 2001 From: rishwanth1995 Date: Fri, 4 May 2018 13:43:57 -0400 Subject: [PATCH 31/44] opencv messagebox --- Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index d8f2bb2d4b..c4ceff3501 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -133,7 +133,7 @@ public class ImageUtils { openCVLoadedTemp = false; LOGGER.log(Level.SEVERE, "OpenCV Native code library failed to load", e); //NON-NLS //TODO: show warning bubble - + MessageNotifyUtil.Notify.show("Open CV", "OpenCV Native code library failed to load, see log for more details", MessageNotifyUtil.MessageType.WARNING); } OPEN_CV_LOADED = openCVLoadedTemp; From 9204fc5a98a3a0a5aabc8436c90821fe33bf1e26 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Fri, 4 May 2018 14:00:43 -0400 Subject: [PATCH 32/44] Update ImageUtils.java --- Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index c4ceff3501..f5c046cb63 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -132,8 +132,7 @@ public class ImageUtils { } catch (UnsatisfiedLinkError e) { openCVLoadedTemp = false; LOGGER.log(Level.SEVERE, "OpenCV Native code library failed to load", e); //NON-NLS - //TODO: show warning bubble - MessageNotifyUtil.Notify.show("Open CV", "OpenCV Native code library failed to load, see log for more details", MessageNotifyUtil.MessageType.WARNING); + MessageNotifyUtil.Notify.show("Open CV", "OpenCV native library failed to load, see log for more details", MessageNotifyUtil.MessageType.WARNING); } OPEN_CV_LOADED = openCVLoadedTemp; From 7f452ab4ead6ec2bfdc732dfd28011e38d3f2bc3 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 4 May 2018 17:35:01 -0400 Subject: [PATCH 33/44] Restore ability to have a result view panel with no content view --- .../corecomponents/DataResultPanel.java | 48 ++++++++++--------- .../DataResultTopComponent.java | 17 ++++--- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index d33360d4f7..bdde06ee1c 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -58,18 +58,19 @@ import org.sleuthkit.autopsy.datamodel.NodeSelectionInfo; * node. A typical result viewer is a JPanel that displays the child nodes of * the given node using a NetBeans explorer view child component. * - * A result panel should be child components of top components that are explorer - * manager providers. The parent top component is expected to expose a lookup - * maintained by its explorer manager to the actions global context. The child - * result view panel will then find the parent top component's explorer manager - * at runtime, so that it can act as an explorer manager provider for its child - * result viewers. This connects the nodes displayed in the result viewers to - * the actions global context. + * All result view panels should be child components of top components that are + * explorer manager providers. The parent top component is expected to expose a + * lookup maintained by its explorer manager to the actions global context. The + * child result view panel will then find the parent top component's explorer + * manager at runtime, so that it can act as an explorer manager provider for + * its child result viewers. This connects the nodes displayed in the result + * viewers to the actions global context. * - * All result view panels push single node selections in the child result - * viewers to either the "main" content view (DataContentTopComponent) that is - * normally docked into the lower right hand side of the main application - * window, or to a supplied custom content view (implements DataContent). + * Result view panels can be constructed so that they push single node + * selections in the child result viewers to a content view (implements + * DataContent). The content view could be the "main" content view + * (DataContentTopComponent) that is normally docked into the lower right hand + * side of the main application window, or could be a custom content view. */ public class DataResultPanel extends javax.swing.JPanel implements DataResult, ChangeListener, ExplorerManager.Provider { @@ -103,7 +104,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @return A result view panel. */ public static DataResultPanel createInstance(String title, String description, Node currentRootNode, int childNodeCount) { - DataResultPanel resultPanel = new DataResultPanel(title, false, Collections.emptyList(), null); + DataResultPanel resultPanel = new DataResultPanel(title, false, Collections.emptyList(), Lookup.getDefault().lookup(DataContent.class)); createInstanceCommon(title, description, currentRootNode, childNodeCount, resultPanel); resultPanel.open(); return resultPanel; @@ -130,7 +131,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @return A result view panel. */ public static DataResultPanel createInstance(String title, String description, Node currentRootNode, int childNodeCount, Collection viewers) { - DataResultPanel resultPanel = new DataResultPanel(title, false, viewers, null); + DataResultPanel resultPanel = new DataResultPanel(title, false, viewers, Lookup.getDefault().lookup(DataContent.class)); createInstanceCommon(title, description, currentRootNode, childNodeCount, resultPanel); resultPanel.open(); return resultPanel; @@ -141,7 +142,8 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * contains instances of the result viewers (DataResultViewer) provided by * the result viewer extension point (service providers that implement * DataResultViewer). The result view panel will push single node selections - * from its child result viewers to the supplied custom content view. + * from its child result viewers to the supplied custom content view, which + * can be null if a content view is not needed. * * @param title The title for the result view panel. * @param description Descriptive text about the source of the nodes @@ -152,7 +154,8 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @param customContentView A custom content view to use instead of the * "main" content view that is normally docked into * the lower right hand side of the main - * application window. + * application window. May be null, if no content + * view is needed. * * @return A result view panel. */ @@ -229,11 +232,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C DataResultPanel(String title, boolean isMain, Collection viewers, DataContent customContentView) { this.setTitle(title); this.isMain = isMain; - if (customContentView == null) { - this.contentView = Lookup.getDefault().lookup(DataContent.class); - } else { - this.contentView = customContentView; - } + this.contentView = customContentView; this.resultViewers = new ArrayList<>(viewers); this.explorerManagerListener = new ExplorerManagerListener(); this.rootNodeListener = new RootNodeListener(); @@ -562,16 +561,18 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C /** * Worker for RootNodeListener childrenAdded. - */ + */ class SetupTabsChildrenWorker extends SwingWorker { - + private final Node childNode; + SetupTabsChildrenWorker(Node aChildNode) { childNode = aChildNode; } + @Override protected Void doInBackground() throws Exception { - setupTabs(childNode); + setupTabs(childNode); return null; } @@ -580,6 +581,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C setupTabs(childNode); } } + /** * Responds to changes in the root node due to asynchronous child node * creation. diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java index 47982bb059..3674b928be 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java @@ -27,6 +27,7 @@ import javax.swing.JComponent; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; import org.openide.nodes.Node; +import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.windows.Mode; import org.openide.windows.RetainLocation; @@ -35,6 +36,7 @@ import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.AddBookmarkTagAction; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; +import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResult; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.coreutils.Logger; @@ -96,7 +98,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, * @return The result view top component. */ public static DataResultTopComponent createInstance(String title, String description, Node node, int childNodeCount) { - DataResultTopComponent resultViewTopComponent = new DataResultTopComponent(false, title, null, Collections.emptyList(), null); + DataResultTopComponent resultViewTopComponent = new DataResultTopComponent(false, title, null, Collections.emptyList(), DataContentTopComponent.findInstance()); initInstance(description, node, childNodeCount, resultViewTopComponent); return resultViewTopComponent; } @@ -121,7 +123,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, * @return The result view top component. */ public static DataResultTopComponent createInstance(String title, String description, Node node, int childNodeCount, Collection viewers) { - DataResultTopComponent resultViewTopComponent = new DataResultTopComponent(false, title, null, viewers, null); + DataResultTopComponent resultViewTopComponent = new DataResultTopComponent(false, title, null, viewers, DataContentTopComponent.findInstance()); initInstance(description, node, childNodeCount, resultViewTopComponent); return resultViewTopComponent; } @@ -143,7 +145,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, * @return The partially initialized result view top component. */ public static DataResultTopComponent createInstance(String title) { - DataResultTopComponent resultViewTopComponent = new DataResultTopComponent(false, title, null, Collections.emptyList(), null); + DataResultTopComponent resultViewTopComponent = new DataResultTopComponent(false, title, null, Collections.emptyList(), DataContentTopComponent.findInstance()); return resultViewTopComponent; } @@ -210,7 +212,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, * component's tab. */ public DataResultTopComponent(String title) { - this(true, title, null, Collections.emptyList(), null); + this(true, title, null, Collections.emptyList(), DataContentTopComponent.findInstance()); } /** @@ -229,10 +231,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, * the result viewers provided by the results * viewer extension point will be used. * @param contentViewTopComponent A content view to which this result view - * will be linked. If null, this result view - * will be linked to the content view docked - * into the lower right hand side of the main - * application window, + * will be linked, possibly null. */ private DataResultTopComponent(boolean isMain, String title, String mode, Collection viewers, DataContentTopComponent contentViewTopComponent) { this.isMain = isMain; @@ -445,7 +444,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, */ @Deprecated public DataResultTopComponent(boolean isMain, String title) { - this(false, title, null, Collections.emptyList(), null); + this(false, title, null, Collections.emptyList(), DataContentTopComponent.findInstance()); } /** From 4a0e5ea09298caefc4490011303c3bca0250b660 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 4 May 2018 17:36:35 -0400 Subject: [PATCH 34/44] Restore ability to have a result view panel with no content view --- .../org/sleuthkit/autopsy/corecomponents/DataResultPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index bdde06ee1c..08c48b7922 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -70,7 +70,7 @@ import org.sleuthkit.autopsy.datamodel.NodeSelectionInfo; * selections in the child result viewers to a content view (implements * DataContent). The content view could be the "main" content view * (DataContentTopComponent) that is normally docked into the lower right hand - * side of the main application window, or could be a custom content view. + * side of the main application window, or it could be a custom content view. */ public class DataResultPanel extends javax.swing.JPanel implements DataResult, ChangeListener, ExplorerManager.Provider { From d84bdf2c509235e570452156950ad3d3578e787d Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 4 May 2018 17:47:11 -0400 Subject: [PATCH 35/44] Restore ability to have a result view panel with no content view --- .../sleuthkit/autopsy/corecomponents/DataResultPanel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 08c48b7922..1e98e40a43 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -104,7 +104,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @return A result view panel. */ public static DataResultPanel createInstance(String title, String description, Node currentRootNode, int childNodeCount) { - DataResultPanel resultPanel = new DataResultPanel(title, false, Collections.emptyList(), Lookup.getDefault().lookup(DataContent.class)); + DataResultPanel resultPanel = new DataResultPanel(title, false, Collections.emptyList(), DataContentTopComponent.findInstance()); createInstanceCommon(title, description, currentRootNode, childNodeCount, resultPanel); resultPanel.open(); return resultPanel; @@ -116,7 +116,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * of the result viewers provided by the results viewer extension point. The * result view panel will push single node selections from its child result * viewers to the "main" content view that is normally docked into the lower - * right hand side of the main application window.. + * right hand side of the main application window. * * @param title The title for the result view panel. * @param description Descriptive text about the source of the nodes @@ -131,7 +131,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @return A result view panel. */ public static DataResultPanel createInstance(String title, String description, Node currentRootNode, int childNodeCount, Collection viewers) { - DataResultPanel resultPanel = new DataResultPanel(title, false, viewers, Lookup.getDefault().lookup(DataContent.class)); + DataResultPanel resultPanel = new DataResultPanel(title, false, viewers, DataContentTopComponent.findInstance()); createInstanceCommon(title, description, currentRootNode, childNodeCount, resultPanel); resultPanel.open(); return resultPanel; From 5cf5159ff9990c51c00a622e9b072cce3a5ede08 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 4 May 2018 17:49:38 -0400 Subject: [PATCH 36/44] Restore ability to have a result view panel with no content view --- .../corecomponents/DataResultPanel.java | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 1e98e40a43..91a4493411 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -142,8 +142,8 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * contains instances of the result viewers (DataResultViewer) provided by * the result viewer extension point (service providers that implement * DataResultViewer). The result view panel will push single node selections - * from its child result viewers to the supplied custom content view, which - * can be null if a content view is not needed. + * from its child result viewers to the supplied content view, which can be + * null if a content view is not needed. * * @param title The title for the result view panel. * @param description Descriptive text about the source of the nodes @@ -151,11 +151,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @param currentRootNode The current root (parent) node for the nodes * displayed. May be changed by calling setNode. * @param childNodeCount The cardinality of the root node's children. - * @param customContentView A custom content view to use instead of the - * "main" content view that is normally docked into - * the lower right hand side of the main - * application window. May be null, if no content - * view is needed. + * @param customContentView A content view,mMay be null. * * @return A result view panel. */ @@ -215,24 +211,24 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * contains a collection of result viewers that is either supplied or * provided by the result viewer extension point. * - * @param title The title of the result view panel. - * @param isMain Whether or not the result view panel is the - * "main" instance of the panel that resides in the - * "main" results view (DataResultTopComponent) - * that is normally docked into the upper right - * hand side of the main application window. - * @param viewers A collection of result viewers to use instead of - * the result viewers provided by the results - * viewer extension point, may be empty. - * @param customContentView A custom content view to use instead of the - * "main" content view that is normally docked into - * the lower right hand side of the main - * application window, may be null. + * @param title The title of the result view panel. + * @param isMain Whether or not the result view panel is the "main" + * instance of the panel that resides in the "main" + * results view (DataResultTopComponent) that is normally + * docked into the upper right hand side of the main + * application window. + * @param viewers A collection of result viewers to use instead of the + * result viewers provided by the results viewer + * extension point, may be empty. + * @param contentView A custom content view to use instead of the "main" + * content view that is normally docked into the lower + * right hand side of the main application window, may be + * null. */ - DataResultPanel(String title, boolean isMain, Collection viewers, DataContent customContentView) { + DataResultPanel(String title, boolean isMain, Collection viewers, DataContent contentView) { this.setTitle(title); this.isMain = isMain; - this.contentView = customContentView; + this.contentView = contentView; this.resultViewers = new ArrayList<>(viewers); this.explorerManagerListener = new ExplorerManagerListener(); this.rootNodeListener = new RootNodeListener(); From 82d9482f8c40c5a17cd9b868c930a9a8b2651a3b Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 4 May 2018 17:52:08 -0400 Subject: [PATCH 37/44] Restore ability to have a result view panel with no content view --- .../autopsy/corecomponents/DataResultPanel.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 91a4493411..02bf1f4907 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -151,7 +151,11 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @param currentRootNode The current root (parent) node for the nodes * displayed. May be changed by calling setNode. * @param childNodeCount The cardinality of the root node's children. - * @param customContentView A content view,mMay be null. + * @param customContentView A custom content view to use instead of the + * "main" content view that is normally docked into + * the lower right hand side of the main + * application window. May be null, if no content + * view is needed. * * @return A result view panel. */ @@ -220,10 +224,8 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C * @param viewers A collection of result viewers to use instead of the * result viewers provided by the results viewer * extension point, may be empty. - * @param contentView A custom content view to use instead of the "main" - * content view that is normally docked into the lower - * right hand side of the main application window, may be - * null. + * @param contentView A content view to into which to push single node + * selections in the child result viewers, may be null. */ DataResultPanel(String title, boolean isMain, Collection viewers, DataContent contentView) { this.setTitle(title); From bedcaf62512a764c27454bf6c45e24c85ddc0b07 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 4 May 2018 18:42:04 -0400 Subject: [PATCH 38/44] Restore ability to have a result view panel with no content view (Codacy fixes) --- .../autopsy/corecomponents/DataResultTopComponent.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java index 3674b928be..c6b0037a85 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java @@ -27,7 +27,6 @@ import javax.swing.JComponent; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; import org.openide.nodes.Node; -import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.windows.Mode; import org.openide.windows.RetainLocation; @@ -36,7 +35,6 @@ import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.AddBookmarkTagAction; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; -import org.sleuthkit.autopsy.corecomponentinterfaces.DataContent; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResult; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.coreutils.Logger; @@ -70,7 +68,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; * viewers to the actions global context. */ @RetainLocation("editor") -public class DataResultTopComponent extends TopComponent implements DataResult, ExplorerManager.Provider { +public final class DataResultTopComponent extends TopComponent implements DataResult, ExplorerManager.Provider { private static final Logger logger = Logger.getLogger(DataResultTopComponent.class.getName()); private static final List activeComponentIds = Collections.synchronizedList(new ArrayList()); From e5955ac5429f47a61817d8d58478a19c45f5452d Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 7 May 2018 10:46:24 -0400 Subject: [PATCH 39/44] Case.getCurrentOpenCase => getCurrentCaseThrows --- .../AddBlackboardArtifactTagAction.java | 2 +- .../autopsy/actions/AddBookmarkTagAction.java | 2 +- .../autopsy/actions/AddContentTagAction.java | 2 +- .../autopsy/actions/AddTagAction.java | 4 ++-- .../DeleteBlackboardArtifactTagAction.java | 2 +- .../actions/DeleteContentTagAction.java | 2 +- ...DeleteFileBlackboardArtifactTagAction.java | 6 ++--- .../actions/DeleteFileContentTagAction.java | 6 ++--- .../actions/GetTagNameAndCommentDialog.java | 2 +- .../autopsy/actions/GetTagNameDialog.java | 6 ++--- .../autopsy/actions/OpenLogFolderAction.java | 2 +- .../actions/OpenOutputFolderAction.java | 2 +- .../autopsy/casemodule/AddImageTask.java | 2 +- .../AddImageWizardAddingProgressPanel.java | 6 ++--- .../AddImageWizardSelectDspVisual.java | 4 ++-- .../autopsy/casemodule/AddLocalFilesTask.java | 2 +- .../sleuthkit/autopsy/casemodule/Case.java | 21 +++++++++------- .../autopsy/casemodule/CaseDeleteAction.java | 2 +- .../casemodule/CaseInformationPanel.java | 2 +- .../casemodule/CasePropertiesPanel.java | 2 +- .../autopsy/casemodule/ImageDSProcessor.java | 2 +- .../autopsy/casemodule/ImageFilePanel.java | 2 +- .../casemodule/IngestJobInfoPanel.java | 4 ++-- .../autopsy/casemodule/LocalDiskPanel.java | 2 +- .../casemodule/LocalFilesDSProcessor.java | 2 +- .../autopsy/casemodule/LocalFilesPanel.java | 2 +- .../casemodule/LogicalEvidenceFilePanel.java | 2 +- .../casemodule/NewCaseWizardAction.java | 4 ++-- .../OptionalCasePropertiesPanel.java | 8 +++---- .../autopsy/casemodule/RecentCases.java | 4 ++-- .../BlackBoardArtifactTagAddedEvent.java | 2 +- .../events/ContentTagAddedEvent.java | 2 +- .../events/DataSourceAddedEvent.java | 2 +- .../casemodule/events/ReportAddedEvent.java | 2 +- .../services/TagNameDefinition.java | 2 +- .../casemodule/services/TagOptionsPanel.java | 2 +- .../casemodule/services/TagsManager.java | 10 ++++---- .../DataContentViewerOtherCases.java | 8 +++---- .../datamodel/CorrelationDataSource.java | 2 +- .../datamodel/EamArtifactUtil.java | 12 +++++----- .../eventlisteners/CaseEventListener.java | 18 +++++++------- .../eventlisteners/IngestEventsListener.java | 2 +- .../ingestmodule/IngestModule.java | 4 ++-- .../AccountDeviceInstanceKey.java | 2 +- .../communications/AccountsBrowser.java | 2 +- .../autopsy/communications/FiltersPanel.java | 2 +- .../communications/VisualizationPanel.java | 2 +- .../autopsy/contentviewers/PListViewer.java | 2 +- .../autopsy/contentviewers/SQLiteViewer.java | 4 ++-- .../DataContentTopComponent.java | 2 +- .../corecomponents/DataResultPanel.java | 4 ++-- .../DataResultTopComponent.java | 2 +- .../autopsy/coreutils/ImageUtils.java | 2 +- .../autopsy/coreutils/VideoUtils.java | 2 +- .../datamodel/AbstractAbstractFileNode.java | 2 +- .../datamodel/AbstractContentNode.java | 2 +- .../datamodel/BlackboardArtifactNode.java | 8 +++---- .../autopsy/datamodel/DataSourcesNode.java | 2 +- .../autopsy/datamodel/DeletedContent.java | 4 ++-- .../autopsy/datamodel/EmailExtracted.java | 4 ++-- .../autopsy/datamodel/ExtractedContent.java | 8 +++---- .../sleuthkit/autopsy/datamodel/FileSize.java | 4 ++-- .../datamodel/FileTypesByExtension.java | 2 +- .../datamodel/FileTypesByMimeType.java | 2 +- .../autopsy/datamodel/HashsetHits.java | 4 ++-- .../autopsy/datamodel/ImageNode.java | 2 +- .../autopsy/datamodel/InterestingHits.java | 4 ++-- .../autopsy/datamodel/KeywordHits.java | 4 ++-- .../sleuthkit/autopsy/datamodel/Reports.java | 6 ++--- .../org/sleuthkit/autopsy/datamodel/Tags.java | 16 ++++++------- .../datamodel/VirtualDirectoryNode.java | 4 ++-- .../autopsy/datamodel/accounts/Accounts.java | 20 ++++++++-------- .../datasourceprocessors/AddRawImageTask.java | 2 +- .../datasourceprocessors/RawDSInputPanel.java | 2 +- .../autopsy/diagnostics/PerformancePanel.java | 6 ++--- .../DirectoryTreeTopComponent.java | 6 ++--- .../directorytree/ExternalViewerAction.java | 2 +- .../autopsy/directorytree/ExtractAction.java | 4 ++-- .../directorytree/ExtractUnallocAction.java | 6 ++--- .../ViewSourceArtifactAction.java | 2 +- .../SampleDataSourceIngestModule.java | 2 +- .../autopsy/filesearch/DateSearchFilter.java | 4 ++-- .../autopsy/filesearch/FileSearchPanel.java | 2 +- .../autopsy/imagewriter/ImageWriter.java | 4 ++-- .../autopsy/ingest/DataSourceIngestJob.java | 4 ++-- .../autopsy/ingest/GetFilesCountVisitor.java | 2 +- .../ingest/IngestJobSettingsPanel.java | 2 +- .../autopsy/ingest/IngestManager.java | 6 ++--- .../ingest/IngestMessageDetailsPanel.java | 2 +- .../autopsy/ingest/IngestMonitor.java | 2 +- .../autopsy/ingest/IngestServices.java | 4 ++-- .../autopsy/ingest/RunIngestAction.java | 2 +- .../autopsy/ingest/RunIngestSubMenu.java | 2 +- .../ingest/events/BlackboardPostEvent.java | 2 +- .../ingest/events/ContentChangedEvent.java | 2 +- .../events/DataSourceAnalysisEvent.java | 2 +- .../ingest/events/FileAnalyzedEvent.java | 2 +- .../menuactions/DataContentDynamicMenu.java | 2 +- .../menuactions/DataExplorerDynamicMenu.java | 2 +- .../EmbeddedFileExtractorIngestModule.java | 2 +- .../ExtractArchiveWithPasswordAction.java | 4 ++-- .../MSOfficeEmbeddedContentExtractor.java | 2 +- .../SevenZipExtractor.java | 6 ++--- .../EncryptionDetectionFileIngestModule.java | 2 +- .../exif/ExifParserFileIngestModule.java | 2 +- .../FileExtMismatchIngestModule.java | 2 +- .../filetypeid/FileTypeIdIngestModule.java | 2 +- .../hashdatabase/HashDbIngestModule.java | 4 ++-- .../modules/hashdatabase/HashDbSearcher.java | 6 ++--- .../autopsy/modules/iOS/CallLogAnalyzer.java | 6 ++--- .../autopsy/modules/iOS/ContactAnalyzer.java | 4 ++-- .../modules/iOS/TextMessageAnalyzer.java | 6 ++--- .../FilesIdentifierIngestModule.java | 2 +- .../PhotoRecCarverFileIngestModule.java | 2 +- .../PhotoRecCarverOutputParser.java | 2 +- .../autopsy/modules/stix/EvalAccountObj.java | 2 +- .../autopsy/modules/stix/EvalAddressObj.java | 2 +- .../autopsy/modules/stix/EvalDomainObj.java | 2 +- .../autopsy/modules/stix/EvalFileObj.java | 2 +- .../modules/stix/EvalNetworkShareObj.java | 2 +- .../autopsy/modules/stix/EvalRegistryObj.java | 4 ++-- .../autopsy/modules/stix/EvalSystemObj.java | 2 +- .../autopsy/modules/stix/EvalURIObj.java | 2 +- .../modules/stix/EvalURLHistoryObj.java | 4 ++-- .../modules/stix/EvaluatableObject.java | 2 +- .../modules/stix/STIXReportModule.java | 2 +- .../modules/stix/StixArtifactData.java | 4 ++-- .../vmextractor/VMExtractorIngestModule.java | 10 ++++---- .../report/ArtifactSelectionDialog.java | 2 +- .../autopsy/report/FileReportText.java | 2 +- .../autopsy/report/ReportBodyFile.java | 4 ++-- .../sleuthkit/autopsy/report/ReportExcel.java | 4 ++-- .../autopsy/report/ReportGenerator.java | 4 ++-- .../sleuthkit/autopsy/report/ReportHTML.java | 4 ++-- .../sleuthkit/autopsy/report/ReportKML.java | 4 ++-- .../autopsy/report/ReportVisualPanel2.java | 4 ++-- .../autopsy/report/TableReportGenerator.java | 24 +++++++++---------- .../taggedhashes/AddTaggedHashesToHashDb.java | 2 +- .../AddTaggedHashesToHashDbConfigPanel.java | 2 +- .../autopsy/test/CustomArtifactType.java | 2 +- ...nterestingArtifactCreatorIngestModule.java | 4 ++-- .../autopsy/timeline/OpenTimelineAction.java | 4 ++-- .../autopsy/timeline/TimeLineController.java | 2 +- .../actions/SaveSnapshotAsReport.java | 2 +- .../timeline/explorernodes/EventNode.java | 2 +- .../datamodel/CentralRepoDatamodelTest.java | 4 ++-- .../autopsy/ingest/IngestFileFiltersTest.java | 2 +- .../autoingest/AddArchiveTask.java | 2 +- .../autoingest/ArchiveFilePanel.java | 2 +- .../autoingest/AutoIngestManager.java | 2 +- .../autoingest/FileExportRuleSet.java | 4 ++-- .../experimental/autoingest/FileExporter.java | 4 ++-- .../autoingest/FileExporterSettingsPanel.java | 4 ++-- .../volatilityDSP/AddMemoryImageTask.java | 2 +- .../volatilityDSP/MemoryDSInputPanel.java | 2 +- .../volatilityDSP/VolatilityProcessor.java | 2 +- .../imagegallery/ImageGalleryController.java | 4 ++-- .../ImageGalleryOptionsPanel.java | 4 ++-- .../imagegallery/actions/DeleteTagAction.java | 2 +- .../imagegallery/actions/OpenAction.java | 6 ++--- .../imagegallery/datamodel/DrawableFile.java | 2 +- .../keywordsearch/ArtifactTextExtractor.java | 2 +- .../keywordsearch/ExtractedContentViewer.java | 2 +- .../autopsy/keywordsearch/KeywordHit.java | 2 +- .../KeywordSearchIngestModule.java | 2 +- .../KeywordSearchResultFactory.java | 2 +- .../autopsy/keywordsearch/QueryResults.java | 2 +- .../autopsy/keywordsearch/RegexQuery.java | 2 +- .../keywordsearch/TermsComponentQuery.java | 2 +- .../autopsy/recentactivity/Extract.java | 4 ++-- .../autopsy/recentactivity/ExtractIE.java | 2 +- .../autopsy/recentactivity/Util.java | 2 +- .../ThunderbirdMboxFileIngestModule.java | 12 +++++----- 173 files changed, 319 insertions(+), 314 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java index f4cd7e82d6..7ad185ac8e 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java @@ -84,7 +84,7 @@ public class AddBlackboardArtifactTagAction extends AddTagAction { new Thread(() -> { for (BlackboardArtifact artifact : selectedArtifacts) { try { - Case.getCurrentOpenCase().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment); + Case.getCurrentCaseThrows().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS SwingUtilities.invokeLater(() -> { diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java index d4c7b8adfe..d6090b2ace 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddBookmarkTagAction.java @@ -45,7 +45,7 @@ public class AddBookmarkTagAction extends AbstractAction { @Override public void actionPerformed(ActionEvent e) { try { - Map tagNamesMap = Case.getCurrentOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap(); + Map tagNamesMap = Case.getCurrentCaseThrows().getServices().getTagsManager().getDisplayNamesToTagNamesMap(); TagName bookmarkTagName = tagNamesMap.get(BOOKMARK); /* diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java index de8f5838fd..602789735d 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java @@ -140,7 +140,7 @@ public class AddContentTagAction extends AddTagAction { } } - Case.getCurrentOpenCase().getServices().getTagsManager().addContentTag(file, tagName, comment); + Case.getCurrentCaseThrows().getServices().getTagsManager().addContentTag(file, tagName, comment); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS AbstractFile fileCopy = file; diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java index d489183032..7d0212b51c 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java @@ -93,7 +93,7 @@ abstract class AddTagAction extends AbstractAction implements Presenter.Popup { // Get the current set of tag names. Map tagNamesMap = null; try { - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS @@ -170,7 +170,7 @@ abstract class AddTagAction extends AbstractAction implements Presenter.Popup { private void getAndAddTag(String tagDisplayName, TagName tagName, String comment) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); // NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java index 569a8c6694..18ae9ac7e5 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteBlackboardArtifactTagAction.java @@ -73,7 +73,7 @@ public class DeleteBlackboardArtifactTagAction extends AbstractAction { new Thread(() -> { for (BlackboardArtifactTag tag : selectedTags) { try { - Case.getCurrentOpenCase().getServices().getTagsManager().deleteBlackboardArtifactTag(tag); + Case.getCurrentCaseThrows().getServices().getTagsManager().deleteBlackboardArtifactTag(tag); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(DeleteBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS SwingUtilities.invokeLater(() -> { diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java index 01c981d7bc..07cce02bfc 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteContentTagAction.java @@ -72,7 +72,7 @@ public class DeleteContentTagAction extends AbstractAction { new Thread(() -> { for (ContentTag tag : selectedTags) { try { - Case.getCurrentOpenCase().getServices().getTagsManager().deleteContentTag(tag); + Case.getCurrentCaseThrows().getServices().getTagsManager().deleteContentTag(tag); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(DeleteContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS SwingUtilities.invokeLater(() -> { diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java index 1e2be550bf..008cb419ff 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileBlackboardArtifactTagAction.java @@ -98,7 +98,7 @@ public class DeleteFileBlackboardArtifactTagAction extends AbstractAction implem protected Void doInBackground() throws Exception { TagsManager tagsManager; try { - tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Error untagging artifact. No open case found.", ex); //NON-NLS Platform.runLater(() @@ -155,7 +155,7 @@ public class DeleteFileBlackboardArtifactTagAction extends AbstractAction implem Map tagNamesMap = null; try { // Get the current set of tag names. - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -168,7 +168,7 @@ public class DeleteFileBlackboardArtifactTagAction extends AbstractAction implem if (null != tagNamesMap && !tagNamesMap.isEmpty()) { try { List existingTagsList - = Case.getCurrentOpenCase().getServices().getTagsManager() + = Case.getCurrentCaseThrows().getServices().getTagsManager() .getBlackboardArtifactTagsByArtifact(artifact); for (Map.Entry entry : tagNamesMap.entrySet()) { diff --git a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java index 88253181d7..f336cd888f 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/DeleteFileContentTagAction.java @@ -98,7 +98,7 @@ public class DeleteFileContentTagAction extends AbstractAction implements Presen protected Void doInBackground() throws Exception { TagsManager tagsManager; try { - tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Error untagging file. No open case found.", ex); //NON-NLS Platform.runLater(() -> @@ -152,7 +152,7 @@ public class DeleteFileContentTagAction extends AbstractAction implements Presen Map tagNamesMap = null; try { // Get the current set of tag names. - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -165,7 +165,7 @@ public class DeleteFileContentTagAction extends AbstractAction implements Presen if (null != tagNamesMap && !tagNamesMap.isEmpty()) { try { List existingTagsList = - Case.getCurrentOpenCase().getServices().getTagsManager() + Case.getCurrentCaseThrows().getServices().getTagsManager() .getContentTagsByContent(file); for (Map.Entry entry : tagNamesMap.entrySet()) { diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java index d106f3c300..51665012cd 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java +++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java @@ -139,7 +139,7 @@ public class GetTagNameAndCommentDialog extends JDialog { // Tag name DTOs may be null (user tag names that have not been used do // not exist in the database). try { - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); tagNamesSet.addAll(tagsManager.getAllTagNames()); } catch (TskCoreException | NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java index ed421d086a..21785f2003 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java +++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameDialog.java @@ -110,7 +110,7 @@ public class GetTagNameDialog extends JDialog { // Get the current set of tag names and hash them for a speedy lookup in // case the user chooses an existing tag name from the tag names table. try { - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); tagNamesMap.putAll(tagsManager.getDisplayNamesToTagNamesMap()); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(GetTagNameDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS @@ -348,7 +348,7 @@ public class GetTagNameDialog extends JDialog { if (tagName == null) { try { - tagName = Case.getCurrentOpenCase().getServices().getTagsManager().addTagName(tagDisplayName, userTagDescription, TagName.HTML_COLOR.NONE, status); + tagName = Case.getCurrentCaseThrows().getServices().getTagsManager().addTagName(tagDisplayName, userTagDescription, TagName.HTML_COLOR.NONE, status); dispose(); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS @@ -361,7 +361,7 @@ public class GetTagNameDialog extends JDialog { tagName = null; } catch (TagsManager.TagNameAlreadyExistsException ex) { try { - tagName = Case.getCurrentOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(tagDisplayName); + tagName = Case.getCurrentCaseThrows().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(tagDisplayName); } catch (TskCoreException | NoCurrentCaseException ex1) { Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, tagDisplayName + " exists in database but an error occurred in retrieving it.", ex1); //NON-NLS JOptionPane.showMessageDialog(this, diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java index 06287ea65a..fb178c797d 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenLogFolderAction.java @@ -58,7 +58,7 @@ public final class OpenLogFolderAction implements ActionListener { /* * Open the log directory for the case. */ - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); logDir = new File(currentCase.getLogDirectoryPath()); } catch (NoCurrentCaseException ex) { /* diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java index 1cbeb50d64..29b8d67960 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java @@ -57,7 +57,7 @@ public final class OpenOutputFolderAction extends CallableSystemAction { public void performAction() { File outputDir; try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); outputDir = new File(currentCase.getOutputDirectory()); if (outputDir.exists()) { try { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 8b92eab6fe..cbcb06c936 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -109,7 +109,7 @@ class AddImageTask implements Runnable { public void run() { Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java index 8023384190..6c6097717e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java @@ -345,7 +345,7 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel { new Thread(() -> { try { - Case.getCurrentOpenCase().notifyAddingDataSource(dataSourceId); + Case.getCurrentCaseThrows().notifyAddingDataSource(dataSourceId); } catch (NoCurrentCaseException ex) { Logger.getLogger(AddImageWizardAddingProgressVisual.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS } @@ -417,9 +417,9 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel { new Thread(() -> { try { if (!contents.isEmpty()) { - Case.getCurrentOpenCase().notifyDataSourceAdded(contents.get(0), dataSourceId); + Case.getCurrentCaseThrows().notifyDataSourceAdded(contents.get(0), dataSourceId); } else { - Case.getCurrentOpenCase().notifyFailedAddingDataSource(dataSourceId); + Case.getCurrentCaseThrows().notifyFailedAddingDataSource(dataSourceId); } } catch (NoCurrentCaseException ex) { Logger.getLogger(AddImageWizardAddingProgressVisual.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java index bb7c8fceb1..43bfed1caa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectDspVisual.java @@ -59,7 +59,7 @@ final class AddImageWizardSelectDspVisual extends JPanel { selectedDsp = lastDspUsed; //if the last selected DSP was the Local Disk DSP and it would be disabled then we want to select a different DSP try { - if ((Case.getCurrentOpenCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) && selectedDsp.equals(LocalDiskDSProcessor.getType())) { + if ((Case.getCurrentCaseThrows().getCaseType() == Case.CaseType.MULTI_USER_CASE) && selectedDsp.equals(LocalDiskDSProcessor.getType())) { selectedDsp = ImageDSProcessor.getType(); } createDataSourceProcessorButtons(); @@ -131,7 +131,7 @@ final class AddImageWizardSelectDspVisual extends JPanel { //Add the button JToggleButton dspButton = createDspButton(dspType); dspButton.addActionListener(cbActionListener); - if ((Case.getCurrentOpenCase().getCaseType() == Case.CaseType.MULTI_USER_CASE) && dspType.equals(LocalDiskDSProcessor.getType())){ + if ((Case.getCurrentCaseThrows().getCaseType() == Case.CaseType.MULTI_USER_CASE) && dspType.equals(LocalDiskDSProcessor.getType())){ dspButton.setEnabled(false); //disable the button for local disk DSP when this is a multi user case dspButton.setSelected(false); shouldAddMultiUserWarning = true; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java index cb12b2a5f3..feae1ddb6b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddLocalFilesTask.java @@ -87,7 +87,7 @@ class AddLocalFilesTask implements Runnable { List errors = new ArrayList<>(); try { progress.setIndeterminate(true); - FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); LocalFilesDataSource newDataSource = fileManager.addLocalFilesDataSource(deviceId, rootVirtualDirectoryName, "", localFilePaths, new ProgressUpdater()); newDataSources.add(newDataSource); } catch (TskDataException | TskCoreException | NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 765d604ce3..61f54b87af 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -591,7 +591,7 @@ public class Case { */ public static Case getCurrentCase() { try { - return getCurrentOpenCase(); + return getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { /* * Throw a runtime exception, since this is a programming error. @@ -601,18 +601,23 @@ public class Case { } /** - * Gets the current case, if there is one, or throws an exception. This - * method should only be called by methods known to run in threads other - * than threads that close the current case, where the exception provides - * some protection from the consequences of the race condition between the - * calling thread and the case closing thread, although it is not - * fool-proof. + * Gets the current case, if there is one, or throws an exception if there + * is no current case. This method should only be called by methods known to + * run in threads where it is possible that another thread has closed the + * current case. The exception provides some protection from the + * consequences of the race condition between the calling thread and a case + * closing thread, but it is not fool-proof. Background threads calling this + * method should put all operations in an exception firewall with a try and + * catch-all block to handle the possibility of bad timing. + * + * TODO (JIRA-3825): Introduce a reference counting scheme for this get case + * method. * * @return The current case. * * @throws NoCurrentCaseException if there is no current case. */ - public static Case getCurrentOpenCase() throws NoCurrentCaseException { + public static Case getCurrentCaseThrows() throws NoCurrentCaseException { Case openCase = currentCase; if (openCase == null) { throw new NoCurrentCaseException(NbBundle.getMessage(Case.class, "Case.getCurCase.exception.noneOpen")); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java index a55ac143cb..a389aca979 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java @@ -66,7 +66,7 @@ final class CaseDeleteAction extends CallableSystemAction { "# {0} - exception message", "Case.deleteCaseFailureMessageBox.message=Error deleting case: {0}",}) public void actionPerformed(ActionEvent e) { try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); String caseName = currentCase.getName(); String caseDirectory = currentCase.getCaseDirectory(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index 73b61c2c7a..b8542552c4 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -54,7 +54,7 @@ class CaseInformationPanel extends javax.swing.JPanel { }) private void customizeComponents() { try { - propertiesPanel = new CasePropertiesPanel(Case.getCurrentOpenCase()); + propertiesPanel = new CasePropertiesPanel(Case.getCurrentCaseThrows()); } catch (NoCurrentCaseException ex) { Logger.getLogger(CaseInformationPanel.class.getName()).log(Level.INFO, "Exception while getting open case.", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java index b19eca4469..cc3c682830 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CasePropertiesPanel.java @@ -50,7 +50,7 @@ final class CasePropertiesPanel extends javax.swing.JPanel { void updateCaseInfo() { try { - theCase = Case.getCurrentOpenCase(); + theCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java index 2e8d0cff11..2db469e371 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageDSProcessor.java @@ -264,7 +264,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour try { // verify that the image has a file system that TSK can process - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); if (!DataSourceUtils.imageHasFileSystem(dataSourcePath)) { // image does not have a file system that TSK can process return 0; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java index a6e777ccf6..56d5e67839 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java @@ -319,7 +319,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { // Display warning if there is one (but don't disable "next" button) try { - if (false == PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { + if (false == PathValidator.isValid(path, Case.getCurrentCaseThrows().getCaseType())) { pathErrorLabel.setVisible(true); pathErrorLabel.setText(Bundle.ImageFilePanel_pathValidation_dataSourceOnCDriveError()); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index d117e8e12e..3c7d6593db 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -76,7 +76,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel { private void refresh() { try { - SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); List ingestJobs = skCase.getIngestJobs(); this.ingestJobs = ingestJobs; this.repaint(); @@ -116,7 +116,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel { IngestJobInfo currIngestJob = ingestJobs.get(rowIndex); if (columnIndex == 0) { try { - SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); return skCase.getContentById(currIngestJob.getObjectId()).getName(); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get content from db", ex); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index 51be317e5d..fc702076a0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -382,7 +382,7 @@ final class LocalDiskPanel extends JPanel { } private static String getDefaultImageWriterFolder() throws NoCurrentCaseException { - return Paths.get(Case.getCurrentOpenCase().getModuleDirectory(), "Image Writer").toString(); + return Paths.get(Case.getCurrentCaseThrows().getModuleDirectory(), "Image Writer").toString(); } private void setPotentialImageWriterPath(LocalDisk disk) throws NoCurrentCaseException { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java index e344e3a399..1e90777367 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java @@ -198,7 +198,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat command.add("-f"); command.add("files"); command.add("-t"); - File l01Dir = new File(Case.getCurrentOpenCase().getModuleDirectory(), L01_EXTRACTION_DIR); //WJS-TODO change to getOpenCase() when that method exists + File l01Dir = new File(Case.getCurrentCaseThrows().getModuleDirectory(), L01_EXTRACTION_DIR); //WJS-TODO change to getOpenCase() when that method exists if (!l01Dir.exists()) { l01Dir.mkdirs(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java index ba4bb9685a..3ab4088094 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java @@ -283,7 +283,7 @@ final class LocalFilesPanel extends javax.swing.JPanel { errorLabel.setVisible(false); try { - final Case.CaseType currentCaseType = Case.getCurrentOpenCase().getCaseType(); + final Case.CaseType currentCaseType = Case.getCurrentCaseThrows().getCaseType(); for (String currentPath : pathsList) { if (!PathValidator.isValid(currentPath, currentCaseType)) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java index e4b8677426..d38106a0ab 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LogicalEvidenceFilePanel.java @@ -191,7 +191,7 @@ final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements Docum } // display warning if there is one (but don't disable "next" button) try { - if (!PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { + if (!PathValidator.isValid(path, Case.getCurrentCaseThrows().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_dataSourceOnCDriveError()); return false; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index 2f3f947366..2b85a74333 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -91,9 +91,9 @@ final class NewCaseWizardAction extends CallableSystemAction { if (EamDb.isEnabled()) { //if the eam is enabled we need to save the case organization information now EamDb dbManager = EamDb.getInstance(); if (dbManager != null) { - CorrelationCase cRCase = dbManager.getCase(Case.getCurrentOpenCase()); + CorrelationCase cRCase = dbManager.getCase(Case.getCurrentCaseThrows()); if (cRCase == null) { - cRCase = dbManager.newCase(Case.getCurrentOpenCase()); + cRCase = dbManager.newCase(Case.getCurrentCaseThrows()); } if (!organizationName.isEmpty()) { for (EamOrganization org : dbManager.getOrganizations()) { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java index 129aca5a78..4625727d94 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/OptionalCasePropertiesPanel.java @@ -64,7 +64,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { if (editCurrentCase) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -94,7 +94,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { private void setUpOrganizationData() { if (EamDb.isEnabled()) { try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); if (currentCase != null) { EamDb dbManager = EamDb.getInstance(); selectedOrg = dbManager.getCase(currentCase).getOrg(); @@ -567,7 +567,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { private void updateCaseDetails() throws NoCurrentCaseException { if (caseDisplayNameTextField.isVisible()) { try { - Case.getCurrentOpenCase().updateCaseDetails(new CaseDetails( + Case.getCurrentCaseThrows().updateCaseDetails(new CaseDetails( caseDisplayNameTextField.getText(), caseNumberTextField.getText(), examinerTextField.getText(), tfExaminerPhoneText.getText(), tfExaminerEmailText.getText(), taNotesText.getText())); @@ -586,7 +586,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel { if (EamDb.isEnabled()) { try { EamDb dbManager = EamDb.getInstance(); - CorrelationCase correlationCase = dbManager.getCase(Case.getCurrentOpenCase()); + CorrelationCase correlationCase = dbManager.getCase(Case.getCurrentCaseThrows()); if (caseDisplayNameTextField.isVisible()) { correlationCase.setDisplayName(caseDisplayNameTextField.getText()); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java b/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java index ecad0b7450..ccf592ca67 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/RecentCases.java @@ -374,7 +374,7 @@ final class RecentCases extends CallableSystemAction implements Presenter.Menu { int i = 0; String currentCaseName = null; try { - currentCaseName = Case.getCurrentOpenCase().getDisplayName(); + currentCaseName = Case.getCurrentCaseThrows().getDisplayName(); } catch (NoCurrentCaseException ex) { // in case there is no current case. } @@ -407,7 +407,7 @@ final class RecentCases extends CallableSystemAction implements Presenter.Menu { String[] casePaths = new String[LENGTH]; String currentCasePath = null; try { - currentCasePath = Case.getCurrentOpenCase().getMetadata().getFilePath().toString(); + currentCasePath = Case.getCurrentCaseThrows().getMetadata().getFilePath().toString(); } catch (NoCurrentCaseException ex) { /* * There may be no current case. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java index 71a77de147..8c2a2d6dfa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/BlackBoardArtifactTagAddedEvent.java @@ -47,6 +47,6 @@ public class BlackBoardArtifactTagAddedEvent extends TagAddedEvent implements S * @throws TskCoreException */ ContentTag getTagByID() throws NoCurrentCaseException, TskCoreException { - return Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagByTagID(getTagID()); + return Case.getCurrentCaseThrows().getServices().getTagsManager().getContentTagByTagID(getTagID()); } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java index 721d3ac3b5..84a99ee8b2 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/DataSourceAddedEvent.java @@ -79,7 +79,7 @@ public final class DataSourceAddedEvent extends AutopsyEvent implements Serializ } try { long id = (Long) super.getNewValue(); - dataSource = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(id); + dataSource = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(id); return dataSource; } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java index 72947aa170..7f35c625c5 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/ReportAddedEvent.java @@ -70,7 +70,7 @@ public final class ReportAddedEvent extends AutopsyEvent implements Serializable } try { long id = (Long) super.getNewValue(); - List reports = Case.getCurrentOpenCase().getSleuthkitCase().getAllReports(); + List reports = Case.getCurrentCaseThrows().getSleuthkitCase().getAllReports(); for (Report thisReport : reports) { if (thisReport.getId() == id) { report = thisReport; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java index 9e9b671d2e..fb02e7d2d4 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java @@ -297,7 +297,7 @@ final class TagNameDefinition implements Comparable { } setting.append(tagName.toSettingsFormat()); try { - SleuthkitCase caseDb = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase caseDb = Case.getCurrentCaseThrows().getSleuthkitCase(); tagName.saveToCase(caseDb); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java index b65d7ac03f..419a92e8c9 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagOptionsPanel.java @@ -425,7 +425,7 @@ final class TagOptionsPanel extends javax.swing.JPanel implements OptionsPanel { for (String modifiedTagDisplayName : updatedStatusTags) { //if user closes their case after options have been changed but before application of them is complete don't notify try { - Case.getCurrentOpenCase().notifyTagDefinitionChanged(modifiedTagDisplayName); + Case.getCurrentCaseThrows().notifyTagDefinitionChanged(modifiedTagDisplayName); } catch (NoCurrentCaseException ex) { Logger.getLogger(TagOptionsPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java index ef3a61a186..f113a622fe 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java @@ -99,7 +99,7 @@ public class TagsManager implements Closeable { tagDisplayNames.add(tagType.getDisplayName()); }); try { - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); for (TagName tagName : tagsManager.getAllTagNames()) { tagDisplayNames.add(tagName.getDisplayName()); } @@ -340,7 +340,7 @@ public class TagsManager implements Closeable { ContentTag tag; tag = caseDb.addContentTag(content, tagName, comment, beginByteOffset, endByteOffset); try { - Case.getCurrentOpenCase().notifyContentTagAdded(tag); + Case.getCurrentCaseThrows().notifyContentTagAdded(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Added a tag to a closed case", ex); } @@ -358,7 +358,7 @@ public class TagsManager implements Closeable { public void deleteContentTag(ContentTag tag) throws TskCoreException { caseDb.deleteContentTag(tag); try { - Case.getCurrentOpenCase().notifyContentTagDeleted(tag); + Case.getCurrentCaseThrows().notifyContentTagDeleted(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Deleted a tag from a closed case", ex); } @@ -470,7 +470,7 @@ public class TagsManager implements Closeable { public BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException { BlackboardArtifactTag tag = caseDb.addBlackboardArtifactTag(artifact, tagName, comment); try { - Case.getCurrentOpenCase().notifyBlackBoardArtifactTagAdded(tag); + Case.getCurrentCaseThrows().notifyBlackBoardArtifactTagAdded(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Added a tag to a closed case", ex); } @@ -488,7 +488,7 @@ public class TagsManager implements Closeable { public void deleteBlackboardArtifactTag(BlackboardArtifactTag tag) throws TskCoreException { caseDb.deleteBlackboardArtifactTag(tag); try { - Case.getCurrentOpenCase().notifyBlackBoardArtifactTagDeleted(tag); + Case.getCurrentCaseThrows().notifyBlackBoardArtifactTagDeleted(tag); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Deleted a tag from a closed case", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java b/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java index 9da8d804a4..2a86e7c279 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java @@ -169,7 +169,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D private void showCaseDetails(int selectedRowViewIdx) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { JOptionPane.showConfirmDialog(showCaseDetailsMenuItem, Bundle.DataContentViewerOtherCases_noOpenCase_errMsg(), @@ -225,7 +225,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D if (0 != otherCasesTable.getSelectedRowCount()) { Calendar now = Calendar.getInstance(); String fileName = String.format("%1$tY%1$tm%1$te%1$tI%1$tM%1$tS_other_data_sources.csv", now); - CSVFileChooser.setCurrentDirectory(new File(Case.getCurrentOpenCase().getExportDirectory())); + CSVFileChooser.setCurrentDirectory(new File(Case.getCurrentCaseThrows().getExportDirectory())); CSVFileChooser.setSelectedFile(new File(fileName)); CSVFileChooser.setFileFilter(new FileNameExtensionFilter("csv file", "csv")); @@ -434,7 +434,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D private Collection getCorrelatedInstances(CorrelationAttribute corAttr, String dataSourceName, String deviceId) { // @@@ Check exception try { - String caseUUID = Case.getCurrentOpenCase().getName(); + String caseUUID = Case.getCurrentCaseThrows().getName(); EamDb dbManager = EamDb.getInstance(); Collection artifactInstances = dbManager.getArtifactInstancesByTypeValue(corAttr.getCorrelationType(), corAttr.getCorrelationValue()).stream() .filter(artifactInstance -> !artifactInstance.getCorrelationCase().getCaseUUID().equals(caseUUID) @@ -491,7 +491,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D if (af != null) { Content dataSource = af.getDataSource(); dataSourceName = dataSource.getName(); - deviceId = Case.getCurrentOpenCase().getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId(); + deviceId = Case.getCurrentCaseThrows().getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId(); } } catch (TskException | NoCurrentCaseException ex) { // do nothing. diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java index 597826d11e..864bf50923 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java @@ -74,7 +74,7 @@ public class CorrelationDataSource implements Serializable { public static CorrelationDataSource fromTSKDataSource(CorrelationCase correlationCase, Content dataSource) throws EamDbException { Case curCase; try { - curCase = Case.getCurrentOpenCase(); + curCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { throw new EamDbException("Autopsy case is closed"); } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java index 4d6c0675f7..69cad2abef 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java @@ -90,7 +90,7 @@ public class EamArtifactUtil { // if they asked for it, add the instance details associated with this occurance. if (!eamArtifacts.isEmpty() && addInstanceDetails) { try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); AbstractFile bbSourceFile = currentCase.getSleuthkitCase().getAbstractFileById(bbArtifact.getObjectID()); if (null == bbSourceFile) { //@@@ Log this @@ -98,9 +98,9 @@ public class EamArtifactUtil { } // make an instance for the BB source file - CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentOpenCase()); + CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentCaseThrows()); if (null == correlationCase) { - correlationCase = EamDb.getInstance().newCase(Case.getCurrentOpenCase()); + correlationCase = EamDb.getInstance().newCase(Case.getCurrentCaseThrows()); } CorrelationAttributeInstance eamInstance = new CorrelationAttributeInstance( correlationCase, @@ -146,7 +146,7 @@ public class EamArtifactUtil { // Get the associated artifact BlackboardAttribute attribute = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT)); if (attribute != null) { - BlackboardArtifact associatedArtifact = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); + BlackboardArtifact associatedArtifact = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); return EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(correlationType, associatedArtifact); } @@ -254,9 +254,9 @@ public class EamArtifactUtil { try { CorrelationAttribute.Type filesType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); eamArtifact = new CorrelationAttribute(filesType, af.getMd5Hash()); - CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentOpenCase()); + CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentCaseThrows()); if (null == correlationCase) { - correlationCase = EamDb.getInstance().newCase(Case.getCurrentOpenCase()); + correlationCase = EamDb.getInstance().newCase(Case.getCurrentCaseThrows()); } CorrelationAttributeInstance cei = new CorrelationAttributeInstance( correlationCase, diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java index 94457004cb..570f5bca06 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java @@ -163,8 +163,8 @@ final class CaseEventListener implements PropertyChangeListener { try { // Get the remaining tags on the content object - Content content = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(contentID); - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(contentID); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); List tags = tagsManager.getContentTagsByContent(content); if (tags.stream() @@ -244,7 +244,7 @@ final class CaseEventListener implements PropertyChangeListener { } else { //BLACKBOARD_ARTIFACT_TAG_DELETED Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -327,10 +327,10 @@ final class CaseEventListener implements PropertyChangeListener { * that are tagged with the given tag name. */ try { - TagName tagName = Case.getCurrentOpenCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(modifiedTagName); + TagName tagName = Case.getCurrentCaseThrows().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(modifiedTagName); //First update the artifacts //Get all BlackboardArtifactTags with this tag name - List artifactTags = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifactTagsByTagName(tagName); + List artifactTags = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifactTagsByTagName(tagName); for (BlackboardArtifactTag bbTag : artifactTags) { //start with assumption that none of the other tags applied to this Correlation Attribute will prevent it's status from being changed boolean hasTagWithConflictingKnownStatus = false; @@ -346,7 +346,7 @@ final class CaseEventListener implements PropertyChangeListener { } //Get the BlackboardArtifact which this BlackboardArtifactTag has been applied to. BlackboardArtifact bbArtifact = bbTag.getArtifact(); - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); List tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact); //get all tags which are on this blackboard artifact for (BlackboardArtifactTag t : tags) { @@ -374,7 +374,7 @@ final class CaseEventListener implements PropertyChangeListener { } // Next update the files - List fileTags = Case.getCurrentOpenCase().getSleuthkitCase().getContentTagsByTagName(tagName); + List fileTags = Case.getCurrentCaseThrows().getSleuthkitCase().getContentTagsByTagName(tagName); //Get all ContentTags with this tag name for (ContentTag contentTag : fileTags) { //start with assumption that none of the other tags applied to this ContentTag will prevent it's status from being changed @@ -384,7 +384,7 @@ final class CaseEventListener implements PropertyChangeListener { // the status of the file in the central repository if (tagName.getKnownStatus() == TskData.FileKnown.UNKNOWN) { Content content = contentTag.getContent(); - TagsManager tagsManager = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager(); List tags = tagsManager.getContentTagsByContent(content); //get all tags which are on this file for (ContentTag t : tags) { @@ -436,7 +436,7 @@ final class CaseEventListener implements PropertyChangeListener { } Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); return; diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java index 8aee7ef319..46ebe75541 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java @@ -163,7 +163,7 @@ public class IngestEventsListener { tifArtifact.addAttributes(attributes); try { // index the artifact for keyword search - Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); blackboard.indexArtifact(tifArtifact); } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java index 64899be83d..96486a8f5b 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java @@ -94,7 +94,7 @@ final class IngestModule implements FileIngestModule { } try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return ProcessResult.ERROR; @@ -233,7 +233,7 @@ final class IngestModule implements FileIngestModule { } Case autopsyCase; try { - autopsyCase = Case.getCurrentOpenCase(); + autopsyCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); throw new IngestModuleException("Exception while getting open case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java index 089d0a2fa1..2262e6af61 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java @@ -104,7 +104,7 @@ final class AccountDeviceInstanceKey { private static String getDataSourceName(AccountDeviceInstance accountDeviceInstance) { try { - SleuthkitCase db = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase db = Case.getCurrentCaseThrows().getSleuthkitCase(); for (DataSource dataSource : db.getDataSources()) { if (dataSource.getDeviceId().equals(accountDeviceInstance.getDeviceId())) { return db.getContentById(dataSource.getId()).getName(); diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java index 2fbf37d768..a0417855fe 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsBrowser.java @@ -121,7 +121,7 @@ public final class AccountsBrowser extends JPanel implements ExplorerManager.Pro @Subscribe public void handleFilterEvent(CVTEvents.FilterChangeEvent filterChangeEvent) { try { - final CommunicationsManager commsManager = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager(); + final CommunicationsManager commsManager = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager(); accountsTableEM.setRootContext(new AbstractNode(Children.create(new AccountDeviceInstanceNodeFactory(commsManager, filterChangeEvent.getNewFilter()), true))); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "There was an error getting the CommunicationsManager for the current case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 2c941b771f..6cd46fbab4 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -240,7 +240,7 @@ final public class FiltersPanel extends JPanel { */ private void updateDeviceFilter(boolean initialState) { try { - final SleuthkitCase sleuthkitCase = Case.getCurrentOpenCase().getSleuthkitCase(); + final SleuthkitCase sleuthkitCase = Case.getCurrentCaseThrows().getSleuthkitCase(); for (DataSource dataSource : sleuthkitCase.getDataSources()) { String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName(); diff --git a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java index efc5b2b911..8d0743b272 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/VisualizationPanel.java @@ -295,7 +295,7 @@ final public class VisualizationPanel extends JPanel implements Lookup.Provider windowAncestor = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); try { - commsManager = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager(); + commsManager = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager(); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error getting CommunicationsManager for the current case.", ex); } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java index d12ecc99f8..6478114314 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/PListViewer.java @@ -191,7 +191,7 @@ class PListViewer extends javax.swing.JPanel implements FileTypeViewer, Explorer Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { JOptionPane.showMessageDialog(this, "Failed to export plist file.", diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index 65c317269d..250b74f36a 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -319,7 +319,7 @@ class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { // Copy the file to temp folder String tmpDBPathName; try { - tmpDBPathName = Case.getCurrentOpenCase().getTempDirectory() + File.separator + sqliteDbFile.getName(); + tmpDBPathName = Case.getCurrentCaseThrows().getTempDirectory() + File.separator + sqliteDbFile.getName(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Current case has been closed", ex); //NON-NLS MessageNotifyUtil.Message.error(Bundle.SQLiteViewer_errorMessage_noCurrentCase()); @@ -372,7 +372,7 @@ class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { * @param metaFileName name of meta file to look for */ private void findAndCopySQLiteMetaFile(AbstractFile sqliteFile, String metaFileName) throws NoCurrentCaseException, TskCoreException, IOException { - Case openCase = Case.getCurrentOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = openCase.getSleuthkitCase(); Services services = new Services(sleuthkitCase); FileManager fileManager = services.getFileManager(); diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java index e545115b62..6331d67023 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java @@ -184,7 +184,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC */ Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return true; } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 641691bae8..be5176f78a 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -489,7 +489,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C */ Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return true; } @@ -535,7 +535,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C @Override public void propertyChange(PropertyChangeEvent evt) { try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return; } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java index d95c222089..fcd451a4aa 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java @@ -350,7 +350,7 @@ public class DataResultTopComponent extends TopComponent implements DataResult, */ Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return true; } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index f5c046cb63..11e92836ac 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -384,7 +384,7 @@ public class ImageUtils { private static File getCachedThumbnailLocation(long fileID) { return cacheFileMap.computeIfAbsent(fileID, id -> { try { - String cacheDirectory = Case.getCurrentOpenCase().getCacheDirectory(); + String cacheDirectory = Case.getCurrentCaseThrows().getCacheDirectory(); return Paths.get(cacheDirectory, "thumbnails", fileID + ".png").toFile(); //NON-NLS } catch (NoCurrentCaseException e) { LOGGER.log(Level.WARNING, "Could not get cached thumbnail location. No case is open."); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java index 6621f6cab4..1ff258dade 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java @@ -101,7 +101,7 @@ public class VideoUtils { * */ public static File getVideoFileInTempDir(AbstractFile file) throws NoCurrentCaseException { - return Paths.get(Case.getCurrentOpenCase().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); //NON-NLS + return Paths.get(Case.getCurrentCaseThrows().getTempDirectory(), "videos", file.getId() + "." + file.getNameExtension()).toFile(); //NON-NLS } public static boolean isVideoThumbnailSupported(AbstractFile file) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java index d8632e6674..e5bee85c81 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java @@ -264,7 +264,7 @@ public abstract class AbstractAbstractFileNode extends A protected void addTagProperty(Sheet.Set ss) { List tags = new ArrayList<>(); try { - tags.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByContent(content)); + tags.addAll(Case.getCurrentCaseThrows().getServices().getTagsManager().getContentTagsByContent(content)); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get tags for content " + content.getName(), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java index dca42b22cb..b4c34e5da7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java @@ -120,7 +120,7 @@ public abstract class AbstractContentNode extends ContentNode + " AND type = " + TskData.ObjectType.ABSTRACTFILE.getObjectType() + ") AS OBJECT_IDS"; //NON-NLS; - try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery(query)) { + try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCaseThrows().getSleuthkitCase().executeQuery(query)) { ResultSet resultSet = dbQuery.getResultSet(); if(resultSet.next()){ return (0 < resultSet.getInt("count")); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index 6f0fd1306c..d86d91b672 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -266,7 +266,7 @@ public class BlackboardArtifactNode extends AbstractContentNode(NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.name"), NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.displayName"), NO_DESCR, @@ -469,8 +469,8 @@ public class BlackboardArtifactNode extends AbstractContentNode tags = new ArrayList<>(); try { - tags.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact)); - tags.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByContent(associated)); + tags.addAll(Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact)); + tags.addAll(Case.getCurrentCaseThrows().getServices().getTagsManager().getContentTagsByContent(associated)); } catch (TskCoreException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Failed to get tags for artifact " + artifact.getDisplayName(), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java index 698834058a..a0c3597b4d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java @@ -103,7 +103,7 @@ public class DataSourcesNode extends DisplayableItemNode { private void reloadKeys() { try { - currentKeys = Case.getCurrentOpenCase().getDataSources(); + currentKeys = Case.getCurrentCaseThrows().getDataSources(); setKeys(currentKeys); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Error getting data sources: {0}", ex.getMessage()); // NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java index 912c00bb6f..4934d01ec7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java @@ -207,7 +207,7 @@ public class DeletedContent implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); // new file was added // @@@ COULD CHECK If the new file is deleted before notifying... update(); @@ -226,7 +226,7 @@ public class DeletedContent implements AutopsyVisitableItem { * received for a case that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index f617aa53b6..8a2abb019b 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -241,7 +241,7 @@ public class EmailExtracted implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -266,7 +266,7 @@ public class EmailExtracted implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); emailResults.update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index a52a8bb7e4..68f1daf595 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -211,7 +211,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * may be received for a case that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Due to some unresolved issues with how cases are closed, * it is possible for the event to have a null oldValue if @@ -234,7 +234,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * may be received for a case that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { /** @@ -402,7 +402,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -427,7 +427,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java index cfb9ddab95..b807c6575a 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java @@ -202,7 +202,7 @@ public class FileSize implements AutopsyVisitableItem { try { // new file was added // @@@ could check the size here and only fire off updates if we know the file meets the min size criteria - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); update(); } catch (NoCurrentCaseException notUsed) { /** @@ -219,7 +219,7 @@ public class FileSize implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java index 9df3af7a09..3dd3442bbd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByExtension.java @@ -94,7 +94,7 @@ public final class FileTypesByExtension implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); typesRoot.updateShowCounts(); update(); } catch (NoCurrentCaseException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java index 3062a1a1b1..9ae6391ff7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesByMimeType.java @@ -164,7 +164,7 @@ public final class FileTypesByMimeType extends Observable implements AutopsyVisi * already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); typesRoot.updateShowCounts(); populateHashMap(); } catch (NoCurrentCaseException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index 2ae84768bd..a11ec9b0c4 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -209,7 +209,7 @@ public class HashsetHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Due to some unresolved issues with how cases are * closed, it is possible for the event to have a null @@ -233,7 +233,7 @@ public class HashsetHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); hashsetResults.update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index e7c9f9c97e..b2e0aa9ca6 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -171,7 +171,7 @@ public class ImageNode extends AbstractContentNode { Bundle.ImageNode_createSheet_timezone_desc(), this.content.getTimeZone())); - try (CaseDbQuery query = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { + try (CaseDbQuery query = Case.getCurrentCaseThrows().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { ResultSet deviceIdSet = query.getResultSet(); if (deviceIdSet.next()) { ss.put(new NodeProperty<>(Bundle.ImageNode_createSheet_deviceId_name(), diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java index e857ff6760..2cc18aef1f 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java @@ -200,7 +200,7 @@ public class InterestingHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -226,7 +226,7 @@ public class InterestingHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); interestingResults.update(); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index 9a31841570..41a8862bc4 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -412,7 +412,7 @@ public class KeywordHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -435,7 +435,7 @@ public class KeywordHits implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); keywordResults.update(); } catch (NoCurrentCaseException notUsed) { // Case is closed, do nothing. diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java index f635b0da08..b2f7667150 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Reports.java @@ -115,7 +115,7 @@ public final class Reports implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); ReportNodeFactory.this.refresh(true); } catch (NoCurrentCaseException notUsed) { /** @@ -129,7 +129,7 @@ public final class Reports implements AutopsyVisitableItem { @Override protected boolean createKeys(List keys) { try { - keys.addAll(Case.getCurrentOpenCase().getAllReports()); + keys.addAll(Case.getCurrentCaseThrows().getAllReports()); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(Reports.ReportNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get reports", ex); //NON-NLS } @@ -266,7 +266,7 @@ public final class Reports implements AutopsyVisitableItem { NbBundle.getMessage(Reports.class, "DeleteReportAction.actionPerformed.showConfirmDialog.title"), JOptionPane.YES_NO_OPTION)) { try { - Case.getCurrentOpenCase().deleteReports(selectedReportsCollection); + Case.getCurrentCaseThrows().deleteReports(selectedReportsCollection); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(DeleteReportAction.class.getName()).log(Level.SEVERE, "Error deleting reports", ex); // NON-NLS MessageNotifyUtil.Message.error(Bundle.DeleteReportAction_showConfirmDialog_errorMsg()); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java index 7773672c75..832741ddc9 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java @@ -142,7 +142,7 @@ public class Tags implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); tagResults.update(); } catch (NoCurrentCaseException notUsed) { @@ -159,7 +159,7 @@ public class Tags implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); tagResults.update(); } catch (NoCurrentCaseException notUsed) { @@ -196,7 +196,7 @@ public class Tags implements AutopsyVisitableItem { @Override protected boolean createKeys(List keys) { try { - List tagNamesInUse = Case.getCurrentOpenCase().getServices().getTagsManager().getTagNamesInUse(); + List tagNamesInUse = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse(); Collections.sort(tagNamesInUse); keys.addAll(tagNamesInUse); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -243,7 +243,7 @@ public class Tags implements AutopsyVisitableItem { private void updateDisplayName() { long tagsCount = 0; try { - TagsManager tm = Case.getCurrentOpenCase().getServices().getTagsManager(); + TagsManager tm = Case.getCurrentCaseThrows().getServices().getTagsManager(); tagsCount = tm.getContentTagsCountByTagName(tagName); tagsCount += tm.getBlackboardArtifactTagsCountByTagName(tagName); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -348,7 +348,7 @@ public class Tags implements AutopsyVisitableItem { private void updateDisplayName() { long tagsCount = 0; try { - tagsCount = Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName); + tagsCount = Case.getCurrentCaseThrows().getServices().getTagsManager().getContentTagsCountByTagName(tagName); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(ContentTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get content tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } @@ -403,7 +403,7 @@ public class Tags implements AutopsyVisitableItem { protected boolean createKeys(List keys) { // Use the content tags bearing the specified tag name as the keys. try { - keys.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByTagName(tagName)); + keys.addAll(Case.getCurrentCaseThrows().getServices().getTagsManager().getContentTagsByTagName(tagName)); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(ContentTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } @@ -447,7 +447,7 @@ public class Tags implements AutopsyVisitableItem { private void updateDisplayName() { long tagsCount = 0; try { - tagsCount = Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName); + tagsCount = Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(BlackboardArtifactTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get blackboard artifact tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } @@ -502,7 +502,7 @@ public class Tags implements AutopsyVisitableItem { protected boolean createKeys(List keys) { try { // Use the blackboard artifact tags bearing the specified tag name as the keys. - keys.addAll(Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName)); + keys.addAll(Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName)); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java index 9a1ae4297c..6d5efbd558 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java @@ -106,7 +106,7 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode { Bundle.VirtualDirectoryNode_createSheet_size_displayName(), Bundle.VirtualDirectoryNode_createSheet_size_desc(), this.content.getSize())); - try (SleuthkitCase.CaseDbQuery query = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery("SELECT time_zone FROM data_source_info WHERE obj_id = " + this.content.getId())) { + try (SleuthkitCase.CaseDbQuery query = Case.getCurrentCaseThrows().getSleuthkitCase().executeQuery("SELECT time_zone FROM data_source_info WHERE obj_id = " + this.content.getId())) { ResultSet timeZoneSet = query.getResultSet(); if (timeZoneSet.next()) { ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_timezone_name(), @@ -117,7 +117,7 @@ public class VirtualDirectoryNode extends SpecialDirectoryNode { } catch (SQLException | TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get time zone for the following image: " + this.content.getId(), ex); } - try (SleuthkitCase.CaseDbQuery query = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { + try (SleuthkitCase.CaseDbQuery query = Case.getCurrentCaseThrows().getSleuthkitCase().executeQuery("SELECT device_id FROM data_source_info WHERE obj_id = " + this.content.getId());) { ResultSet deviceIdSet = query.getResultSet(); if (deviceIdSet.next()) { ss.put(new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_deviceId_name(), diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java index 702de27090..7ea1795714 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java @@ -238,7 +238,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -262,7 +262,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { // Case is closed, do nothing. @@ -364,7 +364,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -388,7 +388,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { @@ -513,7 +513,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -537,7 +537,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { @@ -647,7 +647,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -671,7 +671,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { @@ -858,7 +858,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); /** * Even with the check above, it is still possible that * the case will be closed in a different thread before @@ -882,7 +882,7 @@ final public class Accounts implements AutopsyVisitableItem { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); refresh(true); } catch (NoCurrentCaseException notUsed) { //NOPMD empy catch clause diff --git a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java index f283a26a66..f8ff559afd 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/AddRawImageTask.java @@ -127,7 +127,7 @@ final class AddRawImageTask implements Runnable { private void addImageToCase(List dataSources, List errorMessages) { SleuthkitCase caseDatabase; try { - caseDatabase = Case.getCurrentOpenCase().getSleuthkitCase(); + caseDatabase = Case.getCurrentCaseThrows().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { errorMessages.add(Bundle.AddRawImageTask_noOpenCase_errMsg()); logger.log(Level.SEVERE, Bundle.AddRawImageTask_noOpenCase_errMsg(), ex); diff --git a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java index 320a6a6880..baf9b15223 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourceprocessors/RawDSInputPanel.java @@ -301,7 +301,7 @@ final class RawDSInputPanel extends JPanel implements DocumentListener { "RawDSInputPanel.noOpenCase.errMsg=Exception while getting open case."}) private void warnIfPathIsInvalid(String path) { try { - if (!PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { + if (!PathValidator.isValid(path, Case.getCurrentCaseThrows().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.RawDSInputPanel_error_text()); } diff --git a/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java b/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java index 57385244df..d50f31e383 100644 --- a/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java +++ b/Core/src/org/sleuthkit/autopsy/diagnostics/PerformancePanel.java @@ -299,7 +299,7 @@ public class PerformancePanel extends javax.swing.JDialog { Case curCase; try { - curCase = Case.getCurrentOpenCase(); + curCase = Case.getCurrentCaseThrows(); } catch (Exception e) { setImgLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text")); setStatusMsg(""); @@ -380,7 +380,7 @@ public class PerformancePanel extends javax.swing.JDialog { Case curCase; try { - curCase = Case.getCurrentOpenCase(); + curCase = Case.getCurrentCaseThrows(); } catch (Exception e) { setFileReadLabel( NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text")); @@ -472,7 +472,7 @@ public class PerformancePanel extends javax.swing.JDialog { Case curCase; try { - curCase = Case.getCurrentOpenCase(); + curCase = Case.getCurrentCaseThrows(); } catch (Exception e) { setDbLabel(NbBundle.getMessage(this.getClass(), "PerformancePanel.label.caseNotOpen.text")); return; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index c431f03b23..5fc6c814fa 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -364,7 +364,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); Case currentCase = null; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { // No open case. } @@ -526,7 +526,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat * sources. */ try { - Case openCase = Case.getCurrentOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); return openCase.hasData() == false; } catch (NoCurrentCaseException ex) { return true; @@ -619,7 +619,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat * already closed. */ try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); // We only need to trigger openCoreWindows() when the // first data source is added. if (currentCase.getDataSources().size() == 1) { diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java index 137fe1224a..3451b073a3 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java @@ -89,7 +89,7 @@ public class ExternalViewerAction extends AbstractAction { // Get the temp folder path of the case Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java index 7392454f35..2f45e44331 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java @@ -101,7 +101,7 @@ public final class ExtractAction extends AbstractAction { private void extractFile(ActionEvent e, AbstractFile selectedFile) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { JOptionPane.showMessageDialog((Component) e.getSource(), Bundle.ExtractAction_noOpenCase_errMsg()); logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS @@ -127,7 +127,7 @@ public final class ExtractAction extends AbstractAction { private void extractFiles(ActionEvent e, Collection selectedFiles) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { JOptionPane.showMessageDialog((Component) e.getSource(), Bundle.ExtractAction_noOpenCase_errMsg()); logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java index b834471d44..b0729d24c6 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExtractUnallocAction.java @@ -121,7 +121,7 @@ final class ExtractUnallocAction extends AbstractAction { } Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { MessageNotifyUtil.Message.info(Bundle.ExtractAction_noOpenCase_errMsg()); return; @@ -611,7 +611,7 @@ final class ExtractUnallocAction extends AbstractAction { this.imageId = img.getId(); this.imageName = img.getName(); this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + 0 + ".dat"; //NON-NLS - this.fileInstance = new File(Case.getCurrentOpenCase().getExportDirectory() + File.separator + this.fileName); + this.fileInstance = new File(Case.getCurrentCaseThrows().getExportDirectory() + File.separator + this.fileName); this.sizeInBytes = calcSizeInBytes(); } @@ -633,7 +633,7 @@ final class ExtractUnallocAction extends AbstractAction { this.imageId = 0; } this.fileName = this.imageName + "-Unalloc-" + this.imageId + "-" + volumeId + ".dat"; //NON-NLS - this.fileInstance = new File(Case.getCurrentOpenCase().getExportDirectory() + File.separator + this.fileName); + this.fileInstance = new File(Case.getCurrentCaseThrows().getExportDirectory() + File.separator + this.fileName); this.layoutFiles = getUnallocFiles(volume); Collections.sort(layoutFiles, new SortObjId()); this.sizeInBytes = calcSizeInBytes(); diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java index 141d609969..c98c59901f 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java @@ -49,7 +49,7 @@ class ViewSourceArtifactAction extends AbstractAction { try { for (BlackboardAttribute attribute : artifact.getAttributes()) { if (attribute.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) { - BlackboardArtifact associatedArtifact = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); + BlackboardArtifact associatedArtifact = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); if (associatedArtifact != null) { dirTree.viewArtifact(associatedArtifact); break; diff --git a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java index 8d2ba6af79..9a1bd96cc7 100644 --- a/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/examples/SampleDataSourceIngestModule.java @@ -77,7 +77,7 @@ class SampleDataSourceIngestModule implements DataSourceIngestModule { try { // Get count of files with .doc extension. - FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); List docFiles = fileManager.findFiles(dataSource, "%.doc"); long fileCount = 0; diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java index 854375448b..048ccd5f79 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java @@ -141,7 +141,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { try { // get the latest case - Case currentCase = Case.getCurrentOpenCase(); // get the most updated case + Case currentCase = Case.getCurrentCaseThrows(); // get the most updated case Set caseTimeZones = currentCase.getTimeZones(); Iterator iterator = caseTimeZones.iterator(); @@ -282,7 +282,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { * that is already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); SwingUtilities.invokeLater(DateSearchFilter.this::updateTimeZoneList); } catch (NoCurrentCaseException notUsed) { /** diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index ee30802b5d..169b36d7ea 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -153,7 +153,7 @@ class FileSearchPanel extends javax.swing.JPanel { String pathText = NbBundle.getMessage(this.getClass(), "FileSearchPanel.search.results.pathText"); // try to get the number of matches first - Case currentCase = Case.getCurrentOpenCase(); // get the most updated case + Case currentCase = Case.getCurrentCaseThrows(); // get the most updated case long totalMatches = 0; List contentList = null; try { diff --git a/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java b/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java index e1178d8104..71404c76e7 100644 --- a/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java +++ b/Core/src/org/sleuthkit/autopsy/imagewriter/ImageWriter.java @@ -83,7 +83,7 @@ class ImageWriter implements PropertyChangeListener{ // null before Image Writer finishes. The user can still elect to wait for image writer // (in ImageWriterService.closeCaseResources) even though the case is closing. try{ - caseDb = Case.getCurrentOpenCase().getSleuthkitCase(); + caseDb = Case.getCurrentCaseThrows().getSleuthkitCase(); } catch (NoCurrentCaseException ex){ logger.log(Level.SEVERE, "Unable to load case. Image writer will be cancelled."); this.isCancelled = true; @@ -152,7 +152,7 @@ class ImageWriter implements PropertyChangeListener{ Image image; try{ - image = Case.getCurrentOpenCase().getSleuthkitCase().getImageById(dataSourceId); + image = Case.getCurrentCaseThrows().getSleuthkitCase().getImageById(dataSourceId); imageHandle = image.getImageHandle(); } catch (NoCurrentCaseException ex){ // This exception means that getOpenCase() failed because no case was open. diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java index 2d301aed09..c59b3f20bf 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java @@ -277,7 +277,7 @@ final class DataSourceIngestJob { Thread.currentThread().interrupt(); } try { - SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); this.addIngestModules(firstStageDataSourceModuleTemplates, IngestModuleType.DATA_SOURCE_LEVEL, skCase); this.addIngestModules(fileIngestModuleTemplates, IngestModuleType.FILE_LEVEL, skCase); this.addIngestModules(secondStageDataSourceModuleTemplates, IngestModuleType.DATA_SOURCE_LEVEL, skCase); @@ -415,7 +415,7 @@ final class DataSourceIngestJob { List errors = startUpIngestPipelines(); if (errors.isEmpty()) { try { - this.ingestJob = Case.getCurrentOpenCase().getSleuthkitCase().addIngestJob(dataSource, NetworkUtils.getLocalHostName(), ingestModules, new Date(this.createTime), new Date(0), IngestJobStatusType.STARTED, ""); + this.ingestJob = Case.getCurrentCaseThrows().getSleuthkitCase().addIngestJob(dataSource, NetworkUtils.getLocalHostName(), ingestModules, new Date(this.createTime), new Date(0), IngestJobStatusType.STARTED, ""); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to add ingest job to database.", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java index 64c7ae1941..8796009f2a 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesCountVisitor.java @@ -47,7 +47,7 @@ final class GetFilesCountVisitor extends ContentVisitor.Default { //case of a real fs, query all files for it SleuthkitCase sc; try { - sc = Case.getCurrentOpenCase().getSleuthkitCase(); + sc = Case.getCurrentCaseThrows().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return 0L; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index b67e7b3318..405157b751 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -98,7 +98,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { this.settings = settings; this.dataSources.addAll(dataSources); try { - SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); ingestJobs.addAll(skCase.getIngestJobs()); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "No open case", ex); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 9ed5a6fd27..28a7c44474 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -191,7 +191,7 @@ public class IngestManager { * only necessary for multi-user cases. */ try { - if (Case.getCurrentOpenCase().getCaseType() != Case.CaseType.MULTI_USER_CASE) { + if (Case.getCurrentCaseThrows().getCaseType() != Case.CaseType.MULTI_USER_CASE) { return; } } catch (NoCurrentCaseException noCaseOpenException) { @@ -252,7 +252,7 @@ public class IngestManager { caseIsOpen = true; clearIngestMessageBox(); try { - Case openedCase = Case.getCurrentOpenCase(); + Case openedCase = Case.getCurrentCaseThrows(); String channelPrefix = openedCase.getName(); if (Case.CaseType.MULTI_USER_CASE == openedCase.getCaseType()) { jobEventPublisher.openRemoteEventChannel(String.format(INGEST_JOB_EVENT_CHANNEL_NAME, channelPrefix)); @@ -369,7 +369,7 @@ public class IngestManager { List errors = null; Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return new IngestJobStartResult(null, new IngestManagerException("Exception while getting open case.", ex), Collections.emptyList()); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java index 3be012765c..17645ccb68 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java @@ -248,7 +248,7 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { long objId = artifact.getObjectID(); AbstractFile file = null; try { - file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(objId); + file = Case.getCurrentCaseThrows().getSleuthkitCase().getAbstractFileById(objId); } catch (TskException | NoCurrentCaseException ex) { } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index 842b7474f7..16fa63554d 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -145,7 +145,7 @@ public final class IngestMonitor { */ private void findRootDirectoryForCurrentCase() { try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); findRootDirectoryForCurrentCase(currentCase); } catch (NoCurrentCaseException unused) { /* diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java index 43c82ac686..01e86823c5 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -63,7 +63,7 @@ public final class IngestServices { * @throws NoCurrentCaseException if there is no open case. */ public Case getCase() throws NoCurrentCaseException { - return Case.getCurrentOpenCase(); + return Case.getCurrentCaseThrows(); } /** @@ -74,7 +74,7 @@ public final class IngestServices { * @throws NoCurrentCaseException if there is no open case. */ public SleuthkitCase getCaseDatabase() throws NoCurrentCaseException { - return Case.getCurrentOpenCase().getSleuthkitCase(); + return Case.getCurrentCaseThrows().getSleuthkitCase(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java index d5e0b36703..d18faeee7b 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestAction.java @@ -84,7 +84,7 @@ public final class RunIngestAction extends CallableSystemAction implements Prese @Override public boolean isEnabled() { try { - Case openCase = Case.getCurrentOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); return openCase.hasData(); } catch (NoCurrentCaseException ex) { return false; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java index b8d18e4288..c03abd577b 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/RunIngestSubMenu.java @@ -49,7 +49,7 @@ final class RunIngestSubMenu extends JMenuItem implements DynamicMenuContent { List dataSources = new ArrayList<>(); try { - dataSources = Case.getCurrentOpenCase().getDataSources(); + dataSources = Case.getCurrentCaseThrows().getDataSources(); } catch (IllegalStateException ex) { // No open Cases, create a disabled empty menu return getEmpty(); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java index d8055f05a6..7d57b420ab 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java @@ -94,7 +94,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa SerializableEventData data = (SerializableEventData) super.getOldValue(); Collection artifacts = new ArrayList<>(); for (Long id : data.artifactIds) { - artifacts.add(Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(id)); + artifacts.add(Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifact(id)); } eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null); return eventData; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java index 4d555147a1..fbb842d9d2 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/ContentChangedEvent.java @@ -86,7 +86,7 @@ public final class ContentChangedEvent extends AutopsyEvent implements Serializa } try { SerializableEventData data = (SerializableEventData) super.getOldValue(); - Content content = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(data.contentId); + Content content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(data.contentId); eventData = new ModuleContentEvent(data.moduleName, content); return eventData; } catch (NoCurrentCaseException | TskCoreException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java index d3b4c6277d..fb7d2f2f56 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/DataSourceAnalysisEvent.java @@ -97,7 +97,7 @@ public abstract class DataSourceAnalysisEvent extends AutopsyEvent implements Se } try { long id = (Long) super.getNewValue(); - dataSource = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(id); + dataSource = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(id); return dataSource; } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java index 0c8f7f5b7c..42488c69de 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/FileAnalyzedEvent.java @@ -77,7 +77,7 @@ public final class FileAnalyzedEvent extends AutopsyEvent implements Serializabl } try { long id = (Long) super.getOldValue(); - file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(id); + file = Case.getCurrentCaseThrows().getSleuthkitCase().getAbstractFileById(id); return file; } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java b/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java index 8bb509fc27..b025cebf79 100644 --- a/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java +++ b/Core/src/org/sleuthkit/autopsy/menuactions/DataContentDynamicMenu.java @@ -52,7 +52,7 @@ class DataContentDynamicMenu extends JMenuItem implements DynamicMenuContent { defaultItem.addActionListener(new OpenTopComponentAction(contentWin)); try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); defaultItem.setEnabled(currentCase.hasData()); } catch (NoCurrentCaseException ex) { defaultItem.setEnabled(false); // disable the menu when no case is opened diff --git a/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java b/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java index a196d25d9e..8dac009bf0 100644 --- a/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java +++ b/Core/src/org/sleuthkit/autopsy/menuactions/DataExplorerDynamicMenu.java @@ -55,7 +55,7 @@ class DataExplorerDynamicMenu extends JMenuItem implements DynamicMenuContent { item.addActionListener(new OpenTopComponentAction(explorerWin)); try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); item.setEnabled(currentCase.hasData()); } catch (NoCurrentCaseException ex) { item.setEnabled(false); // disable the menu when no case is opened diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java index a906cb84a5..5e67e9da8b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java @@ -67,7 +67,7 @@ public final class EmbeddedFileExtractorIngestModule extends FileIngestModuleAda * is used to write the extracted (derived) files to local storage. */ try { - final Case currentCase = Case.getCurrentOpenCase(); + final Case currentCase = Case.getCurrentCaseThrows(); moduleDirRelative = Paths.get(currentCase.getModuleOutputDirectoryRelativePath(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); moduleDirAbsolute = Paths.get(currentCase.getModuleDirectory(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java index 27c927279c..722f211951 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/ExtractArchiveWithPasswordAction.java @@ -111,8 +111,8 @@ public class ExtractArchiveWithPasswordAction extends AbstractAction { protected Boolean doInBackground() { boolean done = false; try { - String moduleDirRelative = Paths.get(Case.getCurrentOpenCase().getModuleOutputDirectoryRelativePath(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); - String moduleDirAbsolute = Paths.get(Case.getCurrentOpenCase().getModuleDirectory(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); + String moduleDirRelative = Paths.get(Case.getCurrentCaseThrows().getModuleOutputDirectoryRelativePath(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); + String moduleDirAbsolute = Paths.get(Case.getCurrentCaseThrows().getModuleDirectory(), EmbeddedFileExtractorModuleFactory.getModuleName()).toString(); /* * Construct a file type detector. */ diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java index 968e47a6b7..b123197f0a 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/MSOfficeEmbeddedContentExtractor.java @@ -118,7 +118,7 @@ class MSOfficeEmbeddedContentExtractor { MSOfficeEmbeddedContentExtractor(IngestJobContext context, FileTypeDetector fileTypeDetector, String moduleDirRelative, String moduleDirAbsolute) throws NoCurrentCaseException { - this.fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + this.fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); this.services = IngestServices.getInstance(); this.context = context; this.fileTypeDetector = fileTypeDetector; diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index a3799672c6..d09c170110 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -284,7 +284,7 @@ class SevenZipExtractor { //check if already has derived files, skip //check if local unpacked dir exists if (archiveFile.hasChildren() && new File(moduleDirAbsolute, EmbeddedFileExtractorIngestModule.getUniqueName(archiveFile)).exists()) { - return Case.getCurrentOpenCase().getServices().getFileManager().findFilesByParentPath(getRootArchiveId(archiveFile), archiveFilePath); + return Case.getCurrentCaseThrows().getServices().getFileManager().findFilesByParentPath(getRootArchiveId(archiveFile), archiveFilePath); } return new ArrayList<>(); } @@ -494,7 +494,7 @@ class SevenZipExtractor { final long archiveId = archiveFile.getId(); SevenZipExtractor.ArchiveDepthCountTree.Archive parentAr = null; try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS unpackSuccessful = false; @@ -997,7 +997,7 @@ class SevenZipExtractor { * files for the entire hierarchy */ void updateOrAddFileToCaseRec(HashMap statusMap, String archiveFilePath) throws TskCoreException, NoCurrentCaseException { - final FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + final FileManager fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); for (UnpackedNode child : rootNode.children) { updateOrAddFileToCaseRec(child, fileManager, statusMap, archiveFilePath); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java index 14302d2014..889a489baf 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java @@ -88,7 +88,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException { try { validateSettings(); - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { throw new IngestModule.IngestModuleException("Failed to create file type detector", ex); diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index 1f689d7d05..b0894cbdd9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -104,7 +104,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule { @Override public ProcessResult process(AbstractFile content) { try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.INFO, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index d6174bfab4..6f2281c45d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -110,7 +110,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { @Messages({"FileExtMismatchIngestModule.indexError.message=Failed to index file extension mismatch artifact for keyword search."}) public ProcessResult process(AbstractFile abstractFile) { try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index e984acbde6..e342f06bbf 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -156,7 +156,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { attributes.add(ruleNameAttribute); artifact.addAttributes(attributes); try { - Case.getCurrentOpenCase().getServices().getBlackboard().indexArtifact(artifact); + Case.getCurrentCaseThrows().getServices().getBlackboard().indexArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java index 6c2bbf26fe..f4a08e3f72 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java @@ -90,7 +90,7 @@ public class HashDbIngestModule implements FileIngestModule { HashDbIngestModule(HashLookupModuleSettings settings) throws NoCurrentCaseException { this.settings = settings; - skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); } @Override @@ -147,7 +147,7 @@ public class HashDbIngestModule implements FileIngestModule { @Override public ProcessResult process(AbstractFile file) { try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java index 6286f52b73..91d1d08e36 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearcher.java @@ -46,7 +46,7 @@ class HashDbSearcher { * @return a List of all FsContent with the given hash */ static List findFilesByMd5(String md5Hash) throws NoCurrentCaseException { - final Case currentCase = Case.getCurrentOpenCase(); + final Case currentCase = Case.getCurrentCaseThrows(); final SleuthkitCase skCase = currentCase.getSleuthkitCase(); return skCase.findFilesByMd5(md5Hash); } @@ -123,7 +123,7 @@ class HashDbSearcher { * @return true if the search feature is ready. */ static boolean allFilesMd5Hashed() throws NoCurrentCaseException { - final Case currentCase = Case.getCurrentOpenCase(); + final Case currentCase = Case.getCurrentCaseThrows(); final SleuthkitCase skCase = currentCase.getSleuthkitCase(); return skCase.allFilesMd5Hashed(); } @@ -134,7 +134,7 @@ class HashDbSearcher { * @return the number of files with an MD5 */ static int countFilesMd5Hashed() throws NoCurrentCaseException { - final Case currentCase = Case.getCurrentOpenCase(); + final Case currentCase = Case.getCurrentCaseThrows(); final SleuthkitCase skCase = currentCase.getSleuthkitCase(); return skCase.countFilesMd5Hashed(); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java index 9ca636bdc9..ec8c84dc0b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java @@ -65,7 +65,7 @@ final class CallLogAnalyzer { public void findCallLogs(IngestJobContext context) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -80,7 +80,7 @@ final class CallLogAnalyzer { } for (AbstractFile file : absFiles) { try { - jFile = new java.io.File(Case.getCurrentOpenCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); + jFile = new java.io.File(Case.getCurrentCaseThrows().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); dbPath = jFile.toString(); //path of file as string fileId = file.getId(); ContentUtils.writeToFile(file, jFile, context::dataSourceIngestIsCancelled); @@ -117,7 +117,7 @@ final class CallLogAnalyzer { Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java index 3a33b6d6fe..1adb60d4dd 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java @@ -71,7 +71,7 @@ final class ContactAnalyzer { public void findContacts(IngestJobContext context) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -116,7 +116,7 @@ final class ContactAnalyzer { } Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java index 5256dba188..c6288f0933 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java @@ -68,7 +68,7 @@ class TextMessageAnalyzer { void findTexts(IngestJobContext context) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -82,7 +82,7 @@ class TextMessageAnalyzer { } for (AbstractFile file : absFiles) { try { - jFile = new java.io.File(Case.getCurrentOpenCase().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); + jFile = new java.io.File(Case.getCurrentCaseThrows().getTempDirectory(), file.getName().replaceAll("[<>%|\"/:*\\\\]", "")); dbPath = jFile.toString(); //path of file as string fileId = file.getId(); ContentUtils.writeToFile(file, jFile, context::dataSourceIngestIsCancelled); @@ -112,7 +112,7 @@ class TextMessageAnalyzer { } Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java index ed3083fcea..88eea65dda 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java @@ -107,7 +107,7 @@ final class FilesIdentifierIngestModule implements FileIngestModule { @Messages({"FilesIdentifierIngestModule.indexError.message=Failed to index interesting file hit artifact for keyword search."}) public ProcessResult process(AbstractFile file) { try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return ProcessResult.ERROR; diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java index 41f33020f6..e98e15a331 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java @@ -427,7 +427,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule { synchronized Path createModuleOutputDirectoryForCase() throws IngestModule.IngestModuleException { Path path; try { - path = Paths.get(Case.getCurrentOpenCase().getModuleDirectory(), PhotoRecCarverIngestModuleFactory.getModuleName()); + path = Paths.get(Case.getCurrentCaseThrows().getModuleDirectory(), PhotoRecCarverIngestModuleFactory.getModuleName()); } catch (NoCurrentCaseException ex) { throw new IngestModule.IngestModuleException(Bundle.cannotCreateOutputDir_message(ex.getLocalizedMessage()), ex); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java index a30dba3c4e..967a3c41ab 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverOutputParser.java @@ -100,7 +100,7 @@ class PhotoRecCarverOutputParser { NodeList fileRanges; Element entry; Path filePath; - FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); // create and initialize the list to put into the database List carvedFiles = new ArrayList<>(); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java index b234e98e86..35bfd82eff 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAccountObj.java @@ -105,7 +105,7 @@ class EvalAccountObj extends EvaluatableObject { try { List finalHits = new ArrayList(); - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_OS_ACCOUNT); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java index 5dec0ed7c6..b37f9dd304 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalAddressObj.java @@ -57,7 +57,7 @@ class EvalAddressObj extends EvaluatableObject { Case case1; try { - case1 = Case.getCurrentOpenCase(); + case1 = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case.", //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java index fcb52141a8..e57ac8e067 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalDomainObj.java @@ -55,7 +55,7 @@ class EvalDomainObj extends EvaluatableObject { Case case1; try { - case1 = Case.getCurrentOpenCase(); + case1 = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case.", //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java index d0064ba5b8..c5b3bae881 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalFileObj.java @@ -62,7 +62,7 @@ class EvalFileObj extends EvaluatableObject { Case case1; try { - case1 = Case.getCurrentOpenCase(); + case1 = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case.", //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java index a82ce9ea7f..7e6fa7c7b1 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalNetworkShareObj.java @@ -89,7 +89,7 @@ class EvalNetworkShareObj extends EvaluatableObject { try { List finalHits = new ArrayList(); - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_REMOTE_DRIVE); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java index 45ddd3f8bf..b5a4662ec6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalRegistryObj.java @@ -348,7 +348,7 @@ class EvalRegistryObj extends EvaluatableObject { // Make the temp directory String tmpDir; try { - tmpDir = Case.getCurrentOpenCase().getTempDirectory() + File.separator + "STIX"; //NON-NLS + tmpDir = Case.getCurrentCaseThrows().getTempDirectory() + File.separator + "STIX"; //NON-NLS } catch (NoCurrentCaseException ex) { throw new TskCoreException(ex.getLocalizedMessage()); } @@ -385,7 +385,7 @@ class EvalRegistryObj extends EvaluatableObject { List registryFiles = new ArrayList(); Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { throw new TskCoreException(ex.getLocalizedMessage()); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java index 43df781ad1..73a7b1449f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalSystemObj.java @@ -136,7 +136,7 @@ class EvalSystemObj extends EvaluatableObject { setUnsupportedFieldWarnings(); try { - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List osInfoList = OSUtility.getOSInfo(sleuthkitCase); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java index 607d1c2367..0c0ddb6971 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURIObj.java @@ -56,7 +56,7 @@ class EvalURIObj extends EvaluatableObject { Case case1; try { - case1 = Case.getCurrentOpenCase(); + case1 = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return new ObservableResult(id, "Exception while getting open case: " + ex.getLocalizedMessage(), //NON-NLS spacing, ObservableResult.ObservableState.FALSE, null); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java index bac1d40f9a..5cf0b28213 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvalURLHistoryObj.java @@ -139,7 +139,7 @@ class EvalURLHistoryObj extends EvaluatableObject { } try { - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY); @@ -232,7 +232,7 @@ class EvalURLHistoryObj extends EvaluatableObject { // It doesn't seem too useful, but we can just search for the browser name // if there aren't any URL entries try { - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); List artList = sleuthkitCase.getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java b/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java index a4775aac92..1fd7a7bed1 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/EvaluatableObject.java @@ -101,7 +101,7 @@ abstract class EvaluatableObject { List hits = null; try { - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); String[] parts = item.getValue().toString().split("##comma##"); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java index ff00ffc109..5daf23c217 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java @@ -186,7 +186,7 @@ public class STIXReportModule implements GeneralReportModule { // Set the progress bar to done. If any errors occurred along the way, modify // the "complete" message to indicate this. - Case.getCurrentOpenCase().addReport(reportPath, Bundle.STIXReportModule_srcModuleName_text(), ""); + Case.getCurrentCaseThrows().addReport(reportPath, Bundle.STIXReportModule_srcModuleName_text(), ""); if (hadErrors) { progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java index 39642a9cb8..6b0622f630 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java @@ -51,7 +51,7 @@ class StixArtifactData { public StixArtifactData(long a_objId, String a_observableId, String a_objType) { try { - Case case1 = Case.getCurrentOpenCase(); + Case case1 = Case.getCurrentCaseThrows(); SleuthkitCase sleuthkitCase = case1.getSleuthkitCase(); file = sleuthkitCase.getAbstractFileById(a_objId); } catch (TskCoreException | NoCurrentCaseException ex) { @@ -66,7 +66,7 @@ class StixArtifactData { public void createArtifact(String a_title) throws TskCoreException { Blackboard blackboard; try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_noOpenCase_errMsg(), ex.getLocalizedMessage()); diff --git a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java index 10d3dcb9a7..843b07a3d6 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VMExtractorIngestModule.java @@ -81,7 +81,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { this.context = context; long dataSourceObjId = context.getDataSource().getId(); try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); SleuthkitCase caseDb = currentCase.getSleuthkitCase(); DataSource dataSource = caseDb.getDataSource(dataSourceObjId); parentDeviceId = dataSource.getDeviceId(); @@ -234,7 +234,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { List vmFiles = new ArrayList<>(); for (String vmExtension : GeneralFilter.VIRTUAL_MACHINE_EXTS) { String searchString = "%" + vmExtension; // want a search string that looks like this "%.vmdk" - vmFiles.addAll(Case.getCurrentOpenCase().getServices().getFileManager().findFiles(dataSource, searchString)); + vmFiles.addAll(Case.getCurrentCaseThrows().getServices().getFileManager().findFiles(dataSource, searchString)); } return vmFiles; } @@ -275,7 +275,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { * Try to add the virtual machine file to the case as a data source. */ UUID taskId = UUID.randomUUID(); - Case.getCurrentOpenCase().notifyAddingDataSource(taskId); + Case.getCurrentCaseThrows().notifyAddingDataSource(taskId); ImageDSProcessor dataSourceProcessor = new ImageDSProcessor(); AddDataSourceCallback dspCallback = new AddDataSourceCallback(vmFile); synchronized (this) { @@ -291,7 +291,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { * ingest context. */ if (!dspCallback.vmDataSources.isEmpty()) { - Case.getCurrentOpenCase().notifyDataSourceAdded(dspCallback.vmDataSources.get(0), taskId); + Case.getCurrentCaseThrows().notifyDataSourceAdded(dspCallback.vmDataSources.get(0), taskId); List dataSourceContent = new ArrayList<>(dspCallback.vmDataSources); IngestJobSettings ingestJobSettings = new IngestJobSettings(context.getExecutionContext()); for (String warning : ingestJobSettings.getWarnings()) { @@ -302,7 +302,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter { NbBundle.getMessage(this.getClass(), "VMExtractorIngestModule.addedVirtualMachineImage.message", vmFile.toString()))); IngestManager.getInstance().queueIngestJob(dataSourceContent, ingestJobSettings); } else { - Case.getCurrentOpenCase().notifyFailedAddingDataSource(taskId); + Case.getCurrentCaseThrows().notifyFailedAddingDataSource(taskId); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java index fc88f17389..50e9715a16 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java +++ b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java @@ -75,7 +75,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog { BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getLabel(), BlackboardArtifact.ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getDisplayName())); // output is too unstructured for table review - artifactTypes = Case.getCurrentOpenCase().getSleuthkitCase().getArtifactTypesInUse(); + artifactTypes = Case.getCurrentCaseThrows().getSleuthkitCase().getArtifactTypesInUse(); artifactTypes.removeAll(doNotReport); Collections.sort(artifactTypes, new Comparator() { @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java index 1dfef3622a..f96bad446b 100644 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java @@ -72,7 +72,7 @@ class FileReportText implements FileReportModule { if (out != null) { try { out.close(); - Case.getCurrentOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), + Case.getCurrentCaseThrows().addReport(reportPath, NbBundle.getMessage(this.getClass(), "FileReportText.getName.text"), ""); } catch (IOException ex) { logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java index afe551d9ed..4695418117 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java @@ -75,7 +75,7 @@ class ReportBodyFile implements GeneralReportModule { public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { // Start the progress bar and setup the report try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -161,7 +161,7 @@ class ReportBodyFile implements GeneralReportModule { if (out != null) { out.flush(); out.close(); - Case.getCurrentOpenCase().addReport(reportPath, + Case.getCurrentCaseThrows().addReport(reportPath, NbBundle.getMessage(this.getClass(), "ReportBodyFile.generateReport.srcModuleName.text"), ""); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index 7b7907f3bf..3dcc416ef3 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -113,7 +113,7 @@ class ReportExcel implements TableReportModule { try { out = new FileOutputStream(reportPath); wb.write(out); - Case.getCurrentOpenCase().addReport(reportPath, NbBundle.getMessage(this.getClass(), + Case.getCurrentCaseThrows().addReport(reportPath, NbBundle.getMessage(this.getClass(), "ReportExcel.endReport.srcModuleName.text"), ""); } catch (IOException ex) { logger.log(Level.SEVERE, "Failed to write Excel report.", ex); //NON-NLS @@ -305,7 +305,7 @@ class ReportExcel implements TableReportModule { private void writeSummaryWorksheet() { Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index d2b4228f91..aecfe0661a 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -228,7 +228,7 @@ class ReportGenerator { private List getFiles() { List absFiles; try { - SleuthkitCase skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); absFiles = skCase.findAllFilesWhere("meta_type != " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()); //NON-NLS return absFiles; } catch (TskCoreException | NoCurrentCaseException ex) { @@ -253,7 +253,7 @@ class ReportGenerator { private static String createReportDirectory(ReportModule module) throws IOException { Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { throw new IOException("Exception while getting open case.", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index 65ccb6d795..2f0cb5f770 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -104,7 +104,7 @@ class ReportHTML implements TableReportModule { // Refesh the member variables private void refresh() throws NoCurrentCaseException { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); skCase = currentCase.getSleuthkitCase(); dataTypes = new TreeMap<>(); @@ -890,7 +890,7 @@ class ReportHTML implements TableReportModule { String indexFilePath = path + "report.html"; //NON-NLS Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index a286384e19..3a092efc83 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -101,7 +101,7 @@ class ReportKML implements GeneralReportModule { @Override public void generateReport(String baseReportDir, ReportProgressPanel progressPanel) { try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; @@ -387,7 +387,7 @@ class ReportKML implements GeneralReportModule { if (result == ReportProgressPanel.ReportStatus.ERROR) { prependedStatus = "Incomplete "; } - Case.getCurrentOpenCase().addReport(kmlFileFullPath, + Case.getCurrentCaseThrows().addReport(kmlFileFullPath, NbBundle.getMessage(this.getClass(), "ReportKML.genReport.srcModuleName.text"), prependedStatus + NbBundle.getMessage(this.getClass(), "ReportKML.genReport.reportName")); } catch (IOException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java index 1b8d5d585c..98160874c9 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java @@ -98,7 +98,7 @@ final class ReportVisualPanel2 extends JPanel { private void initTags() { List tagNamesInUse; try { - tagNamesInUse = Case.getCurrentOpenCase().getServices().getTagsManager().getTagNamesInUse(); + tagNamesInUse = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse(); } catch (TskCoreException | NoCurrentCaseException ex) { Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS return; @@ -137,7 +137,7 @@ final class ReportVisualPanel2 extends JPanel { private void initArtifactTypes() { try { - Case openCase = Case.getCurrentOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); ArrayList doNotReport = new ArrayList<>(); doNotReport.add(new BlackboardArtifact.Type(BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getTypeID(), BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO.getLabel(), diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 1bcb6fecba..9d5d41c836 100644 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -182,7 +182,7 @@ class TableReportGenerator { String accountDisplayname = accountTypeStr; if (accountTypeStr != null) { try { - Account.Type acctType = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager().getAccountType(accountTypeStr); + Account.Type acctType = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager().getAccountType(accountTypeStr); if (acctType != null) { accountDisplayname = acctType.getDisplayName(); } @@ -268,7 +268,7 @@ class TableReportGenerator { // Get the content tags. List tags; try { - tags = Case.getCurrentOpenCase().getServices().getTagsManager().getAllContentTags(); + tags = Case.getCurrentCaseThrows().getServices().getTagsManager().getAllContentTags(); } catch (TskCoreException | NoCurrentCaseException ex) { errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetContentTags")); logger.log(Level.SEVERE, "failed to get content tags", ex); //NON-NLS @@ -361,7 +361,7 @@ class TableReportGenerator { List tags; try { - tags = Case.getCurrentOpenCase().getServices().getTagsManager().getAllBlackboardArtifactTags(); + tags = Case.getCurrentCaseThrows().getServices().getTagsManager().getAllBlackboardArtifactTags(); } catch (TskCoreException | NoCurrentCaseException ex) { errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBArtifactTags")); logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); //NON-NLS @@ -453,7 +453,7 @@ class TableReportGenerator { private void checkIfTagHasImage(BlackboardArtifactTag artifactTag) { AbstractFile file; try { - file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID()); + file = Case.getCurrentCaseThrows().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID()); } catch (TskCoreException | NoCurrentCaseException ex) { errorList.add( NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.errGetContentFromBBArtifact")); @@ -532,7 +532,7 @@ class TableReportGenerator { String orderByClause; Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { errorList.add(Bundle.ReportGenerator_errList_noOpenCase()); logger.log(Level.SEVERE, "Exception while getting open case: ", ex); //NON-NLS @@ -697,7 +697,7 @@ class TableReportGenerator { String orderByClause; Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { errorList.add(Bundle.ReportGenerator_errList_noOpenCase()); logger.log(Level.SEVERE, "Exception while getting open case: ", ex); //NON-NLS @@ -852,7 +852,7 @@ class TableReportGenerator { this.attributes = attrs; this.tags = tags; try { - this.content = Case.getCurrentOpenCase().getSleuthkitCase().getContentById(artifact.getObjectID()); + this.content = Case.getCurrentCaseThrows().getSleuthkitCase().getContentById(artifact.getObjectID()); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Could not get content from database", ex); } @@ -990,7 +990,7 @@ class TableReportGenerator { HashSet allTags = getTags(); try { - List contentTags = Case.getCurrentOpenCase().getServices().getTagsManager().getContentTagsByContent(content); + List contentTags = Case.getCurrentCaseThrows().getServices().getTagsManager().getContentTagsByContent(content); for (ContentTag ct : contentTags) { String notableString = ct.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : ""; allTags.add(ct.getName().getDisplayName() + notableString); @@ -1026,8 +1026,8 @@ class TableReportGenerator { private List getFilteredArtifacts(BlackboardArtifact.Type type, HashSet tagNamesFilter) { List artifacts = new ArrayList<>(); try { - for (BlackboardArtifact artifact : Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) { - List tags = Case.getCurrentOpenCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact); + for (BlackboardArtifact artifact : Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) { + List tags = Case.getCurrentCaseThrows().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact); HashSet uniqueTagNames = new HashSet<>(); for (BlackboardArtifactTag tag : tags) { String notableString = tag.getName().getKnownStatus() == TskData.FileKnown.BAD ? TagsManager.getNotableTagLabel() : ""; @@ -1037,7 +1037,7 @@ class TableReportGenerator { continue; } try { - artifacts.add(new ArtifactData(artifact, Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardAttributes(artifact), uniqueTagNames)); + artifacts.add(new ArtifactData(artifact, Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardAttributes(artifact), uniqueTagNames)); } catch (TskCoreException ex) { errorList.add(NbBundle.getMessage(this.getClass(), "ReportGenerator.errList.failedGetBBAttribs")); logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); //NON-NLS @@ -1627,7 +1627,7 @@ class TableReportGenerator { + //NON-NLS "WHERE tn.tag_name_id = bat.tag_name_id AND bat.artifact_id = " + artifactId; //NON-NLS - try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentOpenCase().getSleuthkitCase().executeQuery(query)) { + try (SleuthkitCase.CaseDbQuery dbQuery = Case.getCurrentCaseThrows().getSleuthkitCase().executeQuery(query)) { ResultSet tagNameRows = dbQuery.getResultSet(); while (tagNameRows.next()) { uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java index 7829d0eedf..eb8b8a289f 100644 --- a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java +++ b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDb.java @@ -69,7 +69,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule { public void generateReport(String reportPath, ReportProgressPanel progressPanel) { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "No open Case", "Exception while getting open case.", JOptionPane.ERROR_MESSAGE); diff --git a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java index e49c597414..06484468a4 100644 --- a/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/taggedhashes/AddTaggedHashesToHashDbConfigPanel.java @@ -68,7 +68,7 @@ class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel { private void populateTagNameComponents() { // Get the tag names in use for the current case. try { - tagNames = Case.getCurrentOpenCase().getServices().getTagsManager().getTagNamesInUse(); + tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse(); } catch (TskCoreException ex) { Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE); diff --git a/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java b/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java index 9284ae888b..032f7da506 100644 --- a/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java +++ b/Core/src/org/sleuthkit/autopsy/test/CustomArtifactType.java @@ -65,7 +65,7 @@ final class CustomArtifactType { * @throws BlackboardException If there is an error adding any of the types. */ static void addToCaseDatabase() throws Blackboard.BlackboardException, NoCurrentCaseException { - Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); artifactType = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAME, ARTIFACT_DISPLAY_NAME); intAttrType = blackboard.getOrAddAttributeType(INT_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.INTEGER, INT_ATTR_DISPLAY_NAME); doubleAttrType = blackboard.getOrAddAttributeType(DOUBLE_ATTR_TYPE_NAME, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DOUBLE, DOUBLE_ATTR_DISPLAY_NAME); diff --git a/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java b/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java index f4df2242d8..f3232ceb86 100644 --- a/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/test/InterestingArtifactCreatorIngestModule.java @@ -55,7 +55,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt @Override public void startUp(IngestJobContext context) throws IngestModuleException { try { - Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); artifactType = blackboard.getOrAddArtifactType(INT_ARTIFACT_TYPE_NAME, INT_ARTIFACT_DISPLAY_NAME); } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.InterestingArtifactCreatorIngestModule_exceptionMessage_errorCreatingCustomType(), ex); @@ -77,7 +77,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt * type. */ int randomArtIndex = (int) (Math.random() * 3); - Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); BlackboardArtifact.Type artifactTypeBase = blackboard.getOrAddArtifactType(ARTIFACT_TYPE_NAMES[randomArtIndex], ARTIFACT_DISPLAY_NAMES[randomArtIndex]); BlackboardArtifact artifactBase = file.newArtifact(artifactTypeBase.getTypeID()); Collection baseAttributes = new ArrayList<>(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java index 9111b205d0..362853db3b 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/OpenTimelineAction.java @@ -112,7 +112,7 @@ public final class OpenTimelineAction extends CallableSystemAction { "OpenTimeLineAction.msgdlg.text=Could not create timeline, there are no data sources."}) synchronized private void showTimeline(AbstractFile file, BlackboardArtifact artifact) { try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); if (currentCase.hasData() == false) { MessageNotifyUtil.Message.info(Bundle.OpenTimeLineAction_msgdlg_text()); logger.log(Level.INFO, "Could not create timeline, there are no data sources.");// NON-NLS @@ -213,7 +213,7 @@ public final class OpenTimelineAction extends CallableSystemAction { private boolean tooManyFiles() { try { - return FILE_LIMIT < Case.getCurrentOpenCase().getSleuthkitCase().countFilesWhere("1 = 1"); + return FILE_LIMIT < Case.getCurrentCaseThrows().getSleuthkitCase().countFilesWhere("1 = 1"); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Can not open timeline with no case open.", ex); } catch (TskCoreException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java index cd5c7d5ba6..c1cd61e427 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineController.java @@ -950,7 +950,7 @@ public class TimeLineController { * already closed. */ try { - Case.getCurrentOpenCase(); + Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException notUsed) { // Case is closed, do nothing. return; diff --git a/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java b/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java index bf16dc32da..b7fe2de313 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/actions/SaveSnapshotAsReport.java @@ -153,7 +153,7 @@ public class SaveSnapshotAsReport extends Action { try { //add main file as report to case - Case.getCurrentOpenCase().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName); + Case.getCurrentCaseThrows().addReport(reportMainFilePath.toString(), Bundle.Timeline_ModuleName(), reportName); } catch (TskCoreException | NoCurrentCaseException ex) { LOGGER.log(Level.WARNING, "Failed to add " + reportMainFilePath.toString() + " to case as a report", ex); //NON_NLS new Alert(Alert.AlertType.ERROR, Bundle.SaveSnapShotAsReport_FailedToAddReport()).show(); diff --git a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java index d7758c6a8d..71618c3161 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/explorernodes/EventNode.java @@ -223,7 +223,7 @@ public class EventNode extends DisplayableItemNode { */ final SingleEvent eventById = eventsModel.getEventById(eventID); - SleuthkitCase sleuthkitCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase sleuthkitCase = Case.getCurrentCaseThrows().getSleuthkitCase(); AbstractFile file = sleuthkitCase.getAbstractFileById(eventById.getFileID()); if (eventById.getArtifactID().isPresent()) { diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index e8947f1055..99dbd9204d 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -2344,7 +2344,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test creating a case from an Autopsy case // The case may already be in the database - the result is the same either way try { - caseB = EamDb.getInstance().newCase(Case.getCurrentOpenCase()); + caseB = EamDb.getInstance().newCase(Case.getCurrentCaseThrows()); assertTrue("Failed to create correlation case from Autopsy case", caseB != null); } catch (EamDbException | NoCurrentCaseException ex) { Exceptions.printStackTrace(ex); @@ -2413,7 +2413,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting a case from an Autopsy case try { - CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentOpenCase()); + CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentCaseThrows()); assertTrue("getCase returned null for current Autopsy case", tempCase != null); } catch (EamDbException | NoCurrentCaseException ex) { Exceptions.printStackTrace(ex); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java index b52da4a331..940c3d062a 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/IngestFileFiltersTest.java @@ -134,7 +134,7 @@ public class IngestFileFiltersTest extends NbTestCase { FilesSet Files_Dirs_Unalloc_Ingest_Filter = new FilesSet("Filter", "Filter to find all files in dir1.", false, true, rule); try { - Case openCase = Case.getCurrentOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); runIngestJob(openCase.getDataSources(), Files_Dirs_Unalloc_Ingest_Filter); FileManager fileManager = openCase.getServices().getFileManager(); List results = fileManager.findFiles("file.jpg", "dir1"); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java index e25142fd7c..9830cecbe9 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AddArchiveTask.java @@ -100,7 +100,7 @@ class AddArchiveTask implements Runnable { // extract the archive and pass the extracted folder as input try { - Case currentCase = Case.getCurrentOpenCase(); + Case currentCase = Case.getCurrentCaseThrows(); // create folder to extract archive to Path destinationFolder = createDirectoryForFile(archivePath, currentCase.getModuleDirectory()); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java index 263b600d08..e0a5378444 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/ArchiveFilePanel.java @@ -217,7 +217,7 @@ class ArchiveFilePanel extends JPanel implements DocumentListener { // display warning if there is one (but don't disable "next" button) try { - if (false == PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { + if (false == PathValidator.isValid(path, Case.getCurrentCaseThrows().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.DataSourceOnCDriveError_text()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index b078f621d0..2f94ba3bd0 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -2271,7 +2271,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen Thread.sleep(AutoIngestUserPreferences.getSecondsToSleepBetweenCases() * 1000); } currentJob.setCaseDirectoryPath(caseDirectoryPath); - Case caseForJob = Case.getCurrentOpenCase(); + Case caseForJob = Case.getCurrentCaseThrows(); SYS_LOGGER.log(Level.INFO, "Opened case {0} for {1}", new Object[]{caseForJob.getName(), manifest.getFilePath()}); return caseForJob; diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java index a8091c0e2b..399ae574ba 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExportRuleSet.java @@ -375,7 +375,7 @@ final class FileExportRuleSet implements Serializable, Comparable evaluate(long dataSourceId) throws ExportRulesException { try { - SleuthkitCase db = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase db = Case.getCurrentCaseThrows().getSleuthkitCase(); try (SleuthkitCase.CaseDbQuery queryResult = db.executeQuery(getQuery(dataSourceId))) { ResultSet resultSet = queryResult.getResultSet(); List fileIds = new ArrayList<>(); @@ -1063,7 +1063,7 @@ final class FileExportRuleSet implements Serializable, Comparable dataSources) throws FileExportException { SleuthkitCase skCase; try { - skCase = Case.getCurrentOpenCase().getSleuthkitCase(); + skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new FileExportException("Exception while getting open case.", ex); } @@ -341,7 +341,7 @@ final class FileExporter { * storage. */ private void exportFile(Long fileId, List ruleNames, Supplier cancelCheck) throws TskCoreException, IOException, NoCurrentCaseException { - AbstractFile file = Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(fileId); + AbstractFile file = Case.getCurrentCaseThrows().getSleuthkitCase().getAbstractFileById(fileId); if (!shouldExportFile(file)) { return; } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java index 79cee64f07..cea7338f51 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/FileExporterSettingsPanel.java @@ -529,7 +529,7 @@ public final class FileExporterSettingsPanel extends JPanel { void populateArtifacts() { Set artifactTypes = scanRulesForArtifacts(); try { - SleuthkitCase currentCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase currentCase = Case.getCurrentCaseThrows().getSleuthkitCase(); for (BlackboardArtifact.Type type : currentCase.getArtifactTypes()) { artifactTypes.add(type.getTypeName()); } @@ -603,7 +603,7 @@ public final class FileExporterSettingsPanel extends JPanel { Set attributeTypes = scanRulesForAttributes(); try { - SleuthkitCase currentCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase currentCase = Case.getCurrentCaseThrows().getSleuthkitCase(); for (BlackboardAttribute.Type type : currentCase.getAttributeTypes()) { attributeTypes.add(type.getTypeName()); attributeTypeMap.put(type.getTypeName(), type.getValueType()); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java index aa7aeabba6..bcae2b3153 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/AddMemoryImageTask.java @@ -145,7 +145,7 @@ final class AddMemoryImageTask implements Runnable { private Image addImageToCase() throws NoCurrentCaseException, TskCoreException { progressMonitor.setProgressText(Bundle.AddMemoryImageTask_progressMessage_addingImageFile( memoryImagePath)); - SleuthkitCase caseDatabase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase caseDatabase = Case.getCurrentCaseThrows().getSleuthkitCase(); caseDatabase.acquireSingleUserCaseWriteLock(); try { /* diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java index ce51e1121b..a26136fd1a 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/MemoryDSInputPanel.java @@ -421,7 +421,7 @@ final class MemoryDSInputPanel extends JPanel implements DocumentListener { }) private void warnIfPathIsInvalid(String path) { try { - if (!PathValidator.isValid(path, Case.getCurrentOpenCase().getCaseType())) { + if (!PathValidator.isValid(path, Case.getCurrentCaseThrows().getCaseType())) { errorLabel.setVisible(true); errorLabel.setText(Bundle.MemoryDSInputPanel_errorMsg_dataSourcePathOnCdrive()); } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java index a66c760cf0..bff999c810 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java @@ -108,7 +108,7 @@ class VolatilityProcessor { this.errorMsgs.clear(); try { - this.currentCase = Case.getCurrentOpenCase(); + this.currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { throw new VolatilityProcessorException(Bundle.VolatilityProcessor_progressMessage_noCurrentCase(), ex); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index c21b65962e..c8837fa13b 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -194,7 +194,7 @@ public final class ImageGalleryController { stale.set(b); }); try { - new PerCaseProperties(Case.getCurrentOpenCase()).setConfigSetting(ImageGalleryModule.getModuleName(), PerCaseProperties.STALE, b.toString()); + new PerCaseProperties(Case.getCurrentCaseThrows()).setConfigSetting(ImageGalleryModule.getModuleName(), PerCaseProperties.STALE, b.toString()); } catch (NoCurrentCaseException ex) { Logger.getLogger(ImageGalleryController.class.getName()).log(Level.WARNING, "Exception while getting open case."); //NON-NLS } @@ -214,7 +214,7 @@ public final class ImageGalleryController { listeningEnabled.addListener((observable, oldValue, newValue) -> { try { //if we just turned on listening and a case is open and that case is not up to date - if (newValue && !oldValue && ImageGalleryModule.isDrawableDBStale(Case.getCurrentOpenCase())) { + if (newValue && !oldValue && ImageGalleryModule.isDrawableDBStale(Case.getCurrentCaseThrows())) { //populate the db queueDBTask(new CopyAnalyzedFiles(instance, db, sleuthKitCase)); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java index ab559f5dc1..beb2bc0a3d 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryOptionsPanel.java @@ -189,7 +189,7 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { try { if (IngestManager.getInstance().isIngestRunning() == false) { enabledForCaseBox.setEnabled(true); - enabledForCaseBox.setSelected(ImageGalleryModule.isEnabledforCase(Case.getCurrentOpenCase())); + enabledForCaseBox.setSelected(ImageGalleryModule.isEnabledforCase(Case.getCurrentCaseThrows())); } else { enabledForCaseBox.setEnabled(false); enabledForCaseBox.setSelected(enabledByDefaultBox.isSelected()); @@ -204,7 +204,7 @@ final class ImageGalleryOptionsPanel extends javax.swing.JPanel { void store() { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { Logger.getLogger(ImageGalleryOptionsPanel.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS return; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java index 9e665e4f01..efe279bba3 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/DeleteTagAction.java @@ -123,7 +123,7 @@ public class DeleteTagAction extends Action { try { List existingTagsList - = Case.getCurrentOpenCase().getServices().getTagsManager() + = Case.getCurrentCaseThrows().getServices().getTagsManager() .getContentTagsByContent(file); Collection tagNamesList diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java index 359bdf2c57..e10a679792 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/actions/OpenAction.java @@ -109,7 +109,7 @@ public final class OpenAction extends CallableSystemAction { public boolean isEnabled() { Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { return false; } @@ -154,7 +154,7 @@ public final class OpenAction extends CallableSystemAction { //check case final Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return; @@ -188,7 +188,7 @@ public final class OpenAction extends CallableSystemAction { private boolean tooManyFiles() { try { - return FILE_LIMIT < Case.getCurrentOpenCase().getSleuthkitCase().countFilesWhere("1 = 1"); + return FILE_LIMIT < Case.getCurrentCaseThrows().getSleuthkitCase().countFilesWhere("1 = 1"); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Can not open image gallery with no case open.", ex); } catch (TskCoreException ex) { diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java index 620ac5db91..34c9d5a4c5 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/DrawableFile.java @@ -75,7 +75,7 @@ public abstract class DrawableFile { } public static DrawableFile create(Long id, boolean analyzed) throws TskCoreException, NoCurrentCaseException { - return create(Case.getCurrentOpenCase().getSleuthkitCase().getAbstractFileById(id), analyzed); + return create(Case.getCurrentCaseThrows().getSleuthkitCase().getAbstractFileById(id), analyzed); } private SoftReference imageRef; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java index da1003522a..a2724e72da 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ArtifactTextExtractor.java @@ -58,7 +58,7 @@ class ArtifactTextExtractor implements TextExtractor { Case currentCase; try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ignore) { // thorown by Case.getCurrentOpenCase() if currentCase is null return null; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index 18729b07b6..be89109329 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -220,7 +220,7 @@ public class ExtractedContentViewer implements DataContentViewer { BlackboardAttribute attribute = artifact.getAttribute(TSK_ASSOCIATED_ARTIFACT_TYPE); if (attribute != null) { long artifactId = attribute.getValueLong(); - BlackboardArtifact associatedArtifact = Case.getCurrentOpenCase().getSleuthkitCase().getBlackboardArtifact(artifactId); + BlackboardArtifact associatedArtifact = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifact(artifactId); rawArtifactText = new RawText(associatedArtifact, associatedArtifact.getArtifactID()); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java index b3cebcd979..c147618558 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordHit.java @@ -119,7 +119,7 @@ class KeywordHit implements Comparable { // If the hit was in an artifact, look up the source content for the artifact. SleuthkitCase caseDb; try { - caseDb = Case.getCurrentOpenCase().getSleuthkitCase(); + caseDb = Case.getCurrentCaseThrows().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new TskCoreException("Exception while getting open case.", ex); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index c1eb0bb60a..ad16ec4461 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -184,7 +184,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { // if first instance of this module for this job then check the server and existence of keywords Case openCase; try { - openCase = Case.getCurrentOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.KeywordSearchIngestModule_noOpenCase_errMsg(), ex); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java index 061b1c6258..d2676a4ed3 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchResultFactory.java @@ -148,7 +148,7 @@ class KeywordSearchResultFactory extends ChildFactory { } SleuthkitCase tskCase; try { - tskCase = Case.getCurrentOpenCase().getSleuthkitCase(); + tskCase = Case.getCurrentCaseThrows().getSleuthkitCase(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "There was no case open.", ex); //NON-NLS return false; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java index 8ceee79062..e27a01b063 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java @@ -213,7 +213,7 @@ class QueryResults { */ Content content = null; try { - SleuthkitCase tskCase = Case.getCurrentOpenCase().getSleuthkitCase(); + SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase(); content = tskCase.getContentById(hit.getContentID()); } catch (TskCoreException | NoCurrentCaseException tskCoreException) { logger.log(Level.SEVERE, "Failed to get text source object for ", tskCoreException); //NON-NLS diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java index 3ab9d2751e..c679c653eb 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RegexQuery.java @@ -591,7 +591,7 @@ final class RegexQuery implements KeywordSearchQuery { * Create an account instance. */ try { - AccountFileInstance ccAccountInstance = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString() , MODULE_NAME, content); + AccountFileInstance ccAccountInstance = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString() , MODULE_NAME, content); ccAccountInstance.addAttributes(attributes); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java index 7ab63167be..7b3893df98 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermsComponentQuery.java @@ -495,7 +495,7 @@ final class TermsComponentQuery implements KeywordSearchQuery { * Create an account. */ try { - AccountFileInstance ccAccountInstance = Case.getCurrentOpenCase().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content); + AccountFileInstance ccAccountInstance = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content); ccAccountInstance.addAttributes(attributes); } catch (TskCoreException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java index 2a40e4270c..8ec5b79d56 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java @@ -53,7 +53,7 @@ abstract class Extract { final void init() throws IngestModuleException { try { - currentCase = Case.getCurrentOpenCase(); + currentCase = Case.getCurrentCaseThrows(); tskCase = currentCase.getSleuthkitCase(); } catch (NoCurrentCaseException ex) { throw new IngestModuleException(Bundle.Extract_indexError_message(), ex); @@ -126,7 +126,7 @@ abstract class Extract { "Extract.noOpenCase.errMsg=No open case available."}) void indexArtifact(BlackboardArtifact bbart) { try { - Blackboard blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + Blackboard blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); // index the artifact for keyword search blackboard.indexArtifact(bbart); } catch (Blackboard.BlackboardException ex) { diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java index 5b71823731..1af8761144 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java @@ -75,7 +75,7 @@ class ExtractIE extends Extract { ExtractIE() throws NoCurrentCaseException { moduleName = NbBundle.getMessage(ExtractIE.class, "ExtractIE.moduleName.text"); - moduleTempResultsDir = RAImageIngestModule.getRATempPath(Case.getCurrentOpenCase(), "IE") + File.separator + "results"; //NON-NLS + moduleTempResultsDir = RAImageIngestModule.getRATempPath(Case.getCurrentCaseThrows(), "IE") + File.separator + "results"; //NON-NLS JAVA_PATH = PlatformUtil.getJavaPath(); } diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java index a10ad6f9f4..a47d33f22a 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java @@ -193,7 +193,7 @@ class Util { parent_path = parent_path.substring(0, index); List files = null; try { - FileManager fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + FileManager fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); files = fileManager.findFiles(dataSource, name, parent_path); } catch (TskCoreException | NoCurrentCaseException ex) { logger.log(Level.WARNING, "Error fetching 'index.data' files for Internet Explorer history."); //NON-NLS diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java index 77a01139cd..bfa1542ce1 100644 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java @@ -79,7 +79,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { public void startUp(IngestJobContext context) throws IngestModuleException { this.context = context; try { - fileManager = Case.getCurrentOpenCase().getServices().getFileManager(); + fileManager = Case.getCurrentCaseThrows().getServices().getFileManager(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); throw new IngestModuleException(Bundle.ThunderbirdMboxFileIngestModule_noOpenCase_errMsg(), ex); @@ -90,7 +90,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { public ProcessResult process(AbstractFile abstractFile) { try { - blackboard = Case.getCurrentOpenCase().getServices().getBlackboard(); + blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard(); } catch (NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Exception while getting open case.", ex); return ProcessResult.ERROR; @@ -307,7 +307,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { * @return the temporary folder */ static String getTempPath() throws NoCurrentCaseException { - String tmpDir = Case.getCurrentOpenCase().getTempDirectory() + File.separator + String tmpDir = Case.getCurrentCaseThrows().getTempDirectory() + File.separator + "EmailParser"; //NON-NLS File dir = new File(tmpDir); if (dir.exists() == false) { @@ -323,7 +323,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { * @return the module output folder */ static String getModuleOutputPath() throws NoCurrentCaseException { - String outDir = Case.getCurrentOpenCase().getModuleDirectory() + File.separator + String outDir = Case.getCurrentCaseThrows().getModuleDirectory() + File.separator + EmailParserModuleFactory.getModuleName(); File dir = new File(outDir); if (dir.exists() == false) { @@ -339,7 +339,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { * @return the relative path of the module output folder */ static String getRelModuleOutputPath() throws NoCurrentCaseException { - return Case.getCurrentOpenCase().getModuleOutputDirectoryRelativePath() + File.separator + return Case.getCurrentCaseThrows().getModuleOutputDirectoryRelativePath() + File.separator + EmailParserModuleFactory.getModuleName(); } @@ -460,7 +460,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { AccountFileInstance senderAccountInstance = null; - Case openCase = Case.getCurrentOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); if (senderAddressList.size() == 1) { senderAddress = senderAddressList.get(0); From 2c500be5bb10fbb1a4c9922a1c5ef757334b900e Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 7 May 2018 15:17:26 -0400 Subject: [PATCH 40/44] Merge in release 4.7.0 branch --- .../autopsy/healthmonitor/EnterpriseHealthMonitor.java | 2 +- .../EncryptionDetectionDataSourceIngestModule.java | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/healthmonitor/EnterpriseHealthMonitor.java b/Core/src/org/sleuthkit/autopsy/healthmonitor/EnterpriseHealthMonitor.java index 2186dc3be1..2c455c1743 100644 --- a/Core/src/org/sleuthkit/autopsy/healthmonitor/EnterpriseHealthMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/healthmonitor/EnterpriseHealthMonitor.java @@ -338,7 +338,7 @@ public final class EnterpriseHealthMonitor implements PropertyChangeListener { */ private void performDatabaseQuery() throws HealthMonitorException { try { - SleuthkitCase skCase = Case.getOpenCase().getSleuthkitCase(); + SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase(); TimingMetric metric = EnterpriseHealthMonitor.getTimingMetric("Database: getImages query"); List images = skCase.getImages(); diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java index a269b2bdd2..2d288532e2 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java @@ -64,12 +64,8 @@ final class EncryptionDetectionDataSourceIngestModule implements DataSourceInges @Override public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException { - try { - validateSettings(); - blackboard = Case.getOpenCase().getServices().getBlackboard(); - } catch (NoCurrentCaseException ex) { - throw new IngestModule.IngestModuleException("Exception while getting open case.", ex); - } + validateSettings(); + blackboard = Case.getCurrentCase().getServices().getBlackboard(); } @Override From 19dd0a0ca75a2d50df8818de9c8dba975ce0f668 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 7 May 2018 17:43:44 -0400 Subject: [PATCH 41/44] Change project back from RELEASE to DEVELOPMENT --- nbproject/project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbproject/project.properties b/nbproject/project.properties index beb6c09b6f..3cbde84d3e 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -6,8 +6,8 @@ app.name=${branding.token} ### if left unset, version will default to today's date app.version=4.7.0 ### build.type must be one of: DEVELOPMENT, RELEASE -build.type=RELEASE -#build.type=DEVELOPMENT +#build.type=RELEASE +build.type=DEVELOPMENT project.org.netbeans.progress=org-netbeans-api-progress project.org.sleuthkit.autopsy.experimental=Experimental From bc00fc95fd754d91ab07f6391c64a27dc0afe13c Mon Sep 17 00:00:00 2001 From: Andrew Ziehl Date: Mon, 7 May 2018 12:44:39 -0700 Subject: [PATCH 42/44] Fix for postgres String handling of mime_type query --- .../autopsy/commonfilesearch/CommonFilesMetadataBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesMetadataBuilder.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesMetadataBuilder.java index 339763fd4e..2d279179ee 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesMetadataBuilder.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/CommonFilesMetadataBuilder.java @@ -225,7 +225,7 @@ abstract class CommonFilesMetadataBuilder { StringBuilder mimeTypeFilter = new StringBuilder(mimeTypesToFilterOn.size()); if (!mimeTypesToFilterOn.isEmpty()) { for (String mimeType : mimeTypesToFilterOn) { - mimeTypeFilter.append('"').append(mimeType).append("\","); + mimeTypeFilter.append("'").append(mimeType).append("',"); } mimeTypeString = mimeTypeFilter.toString().substring(0, mimeTypeFilter.length() - 1); mimeTypeString = String.format(filterByMimeTypesWhereClause, new Object[]{mimeTypeString}); From a06cfb3c0c1e57c761220a681ab6146f9f0294c1 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 8 May 2018 16:22:06 -0400 Subject: [PATCH 43/44] Fix merge error, updating getOpenCase to getCurrentCaseThrows in encryption detection test --- .../modules/encryptiondetection/EncryptionDetectionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java index b1963c3fd0..41844fb62f 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionTest.java @@ -77,7 +77,7 @@ public class EncryptionDetectionTest extends NbTestCase { */ public void testPasswordProtection() { try { - Case openCase = Case.getOpenCase(); + Case openCase = Case.getCurrentCaseThrows(); /* * Create ingest job settings. From 650de5096967dab96b3ea0b1b3545dfab7bd70ba Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 8 May 2018 16:37:34 -0400 Subject: [PATCH 44/44] fix additional test related merge refactoring issues --- .../src/org/sleuthkit/autopsy/ingest/EmbeddedFileTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/EmbeddedFileTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/EmbeddedFileTest.java index 36ecd56d8f..663a49a666 100755 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/EmbeddedFileTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/ingest/EmbeddedFileTest.java @@ -61,12 +61,12 @@ public class EmbeddedFileTest extends NbTestCase { @Override public void setUp() { - CaseUtils.createCase(CASE_DIRECTORY_PATH); + CaseUtils.createCase(CASE_DIRECTORY_PATH, "EmbeddedFileTest"); ImageDSProcessor dataSourceProcessor = new ImageDSProcessor(); IngestUtils.addDataSource(dataSourceProcessor, IMAGE_PATH); try { - openCase = Case.getOpenCase(); + openCase = Case.getCurrentCaseThrows(); } catch (NoCurrentCaseException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex);