mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-0: Creating BundleHost cache directory in a more reliable fashion
This commit is contained in:
@@ -15,9 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.osgi;
|
package ghidra.app.plugin.core.osgi;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.*;
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
@@ -42,6 +40,7 @@ import ghidra.framework.plugintool.PluginTool;
|
|||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
import ghidra.util.task.TaskLauncher;
|
import ghidra.util.task.TaskLauncher;
|
||||||
import ghidra.util.task.TaskMonitor;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
import utilities.util.FileUtilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hosts the embedded OSGi framework and manages {@link GhidraBundle}s.
|
* Hosts the embedded OSGi framework and manages {@link GhidraBundle}s.
|
||||||
@@ -373,9 +372,11 @@ public class BundleHost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String makeCacheDir() throws IOException {
|
private static String makeCacheDir() throws IOException {
|
||||||
Path cacheDir = getCacheDir();
|
File cacheDir = getCacheDir().toFile();
|
||||||
Files.createDirectories(cacheDir);
|
if (!FileUtilities.mkdirs(cacheDir)) {
|
||||||
return cacheDir.toAbsolutePath().toString();
|
throw new IOException("Failed to make cache directory: " + cacheDir);
|
||||||
|
}
|
||||||
|
return cacheDir.getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAndConfigureFramework() throws IOException {
|
private void createAndConfigureFramework() throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user