From ef518c2af01b67a7a2fc59566842cbb4bfbea670 Mon Sep 17 00:00:00 2001 From: Mark McKinnon Date: Thu, 26 Aug 2021 09:29:39 -0400 Subject: [PATCH] Update ChromeCacheExtractor.java Move creation of chromecache directory to only happen if chromecache files present --- .../recentactivity/ChromeCacheExtractor.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java index f3e073e7f9..42be2d0233 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java @@ -177,14 +177,6 @@ final class ChromeCacheExtractor { currentCase = Case.getCurrentCaseThrows(); fileManager = currentCase.getServices().getFileManager(); - // Create an output folder to save any derived files - absOutputFolderName = RAImageIngestModule.getRAOutputPath(currentCase, moduleName, context.getJobId()); - relOutputFolderName = Paths.get(RAImageIngestModule.getRelModuleOutputPath(currentCase, moduleName, context.getJobId())).normalize().toString(); - - File dir = new File(absOutputFolderName); - if (dir.exists() == false) { - dir.mkdirs(); - } } catch (NoCurrentCaseException ex) { String msg = "Failed to get current case."; //NON-NLS throw new IngestModuleException(msg, ex); @@ -279,6 +271,17 @@ final class ChromeCacheExtractor { // Identify each cache folder by searching for the index files in each List indexFiles = findIndexFiles(); + if (indexFiles.size() > 0) { + // Create an output folder to save any derived files + absOutputFolderName = RAImageIngestModule.getRAOutputPath(currentCase, moduleName, context.getJobId()); + relOutputFolderName = Paths.get(RAImageIngestModule.getRelModuleOutputPath(currentCase, moduleName, context.getJobId())).normalize().toString(); + + File dir = new File(absOutputFolderName); + if (dir.exists() == false) { + dir.mkdirs(); + } + } + // Process each of the cache folders for (AbstractFile indexFile: indexFiles) {