public class ClasspathThemeResourceProviderFactory extends Object implements ThemeResourceProviderFactory, ThemeResourceProvider
Modifier and Type | Field and Description |
---|---|
static String |
THEME_RESOURCES_MESSAGES |
static String |
THEME_RESOURCES_RESOURCES |
static String |
THEME_RESOURCES_TEMPLATES |
Constructor and Description |
---|
ClasspathThemeResourceProviderFactory(String id,
ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
void |
close()
This is called when the server shuts down.
|
ThemeResourceProvider |
create(KeycloakSession session) |
String |
getId() |
Properties |
getMessages(String baseBundlename,
Locale locale)
Load the message bundle for the specific name and locale
|
InputStream |
getResourceAsStream(String path)
Load the resource for the specific path
|
URL |
getTemplate(String name)
Load the template for the specific name
|
void |
init(Config.Scope config)
Only called once when the factory is first created.
|
void |
postInit(KeycloakSessionFactory factory)
Called after all provider factories have been initialized
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
order
public static final String THEME_RESOURCES_TEMPLATES
public static final String THEME_RESOURCES_RESOURCES
public static final String THEME_RESOURCES_MESSAGES
public ClasspathThemeResourceProviderFactory(String id, ClassLoader classLoader)
public ThemeResourceProvider create(KeycloakSession session)
create
in interface ProviderFactory<ThemeResourceProvider>
public URL getTemplate(String name) throws IOException
ThemeResourceProvider
getTemplate
in interface ThemeResourceProvider
name
- the template nameIOException
public InputStream getResourceAsStream(String path) throws IOException
ThemeResourceProvider
getResourceAsStream
in interface ThemeResourceProvider
path
- the resource pathIOException
public Properties getMessages(String baseBundlename, Locale locale) throws IOException
ThemeResourceProvider
getMessages
in interface ThemeResourceProvider
baseBundlename
- The base name of the bundle, such as "messages" in
messages_en.properties.locale
- The locale of the desired message bundle.IOException
- If bundle can not be read.public String getId()
getId
in interface ProviderFactory<ThemeResourceProvider>
public void init(Config.Scope config)
ProviderFactory
init
in interface ProviderFactory<ThemeResourceProvider>
public void postInit(KeycloakSessionFactory factory)
ProviderFactory
postInit
in interface ProviderFactory<ThemeResourceProvider>
public void close()
ProviderFactory
close
in interface Provider
close
in interface ProviderFactory<ThemeResourceProvider>
Copyright © 2021 JBoss by Red Hat. All rights reserved.