Package be.dezijwegel.betteryaml.files
Class YamlReader
java.lang.Object
be.dezijwegel.betteryaml.files.YamlReader
public class YamlReader extends Object
-
Constructor Summary
Constructors Constructor Description YamlReader(File file)Creates a YamlReader from a given File YamlReader supports nested keys All key-value pairs will be added to a MapYamlReader(InputStream fis)Creates a YamlReader from a given InputStream YamlReader supports nested keys All key-value pairs will be added to a Map -
Method Summary
Modifier and Type Method Description Map<String,Object>getContents()Get the contents from the provided File or InputStream ConfigurationSections are not added separately Nested keys are saved as: section.subsection.option
-
Constructor Details
-
YamlReader
Creates a YamlReader from a given File YamlReader supports nested keys All key-value pairs will be added to a Map- Parameters:
file- the file to be read- Throws:
IOException- when a stream cannot be created or the file does not exist
-
YamlReader
Creates a YamlReader from a given InputStream YamlReader supports nested keys All key-value pairs will be added to a Map- Parameters:
fis- the InputStream to be read- Throws:
IOException- when a stream cannot be created or the file does not exist
-
-
Method Details
-
getContents
Get the contents from the provided File or InputStream ConfigurationSections are not added separately Nested keys are saved as: section.subsection.option- Returns:
- all keys and their mapped values from within the file
-