diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoFilesUtils.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoFilesUtils.java index 76553893a..1d67f3bf8 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoFilesUtils.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoFilesUtils.java @@ -47,17 +47,20 @@ public static void writeInputFiles(Path workingDir, DynawoSimulationContext cont if (context.withFsvVariables()) { OutputVariablesXml.writeFsv(workingDir, context); } - writeInputFiles(workingDir, context.getDynawoSimulationParameters()); + writeDumpFiles(workingDir, context.getDynawoSimulationParameters().getDumpFileParameters()); + writeCriteriaFile(workingDir, context.getDynawoSimulationParameters()); } - public static void writeInputFiles(Path workingDir, DynawoSimulationParameters parameters) throws IOException { - DumpFileParameters dumpFileParameters = parameters.getDumpFileParameters(); + private static void writeDumpFiles(Path workingDir, DumpFileParameters dumpFileParameters) throws IOException { if (dumpFileParameters.useDumpFile()) { Path dumpFilePath = dumpFileParameters.getDumpFilePath(); if (dumpFilePath != null) { Files.copy(dumpFilePath, workingDir.resolve(dumpFileParameters.dumpFile()), StandardCopyOption.REPLACE_EXISTING); } } + } + + private static void writeCriteriaFile(Path workingDir, DynawoSimulationParameters parameters) { parameters.getCriteriaFilePath().ifPresent(filePath -> { try { Files.copy(filePath, workingDir.resolve(filePath.getFileName()), StandardCopyOption.REPLACE_EXISTING);