Package org.ec4j.core
Class Resource.Resources
java.lang.Object
org.ec4j.core.Resource.Resources
- Enclosing interface:
Resource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classAResourceimplementation that loads resources from the current class path via the givenClassLoader.(package private) static classAResourceimplementation based onjava.nio.file.Path.static classAResource.RandomReaderthat reads from aString(package private) static classstatic classA simpleMapbacked tree ofResource.Resources.StringResources. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceofClassPath(ClassLoader loader, String path, Charset encoding) static Resourcestatic Resource
-
Constructor Details
-
Resources
private Resources()
-
-
Method Details
-
ofClassPath
- Parameters:
loader- theClassLoaderto load the resource frompath- the path to loadencoding- the encoding of the resource under the givenpath- Returns:
- a new
Resource.Resources.ClassPathResource
-
ofPath
- Parameters:
path- thePathto create a newResourcefromencoding- theCharsetto use when reading from the given @{code path}- Returns:
- a new
Resource.Resources.PathResource
-
ofString
- Parameters:
path- the file path of thisResource.Resources.StringResource, must have at least one segment, e.g."my-file.txt", or"path/to/my-file.txt"or"/path/to/my-file.txt"content- the content of theResource- Returns:
- a new
Resource.Resources.StringResourcewith the givenpath, bound to aResource.Resources.StringResourceTreethat contains just the givenpath
-
stringResourceTreeBuilder
- Returns:
- a new
Resource.Resources.StringResourceTree.Builder
-