update paths for collab

This commit is contained in:
Karl Mortensen 2015-05-12 17:01:47 -04:00
parent e90f5c7203
commit 8d2f2fd21e
23 changed files with 354 additions and 143 deletions

View File

@ -50,6 +50,9 @@ GetTagNameDialog.tagNameAlreadyDef.msg=A {0} tag name has already been defined.
GetTagNameDialog.dupTagErr=Duplicate Tag Error
OpenLogFolder.error1=Log File Not Found: {0}
CTL_OpenLogFolder=Open Log Folder
CTL_OpenOutputFolder=Open Output Folder
OpenOutputFolder.error1=Output Folder Not Found: {0}
OpenOutputFolder.noCaseOpen=No open case, therefore no current output folder available.
ShowIngestProgressSnapshotAction.actionName.text=Get Ingest Progress Snapshot
OpenPythonModulesFolderAction.actionName.text=Python Plugins
OpenPythonModulesFolderAction.errorMsg.folderNotFound=Python plugins folder not found: {0}

View File

@ -0,0 +1,68 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> 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.actions;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import javax.swing.JOptionPane;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
/**
* Action in menu to open the folder containing the output files
*/
@ActionRegistration(
displayName = "#CTL_OpenOutputFolder", iconInMenu = true)
@ActionReference(path = "Menu/Help", position = 1850)
@ActionID(id = "org.sleuthkit.autopsy.actions.OpenOutputFolderAction", category = "Help")
public final class OpenOutputFolderAction implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
try {
File outputDir;
if (Case.isCaseOpen()) {
outputDir = new File(Case.getCurrentCase().getHostDirectory());
if (outputDir.exists() == false) {
NotifyDescriptor d
= new NotifyDescriptor.Message(NbBundle.getMessage(this.getClass(),
"OpenOutputFolder.error1", outputDir.getAbsolutePath()),
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(d);
} else {
Desktop.getDesktop().open(outputDir);
}
} else {
JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "OpenOutputFolder.noCaseOpen"));
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
}

View File

@ -133,6 +133,7 @@ Case.createCaseDir.exception.existCantRW=Cannot create case dir, already exists
Case.createCaseDir.exception.cantCreate=Cannot create case dir\: {0}
Case.createCaseDir.exception.cantCreateCaseDir=Could not create case directory\: {0}
Case.createCaseDir.exception.cantCreateModDir=Could not create modules output directory\: {0}
Case.createCaseDir.exception.cantCreateReportsDir=Could not create reports output directory\: {0}
Case.createCaseDir.exception.gen=Could not create case directory\: {0}
Case.OpenEventChannel.ErrMsg=Case opening process failed to connect to nodes collaborating on case {0}.
CaseDeleteAction.closeConfMsg.text=Are you sure want to close and delete this case? \n\

View File

