diff --git a/benchmark-framework/src/main/java/io/openmessaging/benchmark/worker/WorkerHandler.java b/benchmark-framework/src/main/java/io/openmessaging/benchmark/worker/WorkerHandler.java index 713e79f6..25359b22 100644 --- a/benchmark-framework/src/main/java/io/openmessaging/benchmark/worker/WorkerHandler.java +++ b/benchmark-framework/src/main/java/io/openmessaging/benchmark/worker/WorkerHandler.java @@ -21,6 +21,7 @@ import java.io.File; import java.net.HttpURLConnection; import java.nio.ByteBuffer; +import java.nio.file.Files; import java.util.List; import org.apache.bookkeeper.stats.StatsLogger; @@ -75,7 +76,7 @@ public WorkerHandler(Javalin app, StatsLogger statsLogger) { private void handleInitializeDriver(Context ctx) throws Exception { // Save config to temp file - File tempFile = File.createTempFile("driver-configuration" + System.currentTimeMillis(), "conf"); + File tempFile = Files.createTempFile("driver-configuration" + System.currentTimeMillis(), "conf").toFile(); Files.write(ctx.bodyAsBytes(), tempFile); localWorker.initializeDriver(tempFile);