Skip to content
Snippets Groups Projects
Commit e0bc953e authored by René Schöne's avatar René Schöne
Browse files

create images directory if it does not exist

parent 6b15ff69
No related branches found
No related tags found
No related merge requests found
Pipeline #14203 passed
......@@ -36,6 +36,20 @@ public class MainB extends SharedMainParts<MqttHandler, WorldModelB> {
new MainB(configFile).run();
}
@Override
public void run() throws Exception {
// ensure that directory "images" exists
File imagesDirectory = Paths.get("images/").toFile();
if (!imagesDirectory.exists()) {
boolean success = imagesDirectory.mkdir();
if (!success) {
logger.debug("Failed to create directory {}", imagesDirectory.getAbsolutePath());
}
}
super.run();
}
@Override
protected MqttHandler createMqttHandler() {
return new MqttHandler("mainHandlerB");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment