diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java index a1629609ce..4d5e3eac36 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesDSProcessor.java @@ -193,7 +193,7 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat List command = new ArrayList<>(); for (final String l01Path : logicalEvidenceFilePaths) { command.clear(); - command.add(String.format("\"%s\"", ewfexportPath.toAbsolutePath().toString())); + command.add(ewfexportPath.toAbsolutePath().toString()); command.add("-f"); command.add("files"); command.add("-t"); @@ -203,8 +203,8 @@ public class LocalFilesDSProcessor implements DataSourceProcessor, AutoIngestDat } Path dirPath = Paths.get(FilenameUtils.getBaseName(l01Path) + UNIQUENESS_CONSTRAINT_SEPERATOR + System.currentTimeMillis()); - command.add(String.format("\"%s\"", dirPath.toString())); - command.add(String.format("\"%s\"", l01Path)); + command.add(dirPath.toString()); + command.add(l01Path); ProcessBuilder processBuilder = new ProcessBuilder(command); processBuilder.directory(l01Dir); try { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/UnpackagePortableCaseProgressDialog.java b/Core/src/org/sleuthkit/autopsy/casemodule/UnpackagePortableCaseProgressDialog.java index 914f88afb1..b5f495806b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/UnpackagePortableCaseProgressDialog.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/UnpackagePortableCaseProgressDialog.java @@ -173,10 +173,10 @@ class UnpackagePortableCaseProgressDialog extends javax.swing.JDialog implements throw new TskCoreException("Error finding 7-Zip executable"); // NON-NLS } - String outputFolderSwitch = String.format("\"-o%s\"",outputFolder); // NON-NLS + String outputFolderSwitch = "-o" + outputFolder; // NON-NLS ProcessBuilder procBuilder = new ProcessBuilder(); procBuilder.command( - String.format("\"%s\"",sevenZipExe.getAbsolutePath()), + sevenZipExe.getAbsolutePath(), "x", // Extract packagedCase, outputFolderSwitch diff --git a/Core/src/org/sleuthkit/autopsy/modules/ileappanalyzer/ILeappAnalyzerIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/ileappanalyzer/ILeappAnalyzerIngestModule.java index fafb8444b0..f859919bae 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/ileappanalyzer/ILeappAnalyzerIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/ileappanalyzer/ILeappAnalyzerIngestModule.java @@ -213,8 +213,8 @@ public class ILeappAnalyzerIngestModule implements DataSourceIngestModule { ProcessBuilder processBuilder = buildProcessWithRunAsInvoker( "\"" + iLeappExecutable + "\"", //NON-NLS "-t", iLeappFileSystemType, //NON-NLS - "-i", String.format("\"%s\"",sourceFilePath), //NON-NLS - "-o", String.format("\"%s\"",moduleOutputPath.toString()) + "-i", sourceFilePath, //NON-NLS + "-o", moduleOutputPath.toString() ); processBuilder.redirectError(moduleOutputPath.resolve("iLeapp_err.txt").toFile()); //NON-NLS processBuilder.redirectOutput(moduleOutputPath.resolve("iLeapp_out.txt").toFile()); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java index d887f3ba4c..1b42cc7f47 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java @@ -321,9 +321,9 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule { ProcessBuilder processAndSettings = new ProcessBuilder( executableFile.toString(), "/d", // NON-NLS - String.format("\"%s\"", Paths.get(outputDirPath.toAbsolutePath().toString(), PHOTOREC_RESULTS_BASE).toString()), + outputDirPath.toAbsolutePath().toString() + File.separator + PHOTOREC_RESULTS_BASE, "/cmd", // NON-NLS - String.format("\"%s\"",tempFilePath.toFile().toString())); + tempFilePath.toFile().toString()); processAndSettings.command().add(this.optionsString); diff --git a/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java b/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java index c2e685ca31..b71694f2d4 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/pictureanalyzer/impls/HEICProcessor.java @@ -190,9 +190,9 @@ public class HEICProcessor implements PictureProcessor { // Any additional images found within the HEIC container will be // formatted as fileName-1.jpg, fileName-2.jpg, etc. final ProcessBuilder processBuilder = new ProcessBuilder() - .command(String.format("\"%s\"",IMAGE_MAGICK_PATH.toString()), - String.format("\"%s\"",localDiskCopy.toString()), - String.format("\"%s\"",outputFile.toString())); + .command(IMAGE_MAGICK_PATH.toString(), + localDiskCopy.toString(), + outputFile.toString()); processBuilder.redirectError(imageMagickErrorOutput.toFile()); diff --git a/Core/src/org/sleuthkit/autopsy/modules/plaso/PlasoIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/plaso/PlasoIngestModule.java index d1838c2798..d359332f84 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/plaso/PlasoIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/plaso/PlasoIngestModule.java @@ -235,8 +235,8 @@ public class PlasoIngestModule implements DataSourceIngestModule { "--parsers", "\"" + parsersString + "\"",//NON-NLS "--no_dependencies_check", //NON-NLS "--workers", String.valueOf(LOG2TIMELINE_WORKERS),//NON-NLS - String.format("\"%s\"",moduleOutputPath.resolve(PLASO).toString()), - String.format("\"%s\"",image.getPaths()[0]) + moduleOutputPath.resolve(PLASO).toString(), + image.getPaths()[0] ); processBuilder.redirectError(moduleOutputPath.resolve("log2timeline_err.txt").toFile()); //NON-NLS return processBuilder; @@ -256,8 +256,8 @@ public class PlasoIngestModule implements DataSourceIngestModule { ProcessBuilder processBuilder = buildProcessWithRunAsInvoker( "\"" + psortExecutable + "\"", //NON-NLS "-o", "4n6time_sqlite", //NON-NLS - "-w", String.format("\"%s\"",moduleOutputPath.resolve("plasodb.db3").toString()), //NON-NLS - String.format("\"%s\"",moduleOutputPath.resolve(PLASO).toString()) + "-w", moduleOutputPath.resolve("plasodb.db3").toString(), //NON-NLS + moduleOutputPath.resolve(PLASO).toString() ); processBuilder.redirectOutput(moduleOutputPath.resolve("psort_output.txt").toFile()); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java b/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java index 29dc530aa0..83bfb2fdae 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java @@ -1329,10 +1329,10 @@ public class PortableCaseReportModule implements ReportModule { File zipFile = Paths.get(tempZipFolder.getAbsolutePath(), caseName + ".zip").toFile(); // NON-NLS ProcessBuilder procBuilder = new ProcessBuilder(); procBuilder.command( - String.format("\"%s\"",sevenZipExe.getAbsolutePath()), + sevenZipExe.getAbsolutePath(), "a", // Add to archive - String.format("\"%s\"",zipFile.getAbsolutePath()), - String.format("\"%s\"",dirToCompress.toAbsolutePath().toString()), + zipFile.getAbsolutePath(), + dirToCompress.toAbsolutePath().toString(), chunkOption ); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java index d68493e59a..9282362c1c 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java @@ -196,7 +196,7 @@ class VolatilityProcessor { List commandLine = new ArrayList<>(); commandLine.add("\"" + executableFile + "\""); //NON-NLS File memoryImage = new File(memoryImagePath); - commandLine.add("--filename=" + String.format("\"%s\"",memoryImage.getName())); //NON-NLS + commandLine.add("--filename=" + memoryImage.getName()); //NON-NLS if (!profile.isEmpty()) { commandLine.add("--profile=" + profile); //NON-NLS } @@ -213,7 +213,7 @@ class VolatilityProcessor { if (!directory.exists()) { directory.mkdirs(); } - commandLine.add("--dump-dir=" + String.format("\"%s\"",outputDir)); //NON-NLS + commandLine.add("--dump-dir=" + outputDir); //NON-NLS break; default: break; diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractEdge.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractEdge.java index d9f8278a1b..aeb2b27954 100755 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractEdge.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractEdge.java @@ -575,10 +575,10 @@ final class ExtractEdge extends Extract { List commandLine = new ArrayList<>(); commandLine.add(dumperPath); commandLine.add("/table"); //NON-NLS - commandLine.add(String.format("\"%s\"",inputFilePath)); + commandLine.add(inputFilePath); commandLine.add("*"); //NON-NLS commandLine.add("/scomma"); //NON-NLS - commandLine.add(String.format("\"%s\"",outputDir + "\\" + "*.csv")); //NON-NLS + commandLine.add(outputDir + "\\" + "*.csv"); //NON-NLS ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(outputFilePath.toFile()); diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java index 576a02a393..d128c09dc7 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractIE.java @@ -400,7 +400,7 @@ class ExtractIE extends Extract { List commandLine = new ArrayList<>(); commandLine.add(JAVA_PATH); commandLine.add("-cp"); //NON-NLS - commandLine.add(String.format("\"%s\"",PASCO_LIB_PATH)); + commandLine.add(PASCO_LIB_PATH); commandLine.add("isi.pasco2.Main"); //NON-NLS commandLine.add("-T"); //NON-NLS commandLine.add("history"); //NON-NLS diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractPrefetch.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractPrefetch.java index 88f0019209..4771b76223 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractPrefetch.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractPrefetch.java @@ -177,9 +177,9 @@ final class ExtractPrefetch extends Extract { final Path errFilePath = Paths.get(tempOutPath, PREFETCH_ERROR_FILE_NAME); List commandLine = new ArrayList<>(); - commandLine.add(String.format("\"%s\"",prefetchExePath)); - commandLine.add(String.format("\"%s\"",prefetchDir)); //NON-NLS - commandLine.add(String.format("\"%s\"",tempOutFile)); + commandLine.add(prefetchExePath); + commandLine.add(prefetchDir); //NON-NLS + commandLine.add(tempOutFile); ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(outputFilePath.toFile()); diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java index d4cf0e9c66..9d232cdc84 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java @@ -472,7 +472,7 @@ class ExtractRegistry extends Extract { commandLine.add(cmd); } commandLine.add("-r"); //NON-NLS - commandLine.add(String.format("\"%s\"",hiveFilePath)); + commandLine.add(hiveFilePath); commandLine.add("-f"); //NON-NLS commandLine.add(hiveFileType); diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractSru.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractSru.java index 2f6cf0a303..fb85593953 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractSru.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractSru.java @@ -247,10 +247,10 @@ final class ExtractSru extends Extract { final Path errFilePath = Paths.get(tempOutPath, SRU_ERROR_FILE_NAME); List commandLine = new ArrayList<>(); - commandLine.add(String.format("\"%s\"",sruExePath)); + commandLine.add(sruExePath); commandLine.add(sruFile); //NON-NLS commandLine.add(softwareHiveFile); - commandLine.add(String.format("\"%s\"",tempOutFile)); + commandLine.add(tempOutFile); ProcessBuilder processBuilder = new ProcessBuilder(commandLine); processBuilder.redirectOutput(outputFilePath.toFile());