Package org.keycloak.theme
Class ClasspathThemeResourceProviderFactory
java.lang.Object
org.keycloak.theme.ClasspathThemeResourceProviderFactory
- All Implemented Interfaces:
Provider,ProviderFactory<ThemeResourceProvider>,ThemeResourceProvider,ThemeResourceProviderFactory
public class ClasspathThemeResourceProviderFactory
extends Object
implements ThemeResourceProviderFactory, ThemeResourceProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassLoaderstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This is called when the server shuts down.create(KeycloakSession session) getId()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 namevoidinit(Config.Scope config) Only called once when the factory is first created.protected voidloadMessages(Properties messages, URL resource) voidpostInit(KeycloakSessionFactory factory) Called after all provider factories have been initializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.provider.ProviderFactory
dependsOn, getConfigMetadata, order
-
Field Details
-
THEME_RESOURCES
- See Also:
-
THEME_RESOURCES_TEMPLATES
- See Also:
-
THEME_RESOURCES_RESOURCES
- See Also:
-
THEME_RESOURCES_MESSAGES
- See Also:
-
classLoader
-
-
Constructor Details
-
ClasspathThemeResourceProviderFactory
public ClasspathThemeResourceProviderFactory() -
ClasspathThemeResourceProviderFactory
-
-
Method Details
-
create
- Specified by:
createin interfaceProviderFactory<ThemeResourceProvider>
-
getTemplate
Description copied from interface:ThemeResourceProviderLoad the template for the specific name- Specified by:
getTemplatein interfaceThemeResourceProvider- Parameters:
name- the template name- Returns:
- the URL of the template, or null if the template is unknown
- Throws:
IOException
-
getResourceAsStream
Description copied from interface:ThemeResourceProviderLoad the resource for the specific path- Specified by:
getResourceAsStreamin interfaceThemeResourceProvider- Parameters:
path- the resource path- Returns:
- an InputStream to read the resource, or null if the resource is unknown
- Throws:
IOException
-
getMessages
Description copied from interface:ThemeResourceProviderLoad the message bundle for the specific name and locale- Specified by:
getMessagesin interfaceThemeResourceProvider- 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.
-
loadMessages
- Throws:
IOException
-
getId
- Specified by:
getIdin interfaceProviderFactory<ThemeResourceProvider>
-
init
Description copied from interface:ProviderFactoryOnly called once when the factory is first created.- Specified by:
initin interfaceProviderFactory<ThemeResourceProvider>
-
postInit
Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
postInitin interfaceProviderFactory<ThemeResourceProvider>
-
close
public void close()Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
closein interfaceProvider- Specified by:
closein interfaceProviderFactory<ThemeResourceProvider>
-