Package org.keycloak.theme
Class FolderTheme
- java.lang.Object
-
- org.keycloak.theme.FolderTheme
-
- All Implemented Interfaces:
Theme
public class FolderTheme extends Object implements Theme
- Author:
- Stian Thorgersen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.theme.Theme
Theme.Type
-
-
Constructor Summary
Constructors Constructor Description FolderTheme(File themeDir, String name, Theme.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetImportName()PropertiesgetMessages(String baseBundlename, Locale locale)Retrieve localized messages from a message bundle.PropertiesgetMessages(Locale locale)Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".StringgetName()StringgetParentName()PropertiesgetProperties()InputStreamgetResourceAsStream(String path)URLgetTemplate(String name)Theme.TypegetType()
-
-
-
Constructor Detail
-
FolderTheme
public FolderTheme(File themeDir, String name, Theme.Type type) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getParentName
public String getParentName()
- Specified by:
getParentNamein interfaceTheme
-
getImportName
public String getImportName()
- Specified by:
getImportNamein interfaceTheme
-
getType
public Theme.Type getType()
-
getTemplate
public URL getTemplate(String name) throws IOException
- Specified by:
getTemplatein interfaceTheme- Throws:
IOException
-
getResourceAsStream
public InputStream getResourceAsStream(String path) throws IOException
- Specified by:
getResourceAsStreamin interfaceTheme- Throws:
IOException
-
getMessages
public Properties getMessages(Locale locale) throws IOException
Description copied from interface:ThemeSame as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".- Specified by:
getMessagesin interfaceTheme- Parameters:
locale- The locale of the desired message bundle.- Returns:
- The localized messages from the bundle.
- Throws:
IOException- If bundle can not be read.
-
getMessages
public Properties getMessages(String baseBundlename, Locale locale) throws IOException
Description copied from interface:ThemeRetrieve localized messages from a message bundle.- Specified by:
getMessagesin interfaceTheme- 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.
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfaceTheme
-
-