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 SummaryFields Modifier and Type Field Description protected ClassLoaderclassLoaderstatic StringTHEME_RESOURCESstatic StringTHEME_RESOURCES_MESSAGESstatic StringTHEME_RESOURCES_RESOURCESstatic StringTHEME_RESOURCES_TEMPLATES
 - 
Constructor SummaryConstructors Constructor Description ClasspathThemeResourceProviderFactory()ClasspathThemeResourceProviderFactory(String id, ClassLoader classLoader)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This is called when the server shuts down.ThemeResourceProvidercreate(KeycloakSession session)StringgetId()PropertiesgetMessages(String baseBundlename, Locale locale)Load the message bundle for the specific name and localeInputStreamgetResourceAsStream(String path)Load the resource for the specific pathprotected InputStreamgetResourceAsStream(String path, URL rootResourceURL)URLgetTemplate(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 initialized- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.provider.ProviderFactorygetConfigMetadata, order
 
- 
 
- 
- 
- 
Field Detail- 
THEME_RESOURCESpublic static final String THEME_RESOURCES - See Also:
- Constant Field Values
 
 - 
THEME_RESOURCES_TEMPLATESpublic static final String THEME_RESOURCES_TEMPLATES - See Also:
- Constant Field Values
 
 - 
THEME_RESOURCES_RESOURCESpublic static final String THEME_RESOURCES_RESOURCES - See Also:
- Constant Field Values
 
 - 
THEME_RESOURCES_MESSAGESpublic static final String THEME_RESOURCES_MESSAGES - See Also:
- Constant Field Values
 
 - 
classLoaderprotected final ClassLoader classLoader 
 
- 
 - 
Constructor Detail- 
ClasspathThemeResourceProviderFactorypublic ClasspathThemeResourceProviderFactory() 
 - 
ClasspathThemeResourceProviderFactorypublic ClasspathThemeResourceProviderFactory(String id, ClassLoader classLoader) 
 
- 
 - 
Method Detail- 
createpublic ThemeResourceProvider create(KeycloakSession session) - Specified by:
- createin interface- ProviderFactory<ThemeResourceProvider>
 
 - 
getTemplatepublic URL getTemplate(String name) throws IOException Description copied from interface:ThemeResourceProviderLoad the template for the specific name- Specified by:
- getTemplatein interface- ThemeResourceProvider
- Parameters:
- name- the template name
- Returns:
- the URL of the template, or null if the template is unknown
- Throws:
- IOException
 
 - 
getResourceAsStreampublic InputStream getResourceAsStream(String path) throws IOException Description copied from interface:ThemeResourceProviderLoad the resource for the specific path- Specified by:
- getResourceAsStreamin interface- ThemeResourceProvider
- Parameters:
- path- the resource path
- Returns:
- an InputStream to read the resource, or null if the resource is unknown
- Throws:
- IOException
 
 - 
getResourceAsStreamprotected InputStream getResourceAsStream(String path, URL rootResourceURL) throws IOException - Throws:
- IOException
 
 - 
getMessagespublic Properties getMessages(String baseBundlename, Locale locale) throws IOException Description copied from interface:ThemeResourceProviderLoad the message bundle for the specific name and locale- Specified by:
- getMessagesin interface- ThemeResourceProvider
- 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.
 
 - 
loadMessagesprotected void loadMessages(Properties messages, URL resource) throws IOException - Throws:
- IOException
 
 - 
getIdpublic String getId() - Specified by:
- getIdin interface- ProviderFactory<ThemeResourceProvider>
 
 - 
initpublic void init(Config.Scope config) Description copied from interface:ProviderFactoryOnly called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
- initin interface- ProviderFactory<ThemeResourceProvider>
 
 - 
postInitpublic void postInit(KeycloakSessionFactory factory) Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
- postInitin interface- ProviderFactory<ThemeResourceProvider>
 
 - 
closepublic void close() Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
- closein interface- Provider
- Specified by:
- closein interface- ProviderFactory<ThemeResourceProvider>
 
 
- 
 
-