Package io.confound.config.file
Interface ConfigurationFileFormat
public interface ConfigurationFileFormat
A strategy for loading a configuration from an input stream.
- Author:
- Garret Wilson
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the extensions of files supported by this file format.io.confound.config.Configurationload(InputStream inputStream) Loads a configuration from the given input stream.
-
Method Details
-
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
.characterU+002Ewill be prepended to the suffix. For example, an extension offoo.barwould match a file ending in.foo.bar, such asexample.foo.bar.- Returns:
- The extensions of filenames for file type supported by this loader.
-
load
Loads a configuration from the given input stream.The given input stream is guaranteed to support
InputStream.mark(int)andInputStream.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:
-