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 String
getImportName()
Properties
getMessages(String baseBundlename, Locale locale)
Retrieve localized messages from a message bundle.Properties
getMessages(Locale locale)
Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".String
getName()
String
getParentName()
Properties
getProperties()
InputStream
getResourceAsStream(String path)
URL
getTemplate(String name)
Theme.Type
getType()
-
-
-
Constructor Detail
-
FolderTheme
public FolderTheme(File themeDir, String name, Theme.Type type) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getParentName
public String getParentName()
- Specified by:
getParentName
in interfaceTheme
-
getImportName
public String getImportName()
- Specified by:
getImportName
in interfaceTheme
-
getType
public Theme.Type getType()
-
getTemplate
public URL getTemplate(String name) throws IOException
- Specified by:
getTemplate
in interfaceTheme
- Throws:
IOException
-
getResourceAsStream
public InputStream getResourceAsStream(String path) throws IOException
- Specified by:
getResourceAsStream
in interfaceTheme
- Throws:
IOException
-
getMessages
public Properties getMessages(Locale locale) throws IOException
Description copied from interface:Theme
Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".- Specified by:
getMessages
in 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:Theme
Retrieve localized messages from a message bundle.- Specified by:
getMessages
in 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:
getProperties
in interfaceTheme
-
-