public class ConfigReader
extends java.lang.Object
implements java.io.Closeable
Config
out of file-lines.
ConfigReader can read a single file at a time, so it is NOT thread safe.
Constructor and Description |
---|
ConfigReader(java.io.BufferedReader bufferedReader)
Create a new ConfigReader for a BufferedReader.
|
ConfigReader(java.io.InputStream in)
Create a new ConfigReader for an InputStream.
|
ConfigReader(java.nio.file.Path filePath)
Create a new ConfigReader for a Path.
|
ConfigReader(java.util.Scanner scanner)
Create a new ConfigReader for a Scanner.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Config |
read()
Read the resource into a
Config . |
public ConfigReader(java.nio.file.Path filePath) throws java.io.IOException
filePath
- Path to a config file.java.io.IOException
- If the path can not be read.public ConfigReader(java.io.InputStream in)
in
- InputStream of a resource that is a config.public ConfigReader(java.io.BufferedReader bufferedReader)
bufferedReader
- BufferedReader of a resource that is a config.public ConfigReader(java.util.Scanner scanner)
scanner
- Scanner of a resource that is a config.public Config read()
Config
.java.lang.IllegalStateException
- If the configReader is closed by calling close()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable