Class FileConfigSource<SECTION extends ConfigureSection,ORIGINAL,SELF extends FileConfigSource<SECTION,ORIGINAL,SELF>>
java.lang.Object
cc.carm.lib.configuration.source.section.ConfigureSource<SECTION,ORIGINAL,SELF>
cc.carm.lib.configuration.source.file.FileConfigSource<SECTION,ORIGINAL,SELF>
- All Implemented Interfaces:
ConfigureSection
- Direct Known Subclasses:
JSONSource
public abstract class FileConfigSource<SECTION extends ConfigureSection,ORIGINAL,SELF extends FileConfigSource<SECTION,ORIGINAL,SELF>>
extends ConfigureSource<SECTION,ORIGINAL,SELF>
-
Field Summary
FieldsFields inherited from class cc.carm.lib.configuration.source.section.ConfigureSource
holder, lastUpdateMillis -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFileConfigSource(@NotNull ConfigurationHolder<? extends SELF> holder, long lastUpdateMillis, @NotNull File file, @Nullable String resourcePath) -
Method Summary
Modifier and TypeMethodDescriptioncharset()booleanprotected <R> RfileInputStream(@NotNull DataFunction<InputStream, R> loader) protected voidfileOutputStream(@NotNull DataConsumer<OutputStream> stream) protected <R> RfileReader(@NotNull DataFunction<Reader, R> loader) protected voidfileReadString(@NotNull DataConsumer<String> loader) protected <R> RfileReadString(@NotNull DataFunction<String, R> loader) protected voidfileWriter(@NotNull DataConsumer<Writer> writer) protected @Nullable InputStreamgetResource(@NotNull String filename) voidprotected voidsaveResource(@NotNull String resourcePath, boolean replace) Methods inherited from class cc.carm.lib.configuration.source.section.ConfigureSource
asMap, createSection, get, getKeys, getLastUpdateMillis, getValues, holder, isExpired, onReload, original, parent, path, pathSeparator, reload, remove, save, section, self, setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cc.carm.lib.configuration.source.section.ConfigureSection
childPath, computeSection, computeSection, computeSection, computeSection, contains, containsValue, createSection, createSection, createSection, forEach, fullPath, get, get, get, get, getBoolean, getBoolean, getByte, getByte, getByteList, getChar, getChar, getCharList, getCollection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInt, getInt, getIntegerList, getList, getList, getLong, getLong, getLongList, getSection, getSectionList, getShort, getShort, getString, getString, getStringList, isBoolean, isByte, isChar, isDouble, isEmpty, isFloat, isInt, isList, isLong, isRoot, isSection, isShort, isString, isType, keys, size, stream, stream, stream, values
-
Field Details
-
file
-
resourcePath
-
-
Constructor Details
-
FileConfigSource
protected FileConfigSource(@NotNull @NotNull ConfigurationHolder<? extends SELF> holder, long lastUpdateMillis, @NotNull @NotNull File file, @Nullable @Nullable String resourcePath)
-
-
Method Details
-
charset
-
copyDefaults
public boolean copyDefaults() -
initializeFile
- Throws:
IOException
-
fileInputStream
protected <R> R fileInputStream(@NotNull @NotNull DataFunction<InputStream, R> loader) throws Exception- Throws:
Exception
-
fileReader
- Throws:
Exception
-
fileReadString
- Throws:
Exception
-
fileReadString
- Throws:
Exception
-
fileOutputStream
protected void fileOutputStream(@NotNull @NotNull DataConsumer<OutputStream> stream) throws Exception - Throws:
Exception
-
fileWriter
- Throws:
Exception
-
saveResource
protected void saveResource(@NotNull @NotNull String resourcePath, boolean replace) throws IOException, IllegalArgumentException - Throws:
IOExceptionIllegalArgumentException
-
getResource
-