Package net.solarnetwork.node.setup
Class SimpleSetupResourceProvider
java.lang.Object
net.solarnetwork.node.setup.SimpleSetupResourceProvider
- All Implemented Interfaces:
SetupResourceProvider
Basic implementation of
SetupResourceProvider for serving static
content.- Version:
- 1.0
- Author:
- matt
-
Field Summary
Fields inherited from interface net.solarnetwork.node.setup.SetupResourceProvider
WEB_CONSUMER_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the setup resources.getSetupResource(String resourceUID, Locale locale) Get a specific resource for a resource UID.getSetupResourcesForConsumer(String consumerType, Locale locale) Get a set of resources for specific context and content type.voidsetDefaultLocale(Locale defaultLocale) Set the locale to use for resources that have no locale specified in their filename.voidsetResources(List<SetupResource> resources) Set the list of resources to use.
-
Constructor Details
-
SimpleSetupResourceProvider
public SimpleSetupResourceProvider()Default constructor.
-
-
Method Details
-
getSetupResource
Description copied from interface:SetupResourceProviderGet a specific resource for a resource UID.- Specified by:
getSetupResourcein interfaceSetupResourceProvider- Parameters:
resourceUID- the ID of the resource to getlocale- the desired locale- Returns:
- the resource, or null if not available
-
getSetupResourcesForConsumer
Description copied from interface:SetupResourceProviderGet a set of resources for specific context and content type. AconsumerTyperepresents the type of application the consumer of the setup resources represents. TheSetupResourceProvider.WEB_CONSUMER_TYPErepresents a webapp, for example, and would be interested in resources such as JavaScript, CSS, images, etc.- Specified by:
getSetupResourcesForConsumerin interfaceSetupResourceProvider- Parameters:
consumerType- the consumer type to get all appropriate resources for.locale- the desired locale.- Returns:
- all matching resources, never null
-
getResources
Get the setup resources.- Returns:
- the resources
-
setResources
Set the list of resources to use.- Parameters:
resources- The fixed set of resources managed by this service.
-
setDefaultLocale
Set the locale to use for resources that have no locale specified in their filename.- Parameters:
defaultLocale- The default locale.
-