public final class ResourceOf extends Object implements Input
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"
.
ClassLoader.getResource(String)
Input.NoNulls
Constructor and Description |
---|
ResourceOf(CharSequence res)
New resource input with current context
ClassLoader . |
ResourceOf(CharSequence res,
CharSequence fbk)
New resource input with current context
ClassLoader . |
ResourceOf(CharSequence res,
ClassLoader ldr)
New resource input with specified
ClassLoader . |
ResourceOf(CharSequence res,
Func<CharSequence,Input> fbk)
New resource input with current context
ClassLoader . |
ResourceOf(CharSequence res,
Func<CharSequence,Input> fbk,
ClassLoader ldr)
New resource input with specified
ClassLoader . |
ResourceOf(CharSequence res,
Input fbk)
New resource input with current context
ClassLoader . |
public ResourceOf(CharSequence res)
ClassLoader
.res
- Resource namepublic ResourceOf(CharSequence res, CharSequence fbk)
ClassLoader
.res
- Resource namefbk
- Fallbackpublic ResourceOf(CharSequence res, Input fbk)
ClassLoader
.res
- Resource namefbk
- Fallbackpublic ResourceOf(CharSequence res, Func<CharSequence,Input> fbk)
ClassLoader
.res
- Resource namefbk
- Fallbackpublic ResourceOf(CharSequence res, ClassLoader ldr)
ClassLoader
.res
- Resource nameldr
- Resource class loaderpublic ResourceOf(CharSequence res, Func<CharSequence,Input> fbk, ClassLoader ldr)
ClassLoader
.res
- Resource nameldr
- Resource class loaderfbk
- Fallbackpublic InputStream stream() throws IOException
Input
stream
in interface Input
IOException
- If something goes wrongCopyright © 2017 Cactoos. All rights reserved.