Skip to content

Commit cb7aa72

Browse files
author
kasemir
committed
EDM auto converter: Create output folders
1 parent b9aec75 commit cb7aa72

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/display/convert-edm/src/main/java/org/csstudio/display/converter/edm/EdmAutoConverter.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2019-2022 Oak Ridge National Laboratory.
2+
* Copyright (c) 2019-2025 Oak Ridge National Laboratory.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
1010
import static org.csstudio.display.converter.edm.Converter.logger;
1111

1212
import java.io.File;
13+
import java.nio.file.Files;
1314
import java.util.concurrent.ConcurrentHashMap;
1415
import java.util.concurrent.Semaphore;
1516
import java.util.logging.Level;
@@ -142,7 +143,11 @@ private DisplayModel doConvert(final String display_path) throws Exception
142143
// Convert EDM input
143144
logger.log(Level.INFO, "Converting " + input + " into " + output);
144145
locator.setPrefix(new File(display_file).getParent());
145-
new EdmConverter(input, locator).write(output);
146+
final EdmConverter converter = new EdmConverter(input, locator);
147+
148+
// Save EDM file to potentially new folder
149+
Files.createDirectories(output.getParentFile().toPath());
150+
converter.write(output);
146151

147152
// Return DisplayModel of the converted file
148153
return ModelLoader.loadModel(output.getPath());

0 commit comments

Comments
 (0)