content: package airhacks.zb.configuration.control;
  
  import java.io.FileWriter;
  import java.io.IOException;
  import java.nio.file.Files;
  import java.nio.file.Path;
  import java.time.LocalDateTime;
  import java.util.Map;
  import java.util.Properties;
  
  import airhacks.App;
  import airhacks.zb.log.control.Log;
  
  public interface PropertyFile {
      Path PROPERTY_FILE = Path.of(".zb");
      
      static void createIfNotExists(Map<String,String> properties) {
          if(!Files.exists(PROPERTY_FILE)) {
              Log.user("🔍 creating configuration file %s".formatted(PROPERTY_FILE));
              var newProperties = new Properties();
              newProperties.putAll(properties);
              var comment = "generated by %s at %s".formatted(App.VERSION,LocalDateTime.now());
              try(var writer =  new FileWriter(PROPERTY_FILE.toFile())){
                  newProperties.store(writer, comment);
              } catch (IOException e) {
                  Log.error("failed to create property file "+ PROPERTY_FILE,e);
              }
          }
      }
  }
  