Class ResourceUtils


  • public final class ResourceUtils
    extends Object
    Utility methods for testing.
    Since:
    1.0.0
    • Method Detail

      • getAsStream

        public static InputStream getAsStream​(String name)
        Parameters:
        name - The path to the resource to load.
        Returns:
        The InputStream of the resource located at the specified path relative to the root of the classpath.
        Throws:
        NullPointerException - If the resource doesn't exist.
      • getAsString

        public static String getAsString​(String name)
                                  throws IOException
        Load all content from the file specified. Path should be relative to the root of the classpath.
        Parameters:
        name - The path to the resource to load.
        Returns:
        The content of the file.
        Throws:
        IOException - If we fail to read the resource.