Class ResourceFinder


  • public class ResourceFinder
    extends Object
    Utility class containing helper method for accessing a particular resource
    • Method Detail

      • openResource

        public static InputStream openResource​(URI uri)
                                        throws IOException
        Access a resource for a particular URI
        Parameters:
        uri - of the resource
        Returns:
        InputStream containing file contents
        Throws:
        IOException
      • openResource

        public static InputStream openResource​(ClassLoader classLoader,
                                               String pathName)
                                        throws IOException
        Access a resource on a FilePath
        Parameters:
        classLoader - ClassPath for the resource
        pathName - Absolute or Relative Path of the resource
        Returns:
        InputStream containing file contents
        Throws:
        IOException
      • openResourceWithRelativePath

        public static InputStream openResourceWithRelativePath​(ClassLoader classLoader,
                                                               String pathName)
                                                        throws IOException
        Access a resource on a Relative FilePath
        Parameters:
        classLoader - ClassPath for the resource
        pathName - Relative Path of the resource
        Returns:
        InputStream containing file contents
        Throws:
        IOException