@ -25,6 +25,9 @@ import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.UnknownHostException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -188,6 +191,9 @@ public class Case implements SleuthkitCase.ErrorObserver {
private static final Logger logger = Logger.getLogger(Case.class.getName());
static final String CASE_EXTENSION = "aut"; //NON-NLS
static final String CASE_DOT_EXTENSION = "." + CASE_EXTENSION;
private static String HOSTNAME;
private static String REPORTOUTPUT = "Reports";
private static String MODULEOUTPUT = "ModuleOutput";
// we cache if the case has data in it yet since a few places ask for it and we dont' need to keep going to DB
private boolean hasData = false;
@ -204,6 +210,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
this.caseType = type;
this.db = db;
this.services = new Services(db);
setHostName();
}
/**
@ -315,7 +322,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
// create case directory if it doesn't already exist.
if (new File(caseDir).exists() == false) {
Case.createCaseDirectory(caseDir);
Case.createCaseDirectory(caseDir, caseType);
}
String configFilePath = caseDir + File.separator + caseName + CASE_DOT_EXTENSION;
@ -738,7 +745,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
if (xmlcm == null) {
return "";
} else {
return xmlcm.getTempDir();
return xmlcm.getTempDir(HOSTNAME, caseType);
}
}
@ -751,7 +758,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
if (xmlcm == null) {
return "";
} else {
return xmlcm.getCacheDir();
return xmlcm.getCacheDir(HOSTNAME, caseType);
}
}
@ -764,7 +771,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
if (xmlcm == null) {
return "";
} else {
return xmlcm.getExportDir();
return xmlcm.getExportDir(HOSTNAME, caseType);
}
}
@ -777,7 +784,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
if (xmlcm == null) {
return "";
} else {
return xmlcm.getLogDir();
return xmlcm.getLogDir(HOSTNAME, caseType);
}
}
@ -808,24 +815,65 @@ public class Case implements SleuthkitCase.ErrorObserver {
}
/**
* Get absolute module output directory path where modules should save their
* permanent data The directory is a subdirectory of this case dir.
* Get the host output directory path where modules should save their
* permanent data. If single-user case, the directory is a subdirectory of
* the case directory. If multi-user case, the directory is a subdirectory
* of HOSTNAME, which is a subdirectory of the case directory.
*
* @return the path to the host output directory
*/
public String getHostDirectory() {
if (xmlcm == null) {
return "";
} else {
return xmlcm.getHostPath(HOSTNAME, this.getCaseType());
}
}
/**
* Get the reports directory path where modules should save their reports.
*
* @return absolute path to the report output directory
*/
public String getReportDirectory() {
Path thePath = Paths.get(this.getHostDirectory(), REPORTOUTPUT);
if (!thePath.toFile().exists()) {
thePath.toFile().mkdirs();
}
return thePath.toString();
}
/**
* Get module output directory path where modules should save their
* permanent data.
*
* @return absolute path to the module output dir
*/
public String getModulesOutputDirAbsPath() {
return this.getCaseDirectory() + File.separator + getModulesOutputDirRelPath();
public String getModulesDirectory() {
Path thePath = Paths.get(this.getHostDirectory(), MODULEOUTPUT);
if (!thePath.toFile().exists()) {
thePath.toFile().mkdirs();
}
return thePath.toString();
}
/**
* Get relative (with respect to case dir) module output directory path
* where modules should save their permanent data The directory is a
* where modules should save their permanent data. The directory is a
* subdirectory of this case dir.
*
* @return relative path to the module output dir
*/
public static String getModulesOutputDirRelPath() {
return "ModuleOutput"; //NON-NLS
public String getModuleOutputDirectoryRelativePath() {
Path thePath;
if (getCaseType() == CaseType.MULTI_USER_CASE) {
thePath = Paths.get(HOSTNAME, MODULEOUTPUT);
} else {
thePath = Paths.get(MODULEOUTPUT);
}
// Do not autocreate this relative path. It will have already been
// created when the case was made.
return thePath.toString();
}
/**
@ -1046,8 +1094,8 @@ public class Case implements SleuthkitCase.ErrorObserver {
* @throws CaseActionException throw if could not create the case dir
* @Deprecated
*/
static void createCaseDirectory(String caseDir, String caseName) throws CaseActionException {
createCaseDirectory(caseDir);
static void createCaseDirectory(String caseDir, String caseName, CaseType caseType) throws CaseActionException {
createCaseDirectory(caseDir, caseType);
}
@ -1055,10 +1103,10 @@ public class Case implements SleuthkitCase.ErrorObserver {
* Create the case directory and its needed subfolders.
*
* @param caseDir Path to the case directory (typically base + case name)
*
* @param caseType The type of case, single-user or multi-user
* @throws CaseActionException throw if could not create the case dir
*/
static void createCaseDirectory(String caseDir) throws CaseActionException {
static void createCaseDirectory(String caseDir, CaseType caseType) throws CaseActionException {
File caseDirF = new File(caseDir);
if (caseDirF.exists()) {
@ -1079,17 +1127,25 @@ public class Case implements SleuthkitCase.ErrorObserver {
}
// create the folders inside the case directory
result = result && (new File(caseDir + File.separator + XMLCaseManagement.EXPORT_FOLDER_RELPATH)).mkdir()
&& (new File(caseDir + File.separator + XMLCaseManagement.LOG_FOLDER_RELPATH)).mkdir()
&& (new File(caseDir + File.separator + XMLCaseManagement.TEMP_FOLDER_RELPATH)).mkdir()
&& (new File(caseDir + File.separator + XMLCaseManagement.CACHE_FOLDER_RELPATH)).mkdir();
String hostClause = "";
if (HOSTNAME == null || HOSTNAME.isEmpty()) {
setHostName();
}
if (caseType == CaseType.MULTI_USER_CASE) {
hostClause = File.separator + HOSTNAME;
}
result = result && (new File(caseDir + hostClause + File.separator + XMLCaseManagement.EXPORT_FOLDER_RELPATH)).mkdirs()
&& (new File(caseDir + hostClause + File.separator + XMLCaseManagement.LOG_FOLDER_RELPATH)).mkdirs()
&& (new File(caseDir + hostClause + File.separator + XMLCaseManagement.TEMP_FOLDER_RELPATH)).mkdirs()
&& (new File(caseDir + hostClause + File.separator + XMLCaseManagement.CACHE_FOLDER_RELPATH)).mkdirs();
if (result == false) {
throw new CaseActionException(
NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.cantCreateCaseDir", caseDir));
}
final String modulesOutDir = caseDir + File.separator + getModulesOutputDirRelPath();
final String modulesOutDir = caseDir + hostClause + File.separator + MODULEOUTPUT;
result = new File(modulesOutDir).mkdir();
if (result == false) {
throw new CaseActionException(
@ -1097,6 +1153,14 @@ public class Case implements SleuthkitCase.ErrorObserver {
modulesOutDir));
}
final String reportsOutDir = caseDir + hostClause + File.separator + REPORTOUTPUT;
result = new File(reportsOutDir).mkdir();
if (result == false) {
throw new CaseActionException(
NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.cantCreateReportsDir",
modulesOutDir));
}
} catch (Exception e) {
throw new CaseActionException(
NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.gen", caseDir), e);
@ -1171,7 +1235,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
* @param openedCase
*/
private static void checkSubFolders(Case openedCase) {
String modulesOutputDir = openedCase.getModulesOutputDirAbsPath();
String modulesOutputDir = openedCase.getModulesDirectory();
File modulesOutputDirF = new File(modulesOutputDir);
if (!modulesOutputDirF.exists()) {
logger.log(Level.INFO, "Creating modules output dir for the case."); //NON-NLS
@ -1284,4 +1348,24 @@ public class Case implements SleuthkitCase.ErrorObserver {
return hasData;
}
/**
* Set the host name variable. Sometimes the network can be finicky, so the
* answer returned by getHostName() could throw an exception or be null.
* Have it read the environment variable if getHostName() is unsuccessful.
* Also note that some calls into the Case class are static via Case.*, so
* anywhere we use HOSTNAME prior to a Case class being instantiated, we
* must call setHostName() first.
*/
private static void setHostName() {
try {
HOSTNAME = java.net.InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException ex) {
// getLocalHost().getHostName() can fail in some situations.
// Use environment variable if so.
HOSTNAME = System.getenv("COMPUTERNAME");
}
if (HOSTNAME == null || HOSTNAME.isEmpty()) {
HOSTNAME = System.getenv("COMPUTERNAME");
}
}
}

View File

@ -242,7 +242,7 @@ class NewCaseWizardPanel1 implements WizardDescriptor.ValidatingPanel<WizardDesc
if (res2 != null && res2 == DialogDescriptor.YES_OPTION) {
// if user say yes
try {
createDirectory(caseDirPath);
createDirectory(caseDirPath, getComponent().getCaseType());
} catch (Exception ex) {
String errorMsg = NbBundle.getMessage(this.getClass(),
"NewCaseWizardPanel1.validate.errMsg.cantCreateParDir.msg",
@ -259,7 +259,7 @@ class NewCaseWizardPanel1 implements WizardDescriptor.ValidatingPanel<WizardDesc
}
} else {
try {
createDirectory(caseDirPath);
createDirectory(caseDirPath, getComponent().getCaseType());
} catch (Exception ex) {
String errorMsg = NbBundle
.getMessage(this.getClass(), "NewCaseWizardPanel1.validate.errMsg.cantCreateDir");
@ -284,11 +284,11 @@ class NewCaseWizardPanel1 implements WizardDescriptor.ValidatingPanel<WizardDesc
/*
* create the directory and create a new case
*/
private void createDirectory(final String caseDirPath) throws WizardValidationException {
// try to create the directory with the case name in the choosen parent directory
private void createDirectory(final String caseDirPath, CaseType caseType) throws WizardValidationException {
// try to create the directory with the case name in the chosen parent directory
boolean success = false;
try {
Case.createCaseDirectory(caseDirPath);
Case.createCaseDirectory(caseDirPath, caseType);
success = true;
} catch (CaseActionException ex) {
logger.log(Level.SEVERE, "Could not createDirectory for the case, ", ex); //NON-NLS

View File

@ -19,6 +19,8 @@
package org.sleuthkit.autopsy.casemodule;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -85,7 +87,7 @@ import org.xml.sax.SAXException;
private String caseName; // case name
private String caseNumber; // case number
private String examiner; // examiner name
private String schemaVersion = "1.0";
private String schemaVersion = "2.0";
private String autopsySavedVersion;
private CaseType caseType; // The type of case: local or shared
private String dbName; // The name of the database
@ -344,13 +346,17 @@ import org.xml.sax.SAXException;
*
* @return caseDirPath the case directory path
*/
public String getCaseDirectory() {
if (doc == null) {
return "";
} else {
return caseDirPath;
}
// Note: change this to get the case name from the xml file if needed
public String getCaseDirectory() {
if (doc == null) {
return "";
} else {
File casePath = new File(caseDirPath);
if (!casePath.exists()) {
casePath.mkdirs();
}
return caseDirPath;
}
// Note: change this to get the case name from the xml file if needed
}
/**
@ -450,81 +456,139 @@ import org.xml.sax.SAXException;
}
}
/**
* Gets the full path to the log directory
*
* @return logDir the full path of the "Log" directory
*/
protected String getLogDir() {
if (doc != null) {
Element logElement = (Element) getCaseElement().getElementsByTagName(LOG_FOLDER_NAME).item(0);
if (logElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
return caseDirPath + File.separator + logElement.getTextContent();
} else {
return logElement.getTextContent();
}
} else {
return ""; // should throw error or exception
}
}
/**
* Get the path to the case, with the host name in it if it's a multi-user
* case, without the host name if it's a single-user case.
*
* @param hostname The host name
* @param caseType The case type
* @return
*/
public String getHostPath(String hostname, CaseType caseType) {
Path thePath;
if (caseType == CaseType.MULTI_USER_CASE) {
thePath = Paths.get(caseDirPath, hostname);
} else {
thePath = Paths.get(caseDirPath);
}
/**
* Gets the full path to the temp directory
*
* @return tempDir the full path of the "Temp" directory
*/
protected String getTempDir() {
if (doc != null) {
Element tempElement = (Element) getCaseElement().getElementsByTagName(TEMP_FOLDER_NAME).item(0);
if (tempElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
return caseDirPath + File.separator + tempElement.getTextContent();
} else {
return tempElement.getTextContent();
}
} else {
return ""; // should throw error or exception
}
}
if (!thePath.toFile().exists()) {
thePath.toFile().mkdirs();
}
return thePath.toString();
}
/**
* Gets the full path to the Export directory
*
* @return exportDir the full path of the "Export" directory
*/
protected String getExportDir() {
if (doc != null) {
Element exportElement = (Element) getCaseElement().getElementsByTagName(EXPORT_FOLDER_NAME).item(0);
if (exportElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
return caseDirPath + File.separator + exportElement.getTextContent();
} else {
return exportElement.getTextContent();
}
} else {
return ""; // should throw error or exception
}
}
/**
* Gets the full path to the log directory
*
* @param hostname The hostname of this machine
* @param caseType The type of the case.
* @return logDir the full path of the "Log" directory
*/
protected String getLogDir(String hostname, CaseType caseType) {
String thePath = getHostPath(hostname, caseType);
if (doc != null) {
Element logElement = (Element) getCaseElement().getElementsByTagName(LOG_FOLDER_NAME).item(0);
if (logElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
thePath += File.separator + logElement.getTextContent();
} else {
thePath = logElement.getTextContent();
}
} else {
thePath += File.separator + LOG_FOLDER_RELPATH;
}
/**
* Gets the full path to the Cache directory
*
* @return cacheDir the full path of the "Cache" directory
*/
protected String getCacheDir() {
if (doc != null) {
Element cacheElement = (Element) getCaseElement().getElementsByTagName(CACHE_FOLDER_NAME).item(0);
if (cacheElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
return caseDirPath + File.separator + cacheElement.getTextContent();
} else {
return cacheElement.getTextContent();
}
} else {
return ""; // should throw error or exception
}
}
File logPath = new File(thePath);
if (!logPath.exists()) {
logPath.mkdirs();
}
return thePath;
}
/**
* Gets the full path to the temp directory
*
* @param hostname The hostname of this machine
* @param caseType The type of the case.
* @return tempDir the full path of the "Temp" directory
*/
protected String getTempDir(String hostname, CaseType caseType) {
String thePath = getHostPath(hostname, caseType);
if (doc != null) {
Element tempElement = (Element) getCaseElement().getElementsByTagName(TEMP_FOLDER_NAME).item(0);
if (tempElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
thePath += File.separator + tempElement.getTextContent();
} else {
thePath = tempElement.getTextContent();
}
} else {
thePath += File.separator + TEMP_FOLDER_RELPATH;
}
File tempPath = new File(thePath);
if (!tempPath.exists()) {
tempPath.mkdirs();
}
return thePath;
}
/**
* Gets the full path to the Export directory
*
* @param hostname The hostname of this machine
* @param caseType The type of the case.
* @return exportDir the full path of the "Export" directory
*/
protected String getExportDir(String hostname, CaseType caseType) {
String thePath = getHostPath(hostname, caseType);
if (doc != null) {
Element exportElement = (Element) getCaseElement().getElementsByTagName(EXPORT_FOLDER_NAME).item(0);
if (exportElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
thePath += File.separator + exportElement.getTextContent();
} else {
thePath = exportElement.getTextContent();
}
} else {
thePath += File.separator + EXPORT_FOLDER_RELPATH;
}
File exportPath = new File(thePath);
if (!exportPath.exists()) {
exportPath.mkdirs();
}
return thePath;
}
/**
* Gets the full path to the Cache directory
*
* @param hostname The hostname of this machine
* @param caseType The type of the case.
* @return cacheDir the full path of the "Cache" directory
*/
protected String getCacheDir(String hostname, CaseType caseType) {
String thePath = getHostPath(hostname, caseType);
if (doc != null) {
Element cacheElement = (Element) getCaseElement().getElementsByTagName(CACHE_FOLDER_NAME).item(0);
if (cacheElement.getAttribute(RELATIVE_NAME).equals(RELATIVE_TRUE)) {
thePath += File.separator + cacheElement.getTextContent();
} else {
thePath = cacheElement.getTextContent();
}
} else {
thePath += File.separator + CACHE_FOLDER_RELPATH;
}
File cachePath = new File(thePath);
if (!cachePath.exists()) {
cachePath.mkdirs();
}
return thePath;
}
/**
* Initialize the basic values for a new case management file. Note: this is
* the schema version 1.0
* the schema version 2.0
*
* @param dirPath case directory path
* @param caseName the name of the config file to be located in the case
@ -532,7 +596,7 @@ import org.xml.sax.SAXException;
* @param examiner examiner for the case (optional, can be empty string
* @param caseNumber case number (optional), can be empty
* @param dbName the name of the database. Could be a local path, could be
* a Postgre db name.
* a Postgres db name.
* @param textIndexName The name of the index where extracted text is stored.
*/
protected void create(String dirPath, String caseName, String examiner, String caseNumber, CaseType caseType, String dbName, String textIndexName) throws CaseActionException {

View File

@ -122,7 +122,7 @@ import org.sleuthkit.datamodel.VolumeSystem;
}
};
fc.setCurrentDirectory(new File(Case.getCurrentCase().getCaseDirectory() + File.separator + "Export"));
fc.setCurrentDirectory(new File(Case.getCurrentCase().getExportDirectory()));
fc.setDialogTitle(
NbBundle.getMessage(this.getClass(), "ExtractUnallocAction.dlgTitle.selectDirToSaveTo.msg"));
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
@ -500,7 +500,7 @@ import org.sleuthkit.datamodel.VolumeSystem;
this.ImageId = img.getId();
this.ImageName = img.getName();
this.FileName = this.ImageName + "-Unalloc-" + this.ImageId + "-" + 0 + ".dat"; //NON-NLS
this.FileInstance = new File(Case.getCurrentCase().getCaseDirectory() + File.separator + "Export" + File.separator + this.FileName);
this.FileInstance = new File(Case.getCurrentCase().getExportDirectory() + File.separator + this.FileName);
this.SizeInBytes = calcSizeInBytes();
}
@ -520,7 +520,7 @@ import org.sleuthkit.datamodel.VolumeSystem;
this.ImageId = 0;
}
this.FileName = this.ImageName + "-Unalloc-" + this.ImageId + "-" + VolumeId + ".dat"; //NON-NLS
this.FileInstance = new File(Case.getCurrentCase().getCaseDirectory() + File.separator + "Export" + File.separator + this.FileName);
this.FileInstance = new File(Case.getCurrentCase().getExportDirectory() + File.separator + this.FileName);
this.llf = getUnallocFiles(volu);
Collections.sort(llf, new SortObjId());
this.SizeInBytes = calcSizeInBytes();

View File

@ -84,7 +84,7 @@ public class SampleExecutableDataSourceIngestModule implements DataSourceIngestM
this.context = context;
if (refCounter.incrementAndGet(context.getJobId()) == 1) {
// Create an output directory for this job.
outputDirPath = Case.getCurrentCase().getModulesOutputDirAbsPath() + File.separator + moduleName; //NON-NLS
outputDirPath = Case.getCurrentCase().getModulesDirectory() + File.separator + moduleName; //NON-NLS
File outputDir = new File(outputDirPath);
if (outputDir.exists() == false) {
outputDir.mkdirs();

View File

@ -234,7 +234,7 @@ public final class ExternalResultsImporter {
private String getPathRelativeToCaseFolder(String localPath) {
String relativePath = "";
String caseDirectoryPath = Case.getCurrentCase().getCaseDirectory();
String caseDirectoryPath = Case.getCurrentCase().getHostDirectory();
Path path = Paths.get(localPath);
if (path.isAbsolute()) {
Path pathBase = Paths.get(caseDirectoryPath);

View File

@ -56,7 +56,7 @@ class ContactAnalyzer {
List<AbstractFile> absFiles;
try {
SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
absFiles = skCase.findAllFilesWhere("LOWER(name) LIKE '%call_history%' "); //NON-NLS //get exact file names
absFiles = skCase.findAllFilesWhere("LOWER(name) LIKE LOWER('%call_history%') "); //NON-NLS //get exact file names
if (absFiles.isEmpty()) {
return;
}

View File

@ -142,8 +142,10 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
}
// Check that we have roughly enough disk space left to complete the operation
// Some network drives always return -1 for free disk space.
// In this case, expect enough space and move on.
long freeDiskSpace = IngestServices.getInstance().getFreeDiskSpace();
if ((file.getSize() * 2) > freeDiskSpace) {
if ((freeDiskSpace!=-1) && ((file.getSize() * 2) > freeDiskSpace)) {
logger.log(Level.SEVERE, "PhotoRec error processing {0} with {1} Not enough space on primary disk to carve unallocated space.", // NON-NLS
new Object[]{file.getName(), PhotoRecCarverIngestModuleFactory.getModuleName()}); // NON-NLS
return IngestModule.ProcessResult.ERROR;
@ -278,7 +280,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule {
* @throws org.sleuthkit.autopsy.ingest.IngestModule.IngestModuleException
*/
synchronized static Path createModuleOutputDirectoryForCase() throws IngestModule.IngestModuleException {
Path path = Paths.get(Case.getCurrentCase().getModulesOutputDirAbsPath(), PhotoRecCarverIngestModuleFactory.getModuleName());
Path path = Paths.get(Case.getCurrentCase().getModulesDirectory(), PhotoRecCarverIngestModuleFactory.getModuleName());
try {
Files.createDirectory(path);
}

View File

@ -105,8 +105,8 @@ public final class SevenZipIngestModule implements FileIngestModule {
final Case currentCase = Case.getCurrentCase();
moduleDirRelative = Case.getModulesOutputDirRelPath() + File.separator + ArchiveFileExtractorModuleFactory.getModuleName();
moduleDirAbsolute = currentCase.getModulesOutputDirAbsPath() + File.separator + ArchiveFileExtractorModuleFactory.getModuleName();
moduleDirRelative = currentCase.getModuleOutputDirectoryRelativePath() + File.separator + ArchiveFileExtractorModuleFactory.getModuleName();
moduleDirAbsolute = currentCase.getModulesDirectory() + File.separator + ArchiveFileExtractorModuleFactory.getModuleName();
File unpackDirPathFile = new File(moduleDirAbsolute);

View File

@ -110,7 +110,7 @@ import org.sleuthkit.datamodel.TskData;
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
Date date = new Date();
String dateNoTime = dateFormat.format(date);
this.reportPath = currentCase.getCaseDirectory() + File.separator + REPORTS_DIR + File.separator + currentCase.getName() + " " + dateNoTime + File.separator;
this.reportPath = currentCase.getReportDirectory()+ File.separator + currentCase.getName() + " " + dateNoTime + File.separator;
this.errorList = new ArrayList<String>();

View File

@ -89,17 +89,6 @@ public final class ReportWizardAction extends CallableSystemAction implements P
if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
Case newCase = (Case) evt.getNewValue();
setEnabled(newCase != null);
// Make the cases' Reoports folder, if it doesn't exist
if (newCase != null) {
boolean exists = (new File(newCase.getCaseDirectory() + File.separator + "Reports")).exists();
if (!exists) {
boolean reportCreate = (new File(newCase.getCaseDirectory() + File.separator + "Reports")).mkdirs();
if (!reportCreate) {
logger.log(Level.WARNING, "Could not create Reports directory for case. It does not exist."); //NON-NLS
}
}
}
}
}
});

View File

@ -69,7 +69,7 @@ public class SaveSnapshot extends Action {
//choose location/name
DirectoryChooser fileChooser = new DirectoryChooser();
fileChooser.setTitle(NbBundle.getMessage(this.getClass(), "SaveSnapshot.fileChoose.title.text"));
fileChooser.setInitialDirectory(new File(Case.getCurrentCase().getCaseDirectory() + File.separator + "Reports")); // NON-NLS
fileChooser.setInitialDirectory(new File(Case.getCurrentCase().getReportDirectory()));
File outFolder = fileChooser.showDialog(null);
if (outFolder == null) {
return;

View File

@ -107,7 +107,7 @@ public class EventsRepository {
public EventsRepository(ReadOnlyObjectProperty<ZoomParams> currentStateProperty) {
//TODO: we should check that case is open, or get passed a case object/directory -jm
this.eventDB = EventDB.getEventDB(Case.getCurrentCase().getCaseDirectory());
this.eventDB = EventDB.getEventDB(Case.getCurrentCase().getHostDirectory());
idToEventCache = CacheBuilder.newBuilder().maximumSize(5000L).expireAfterAccess(10, TimeUnit.MINUTES).removalListener((RemovalNotification<Long, TimeLineEvent> rn) -> {
//LOGGER.log(Level.INFO, "evicting event: {0}", rn.toString());

View File

@ -88,7 +88,7 @@ class PerCaseProperties {
* @return true if the config exists, false otherwise.
*/
public synchronized boolean configExists(String moduleName) {
File f = new File(c.getCaseDirectory() + File.separator + moduleName + ".properties");
File f = new File(c.getHostDirectory() + File.separator + moduleName + ".properties"); // NON-NLS
return f.exists();
}
@ -114,7 +114,7 @@ class PerCaseProperties {
* file doesn't exist.
*/
private synchronized String getPropertyPath(String moduleName) {
return c.getCaseDirectory() + File.separator + moduleName + ".properties"; //NON-NLS
return c.getHostDirectory() + File.separator + moduleName + ".properties"; //NON-NLS
}
/**

View File

@ -639,7 +639,7 @@ public class Server {
logger.log(Level.INFO, "Validating keyword search index location"); //NON-NLS
String properIndexPath = getIndexDirPath(theCase);
String legacyIndexPath = theCase.getCaseDirectory()
String legacyIndexPath = theCase.getHostDirectory()
+ File.separator + "keywordsearch" + File.separator + "data"; //NON-NLS
@ -680,8 +680,8 @@ public class Server {
* @return absolute path to index dir
*/
String getIndexDirPath(Case theCase) {
String indexDir = theCase.getModulesOutputDirAbsPath()
+ File.separator + "keywordsearch" + File.separator + "data"; //NON-NLS
String indexDir = theCase.getModulesDirectory() +
File.separator + "keywordsearch" + File.separator + "data"; //NON-NLS
return indexDir;
}

View File

@ -209,7 +209,7 @@ public final class RAImageIngestModule implements DataSourceIngestModule {
* @return Path to directory
*/
protected static String getRAOutputPath(Case a_case, String mod) {
String tmpDir = a_case.getModulesOutputDirAbsPath() + File.separator + "RecentActivity" + File.separator + mod; //NON-NLS
String tmpDir = a_case.getModulesDirectory()+ File.separator + "RecentActivity" + File.separator + mod; //NON-NLS
File dir = new File(tmpDir);
if (dir.exists() == false) {
dir.mkdirs();

View File

@ -83,7 +83,7 @@ class ScalpelCarverIngestModule implements FileIngestModule {
}
// make sure module output directory exists; create it if it doesn't
moduleOutputDirPath = Case.getCurrentCase().getModulesOutputDirAbsPath()
moduleOutputDirPath = Case.getCurrentCase().getModulesDirectory()
+ File.separator + MODULE_OUTPUT_DIR_NAME;
File moduleOutputDir = new File(moduleOutputDirPath);
if (!moduleOutputDir.exists()) {

View File

@ -1,5 +1,5 @@
#Updated by build script
#Tue, 28 Apr 2015 18:19:58 -0400
#Tue, 12 May 2015 16:43:39 -0400
LBL_splash_window_title=Starting Autopsy
SPLASH_HEIGHT=314
SPLASH_WIDTH=538

View File

@ -1,5 +1,5 @@
#Updated by build script
#Tue, 28 Apr 2015 18:19:58 -0400
#Tue, 12 May 2015 16:43:39 -0400
CTL_MainWindow_Title=Autopsy 3.1.2
CTL_MainWindow_Title_No_Project=Autopsy 3.1.2

View File

@ -252,8 +252,8 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
}
public static String getModuleOutputPath() {
String outDir = Case.getCurrentCase().getModulesOutputDirAbsPath() + File.separator
+ EmailParserModuleFactory.getModuleName();
String outDir = Case.getCurrentCase().getModulesDirectory() +
File.separator + EmailParserModuleFactory.getModuleName();
File dir = new File(outDir);
if (dir.exists() == false) {
dir.mkdirs();
@ -262,8 +262,8 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
}
public static String getRelModuleOutputPath() {
return Case.getModulesOutputDirRelPath() + File.separator
+ EmailParserModuleFactory.getModuleName();
return Case.getCurrentCase().getModuleOutputDirectoryRelativePath() +
File.separator + EmailParserModuleFactory.getModuleName();
}
/**