Interface ThemeResourceProvider

  • All Superinterfaces:
    Provider
    All Known Implementing Classes:
    ClasspathThemeResourceProviderFactory

    public interface ThemeResourceProvider
    extends Provider
    A theme resource provider can be used to load additional templates and resources. An example use of this would be a custom authenticator that requires an additional template and a JavaScript file. The theme is searched for templates and resources first. Theme resource providers are only searched if the template or resource is not found. This allows overriding templates and resources from theme resource providers in the theme.
    Author:
    Stian Thorgersen
    • Method Detail

      • getTemplate

        URL getTemplate​(String name)
                 throws IOException
        Load the template for the specific name
        Parameters:
        name - the template name
        Returns:
        the URL of the template, or null if the template is unknown
        Throws:
        IOException
      • getResourceAsStream

        InputStream getResourceAsStream​(String path)
                                 throws IOException
        Load the resource for the specific path
        Parameters:
        path - the resource path
        Returns:
        an InputStream to read the resource, or null if the resource is unknown
        Throws:
        IOException
      • getMessages

        default Properties getMessages​(String baseBundlename,
                                       Locale locale)
                                throws IOException
        Load the message bundle for the specific name and locale
        Parameters:
        baseBundlename - The base name of the bundle, such as "messages" in messages_en.properties.
        locale - The locale of the desired message bundle.
        Returns:
        The localized messages from the bundle.
        Throws:
        IOException - If bundle can not be read.