19 package org.sleuthkit.autopsy.casemodule;
22 import com.google.common.annotations.Beta;
23 import com.google.common.eventbus.Subscribe;
24 import com.google.common.util.concurrent.ThreadFactoryBuilder;
26 import java.awt.Frame;
27 import java.awt.event.ActionEvent;
28 import java.awt.event.ActionListener;
29 import java.beans.PropertyChangeListener;
30 import java.beans.PropertyChangeSupport;
32 import java.nio.file.InvalidPathException;
33 import java.nio.file.Path;
34 import java.nio.file.Paths;
35 import java.sql.Connection;
36 import java.sql.DriverManager;
37 import java.sql.ResultSet;
38 import java.sql.SQLException;
39 import java.sql.Statement;
40 import java.text.SimpleDateFormat;
41 import java.util.Collection;
42 import java.util.Date;
43 import java.util.HashMap;
44 import java.util.HashSet;
45 import java.util.List;
48 import java.util.TimeZone;
49 import java.util.UUID;
50 import java.util.concurrent.CancellationException;
51 import java.util.concurrent.ExecutionException;
52 import java.util.concurrent.ExecutorService;
53 import java.util.concurrent.Executors;
54 import java.util.concurrent.Future;
55 import java.util.concurrent.ThreadFactory;
56 import java.util.concurrent.TimeUnit;
57 import java.util.logging.Level;
58 import java.util.stream.Collectors;
59 import java.util.stream.Stream;
60 import javax.annotation.concurrent.GuardedBy;
61 import javax.annotation.concurrent.ThreadSafe;
62 import javax.swing.JOptionPane;
63 import javax.swing.SwingUtilities;
64 import org.openide.util.Lookup;
65 import org.openide.util.NbBundle;
66 import org.openide.util.NbBundle.Messages;
67 import org.openide.util.actions.CallableSystemAction;
68 import org.openide.windows.WindowManager;
137 import org.
sleuthkit.datamodel.TskUnsupportedSchemaVersionException;
163 = Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder().setNameFormat(
"case-open-file-systems-%d").build());
180 WindowManager.getDefault().invokeWhenUIReady(() -> {
181 mainFrame = WindowManager.getDefault().getMainWindow();
203 if (typeName != null) {
205 if (typeName.equalsIgnoreCase(c.toString())) {
229 "Case_caseType_singleUser=Single-user case",
230 "Case_caseType_multiUser=Multi-user case"
233 if (fromString(typeName) == SINGLE_USER_CASE) {
234 return Bundle.Case_caseType_singleUser();
236 return Bundle.Case_caseType_multiUser();
246 this.typeName = typeName;
261 return (otherTypeName == null) ?
false : typeName.equals(otherTypeName);
428 @SuppressWarnings(
"deprecation")
431 for (BlackboardArtifact.Type artifactType : event.getArtifactTypes()) {
441 event.getModuleName(),
443 event.getArtifacts(artifactType)));
456 .map(Events::toString)
457 .collect(Collectors.toSet()), listener);
468 .map(Events::toString)
469 .collect(Collectors.toSet()), listener);
492 eventTypes.forEach((
Events event) -> {
537 eventTypes.forEach((
Events event) -> {
551 return !(caseName.contains(
"\\") || caseName.contains(
"/") || caseName.contains(
":")
552 || caseName.contains(
"*") || caseName.contains(
"?") || caseName.contains(
"\"")
553 || caseName.contains(
"<") || caseName.contains(
">") || caseName.contains(
"|"));
605 "Case.exceptionMessage.emptyCaseName=Must specify a case name.",
606 "Case.exceptionMessage.emptyCaseDir=Must specify a case directory path."
610 throw new CaseActionException(Bundle.Case_exceptionMessage_emptyCaseName());
612 if (caseDir.isEmpty()) {
613 throw new CaseActionException(Bundle.Case_exceptionMessage_emptyCaseDir());
632 "# {0} - exception message",
"Case.exceptionMessage.failedToReadMetadata=Failed to read case metadata:\n{0}.",
633 "Case.exceptionMessage.cannotOpenMultiUserCaseNoSettings=Multi-user settings are missing (see Tools, Options, Multi-user tab), cannot open a multi-user case."
638 metadata =
new CaseMetadata(Paths.get(caseMetadataFilePath));
640 throw new CaseActionException(Bundle.Case_exceptionMessage_failedToReadMetadata(ex.getLocalizedMessage()), ex);
643 throw new CaseActionException(Bundle.Case_exceptionMessage_cannotOpenMultiUserCaseNoSettings());
654 return currentCase != null;
671 throw new IllegalStateException(NbBundle.getMessage(
Case.class,
"Case.getCurCase.exception.noneOpen"), ex);
695 if (openCase == null) {
696 throw new NoCurrentCaseException(NbBundle.getMessage(
Case.class,
"Case.getCurCase.exception.noneOpen"));
711 "# {0} - exception message",
"Case.closeException.couldNotCloseCase=Error closing case: {0}",
712 "Case.progressIndicatorTitle.closingCase=Closing Case"
716 if (null == currentCase) {
722 logger.log(Level.INFO,
"Closing current case {0} ({1}) in {2}",
new Object[]{closedCase.getDisplayName(), closedCase.getName(), closedCase.getCaseDirectory()});
725 logger.log(Level.INFO,
"Closed current case {0} ({1}) in {2}",
new Object[]{closedCase.getDisplayName(), closedCase.getName(), closedCase.getCaseDirectory()});
726 }
catch (CaseActionException ex) {
747 if (null == currentCase) {
767 "Case.progressIndicatorTitle.deletingDataSource=Removing Data Source"
769 static void deleteDataSourceFromCurrentCase(Long dataSourceObjectID)
throws CaseActionException {
771 if (null == currentCase) {
778 CaseMetadata caseMetadata = currentCase.getMetadata();
786 Case theCase =
new Case(caseMetadata);
787 theCase.doOpenCaseAction(Bundle.Case_progressIndicatorTitle_deletingDataSource(), theCase::deleteDataSource, CaseLockType.EXCLUSIVE,
false, dataSourceObjectID);
808 "Case.progressIndicatorTitle.deletingCase=Deleting Case",
809 "Case.exceptionMessage.cannotDeleteCurrentCase=Cannot delete current case, it must be closed first.",
810 "# {0} - case display name",
"Case.exceptionMessage.deletionInterrupted=Deletion of the case {0} was cancelled."
814 if (null != currentCase) {
815 throw new CaseActionException(Bundle.Case_exceptionMessage_cannotDeleteCurrentCase());
825 progressIndicator.
start(Bundle.Case_progressMessage_preparing());
832 }
catch (InterruptedException ex) {
838 throw new CaseActionException(Bundle.Case_exceptionMessage_deletionInterrupted(metadata.
getCaseDisplayName()), ex);
842 progressIndicator.
finish();
857 "Case.progressIndicatorTitle.creatingCase=Creating Case",
858 "Case.progressIndicatorTitle.openingCase=Opening Case",
859 "Case.exceptionMessage.cannotLocateMainWindow=Cannot locate main application window"
863 if (null != currentCase) {
866 }
catch (CaseActionException ex) {
875 logger.log(Level.INFO,
"Opening {0} ({1}) in {2} as the current case",
new Object[]{newCurrentCase.getDisplayName(), newCurrentCase.getName(), newCurrentCase.getCaseDirectory()});
876 String progressIndicatorTitle;
879 progressIndicatorTitle = Bundle.Case_progressIndicatorTitle_creatingCase();
880 openCaseAction = newCurrentCase::create;
882 progressIndicatorTitle = Bundle.Case_progressIndicatorTitle_openingCase();
883 openCaseAction = newCurrentCase::open;
886 currentCase = newCurrentCase;
887 logger.log(Level.INFO,
"Opened {0} ({1}) in {2} as the current case",
new Object[]{newCurrentCase.getDisplayName(), newCurrentCase.getName(), newCurrentCase.getCaseDirectory()});
893 logger.log(Level.INFO, String.format(
"Cancelled opening %s (%s) in %s as the current case", newCurrentCase.
getDisplayName(), newCurrentCase.
getName(), newCurrentCase.
getCaseDirectory()));
895 }
catch (CaseActionException ex) {
896 logger.log(Level.SEVERE, String.format(
"Error opening %s (%s) in %s as the current case", newCurrentCase.
getDisplayName(), newCurrentCase.
getName(), newCurrentCase.
getCaseDirectory()), ex);
914 String uniqueCaseName = caseDisplayName.replaceAll(
"[^\\p{ASCII}]",
"_");
919 uniqueCaseName = uniqueCaseName.replaceAll(
"[\\p{Cntrl}]",
"_");
924 uniqueCaseName = uniqueCaseName.replaceAll(
"[ /?:'\"\\\\]",
"_");
929 uniqueCaseName = uniqueCaseName.toLowerCase();
934 SimpleDateFormat dateFormat =
new SimpleDateFormat(
"yyyyMMdd_HHmmss");
935 Date date =
new Date();
936 uniqueCaseName = uniqueCaseName +
"_" + dateFormat.format(date);
938 return uniqueCaseName;
955 File caseDir =
new File(caseDirPath);
956 if (caseDir.exists()) {
957 if (caseDir.isFile()) {
958 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.existNotDir", caseDirPath));
959 }
else if (!caseDir.canRead() || !caseDir.canWrite()) {
960 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.existCantRW", caseDirPath));
967 if (!caseDir.mkdirs()) {
968 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreate", caseDirPath));
976 String hostPathComponent =
"";
981 Path exportDir = Paths.get(caseDirPath, hostPathComponent, EXPORT_FOLDER);
982 if (!exportDir.toFile().mkdirs()) {
983 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreateCaseDir", exportDir));
986 Path logsDir = Paths.get(caseDirPath, hostPathComponent, LOG_FOLDER);
987 if (!logsDir.toFile().mkdirs()) {
988 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreateCaseDir", logsDir));
991 Path tempDir = Paths.get(caseDirPath, hostPathComponent, TEMP_FOLDER);
992 if (!tempDir.toFile().mkdirs()) {
993 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreateCaseDir", tempDir));
996 Path cacheDir = Paths.get(caseDirPath, hostPathComponent, CACHE_FOLDER);
997 if (!cacheDir.toFile().mkdirs()) {
998 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreateCaseDir", cacheDir));
1001 Path moduleOutputDir = Paths.get(caseDirPath, hostPathComponent, MODULE_FOLDER);
1002 if (!moduleOutputDir.toFile().mkdirs()) {
1003 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreateModDir", moduleOutputDir));
1006 Path reportsDir = Paths.get(caseDirPath, hostPathComponent, REPORTS_FOLDER);
1007 if (!reportsDir.toFile().mkdirs()) {
1008 throw new CaseActionException(NbBundle.getMessage(
Case.class,
"Case.createCaseDir.exception.cantCreateReportsDir", reportsDir));
1019 static Map<Long, String> getImagePaths(SleuthkitCase db) {
1020 Map<Long, String> imgPaths =
new HashMap<>();
1022 Map<Long, List<String>> imgPathsList = db.getImagePaths();
1023 for (Map.Entry<Long, List<String>> entry : imgPathsList.entrySet()) {
1024 if (entry.getValue().size() > 0) {
1025 imgPaths.put(entry.getKey(), entry.getValue().get(0));
1028 }
catch (TskCoreException ex) {
1029 logger.log(Level.SEVERE,
"Error getting image paths", ex);
1045 "Case.creationException.couldNotAcquireResourcesLock=Failed to get lock on case resources"
1049 Path caseDirPath = Paths.get(caseDir);
1053 }
catch (InterruptedException ex) {
1056 throw new CaseActionException(Bundle.Case_creationException_couldNotAcquireResourcesLock(), ex);
1075 SwingUtilities.invokeLater(() -> {
1081 String backupDbPath = caseDb.getBackupDatabasePath();
1082 if (null != backupDbPath) {
1083 JOptionPane.showMessageDialog(
1085 NbBundle.getMessage(
Case.class,
"Case.open.msgDlg.updated.msg", backupDbPath),
1086 NbBundle.getMessage(
Case.class,
"Case.open.msgDlg.updated.title"),
1087 JOptionPane.INFORMATION_MESSAGE);
1095 Map<Long, String> imgPaths = getImagePaths(caseDb);
1096 for (Map.Entry<Long, String> entry : imgPaths.entrySet()) {
1097 long obj_id = entry.getKey();
1098 String path = entry.getValue();
1101 int response = JOptionPane.showConfirmDialog(
1103 NbBundle.getMessage(
Case.class,
"Case.checkImgExist.confDlg.doesntExist.msg", path),
1104 NbBundle.getMessage(
Case.class,
"Case.checkImgExist.confDlg.doesntExist.title"),
1105 JOptionPane.YES_NO_OPTION);
1106 if (response == JOptionPane.YES_OPTION) {
1107 MissingImageDialog.makeDialog(obj_id, caseDb);
1109 logger.log(Level.SEVERE,
"User proceeding with missing image files");
1120 CallableSystemAction.get(CaseDetailsAction.class).setEnabled(
true);
1134 RecentCases.getInstance().addRecentCase(newCurrentCase.
getDisplayName(), newCurrentCase.getMetadata().getFilePath().toString());
1144 if (newCurrentCase.
hasData()) {
1163 SwingUtilities.invokeLater(() -> {
1173 CallableSystemAction.get(
AddImageAction.class).setEnabled(
false);
1175 CallableSystemAction.get(CaseDetailsAction.class).setEnabled(
false);
1177 CallableSystemAction.get(CaseDeleteAction.class).setEnabled(
false);
1203 File tempFolder =
new File(tempSubDirPath);
1204 if (tempFolder.isDirectory()) {
1205 File[] files = tempFolder.listFiles();
1206 if (files.length > 0) {
1207 for (File file : files) {
1208 if (file.isDirectory()) {
1340 hostPath = Paths.get(caseDirectory);
1342 if (!hostPath.toFile().exists()) {
1343 hostPath.toFile().mkdirs();
1345 return hostPath.toString();
1428 return path.subpath(path.getNameCount() - 2, path.getNameCount()).toString();
1430 return path.subpath(path.getNameCount() - 1, path.getNameCount()).toString();
1444 return caseDb.getRootObjects();
1453 Set<TimeZone> timezones =
new HashSet<>();
1456 final Content dataSource = c.getDataSource();
1457 if ((dataSource != null) && (dataSource instanceof Image)) {
1458 Image image = (Image) dataSource;
1459 timezones.add(TimeZone.getTimeZone(image.getTimeZone()));
1462 }
catch (TskCoreException ex) {
1463 logger.log(Level.SEVERE,
"Error getting data source time zones", ex);
1485 boolean hasDataSources =
false;
1488 }
catch (TskCoreException ex) {
1489 logger.log(Level.SEVERE,
"Error accessing case database", ex);
1491 return hasDataSources;
1611 logger.log(Level.WARNING,
"Unable to send notifcation regarding comment change due to no current case being open", ex);
1661 public void addReport(String localPath, String srcModuleName, String reportName)
throws TskCoreException {
1662 addReport(localPath, srcModuleName, reportName, null);
1679 public Report
addReport(String localPath, String srcModuleName, String reportName, Content parent)
throws TskCoreException {
1680 String normalizedLocalPath;
1682 if (localPath.toLowerCase().contains(
"http:")) {
1683 normalizedLocalPath = localPath;
1685 normalizedLocalPath = Paths.get(localPath).normalize().toString();
1687 }
catch (InvalidPathException ex) {
1688 String errorMsg =
"Invalid local path provided: " + localPath;
1689 throw new TskCoreException(errorMsg, ex);
1691 Report report = this.caseDb.addReport(normalizedLocalPath, srcModuleName, reportName, parent);
1705 return this.caseDb.getAllReports();
1716 public void deleteReports(Collection<? extends Report> reports)
throws TskCoreException {
1717 for (Report report : reports) {
1718 this.caseDb.deleteReport(report);
1740 "Case.exceptionMessage.metadataUpdateError=Failed to update case metadata"
1742 void updateCaseDetails(CaseDetails caseDetails)
throws CaseActionException {
1745 metadata.setCaseDetails(caseDetails);
1746 }
catch (CaseMetadataException ex) {
1747 throw new CaseActionException(Bundle.Case_exceptionMessage_metadataUpdateError(), ex);
1751 CaseNodeData nodeData = CaseNodeData.readCaseNodeData(metadata.
getCaseDirectory());
1753 CaseNodeData.writeCaseNodeData(nodeData);
1754 }
catch (CaseNodeDataException | InterruptedException ex) {
1755 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotUpdateCaseNodeData(ex.getLocalizedMessage()), ex);
1758 if (!oldCaseDetails.getCaseNumber().equals(caseDetails.
getCaseNumber())) {
1759 eventPublisher.
publish(
new AutopsyEvent(Events.NUMBER.toString(), oldCaseDetails.getCaseNumber(), caseDetails.
getCaseNumber()));
1761 if (!oldCaseDetails.getExaminerName().equals(caseDetails.
getExaminerName())) {
1762 eventPublisher.
publish(
new AutopsyEvent(Events.NUMBER.toString(), oldCaseDetails.getExaminerName(), caseDetails.
getExaminerName()));
1765 eventPublisher.
publish(
new AutopsyEvent(Events.NAME.toString(), oldCaseDetails.getCaseDisplayName(), caseDetails.
getCaseDisplayName()));
1767 eventPublisher.
publish(
new AutopsyEvent(Events.CASE_DETAILS.toString(), oldCaseDetails, caseDetails));
1768 if (RuntimeProperties.runningWithGUI()) {
1769 SwingUtilities.invokeLater(() -> {
1772 RecentCases.getInstance().updateRecentCase(oldCaseDetails.getCaseDisplayName(), metadata.getFilePath().toString(), caseDetails.
getCaseDisplayName(), metadata.getFilePath().toString());
1773 }
catch (Exception ex) {
1774 logger.log(Level.SEVERE,
"Error updating case name in UI", ex);
1802 metadata = caseMetaData;
1836 "Case.progressIndicatorCancelButton.label=Cancel",
1837 "Case.progressMessage.preparing=Preparing...",
1838 "Case.progressMessage.cancelling=Cancelling...",
1839 "Case.exceptionMessage.cancelled=Cancelled.",
1840 "# {0} - exception message",
"Case.exceptionMessage.execExceptionWrapperMessage={0}"
1850 if (allowCancellation) {
1854 progressIndicatorTitle,
1855 new String[]{Bundle.Case_progressIndicatorCancelButton_label()},
1856 Bundle.Case_progressIndicatorCancelButton_label(),
1857 cancelButtonListener);
1861 progressIndicatorTitle);
1866 progressIndicator.
start(Bundle.Case_progressMessage_preparing());
1875 caseActionExecutor = Executors.newSingleThreadExecutor(threadFactory);
1876 Future<Void> future = caseActionExecutor.submit(() -> {
1878 caseAction.
execute(progressIndicator, additionalParams);
1882 if (null == resourcesLock) {
1883 throw new CaseActionException(Bundle.Case_creationException_couldNotAcquireResourcesLock());
1885 caseAction.
execute(progressIndicator, additionalParams);
1886 }
catch (CaseActionException ex) {
1893 if (null != cancelButtonListener) {
1902 }
catch (InterruptedException discarded) {
1906 if (null != cancelButtonListener) {
1909 future.cancel(
true);
1912 }
catch (CancellationException discarded) {
1918 }
catch (ExecutionException ex) {
1923 throw new CaseActionException(Bundle.Case_exceptionMessage_execExceptionWrapperMessage(ex.getCause().getLocalizedMessage()), ex);
1925 progressIndicator.
finish();
1945 assert (additionalParams == null);
1966 }
catch (CaseActionException ex) {
1975 }
catch (InterruptedException discarded) {
1977 close(progressIndicator);
1997 assert (additionalParams == null);
2017 }
catch (CaseActionException ex) {
2026 }
catch (InterruptedException discarded) {
2028 close(progressIndicator);
2043 "# {0} - case",
"Case.openFileSystems.retrievingImages=Retrieving images for case: {0}...",
2044 "# {0} - image",
"Case.openFileSystems.openingImage=Opening all filesystems for image: {0}..."
2047 if (backgroundOpenFileSystemsFuture != null && !backgroundOpenFileSystemsFuture.isDone()) {
2048 backgroundOpenFileSystemsFuture.cancel(
true);
2077 caseName = (this.tskCase != null) ? this.tskCase.getDatabaseName() :
"";
2088 if (Thread.interrupted()) {
2089 throw new InterruptedException();
2099 progressIndicator.
progress(Bundle.Case_openFileSystems_retrievingImages(caseName));
2101 return this.tskCase.getImages();
2102 }
catch (TskCoreException ex) {
2105 String.format(
"Could not obtain images while opening case: %s.", caseName),
2121 private void openFileSystems(List<Image> images)
throws TskCoreException, InterruptedException {
2122 byte[] tempBuff =
new byte[512];
2124 for (Image image : images) {
2125 String imageStr = image.getName();
2127 progressIndicator.
progress(Bundle.Case_openFileSystems_openingImage(imageStr));
2129 Collection<FileSystem> fileSystems = this.tskCase.getImageFileSystems(image);
2131 for (FileSystem fileSystem : fileSystems) {
2132 fileSystem.read(tempBuff, 0, 512);
2144 if (images == null) {
2152 String.format(
"Skipping background load of file systems due to large number of images in case (%d)", images.size()));
2158 }
catch (InterruptedException ex) {
2161 String.format(
"Background operation opening all file systems in %s has been cancelled.", caseName));
2162 }
catch (Exception ex) {
2164 logger.log(Level.WARNING,
"Error while opening file systems in background", ex);
2185 "Case.progressMessage.deletingDataSource=Removing the data source from the case...",
2186 "Case.exceptionMessage.dataSourceNotFound=The data source was not found.",
2187 "Case.exceptionMessage.errorDeletingDataSourceFromCaseDb=An error occurred while removing the data source from the case database.",
2188 "Case.exceptionMessage.errorDeletingDataSourceFromTextIndex=An error occurred while removing the data source from the text index.",})
2189 Void deleteDataSource(ProgressIndicator progressIndicator, Object additionalParams)
throws CaseActionException {
2190 assert (additionalParams instanceof Long);
2191 open(progressIndicator, null);
2193 progressIndicator.progress(Bundle.Case_progressMessage_deletingDataSource());
2194 Long dataSourceObjectID = (Long) additionalParams;
2196 DataSource dataSource = this.caseDb.getDataSource(dataSourceObjectID);
2197 if (dataSource == null) {
2198 throw new CaseActionException(Bundle.Case_exceptionMessage_dataSourceNotFound());
2200 SleuthkitCaseAdminUtil.deleteDataSource(this.caseDb, dataSourceObjectID);
2201 }
catch (TskDataException | TskCoreException ex) {
2202 throw new CaseActionException(Bundle.Case_exceptionMessage_errorDeletingDataSourceFromCaseDb(), ex);
2206 }
catch (KeywordSearchServiceException ex) {
2207 throw new CaseActionException(Bundle.Case_exceptionMessage_errorDeletingDataSourceFromTextIndex(), ex);
2209 eventPublisher.
publish(
new DataSourceDeletedEvent(dataSourceObjectID));
2212 close(progressIndicator);
2227 public SleuthkitCase
createPortableCase(String caseName, File portableCaseFolder)
throws TskCoreException {
2229 if (portableCaseFolder.exists()) {
2230 throw new TskCoreException(
"Portable case folder " + portableCaseFolder.toString() +
" already exists");
2232 if (!portableCaseFolder.mkdirs()) {
2233 throw new TskCoreException(
"Error creating portable case folder " + portableCaseFolder.toString());
2241 portableCaseMetadata.setCaseDatabaseName(SINGLE_USER_CASE_DB_NAME);
2243 throw new TskCoreException(
"Error creating case metadata", ex);
2247 SleuthkitCase portableSleuthkitCase;
2249 portableSleuthkitCase = SleuthkitCase.newCase(dbFilePath);
2251 return portableSleuthkitCase;
2264 if (Thread.currentThread().isInterrupted()) {
2265 throw new CaseActionCancelledException(Bundle.Case_exceptionMessage_cancelled());
2280 "Case.progressMessage.creatingCaseDirectory=Creating case directory..."
2287 progressIndicator.
progress(Bundle.Case_progressMessage_creatingCaseDirectory());
2289 progressIndicator.
progress(Bundle.Case_progressMessage_creatingCaseDirectory());
2301 "Case.progressMessage.switchingLogDirectory=Switching log directory..."
2304 progressIndicator.
progress(Bundle.Case_progressMessage_switchingLogDirectory());
2320 "Case.progressMessage.savingCaseMetadata=Saving case metadata to file...",
2321 "# {0} - exception message",
"Case.exceptionMessage.couldNotSaveCaseMetadata=Failed to save case metadata:\n{0}."
2324 progressIndicator.
progress(Bundle.Case_progressMessage_savingCaseMetadata());
2326 this.metadata.writeToFile();
2328 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotSaveCaseMetadata(ex.getLocalizedMessage()), ex);
2344 "Case.progressMessage.creatingCaseNodeData=Creating coordination service node data...",
2345 "# {0} - exception message",
"Case.exceptionMessage.couldNotCreateCaseNodeData=Failed to create coordination service node data:\n{0}."
2349 progressIndicator.
progress(Bundle.Case_progressMessage_creatingCaseNodeData());
2353 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotCreateCaseNodeData(ex.getLocalizedMessage()), ex);
2370 "Case.progressMessage.updatingCaseNodeData=Updating coordination service node data...",
2371 "# {0} - exception message",
"Case.exceptionMessage.couldNotUpdateCaseNodeData=Failed to update coordination service node data:\n{0}."
2375 progressIndicator.
progress(Bundle.Case_progressMessage_updatingCaseNodeData());
2381 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotUpdateCaseNodeData(ex.getLocalizedMessage()), ex);
2392 "Case.progressMessage.clearingTempDirectory=Clearing case temp directory..."
2398 progressIndicator.
progress(Bundle.Case_progressMessage_clearingTempDirectory());
2414 "Case.progressMessage.creatingCaseDatabase=Creating case database...",
2415 "# {0} - exception message",
"Case.exceptionMessage.couldNotGetDbServerConnectionInfo=Failed to get case database server conneciton info:\n{0}.",
2416 "# {0} - exception message",
"Case.exceptionMessage.couldNotCreateCaseDatabase=Failed to create case database:\n{0}.",
2417 "# {0} - exception message",
"Case.exceptionMessage.couldNotSaveDbNameToMetadataFile=Failed to save case database name to case metadata file:\n{0}."
2420 progressIndicator.
progress(Bundle.Case_progressMessage_creatingCaseDatabase());
2429 metadata.setCaseDatabaseName(SINGLE_USER_CASE_DB_NAME);
2437 metadata.setCaseDatabaseName(caseDb.getDatabaseName());
2439 }
catch (TskCoreException ex) {
2440 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotCreateCaseDatabase(ex.getLocalizedMessage()), ex);
2442 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotGetDbServerConnectionInfo(ex.getLocalizedMessage()), ex);
2444 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotSaveDbNameToMetadataFile(ex.getLocalizedMessage()), ex);
2460 "Case.progressMessage.openingCaseDatabase=Opening case database...",
2461 "# {0} - exception message",
"Case.exceptionMessage.couldNotOpenCaseDatabase=Failed to open case database:\n{0}.",
2462 "# {0} - exception message",
"Case.exceptionMessage.unsupportedSchemaVersionMessage=Unsupported case database schema version:\n{0}.",
2463 "Case.open.exception.multiUserCaseNotEnabled=Cannot open a multi-user case if multi-user cases are not enabled. See Tools, Options, Multi-User."
2466 progressIndicator.
progress(Bundle.Case_progressMessage_openingCaseDatabase());
2470 caseDb = SleuthkitCase.openCase(Paths.get(metadata.
getCaseDirectory(), databaseName).toString());
2474 throw new CaseActionException(Bundle.Case_open_exception_multiUserCaseNotEnabled());
2476 }
catch (TskUnsupportedSchemaVersionException ex) {
2477 throw new CaseActionException(Bundle.Case_exceptionMessage_unsupportedSchemaVersionMessage(ex.getLocalizedMessage()), ex);
2479 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotGetDbServerConnectionInfo(ex.getLocalizedMessage()), ex);
2480 }
catch (TskCoreException ex) {
2481 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotOpenCaseDatabase(ex.getLocalizedMessage()), ex);
2492 "Case.progressMessage.openingCaseLevelServices=Opening case-level services...",})
2494 progressIndicator.
progress(Bundle.Case_progressMessage_openingCaseLevelServices());
2495 this.caseServices =
new Services(caseDb);
2501 caseDb.registerForEvents(sleuthkitEventListener);
2516 @NbBundle.Messages({
2517 "Case.progressMessage.openingApplicationServiceResources=Opening application service case resources...",
2518 "# {0} - service name",
"Case.serviceOpenCaseResourcesProgressIndicator.title={0} Opening Case Resources",
2519 "# {0} - service name",
"Case.serviceOpenCaseResourcesProgressIndicator.cancellingMessage=Cancelling opening case resources by {0}...",
2520 "# {0} - service name",
"Case.servicesException.notificationTitle={0} Error"
2531 progressIndicator.
progress(Bundle.Case_progressMessage_openingApplicationServiceResources());
2543 cancelButtonListener =
new CancelButtonListener(Bundle.Case_serviceOpenCaseResourcesProgressIndicator_cancellingMessage(service.getServiceName()));
2546 Bundle.Case_serviceOpenCaseResourcesProgressIndicator_title(service.getServiceName()),
2547 new String[]{Bundle.Case_progressIndicatorCancelButton_label()},
2548 Bundle.Case_progressIndicatorCancelButton_label(),
2549 cancelButtonListener);
2553 appServiceProgressIndicator.
start(Bundle.Case_progressMessage_preparing());
2555 String threadNameSuffix = service.getServiceName().replaceAll(
"[ ]",
"-");
2556 threadNameSuffix = threadNameSuffix.toLowerCase();
2558 ExecutorService executor = Executors.newSingleThreadExecutor(threadFactory);
2559 Future<Void> future = executor.submit(() -> {
2560 service.openCaseResources(context);
2563 if (null != cancelButtonListener) {
2575 }
catch (InterruptedException discarded) {
2580 future.cancel(
true);
2581 }
catch (CancellationException discarded) {
2589 }
catch (ExecutionException ex) {
2596 Case.
logger.log(Level.SEVERE, String.format(
"%s failed to open case resources for %s", service.getServiceName(), this.
getDisplayName()), ex);
2598 SwingUtilities.invokeLater(() -> {
2610 appServiceProgressIndicator.
finish();
2628 "Case.progressMessage.settingUpNetworkCommunications=Setting up network communications...",
2629 "# {0} - exception message",
"Case.exceptionMessage.couldNotOpenRemoteEventChannel=Failed to open remote events channel:\n{0}.",
2630 "# {0} - exception message",
"Case.exceptionMessage.couldNotCreatCollaborationMonitor=Failed to create collaboration monitor:\n{0}."
2634 progressIndicator.
progress(Bundle.Case_progressMessage_settingUpNetworkCommunications());
2638 collaborationMonitor =
new CollaborationMonitor(metadata.
getCaseName());
2640 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotOpenRemoteEventChannel(ex.getLocalizedMessage()), ex);
2641 }
catch (CollaborationMonitor.CollaborationMonitorException ex) {
2642 throw new CaseActionException(Bundle.Case_exceptionMessage_couldNotCreatCollaborationMonitor(ex.getLocalizedMessage()), ex);
2670 Bundle.Case_progressIndicatorTitle_closingCase());
2674 progressIndicator.
start(Bundle.Case_progressMessage_preparing());
2683 Future<Void> future = caseActionExecutor.submit(() -> {
2685 close(progressIndicator);
2692 progressIndicator.
progress(Bundle.Case_progressMessage_preparing());
2694 if (null == resourcesLock) {
2695 throw new CaseActionException(Bundle.Case_creationException_couldNotAcquireResourcesLock());
2697 close(progressIndicator);
2711 }
catch (InterruptedException | CancellationException unused) {
2718 }
catch (ExecutionException ex) {
2719 throw new CaseActionException(Bundle.Case_exceptionMessage_execExceptionWrapperMessage(ex.getCause().getMessage()), ex);
2722 progressIndicator.
finish();
2732 "Case.progressMessage.shuttingDownNetworkCommunications=Shutting down network communications...",
2733 "Case.progressMessage.closingApplicationServiceResources=Closing case-specific application service resources...",
2734 "Case.progressMessage.closingCaseDatabase=Closing case database..."
2744 progressIndicator.
progress(Bundle.Case_progressMessage_shuttingDownNetworkCommunications());
2745 if (null != collaborationMonitor) {
2746 collaborationMonitor.shutdown();
2755 progressIndicator.
progress(Bundle.Case_progressMessage_closingApplicationServiceResources());
2761 if (null != caseDb) {
2762 progressIndicator.
progress(Bundle.Case_progressMessage_closingCaseDatabase());
2763 caseDb.unregisterForEvents(sleuthkitEventListener);
2770 progressIndicator.
progress(Bundle.Case_progressMessage_switchingLogDirectory());
2779 "# {0} - serviceName",
"Case.serviceCloseResourcesProgressIndicator.title={0} Closing Case Resources",
2780 "# {0} - service name",
"# {1} - exception message",
"Case.servicesException.serviceResourcesCloseError=Could not close case resources for {0} service: {1}"
2793 Bundle.Case_serviceCloseResourcesProgressIndicator_title(service.getServiceName()));
2797 progressIndicator.
start(Bundle.Case_progressMessage_preparing());
2799 String threadNameSuffix = service.getServiceName().replaceAll(
"[ ]",
"-");
2800 threadNameSuffix = threadNameSuffix.toLowerCase();
2802 ExecutorService executor = Executors.newSingleThreadExecutor(threadFactory);
2803 Future<Void> future = executor.submit(() -> {
2804 service.closeCaseResources(context);
2809 }
catch (InterruptedException ex) {
2810 Case.
logger.log(Level.SEVERE, String.format(
"Unexpected interrupt while waiting on %s service to close case resources", service.getServiceName()), ex);
2811 }
catch (CancellationException ex) {
2812 Case.
logger.log(Level.SEVERE, String.format(
"Unexpected cancellation while waiting on %s service to close case resources", service.getServiceName()), ex);
2813 }
catch (ExecutionException ex) {
2814 Case.
logger.log(Level.SEVERE, String.format(
"%s service failed to open case resources", service.getServiceName()), ex);
2817 Bundle.Case_servicesException_notificationTitle(service.getServiceName()),
2818 Bundle.Case_servicesException_serviceResourcesCloseError(service.getServiceName(), ex.getLocalizedMessage())));
2822 progressIndicator.
finish();
2833 "Case.lockingException.couldNotAcquireSharedLock=Failed to get an shared lock on the case.",
2834 "Case.lockingException.couldNotAcquireExclusiveLock=Failed to get a exclusive lock on the case."
2845 throw new CaseActionException(Bundle.Case_lockingException_couldNotAcquireSharedLock());
2847 throw new CaseActionException(Bundle.Case_lockingException_couldNotAcquireExclusiveLock());
2852 throw new CaseActionException(Bundle.Case_lockingException_couldNotAcquireSharedLock(), ex);
2854 throw new CaseActionException(Bundle.Case_lockingException_couldNotAcquireExclusiveLock(), ex);
2868 logger.log(Level.SEVERE, String.format(
"Failed to release shared case directory lock for %s", getMetadata().
getCaseDirectory()), ex);
2881 if (!subDirectory.exists()) {
2882 subDirectory.mkdirs();
2884 return subDirectory.toString();
2900 "Case.exceptionMessage.errorsDeletingCase=Errors occured while deleting the case. See the application log for details."
2903 boolean errorsOccurred =
false;
2907 errorsOccurred =
true;
2913 }
catch (CaseActionException ex) {
2914 errorsOccurred =
true;
2920 if (errorsOccurred) {
2921 throw new CaseActionException(Bundle.Case_exceptionMessage_errorsDeletingCase());
2945 "Case.progressMessage.connectingToCoordSvc=Connecting to coordination service...",
2946 "# {0} - exception message",
"Case.exceptionMessage.failedToConnectToCoordSvc=Failed to connect to coordination service:\n{0}.",
2947 "Case.exceptionMessage.cannotGetLockToDeleteCase=Cannot delete case because it is open for another user or host.",
2948 "# {0} - exception message",
"Case.exceptionMessage.failedToLockCaseForDeletion=Failed to exclusively lock case for deletion:\n{0}.",
2949 "Case.progressMessage.fetchingCoordSvcNodeData=Fetching coordination service node data for the case...",
2950 "# {0} - exception message",
"Case.exceptionMessage.failedToFetchCoordSvcNodeData=Failed to fetch coordination service node data:\n{0}.",
2951 "Case.progressMessage.deletingResourcesCoordSvcNode=Deleting case resources coordination service node...",
2952 "Case.progressMessage.deletingCaseDirCoordSvcNode=Deleting case directory coordination service node..."
2955 progressIndicator.
progress(Bundle.Case_progressMessage_connectingToCoordSvc());
2961 throw new CaseActionException(Bundle.Case_exceptionMessage_failedToConnectToCoordSvc(ex.getLocalizedMessage()));
2965 boolean errorsOccurred =
false;
2967 if (dirLock == null) {
2969 throw new CaseActionException(Bundle.Case_exceptionMessage_cannotGetLockToDeleteCase());
2972 progressIndicator.
progress(Bundle.Case_progressMessage_fetchingCoordSvcNodeData());
2977 throw new CaseActionException(Bundle.Case_exceptionMessage_failedToFetchCoordSvcNodeData(ex.getLocalizedMessage()));
2982 progressIndicator.
progress(Bundle.Case_progressMessage_deletingResourcesCoordSvcNode());
2988 errorsOccurred =
true;
2989 logger.log(Level.WARNING, String.format(
"Error deleting the case resources coordination service node for the case at %s (%s) in %s", metadata.
getCaseDisplayName(), metadata.
getCaseName(), metadata.
getCaseDirectory()), ex);
2991 }
catch (InterruptedException ex) {
2992 logger.log(Level.WARNING, String.format(
"Error deleting the case resources coordination service node for the case at %s (%s) in %s", metadata.
getCaseDisplayName(), metadata.
getCaseName(), metadata.
getCaseDirectory()), ex);
2997 throw new CaseActionException(Bundle.Case_exceptionMessage_failedToLockCaseForDeletion(ex.getLocalizedMessage()));
3000 if (!errorsOccurred) {
3001 progressIndicator.
progress(Bundle.Case_progressMessage_deletingCaseDirCoordSvcNode());
3007 errorsOccurred =
true;
3011 if (errorsOccurred) {
3012 throw new CaseActionException(Bundle.Case_exceptionMessage_errorsDeletingCase());
3042 boolean errorsOccurred =
false;
3049 errorsOccurred =
true;
3052 errorsOccurred =
true;
3054 }
catch (CaseActionException ex) {
3055 errorsOccurred =
true;
3058 return errorsOccurred;
3082 "Case.progressMessage.deletingCaseDatabase=Deleting case database..."
3086 progressIndicator.
progress(Bundle.Case_progressMessage_deletingCaseDatabase());
3087 logger.log(Level.INFO, String.format(
"Deleting case database for %s (%s) in %s", caseNodeData.
getDisplayName(), caseNodeData.
getName(), caseNodeData.
getDirectory()));
3089 String url =
"jdbc:postgresql://" + info.getHost() +
":" + info.getPort() +
"/postgres";
3090 Class.forName(
"org.postgresql.Driver");
3091 try (Connection connection = DriverManager.getConnection(url, info.getUserName(), info.getPassword()); Statement statement = connection.createStatement()) {
3092 String dbExistsQuery =
"SELECT 1 from pg_database WHERE datname = '" + metadata.
getCaseDatabaseName() +
"'";
3093 try (ResultSet queryResult = statement.executeQuery(dbExistsQuery)) {
3094 if (queryResult.next()) {
3096 statement.execute(deleteCommand);
3137 "Case.progressMessage.deletingTextIndex=Deleting text index..."
3140 progressIndicator.
progress(Bundle.Case_progressMessage_deletingTextIndex());
3144 searchService.deleteTextIndex(metadata);
3180 "Case.progressMessage.deletingCaseDirectory=Deleting case directory..."
3183 progressIndicator.
progress(Bundle.Case_progressMessage_deletingCaseDirectory());
3185 throw new CaseActionException(String.format(
"Failed to delete %s", metadata.
getCaseDirectory()));
3197 "Case.progressMessage.removingCaseFromRecentCases=Removing case from Recent Cases menu..."
3201 progressIndicator.
progress(Bundle.Case_progressMessage_removingCaseFromRecentCases());
3202 SwingUtilities.invokeLater(() -> {
3203 RecentCases.getInstance().removeRecentCase(metadata.
getCaseDisplayName(), metadata.getFilePath().toString());
3218 boolean isNodeNodeEx =
false;
3219 Throwable cause = ex.getCause();
3220 if (cause != null) {
3221 String causeMessage = cause.getMessage();
3222 isNodeNodeEx = causeMessage.contains(NO_NODE_ERROR_MSG_FRAGMENT);
3224 return isNodeNodeEx;
3243 logger.log(Level.SEVERE, String.format(
"Error updating deleted item flag %s for %s (%s) in %s", flag.name(), caseNodeData.
getDisplayName(), caseNodeData.
getName(), caseNodeData.
getDirectory()), ex);
3268 R
execute(T progressIndicator, V additionalParams)
throws CaseActionException;
3366 ((ModalDialogProgressIndicator) progressIndicator).
setCancelling(cancellationMessage);
3395 return new Thread(task, threadName);
3432 public static void create(String caseDir, String caseDisplayName, String caseNumber, String examiner)
throws CaseActionException {
3457 public static void create(String caseDir, String caseDisplayName, String caseNumber, String examiner,
CaseType caseType)
throws CaseActionException {
3473 public static void open(String caseMetadataFilePath)
throws CaseActionException {
3530 return new File(filePath).isFile();
3569 return "ModuleOutput";
3582 public static PropertyChangeSupport
3584 return new PropertyChangeSupport(
Case.class
3616 public Image
addImage(String imgPath,
long imgId, String timeZone)
throws CaseActionException {
3618 Image newDataSource = caseDb.getImageById(imgId);
3620 return newDataSource;
3621 }
catch (TskCoreException ex) {
3622 throw new CaseActionException(NbBundle.getMessage(
this.getClass(),
"Case.addImg.exception.msg"), ex);
3649 public void deleteReports(Collection<? extends Report> reports,
boolean deleteFromDisk)
throws TskCoreException {
String getLogDirectoryPath()
static final AutopsyEventPublisher eventPublisher
List< Content > getDataSources()
String getModuleOutputDirectoryRelativePath()
static CaseNodeData createCaseNodeData(final CaseMetadata metadata)
void notifyContentTagDeleted(ContentTag deletedTag)
Case(CaseMetadata caseMetaData)
static CaseType fromString(String typeName)
final SleuthkitEventListener sleuthkitEventListener
static final String CASE_ACTION_THREAD_NAME
static void setDeletedItemFlag(CaseNodeData caseNodeData, CaseNodeData.DeletedFlags flag)
void publishLocally(AutopsyEvent event)
static void createAsCurrentCase(CaseType caseType, String caseDir, CaseDetails caseDetails)
static String getCaseDirectoryNodePath(Path caseDirectoryPath)
void notifyBlackBoardArtifactTagDeleted(BlackboardArtifactTag deletedTag)
String getExaminerPhone()
Void open(ProgressIndicator progressIndicator, Object additionalParams)
Set< TimeZone > getTimeZones()
CoordinationService.Lock caseLock
static boolean deleteMultiUserCase(CaseNodeData caseNodeData, CaseMetadata metadata, ProgressIndicator progressIndicator, Logger logger)
static String getNameForTitle()
Image addImage(String imgPath, long imgId, String timeZone)
static synchronized IngestManager getInstance()
void deleteNode(CategoryNode category, String nodePath)
static final ExecutorService openFileSystemsExecutor
static final String NO_NODE_ERROR_MSG_FRAGMENT
static boolean runningWithGUI
static void closeCurrentCase()
void setDeletedFlag(DeletedFlags flag)
void acquireCaseLock(CaseLockType lockType)
String getTempDirectory()
static boolean existsCurrentCase()
boolean isDeletedFlagSet(DeletedFlags flag)
static void removePropertyChangeListener(PropertyChangeListener listener)
void start(String message, int totalWorkUnits)
static final Logger logger
void notifyBlackBoardArtifactTagAdded(BlackboardArtifactTag newTag, List< BlackboardArtifactTag > removedTagList)
void publish(AutopsyEvent event)
String getLocalizedDisplayName()
static Future<?> backgroundOpenFileSystemsFuture
ADDING_DATA_SOURCE_FAILED
static final String EXPORT_FOLDER
static void createCaseDirectory(String caseDirPath, CaseType caseType)
String getCaseDirectory()
static String getAppName()
void notifyTagDefinitionChanged(String changedTagName)
void openFileSystemsInBackground()
void notifyContentTagAdded(ContentTag newTag, List< ContentTag > deletedTagList)
void deleteDataSource(Long dataSourceId)
static volatile Frame mainFrame
static String convertTimeZone(String timeZoneId)
static boolean driveExists(String path)
static void openCoreWindows()
static void deleteSingleUserCase(CaseMetadata metadata, ProgressIndicator progressIndicator)
void addSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
void publishTimelineEventAddedEvent(TimelineManager.TimelineEventAddedEvent event)
synchronized static void setLogDirectory(String directoryPath)
volatile ExecutorService caseActionExecutor
void notifyCentralRepoCommentChanged(long contentId, String newComment)
TaskThreadFactory(String threadName)
static final String CACHE_FOLDER
static String getAutopsyVersion()
CaseType(String typeName)
List< Image > getImages()
static void deleteMultiUserCaseDirectory(CaseNodeData caseNodeData, CaseMetadata metadata, ProgressIndicator progressIndicator, Logger logger)
Case(CaseType caseType, String caseDir, CaseDetails caseDetails)
String getReportDirectory()
static String getCaseResourcesNodePath(Path caseDirectoryPath)
static CaseNodeData readCaseNodeData(String nodePath)
static boolean getIsMultiUserModeEnabled()
void addReport(String localPath, String srcModuleName, String reportName)
static void updateGUIForCaseOpened(Case newCurrentCase)
void notifyDataSourceNameChanged(Content dataSource, String newName)
static CaseDbConnectionInfo getDatabaseConnectionInfo()
String getModulesOutputDirAbsPath()
static void create(String caseDir, String caseDisplayName, String caseNumber, String examiner, CaseType caseType)
void closeAppServiceCaseResources()
static final int CASE_LOCK_TIMEOUT_MINS
static final String SINGLE_USER_CASE_DB_NAME
static void deleteCase(CaseMetadata metadata)
void deleteReports(Collection<?extends Report > reports, boolean deleteFromDisk)
synchronized void closeRemoteEventChannel()
KeywordSearchService getKeywordSearchService()
static final int CASE_RESOURCES_LOCK_TIMEOUT_HOURS
final long MAX_IMAGE_THRESHOLD
List< Report > getAllReports()
static void clearTempSubDir(String tempSubDirPath)
static boolean canAddDataSources()
static boolean isValidName(String caseName)
void openCaseDataBase(ProgressIndicator progressIndicator)
void createCaseDirectoryIfDoesNotExist(ProgressIndicator progressIndicator)
CollaborationMonitor collaborationMonitor
void openCommunicationChannels(ProgressIndicator progressIndicator)
static void shutDownTaskExecutor(ExecutorService executor)
static void closeCoreWindows()
ProgressIndicator getProgressIndicator()
static String getModulesOutputDirRelPath()
void saveCaseMetadataToFile(ProgressIndicator progressIndicator)
static void deleteMultiUserCaseTextIndex(CaseNodeData caseNodeData, CaseMetadata metadata, ProgressIndicator progressIndicator, Logger logger)
void doOpenCaseAction(String progressIndicatorTitle, CaseAction< ProgressIndicator, Object, Void > caseAction, CaseLockType caseLockType, boolean allowCancellation, Object additionalParams)
Set< TimeZone > getTimeZone()
static void writeCaseNodeData(CaseNodeData nodeData)
static final String MODULE_FOLDER
void openCaseLevelServices(ProgressIndicator progressIndicator)
static void create(String caseDir, String caseDisplayName, String caseNumber, String examiner)
void openFileSystems(List< Image > images)
synchronized void openRemoteEventChannel(String channelName)
String getCaseDisplayName()
void createCaseNodeData(ProgressIndicator progressIndicator)
static void invokeStartupDialog()
void publishArtifactsPostedEvent(Blackboard.ArtifactsPostedEvent event)
static String displayNameToUniqueName(String caseDisplayName)
static void deleteFromRecentCases(CaseMetadata metadata, ProgressIndicator progressIndicator)
static void openAsCurrentCase(String caseMetadataFilePath)
static void removeEventSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
Lock tryGetExclusiveLock(CategoryNode category, String nodePath, int timeOut, TimeUnit timeUnit)
static boolean isNoNodeException(CoordinationServiceException ex)
void fireModuleDataEvent(ModuleDataEvent moduleDataEvent)
default void setCancelling(String cancellingMessage)
void setLastAccessDate(Date lastAccessDate)
void close(ProgressIndicator progressIndicator)
final ProgressIndicator progressIndicator
SleuthkitCase getSleuthkitCase()
void notifyBlackBoardArtifactTagAdded(BlackboardArtifactTag newTag)
static PropertyChangeSupport getPropertyChangeSupport()
String getCacheDirectory()
static void addPropertyChangeListener(PropertyChangeListener listener)
void removeSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
String getModuleDirectory()
void createCaseDatabase(ProgressIndicator progressIndicator)
Thread newThread(Runnable task)
static void removeEventSubscriber(String eventName, PropertyChangeListener subscriber)
void switchLoggingToCaseLogsDirectory(ProgressIndicator progressIndicator)
final CaseMetadata metadata
static void deleteTextIndex(CaseMetadata metadata, ProgressIndicator progressIndicator)
void deleteTempfilesFromCaseDirectory(ProgressIndicator progressIndicator)
void deleteReports(Collection<?extends Report > reports)
void notifyDataSourceAdded(Content dataSource, UUID addingDataSourceEventId)
Report addReport(String localPath, String srcModuleName, String reportName, Content parent)
static boolean pathExists(String filePath)
SleuthkitCase createPortableCase(String caseName, File portableCaseFolder)
R execute(T progressIndicator, V additionalParams)
BLACKBOARD_ARTIFACT_TAG_ADDED
static void open(String caseMetadataFilePath)
static void openAsCurrentCase(Case newCurrentCase, boolean isNewCase)
static CoordinationService.Lock acquireCaseResourcesLock(String caseDir)
String getOutputDirectory()
static void error(String title, String message)
String getOrCreateSubdirectory(String subDirectoryName)
boolean equalsName(String otherTypeName)
static final String EVENT_CHANNEL_NAME
static Case getCurrentCase()
static String getLocalHostName()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static String convertToAlphaNumericFormat(String timeZoneId)
static final String LOG_FOLDER
Void create(ProgressIndicator progressIndicator, Object additionalParams)
Lock tryGetSharedLock(CategoryNode category, String nodePath, int timeOut, TimeUnit timeUnit)
String getConfigDirectory()
static String getAppName()
static synchronized CoordinationService getInstance()
static volatile Case currentCase
static String getVersion()
void openAppServiceCaseResources(ProgressIndicator progressIndicator, boolean isNewCase)
String getExportDirectory()
static void updateGUIForCaseClosed()
void notifyAddingDataSource(UUID eventId)
static void addEventSubscriber(String eventName, PropertyChangeListener subscriber)
void notifyContentTagAdded(ContentTag newTag)
void cancelAllIngestJobs(IngestJob.CancellationReason reason)
static final String CASE_RESOURCES_THREAD_NAME
static StartupWindowProvider getInstance()
static void deleteCurrentCase()
static boolean deleteDir(File dirPath)
static void createAsCurrentCase(String caseDir, String caseDisplayName, String caseNumber, String examiner, CaseType caseType)
static void deleteCaseDirectory(CaseMetadata metadata, ProgressIndicator progressIndicator)
void notifyFailedAddingDataSource(UUID addingDataSourceEventId)
static void deleteMultiUserCase(CaseMetadata metadata, ProgressIndicator progressIndicator)
static final String CONFIG_FOLDER
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static final Object caseActionSerializationLock
static void deleteMultiUserCaseDatabase(CaseNodeData caseNodeData, CaseMetadata metadata, ProgressIndicator progressIndicator, Logger logger)
static boolean isCaseOpen()
String getTextIndexName()
static final String REPORTS_FOLDER
void progress(String message)
static final String TEMP_FOLDER
BLACKBOARD_ARTIFACT_TAG_DELETED
static void checkForCancellation()
static boolean canDeleteCurrentCase()
static void addEventSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
void updateCaseNodeData(ProgressIndicator progressIndicator)
static void error(String message)
final SleuthkitCase tskCase
static synchronized IngestServices getInstance()
String getExaminerEmail()