code: private synchronized void saveConfiguration() {
          for (WekaModelConfig wekaModelConfig : modelConfigs.values()) {
              if (wekaModelConfig.isDirty() && wekaModelConfig.getModelConfig().isStoreModel()) {
                  try {
                      String modelConfigJson = mapper.writeValueAsString(wekaModelConfig.getModelConfig());
  
                      // create a new file because this model has never been written
                      if (wekaModelConfig.getHeader() == null) {
                          File file = File.createTempFile(wekaModelConfig.getId().toString(), "." + WekaManagerConfig.HEADER_EXTENSION, wekaManagerConfig.getHeaderLocation());
                          wekaModelConfig.setHeader(file);
                      }
  
                      FileUtils.write((wekaModelConfig).getHeader(), modelConfigJson);
                      wekaModelConfig.setDirty(false /* contents have been updated so the model is no longer dirty*/);
                  } catch (IOException e) {
                      logger.error("Could not store configuration for model '{}' (will continue to save others)", wekaModelConfig.getId(), e);
                  }
              }
          }
      }
docs: Save dirty configurations to disk.
  <p/> If saving configuration was not possible, a log is produced but no exception is thrown.