Class ConfigReader
java.lang.Object
com.djrapitops.plan.settings.config.ConfigReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
Reader for parsing
Config
out of file-lines.
ConfigReader can read a single file at a time, so it is NOT thread safe.
-
Constructor Summary
ConstructorDescriptionConfigReader(BufferedReader bufferedReader)
Create a new ConfigReader for a BufferedReader.ConfigReader(InputStream in)
Create a new ConfigReader for an InputStream.ConfigReader(Path filePath)
Create a new ConfigReader for a Path.ConfigReader(Scanner scanner)
Create a new ConfigReader for a Scanner. -
Method Summary
-
Constructor Details
-
ConfigReader
Create a new ConfigReader for a Path.- Parameters:
filePath
- Path to a config file.- Throws:
IOException
- If the path can not be read.
-
ConfigReader
Create a new ConfigReader for an InputStream.- Parameters:
in
- InputStream of a resource that is a config.
-
ConfigReader
Create a new ConfigReader for a BufferedReader.- Parameters:
bufferedReader
- BufferedReader of a resource that is a config.
-
ConfigReader
Create a new ConfigReader for a Scanner.- Parameters:
scanner
- Scanner of a resource that is a config.
-
-
Method Details
-
read
Read the resource into aConfig
.- Returns:
- Config parsed from the lines found in the given resource.
- Throws:
IllegalStateException
- If the configReader is closed by callingclose()
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-