类 Resources
java.lang.Object
cn.sylinx.horm.resource.io.Resources
资源常用类
- 作者:
- han
-
方法概要
修饰符和类型方法说明static Class<?>classForName(String className) return the Class of the classnamestatic Charsetget the Charsetstatic ClassLoaderstatic ClassLoaderget the default classloaderstatic FilegetResourceAsFile(ClassLoader loader, String resource) return the File of the resource on the classpathstatic FilegetResourceAsFile(String resource) return the File of the resource on the classpathstatic PropertiesgetResourceAsProperties(ClassLoader loader, String resource) return the Properties of the resource on the classpathstatic PropertiesgetResourceAsProperties(String resource) return the Properties of the resource on the classpathstatic ReadergetResourceAsReader(ClassLoader loader, String resource) return the Reader of the resource on the classpathstatic ReadergetResourceAsReader(String resource) return the Reader of the resource on the classpathstatic InputStreamgetResourceAsStream(ClassLoader loader, String resource) returns the InputStream of the resource on the classpathstatic InputStreamgetResourceAsStream(String resource) Returns the InputStream of the resource on the classpathstatic URLgetResourceURL(ClassLoader loader, String resource) Returns the URL of the resource on the classpathstatic URLgetResourceURL(String resource) Returns the URL of the resource on the classpathgetResourceURLs(ClassLoader loader, String resource) getResourceURLs(String resource) static PropertiesgetUrlAsProperties(String urlString) return the Properties of urlstatic ReadergetUrlAsReader(String urlString) return the Reader of the urlstatic InputStreamgetUrlAsStream(String urlString) return the InputStream of the urlstatic voidsetCharset(Charset charset) set the Charsetstatic voidsetDefaultClassLoader(ClassLoader defaultClassLoader) Sets the default classloader
-
方法详细资料
-
getDefaultClassLoader
get the default classloader- 返回:
- the classloader
-
getClassLoader
-
setDefaultClassLoader
Sets the default classloader- 参数:
defaultClassLoader- - the new default ClassLoader
-
getResourceURL
Returns the URL of the resource on the classpath- 参数:
resource- The resource to find- 返回:
- The resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceURLs
- 抛出:
IOException
-
getResourceURL
Returns the URL of the resource on the classpath- 参数:
loader- classloaderresource- The resource to find- 返回:
- The resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceURLs
- 抛出:
IOException
-
getResourceAsStream
Returns the InputStream of the resource on the classpath- 参数:
resource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsStream
public static InputStream getResourceAsStream(ClassLoader loader, String resource) throws IOException returns the InputStream of the resource on the classpath- 参数:
loader- The Classloaderresource- The resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsProperties
return the Properties of the resource on the classpath- 参数:
resource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsProperties
public static Properties getResourceAsProperties(ClassLoader loader, String resource) throws IOException return the Properties of the resource on the classpath- 参数:
loader- classloaderresource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsReader
return the Reader of the resource on the classpath- 参数:
resource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsReader
return the Reader of the resource on the classpath- 参数:
loader- ClassLoaderresource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsFile
return the File of the resource on the classpath- 参数:
resource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getResourceAsFile
return the File of the resource on the classpath- 参数:
loader- ClassLoaderresource- the resource to find- 返回:
- the resource
- 抛出:
IOException- If the resource cannot be found or read
-
getUrlAsStream
return the InputStream of the url- 参数:
urlString- url string- 返回:
- the InputStream
- 抛出:
IOException- If the url cannot be found or read
-
getUrlAsReader
return the Reader of the url- 参数:
urlString- url String- 返回:
- the Reader of url
- 抛出:
IOException- If the url cannot be found or read
-
getUrlAsProperties
return the Properties of url- 参数:
urlString- url string- 返回:
- the Properties
- 抛出:
IOException- If the url cannot be found or read
-
classForName
return the Class of the classname- 参数:
className- the classname- 返回:
- the Class
- 抛出:
ClassNotFoundException- If the class cannot be found or read
-
getCharset
get the Charset- 返回:
- the Charset
-
setCharset
set the Charset- 参数:
charset- Charset
-