Class Resources


  • public class Resources
    extends java.lang.Object
    Utilities for working with resources on classpath.
    Author:
    jjlauer
    • Constructor Summary

      Constructors 
      Constructor Description
      Resources()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static byte[] bytes​(java.lang.String resourceName)  
      static java.io.InputStream input​(java.lang.String resourceName)  
      static java.io.InputStream newInputStream​(java.lang.String resourceName)
      Deprecated.
      static byte[] readAllBytes​(java.lang.String resourceName)
      Deprecated.
      static java.lang.String readToString​(java.lang.String resourceName, java.nio.charset.Charset charset)
      Deprecated.
      static java.lang.String readToStringUTF8​(java.lang.String resourceName)
      Deprecated.
      static java.lang.String string​(java.lang.String resourceName, java.nio.charset.Charset charset)  
      static java.lang.String stringUTF8​(java.lang.String resourceName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Resources

        public Resources()
    • Method Detail

      • newInputStream

        @Deprecated
        public static java.io.InputStream newInputStream​(java.lang.String resourceName)
                                                  throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • input

        public static java.io.InputStream input​(java.lang.String resourceName)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • bytes

        public static byte[] bytes​(java.lang.String resourceName)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readAllBytes

        @Deprecated
        public static byte[] readAllBytes​(java.lang.String resourceName)
                                   throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • string

        public static java.lang.String string​(java.lang.String resourceName,
                                              java.nio.charset.Charset charset)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • stringUTF8

        public static java.lang.String stringUTF8​(java.lang.String resourceName)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readToString

        @Deprecated
        public static java.lang.String readToString​(java.lang.String resourceName,
                                                    java.nio.charset.Charset charset)
                                             throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • readToStringUTF8

        @Deprecated
        public static java.lang.String readToStringUTF8​(java.lang.String resourceName)
                                                 throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException