org.apache.tiles.request.locale

## Class PostfixedApplicationResource

- java.lang.Object
- - org.apache.tiles.request.locale.PostfixedApplicationResource

- All Implemented Interfaces:
    ApplicationResource
  Direct Known Subclasses:
    StrutsApplicationResource, URLApplicationResource

      public abstract class PostfixedApplicationResource
      extends Object
      implements ApplicationResource

  An ApplicationResource whose localization is managed by postfixing the file name. The various localizations are file sitting next to each other, with the locale identified in the postfix.

  For instance:

       /WEB-INF/tiles.xml
       /WEB-INF/tiles_fr.xml
       /WEB-INF/tiles_it.xml
       /WEB-INF/tiles_it_IT.xml

  Two PostfixedApplicationResources are equals if they share the same localized path and the same class.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PostfixedApplicationResource(String localePath)` Create a new PostfixedApplicationResource for the specified path.
    `protected` | `PostfixedApplicationResource(String path, Locale locale)` Create a new PostfixedApplicationResource for the specified path.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `Locale` | `getLocale()` Get the Locale for this resource.
    `String` | `getLocalePath()` Get the path name for this resource.
    `String` | `getLocalePath(Locale newLocale)` Get the path name of another version of the resource.
    `String` | `getPath()` Get the path name for this resource.
    `int` | `hashCode()`

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

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

    - ### Methods inherited from interface org.apache.tiles.request.ApplicationResource

      `getInputStream, getLastModified`

- - ### Constructor Detail

    - #### PostfixedApplicationResource

          protected PostfixedApplicationResource(String localePath)

      Create a new PostfixedApplicationResource for the specified path.
      Parameters:
        `localePath` - the path including localization.

    - #### PostfixedApplicationResource

          protected PostfixedApplicationResource(String path,
                                                 Locale locale)

      Create a new PostfixedApplicationResource for the specified path.
      Parameters:
        `path` - the path excluding localization.
        `locale` - the Locale.

  - ### Method Detail

    - #### getLocalePath

          public final String getLocalePath()

      Get the path name for this resource. You can access this resource by passing the path to `getResource`.
      Specified by:
        `getLocalePath` in interface `ApplicationResource`
      Returns:
        the path including localization.

    - #### getPath

          public final String getPath()

      Get the path name for this resource. Multiple versions of a resource can share the same path if the locale part is different.
      Specified by:
        `getPath` in interface `ApplicationResource`
      Returns:
        the path excluding localization.

    - #### getLocalePath

          public final String getLocalePath(Locale newLocale)

      Get the path name of another version of the resource.
      Specified by:
        `getLocalePath` in interface `ApplicationResource`
      Parameters:
        `newLocale` - the Locale for the new version.
      Returns:
        the path including localization.

    - #### getLocale

          public final Locale getLocale()

      Get the Locale for this resource.
      Specified by:
        `getLocale` in interface `ApplicationResource`
      Returns:
        the Locale.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.