Kactoos

kactoos-jvm / nnl.rocks.kactoos.io / ResourceOf / <init>

<init>

ResourceOf(res: CharSequence, ldr: ClassLoader = Thread.currentThread().contextClassLoader) ResourceOf(res: Text, ldr: ClassLoader = Thread.currentThread().contextClassLoader)

New resource input with specified ClassLoader.

Parameters

res - Resource name

ldr - Resource class loaderResourceOf(res: CharSequence, fbk: Func<CharSequence, Input>, ldr: ClassLoader = Thread.currentThread().contextClassLoader)

New resource input with specified ClassLoader.

Parameters

res - Resource name

ldr - Resource class loader

fbk - FallbackResourceOf(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.

Parameters

res - Resource name

fbk - FallbackResourceOf(path: Text, fallback: Func<Text, Input>, loader: ClassLoader = Thread.currentThread().contextClassLoader)

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