Package org.keycloak.theme
Interface ThemeResourceProvider
- All Superinterfaces:
Provider
- All Known Implementing Classes:
ClasspathThemeResourceProviderFactory
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 Summary
Modifier and TypeMethodDescriptiondefault Properties
getMessages
(String baseBundlename, Locale locale) Load the message bundle for the specific name and localegetResourceAsStream
(String path) Load the resource for the specific pathgetTemplate
(String name) Load the template for the specific name
-
Method Details
-
getTemplate
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
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
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.
-