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
Fields Modifier and Type Field Description protected @NotNull java.io.Filefileprotected @Nullable java.lang.StringresourcePath-
Fields inherited from class cc.carm.lib.configuration.source.section.ConfigureSource
holder, lastUpdateMillis
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFileConfigSource(@NotNull ConfigurationHolder<? extends SELF> holder, long lastUpdateMillis, @NotNull java.io.File file, @Nullable java.lang.String resourcePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.charset.Charsetcharset()booleancopyDefaults()protected <R> RfileInputStream(@NotNull DataFunction<java.io.InputStream,R> loader)protected voidfileOutputStream(@NotNull DataConsumer<java.io.OutputStream> stream)protected <R> RfileReader(@NotNull DataFunction<java.io.Reader,R> loader)protected voidfileReadString(@NotNull DataConsumer<java.lang.String> loader)protected <R> RfileReadString(@NotNull DataFunction<java.lang.String,R> loader)protected voidfileWriter(@NotNull DataConsumer<java.io.Writer> writer)protected @Nullable java.io.InputStreamgetResource(@NotNull java.lang.String filename)voidinitializeFile()protected voidsaveResource(@NotNull java.lang.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, set
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods 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, 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
-
-
-
-
Constructor Detail
-
FileConfigSource
protected FileConfigSource(@NotNull @NotNull ConfigurationHolder<? extends SELF> holder, long lastUpdateMillis, @NotNull @NotNull java.io.File file, @Nullable @Nullable java.lang.String resourcePath)
-
-
Method Detail
-
charset
public java.nio.charset.Charset charset()
-
copyDefaults
public boolean copyDefaults()
-
initializeFile
public void initializeFile() throws java.io.IOException- Throws:
java.io.IOException
-
fileInputStream
protected <R> R fileInputStream(@NotNull @NotNull DataFunction<java.io.InputStream,R> loader) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileReader
protected <R> R fileReader(@NotNull @NotNull DataFunction<java.io.Reader,R> loader) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileReadString
protected <R> R fileReadString(@NotNull @NotNull DataFunction<java.lang.String,R> loader) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileReadString
protected void fileReadString(@NotNull @NotNull DataConsumer<java.lang.String> loader) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileOutputStream
protected void fileOutputStream(@NotNull @NotNull DataConsumer<java.io.OutputStream> stream) throws java.lang.Exception- Throws:
java.lang.Exception
-
fileWriter
protected void fileWriter(@NotNull @NotNull DataConsumer<java.io.Writer> writer) throws java.lang.Exception- Throws:
java.lang.Exception
-
saveResource
protected void saveResource(@NotNull @NotNull java.lang.String resourcePath, boolean replace) throws java.io.IOException, java.lang.IllegalArgumentException- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentException
-
getResource
@Nullable protected @Nullable java.io.InputStream getResource(@NotNull @NotNull java.lang.String filename)
-
-