Class ResourceStreamLocator

  • All Implemented Interfaces:
    IResourceStreamLocator
    Direct Known Subclasses:
    OsgiResourceStreamLocator

    public class ResourceStreamLocator
    extends Object
    implements IResourceStreamLocator
    Locates Wicket resources.

    Contains the logic to locate a resource based on a path, a variation, a style (see Session), a locale and an extension string. The full filename will be built like: <path>_<variation>_<style>_<locale>.<extension>.

    Resource matches will be attempted in the following order:

    1. <path>_<variation>_<style>_<locale>.<extension>
    2. <path>_<style>_<locale>.<extension>
    3. <path>_<locale>.<extension>
    4. <path>_<style>.<extension>
    5. <path>.<extension>

    Locales may contain a language, a country and a region or variant. Combinations of these components will be attempted in the following order:

    1. locale.toString() see javadoc for Locale for more details
    2. <language>_<country>
    3. <language>

    Resources will be actually loaded by the IResourceFinders defined in the resource settings. By default there are finders that look in the classpath and in the classpath in META-INF/resources. You can add more by adding WebApplicationPaths or Paths to ResourceSettings.getResourceFinders().

    Author:
    Juergen Donnerstag, Jonathan Locke