Interface ContentResourceLoader

    • Method Detail

      • getResource

        URL getResource​(String path)
                 throws MalformedURLException
        Returns a URL to the resource that is mapped to the given path.

        The path must begin with a / and is interpreted as relative to the current content root.

        This method returns null if no resource is mapped to the pathname.

        Parameters:
        path - a String specifying the path to the resource
        Returns:
        the resource located at the named path, or null if there is no resource at that path
        Throws:
        MalformedURLException - if the pathname is not given in the correct form
      • getResourceAsStream

        InputStream getResourceAsStream​(String path)
                                 throws IOException
        Returns the resource located at the named path as an InputStream object.

        The path must be specified according to the rules given in getResource. This method returns null if no resource exists at the specified path.

        Parameters:
        path - a String specifying the path to the resource
        Returns:
        the InputStream returned to the caller, or null if no resource exists at the specified path
        Throws:
        IOException