Kactoos

kactoos-jvm / nnl.rocks.kactoos.io / ResourceOf

ResourceOf

class ResourceOf : Input

Classpath resource.

Pay attention that the name of resource must always be global, not starting with a leading slash. Thus, if you want to load a text file from /com/example/Test.txt, you must provide this name: "com/example/Test.txt".

Parameters

path - Resource name

fallback - Resource class loader

loader - Fallback

See Also

ClassLoader.getResource

Since 0.1

Constructors

Name Summary
<init> ResourceOf(res: CharSequence, ldr: ClassLoader = Thread.currentThread().contextClassLoader)
ResourceOf(res: CharSequence, fbk: Func<CharSequence, Input>, ldr: ClassLoader = Thread.currentThread().contextClassLoader)
ResourceOf(res: Text, ldr: ClassLoader = Thread.currentThread().contextClassLoader)
New resource input with specified ClassLoader.ResourceOf(res: CharSequence, fbk: CharSequence)
ResourceOf(res: CharSequence, fbk: Input)
ResourceOf(res: Text, fbk: Text)
ResourceOf(res: Text, fbk: Input)
New resource input with current context ClassLoader.ResourceOf(path: Text, fallback: Func<Text, Input>, loader: ClassLoader = Thread.currentThread().contextClassLoader)
Classpath resource.

Functions

Name Summary
stream fun stream(): InputStream
Get read access to it.