Package ch.kk7.confij.source.resource
Class FileResource
- java.lang.Object
-
- ch.kk7.confij.source.resource.FileResource
-
- All Implemented Interfaces:
ConfijResource
public class FileResource extends java.lang.Object implements ConfijResource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileResource.AnyFileResourceprotected static classFileResource.PathAndMatcher-
Nested classes/interfaces inherited from interface ch.kk7.confij.source.resource.ConfijResource
ConfijResource.Defaults, ConfijResource.ResourceContent
-
-
Constructor Summary
Constructors Constructor Description FileResource(java.lang.String fileTemplate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static FileResource.PathAndMatcherextractGlob(java.lang.String path)protected java.lang.StringfileToStr(java.nio.file.Path path, java.nio.charset.Charset charset)protected java.util.List<java.nio.file.Path>getFilesMatching(@NonNull FileResource.PathAndMatcher query)static FileResourceofFile(java.io.File file)static FileResourceofFile(java.lang.String file)static FileResourceofPath(java.nio.file.Path file)java.util.stream.Stream<ConfijResource.ResourceContent>read(ValueResolver.StringResolver resolver)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.kk7.confij.source.resource.ConfijResource
read
-
-
-
-
Method Detail
-
ofFile
public static FileResource ofFile(java.lang.String file)
-
ofFile
public static FileResource ofFile(java.io.File file)
-
ofPath
public static FileResource ofPath(java.nio.file.Path file)
-
extractGlob
protected static FileResource.PathAndMatcher extractGlob(java.lang.String path)
-
getFilesMatching
protected java.util.List<java.nio.file.Path> getFilesMatching(@NonNull @NonNull FileResource.PathAndMatcher query)
-
read
public java.util.stream.Stream<ConfijResource.ResourceContent> read(ValueResolver.StringResolver resolver)
- Specified by:
readin interfaceConfijResource
-
fileToStr
protected java.lang.String fileToStr(java.nio.file.Path path, java.nio.charset.Charset charset)
-
-