Class SimpleSetupResourceProvider

java.lang.Object
net.solarnetwork.node.setup.SimpleSetupResourceProvider
All Implemented Interfaces:
SetupResourceProvider

public class SimpleSetupResourceProvider extends Object implements SetupResourceProvider
Basic implementation of SetupResourceProvider for serving static content.
Version:
1.0
Author:
matt
  • Constructor Details

    • SimpleSetupResourceProvider

      public SimpleSetupResourceProvider()
      Default constructor.
  • Method Details

    • getSetupResource

      public SetupResource getSetupResource(String resourceUID, Locale locale)
      Description copied from interface: SetupResourceProvider
      Get a specific resource for a resource UID.
      Specified by:
      getSetupResource in interface SetupResourceProvider
      Parameters:
      resourceUID - the ID of the resource to get
      locale - the desired locale
      Returns:
      the resource, or null if not available
    • getSetupResourcesForConsumer

      public Collection<SetupResource> getSetupResourcesForConsumer(String consumerType, Locale locale)
      Description copied from interface: SetupResourceProvider
      Get a set of resources for specific context and content type. A consumerType represents the type of application the consumer of the setup resources represents. The SetupResourceProvider.WEB_CONSUMER_TYPE represents a webapp, for example, and would be interested in resources such as JavaScript, CSS, images, etc.
      Specified by:
      getSetupResourcesForConsumer in interface SetupResourceProvider
      Parameters:
      consumerType - the consumer type to get all appropriate resources for.
      locale - the desired locale.
      Returns:
      all matching resources, never null
    • getResources

      public List<SetupResource> getResources()
      Get the setup resources.
      Returns:
      the resources
    • setResources

      public void setResources(List<SetupResource> resources)
      Set the list of resources to use.
      Parameters:
      resources - The fixed set of resources managed by this service.
    • setDefaultLocale

      public void setDefaultLocale(Locale defaultLocale)
      Set the locale to use for resources that have no locale specified in their filename.
      Parameters:
      defaultLocale - The default locale.