Class ClientLocalizationMessageResource

  • All Implemented Interfaces:
    Resource

    public class ClientLocalizationMessageResource
    extends VirtualResource
    Provides a number of symbols related to client-side localization; by exposing these in the global message catalog, they are available to the client (via the "t5/core/messages" module).
    Since:
    5.4
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Resource forLocale​(java.util.Locale locale)
      Returns a localized version of the resource.
      java.lang.String getFile()
      Returns the file portion of the Resource path, everything that follows the final forward slash.
      java.lang.String getPath()
      Return the path (the combination of folder and file).
      java.io.InputStream openStream()
      Opens a stream to the content of the resource, or returns null if the resource does not exist.
      java.net.URL toURL()
      Returns the URL for the resource, or null if it does not exist.
      Resource withExtension​(java.lang.String extension)
      Returns a new Resource with the extension changed (or, if the resource does not have an extension, the extension is added).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • withExtension

        public Resource withExtension​(java.lang.String extension)
        Description copied from interface: Resource
        Returns a new Resource with the extension changed (or, if the resource does not have an extension, the extension is added). The new Resource may not exist (that is, Resource.toURL() may return null.
        Specified by:
        withExtension in interface Resource
        Overrides:
        withExtension in class VirtualResource
        Parameters:
        extension - to apply to the resource, such as "html" or "properties"
        Returns:
        the new resource
      • getPath

        public java.lang.String getPath()
        Description copied from interface: Resource
        Return the path (the combination of folder and file). Starting in 5.4, certain "virtual resources", may return an arbitrary value here.
        Specified by:
        getPath in interface Resource
        Overrides:
        getPath in class VirtualResource
      • getFile

        public java.lang.String getFile()
        Description copied from interface: Resource
        Returns the file portion of the Resource path, everything that follows the final forward slash. Starting in 5.4, certain kinds of "virtual resources" may return null here.
        Specified by:
        getFile in interface Resource
        Overrides:
        getFile in class VirtualResource
      • toURL

        public java.net.URL toURL()
        Description copied from interface: Resource
        Returns the URL for the resource, or null if it does not exist. This value is lazily computed; starting in 5.3.4, subclasses may cache the result. Starting in 5.4, some "virtual resources" may return null.
        Specified by:
        toURL in interface Resource
        Overrides:
        toURL in class VirtualResource
      • forLocale

        public Resource forLocale​(java.util.Locale locale)
        Description copied from interface: Resource
        Returns a localized version of the resource. May return null if no such resource exists. Starting in release 5.3.4, the result of this method is cached internally.
        Specified by:
        forLocale in interface Resource
        Overrides:
        forLocale in class VirtualResource
      • openStream

        public java.io.InputStream openStream()
                                       throws java.io.IOException
        Description copied from interface: Resource
        Opens a stream to the content of the resource, or returns null if the resource does not exist. The native input stream supplied by the resource is wrapped in a BufferedInputStream.
        Returns:
        an open, buffered stream to the content, if available
        Throws:
        java.io.IOException