public final class ResourceLoader extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HTML |
static String |
JSON |
static String |
TXT |
static String |
XML |
Modifier and Type | Method and Description |
---|---|
static Reader |
getHtmlReader(Class<?> clazz)
Gets a UTF-8 reader from resource matching class name with ".html"
suffix.
|
static InputStream |
getHtmlStream(Class<?> clazz)
Gets a stream from a resource matching class name with ".html" suffix.
|
static String |
getHtmlString(Class<?> clazz)
Gets a UTF-8 string from resource matching class name with ".html"
suffix.
|
static Reader |
getJsonReader(Class<?> clazz)
Gets a UTF-8 reader from resource matching class name with ".json"
suffix.
|
static InputStream |
getJsonStream(Class<?> clazz)
Gets a stream from a resource matching class name with ".json" suffix.
|
static String |
getJsonString(Class<?> clazz)
Gets a UTF-8 string from resource matching class name with ".json"
suffix.
|
static Reader |
getReader(Class<?> clazz,
String suffix)
Gets a UTF-8 resource from class loader as a reader.
|
static InputStream |
getStream(Class<?> clazz,
String suffix)
Gets a resource from class loader as stream.
|
static String |
getString(Class<?> clazz,
String suffix)
Gets a UTF-8 a resource from class loader as a string.
|
static Reader |
getTxtReader(Class<?> clazz)
Gets a UTF-8 reader from resource matching class name with ".txt" suffix.
|
static InputStream |
getTxtStream(Class<?> clazz)
Gets a stream from a resource matching class name with ".txt" suffix.
|
static String |
getTxtString(Class<?> clazz)
Gets a UTF-8 string from resource matching class name with ".txt" suffix.
|
static Reader |
getXmlReader(Class<?> clazz)
Gets a UTF-8 reader from resource matching class name with ".xml" suffix.
|
static InputStream |
getXmlStream(Class<?> clazz)
Gets a stream from a resource matching class name with ".xml" suffix.
|
static String |
getXmlString(Class<?> clazz)
Gets a UTF-8 string from resource matching class name with ".xml" suffix.
|
public static final String TXT
public static final String HTML
public static final String XML
public static final String JSON
public static InputStream getStream(Class<?> clazz, String suffix)
clazz
- the class to load related resourcesuffix
- the suffix of the file to load with the same name
as classnull
if class is null
or resource could not be found.public static Reader getReader(Class<?> clazz, String suffix)
clazz
- the class to load related resourcesuffix
- the suffix of the file to load with the same name
as classnull
if class is null
or resource could not be found.public static String getString(Class<?> clazz, String suffix)
clazz
- the class to load related resourcesuffix
- the suffix of the file to load with the same name
as classnull
if class is null
or resource could not be found.public static InputStream getXmlStream(Class<?> clazz)
clazz
- the class to load related resourcenull
public static Reader getXmlReader(Class<?> clazz)
clazz
- the class to load related resourcenull
public static String getXmlString(Class<?> clazz)
clazz
- the class to load related resourcenull
public static InputStream getTxtStream(Class<?> clazz)
clazz
- the class to load related resourcenull
public static Reader getTxtReader(Class<?> clazz)
clazz
- the class to load related resourcenull
public static String getTxtString(Class<?> clazz)
clazz
- the class to load related resourcenull
public static InputStream getHtmlStream(Class<?> clazz)
clazz
- the class to load related resourcenull
public static Reader getHtmlReader(Class<?> clazz)
clazz
- the class to load related resourcenull
public static String getHtmlString(Class<?> clazz)
clazz
- the class to load related resourcenull
public static InputStream getJsonStream(Class<?> clazz)
clazz
- the class to load related resourcenull
public static Reader getJsonReader(Class<?> clazz)
clazz
- the class to load related resourcenull
Copyright © 2008–2023 Norconex Inc.. All rights reserved.