vertx/src/main/java/eu/internetofus/common/vertx/AbstractMain.java
/**
   * Load the configuration form a files on a directory.
   *
   * @param confDirValue directory where are the configuration files.
   *
   * @throws Throwable if exist a problem when load the configuration files.
   */
Load the configuration form a files on a directory.
@param confDirValue directory where are the configuration files.

@throws Throwable if exist a problem when load the configuration files.
Load the configuration form a files on a directory . @param confDirValue directory where are the configuration files . @throws Throwable if exist a problem when load the configuration files .
protected void configureWithFilesAt(final String confDirValue) throws Throwable {
    final var confPath = Path.of(confDirValue);
    Files.list(confPath).filter(confFilePath -> {
      final var file = confFilePath.toFile();
      return file.isFile() && file.canRead();
    }).sorted((a, b) -> b.getFileName().compareTo(a.getFileName())).forEach(confFilePath -> {
      var format = "json";
      final var fileName = confFilePath.getFileName().toString();
      if (fileName.endsWith("yml")) {
        format = "yaml";
      }
      final var confFileOptions = new ConfigStoreOptions().setType("file").setFormat(format)
          .setConfig(new JsonObject().put("path", confFilePath.toFile().getAbsolutePath()));
      this.retrieveOptions = this.retrieveOptions.addStore(confFileOptions);
    });
  }
protected void configureWithFilesAt ( final String confDirValue ) throws Throwable { final var confPath = Path . of ( confDirValue ) ; Files . list ( confPath ) . filter ( confFilePath -> { final var file = confFilePath . toFile ( ) ; return file . isFile ( ) && file . canRead ( ) ; } ) . sorted ( ( a , b ) -> b . getFileName ( ) . compareTo ( a . getFileName ( ) ) ) . forEach ( confFilePath -> { var format = "json" ; final var fileName = confFilePath . getFileName ( ) . toString ( ) ; if ( fileName . endsWith ( "yml" ) ) { format = "yaml" ; } final var confFileOptions = new ConfigStoreOptions ( ) . setType ( "file" ) . setFormat ( format ) . setConfig ( new JsonObject ( ) . put ( "path" , confFilePath . toFile ( ) . getAbsolutePath ( ) ) ) ; this . retrieveOptions = this . retrieveOptions . addStore ( confFileOptions ) ; } ) ; }
Load the configuration form a files on a directory.
Load the configuration form a files on a directory .