Class ConfigSource.FileConfigSource
java.lang.Object
tech.guilhermekaua.spigotboot.config.loader.ConfigSource.FileConfigSource
- All Implemented Interfaces:
ConfigSource
- Enclosing interface:
- ConfigSource
File-based configuration source implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface tech.guilhermekaua.spigotboot.config.loader.ConfigSource
ConfigSource.FileConfigSource, ConfigSource.ResourceConfigSource -
Method Summary
Modifier and TypeMethodDescriptionbooleanexists()Checks if this source exists.@NotNull Stringname()Gets the name of this source (for display/logging purposes).@NotNull InputStreamopenRead()Opens an input stream to read the configuration.@NotNull OutputStreamOpens an output stream to write the configuration.@NotNull Pathpath()Gets the file path for file-based sources.
-
Method Details
-
openRead
Description copied from interface:ConfigSourceOpens an input stream to read the configuration.- Specified by:
openReadin interfaceConfigSource- Returns:
- the input stream
- Throws:
IOException- if the stream cannot be opened
-
openWrite
Description copied from interface:ConfigSourceOpens an output stream to write the configuration.- Specified by:
openWritein interfaceConfigSource- Returns:
- the output stream
- Throws:
IOException- if the stream cannot be opened
-
exists
public boolean exists()Description copied from interface:ConfigSourceChecks if this source exists.- Specified by:
existsin interfaceConfigSource- Returns:
- true if the source exists and can be read
-
name
Description copied from interface:ConfigSourceGets the name of this source (for display/logging purposes).- Specified by:
namein interfaceConfigSource- Returns:
- the source name
-
path
Description copied from interface:ConfigSourceGets the file path for file-based sources.- Specified by:
pathin interfaceConfigSource- Returns:
- the path, or null if not file-based
-