类 Resources

java.lang.Object
cn.sylinx.horm.resource.io.Resources

public class Resources extends Object
资源常用类
作者:
han
  • 方法详细资料

    • getDefaultClassLoader

      public static ClassLoader getDefaultClassLoader()
      get the default classloader
      返回:
      the classloader
    • getClassLoader

      public static ClassLoader getClassLoader()
    • setDefaultClassLoader

      public static void setDefaultClassLoader(ClassLoader defaultClassLoader)
      Sets the default classloader
      参数:
      defaultClassLoader - - the new default ClassLoader
    • getResourceURL

      public static URL getResourceURL(String resource) throws IOException
      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

      public static List<URL> getResourceURLs(String resource) throws IOException
      抛出:
      IOException
    • getResourceURL

      public static URL getResourceURL(ClassLoader loader, String resource) throws IOException
      Returns the URL of the resource on the classpath
      参数:
      loader - classloader
      resource - The resource to find
      返回:
      The resource
      抛出:
      IOException - If the resource cannot be found or read
    • getResourceURLs

      public static List<URL> getResourceURLs(ClassLoader loader, String resource) throws IOException
      抛出:
      IOException
    • getResourceAsStream

      public static InputStream getResourceAsStream(String resource) throws IOException
      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 Classloader
      resource - The resource to find
      返回:
      the resource
      抛出:
      IOException - If the resource cannot be found or read
    • getResourceAsProperties

      public static Properties getResourceAsProperties(String resource) throws IOException
      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 - classloader
      resource - the resource to find
      返回:
      the resource
      抛出:
      IOException - If the resource cannot be found or read
    • getResourceAsReader

      public static Reader getResourceAsReader(String resource) throws IOException
      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

      public static Reader getResourceAsReader(ClassLoader loader, String resource) throws IOException
      return the Reader of the resource on the classpath
      参数:
      loader - ClassLoader
      resource - the resource to find
      返回:
      the resource
      抛出:
      IOException - If the resource cannot be found or read
    • getResourceAsFile

      public static File getResourceAsFile(String resource) throws IOException
      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

      public static File getResourceAsFile(ClassLoader loader, String resource) throws IOException
      return the File of the resource on the classpath
      参数:
      loader - ClassLoader
      resource - the resource to find
      返回:
      the resource
      抛出:
      IOException - If the resource cannot be found or read
    • getUrlAsStream

      public static InputStream getUrlAsStream(String urlString) throws IOException
      return the InputStream of the url
      参数:
      urlString - url string
      返回:
      the InputStream
      抛出:
      IOException - If the url cannot be found or read
    • getUrlAsReader

      public static Reader getUrlAsReader(String urlString) throws IOException
      return the Reader of the url
      参数:
      urlString - url String
      返回:
      the Reader of url
      抛出:
      IOException - If the url cannot be found or read
    • getUrlAsProperties

      public static Properties getUrlAsProperties(String urlString) throws IOException
      return the Properties of url
      参数:
      urlString - url string
      返回:
      the Properties
      抛出:
      IOException - If the url cannot be found or read
    • classForName

      public static Class<?> classForName(String className) throws ClassNotFoundException
      return the Class of the classname
      参数:
      className - the classname
      返回:
      the Class
      抛出:
      ClassNotFoundException - If the class cannot be found or read
    • getCharset

      public static Charset getCharset()
      get the Charset
      返回:
      the Charset
    • setCharset

      public static void setCharset(Charset charset)
      set the Charset
      参数:
      charset - Charset