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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `THEME_RESOURCES_MESSAGES`
    `static String` | `THEME_RESOURCES_RESOURCES`
    `static String` | `THEME_RESOURCES_TEMPLATES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClasspathThemeResourceProviderFactory(String id, ClassLoader classLoader)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.provider.ProviderFactory

      `order`

- - ### Field Detail

    - #### THEME_RESOURCES_TEMPLATES

          public static final String THEME_RESOURCES_TEMPLATES

      See Also:
        Constant Field Values

    - #### THEME_RESOURCES_RESOURCES

          public static final String THEME_RESOURCES_RESOURCES

      See Also:
        Constant Field Values

    - #### THEME_RESOURCES_MESSAGES

          public static final String THEME_RESOURCES_MESSAGES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClasspathThemeResourceProviderFactory

          public ClasspathThemeResourceProviderFactory(String id,
                                                       ClassLoader classLoader)

  - ### Method Detail

    - #### create

          public ThemeResourceProvider create(KeycloakSession session)

      Specified by:
        `create` in interface `ProviderFactory<ThemeResourceProvider>`

    - #### getTemplate

          public URL getTemplate(String name)
                          throws IOException

      Description copied from interface: `ThemeResourceProvider`
      Load the template for the specific name
      Specified by:
        `getTemplate` in interface `ThemeResourceProvider`
      Parameters:
        `name` - the template name
      Returns:
        the URL of the template, or null if the template is unknown
      Throws:
        `IOException`

    - #### getResourceAsStream

          public InputStream getResourceAsStream(String path)
                                          throws IOException

      Description copied from interface: `ThemeResourceProvider`
      Load the resource for the specific path
      Specified by:
        `getResourceAsStream` in interface `ThemeResourceProvider`
      Parameters:
        `path` - the resource path
      Returns:
        an InputStream to read the resource, or null if the resource is unknown
      Throws:
        `IOException`

    - #### getMessages

          public Properties getMessages(String baseBundlename,
                                        Locale locale)
                                 throws IOException

      Description copied from interface: `ThemeResourceProvider`
      Load the message bundle for the specific name and locale
      Specified by:
        `getMessages` in 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.

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `ProviderFactory<ThemeResourceProvider>`

    - #### init

          public void init(Config.Scope config)

      Description copied from interface: `ProviderFactory`
      Only called once when the factory is first created. This config is pulled from keycloak_server.json
      Specified by:
        `init` in interface `ProviderFactory<ThemeResourceProvider>`

    - #### postInit

          public void postInit(KeycloakSessionFactory factory)

      Description copied from interface: `ProviderFactory`
      Called after all provider factories have been initialized
      Specified by:
        `postInit` in interface `ProviderFactory<ThemeResourceProvider>`

    - #### close

          public void close()

      Description copied from interface: `ProviderFactory`
      This is called when the server shuts down.
      Specified by:
        `close` in interface `Provider`
      Specified by:
        `close` in interface `ProviderFactory<ThemeResourceProvider>`

Copyright © 2020 JBoss by Red Hat. All rights reserved.