Ghidra is a software reverse engineering (SRE) framework
GP-0: Creating BundleHost cache directory in a more reliable fashion
Ryan Kurtzc377b245da3c
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/osgi/BundleHost.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/osgi/BundleHost.javaindex e528ec74a2..72e73a02cf 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/osgi/BundleHost.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/osgi/BundleHost.java@@ -15,9 +15,7 @@*/package ghidra.app.plugin.core.osgi;-import java.io.IOException;-import java.io.PrintWriter;-import java.nio.file.Files;+import java.io.*;import java.nio.file.Path;import java.util.*;import java.util.Map.Entry;@@ -42,6 +40,7 @@ import ghidra.framework.plugintool.PluginTool;import ghidra.util.Msg;import ghidra.util.task.TaskLauncher;import ghidra.util.task.TaskMonitor;+import utilities.util.FileUtilities;/*** Hosts the embedded OSGi framework and manages {@link GhidraBundle}s.@@ -373,9 +372,11 @@ public class BundleHost {}private static String makeCacheDir() throws IOException {- Path cacheDir = getCacheDir();- Files.createDirectories(cacheDir);- return cacheDir.toAbsolutePath().toString();+ File cacheDir = getCacheDir().toFile();+ if (!FileUtilities.mkdirs(cacheDir)) {+ throw new IOException("Failed to make cache directory: " + cacheDir);+ }+ return cacheDir.getAbsolutePath();}private void createAndConfigureFramework() throws IOException {