Skip to content

Commit

Permalink
Review fix
Browse files Browse the repository at this point in the history
Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte authored and flo-dup committed Dec 12, 2024
1 parent a439090 commit dda6aec
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dda6aec

Please sign in to comment.