class FileBasedPasswordProvider implements Supplier<String> {

  @Override
  public String get() {
    try (final Stream<String> fileStream = Files.lines(passwordFile)) {
      return fileStream
          .findFirst()
          .orElseThrow(
              () ->
                  new TlsConfigurationException(
                      String.format(
                          "Unable to read keystore password from %s", passwordFile.toString())));
    } catch (final IOException e) {
      throw new TlsConfigurationException(
          String.format("Unable to read keystore password file %s", passwordFile.toString()), e);
    }
  }

  public  FileBasedPasswordProvider(final Path passwordFile);

}