Interface ResourceProvider

  • All Known Subinterfaces:
    PageResourceProvider

    public interface ResourceProvider
    Access to the extension resources
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.io.File getResourceAsFile​(java.lang.String resourceName)
      Retrieve a resource as a File
      java.io.InputStream getResourceAsStream​(java.lang.String resourceName)
      Retrieve a resource as an InputStream
      java.util.ResourceBundle getResourceBundle​(java.lang.String name, java.util.Locale locale)
      Retrieve a ResourceBundle that can be used for localization.
      java.lang.String getResourceURL​(java.lang.String resourceName)
      Retrieve a resource URL
    • Method Detail

      • getResourceAsStream

        java.io.InputStream getResourceAsStream​(java.lang.String resourceName)
                                         throws java.io.FileNotFoundException
        Retrieve a resource as an InputStream
        Parameters:
        resourceName - the name of the resource to retrieve. It can be a path.
        Returns:
        a InputStream for this resource
        Throws:
        java.io.FileNotFoundException
      • getResourceAsFile

        java.io.File getResourceAsFile​(java.lang.String resourceName)
        Retrieve a resource as a File
        Parameters:
        resourceName - the name of the resource to retrieve. It can be a path.
        Returns:
        a File for this resource
      • getResourceURL

        java.lang.String getResourceURL​(java.lang.String resourceName)
        Retrieve a resource URL
        Parameters:
        resourceName - the name of the resource to retrieve. It can be a path.
        Returns:
        the URL of where the resource is available.
      • getResourceBundle

        java.util.ResourceBundle getResourceBundle​(java.lang.String name,
                                                   java.util.Locale locale)
        Retrieve a ResourceBundle that can be used for localization.
        Parameters:
        name - the name of the resource to retrieve (e.g. : messages for a resource named messages_fr.properties)
        locale - the Locale of the ResourceBundle to retrieve.(e.g. : Locale.FRENCH for a resource named messages_fr.properties)
        Returns:
        the ResourceBundle for given name and Locale