Interface ConfigurationFileFormat


public interface ConfigurationFileFormat
A strategy for loading a configuration from an input stream.
Author:
Garret Wilson
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the extensions of files supported by this file format.
    io.confound.config.Configuration
    load(InputStream inputStream)
    Loads a configuration from the given input stream.
  • Method Details

    • getFilenameExtensions

      Set<String> getFilenameExtensions()
      Retrieves the extensions of files supported by this file format.

      An extension is merely a file suffix of any type, except that it is understood that the full stop . character U+002E will be prepended to the suffix. For example, an extension of foo.bar would match a file ending in .foo.bar, such as example.foo.bar.

      Returns:
      The extensions of filenames for file type supported by this loader.
    • load

      @Nonnull io.confound.config.Configuration load(@Nonnull InputStream inputStream) throws IOException
      Loads a configuration from the given input stream.

      The given input stream is guaranteed to support InputStream.mark(int) and InputStream.reset().

      The input stream must not be closed by this method.

      Parameters:
      inputStream - The input stream from which the configuration will be loaded.
      Returns:
      A new configuration, loaded from the given input stream.
      Throws:
      IOException - if there is an error loading a configuration from the giving input stream.
      CharacterCodingException - if the given input stream is for a text document and contains an invalid byte sequence for the charset indicated by the BOM; or if no BOM was present, an invalid byte sequence for the assumed charset, depending on the file format.
      See Also: