Package net.solarnetwork.node.setup
Class ResourceSetupResource
java.lang.Object
net.solarnetwork.node.setup.BaseStaticSetupResource
net.solarnetwork.node.setup.ResourceSetupResource
- All Implemented Interfaces:
SetupResource
A
SetupResource that delegates to a Resource.- Version:
- 1.1
- Author:
- matt
-
Field Summary
Fields inherited from interface net.solarnetwork.node.setup.SetupResource
AUTHENTICATED_USER_ROLE, CACHE_DISABLED, CSS_CONTENT_TYPE, HTML_CONTENT_TYPE, JAVASCRIPT_CONTENT_TYPE, JSON_CONTENT_TYPE, USER_ROLES, WEB_CONSUMER_TYPES -
Constructor Summary
ConstructorsConstructorDescriptionResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, int cacheSeconds, Set<String> consumerTypes, Set<String> roles) Construct from a resource, detecting the locale from the resource filename.ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, int cacheSeconds, Set<String> consumerTypes, Set<String> roles, SetupResourceScope scope) Construct from a resource, detecting the locale from the resource filename.ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, Locale locale, int cacheSeconds, Set<String> consumerTypes, Set<String> roles) Construct from a resource.ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, Locale locale, int cacheSeconds, Set<String> consumerTypes, Set<String> roles, SetupResourceScope scope) Construct from a resource. -
Method Summary
Methods inherited from class net.solarnetwork.node.setup.BaseStaticSetupResource
contentLength, getCacheMaximumSeconds, getContentType, getLocale, getRequiredRoles, getResourceUID, getScope, getSupportedConsumerTypes, lastModified
-
Constructor Details
-
ResourceSetupResource
public ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, int cacheSeconds, Set<String> consumerTypes, Set<String> roles) throws IOException Construct from a resource, detecting the locale from the resource filename.- Parameters:
resource- the resourceuid- theresourceUIDcontentType- the content typecacheSeconds- the maximum cache secondsconsumerTypes- the optional consumer typesroles- the optional required roles- Throws:
IOException- if any IO error occurs
-
ResourceSetupResource
public ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, int cacheSeconds, Set<String> consumerTypes, Set<String> roles, SetupResourceScope scope) throws IOException Construct from a resource, detecting the locale from the resource filename.- Parameters:
resource- the resourceuid- theresourceUIDcontentType- the content typecacheSeconds- the maximum cache secondsconsumerTypes- the optional consumer typesroles- the optional required rolesscope- the scope to use- Throws:
IOException- if any IO error occurs- Since:
- 1.1
-
ResourceSetupResource
public ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, Locale locale, int cacheSeconds, Set<String> consumerTypes, Set<String> roles) throws IOException Construct from a resource.- Parameters:
resource- the resourceuid- theresourceUIDcontentType- the content typelocale- the locale to usecacheSeconds- the maximum cache secondsconsumerTypes- the optional consumer typesroles- the optional required roles- Throws:
IOException- if any IO error occurs
-
ResourceSetupResource
public ResourceSetupResource(org.springframework.core.io.Resource resource, String uid, String contentType, Locale locale, int cacheSeconds, Set<String> consumerTypes, Set<String> roles, SetupResourceScope scope) throws IOException Construct from a resource.- Parameters:
resource- the resourceuid- theresourceUIDcontentType- the content typelocale- the locale to usecacheSeconds- the maximum cache secondsconsumerTypes- the optional consumer typesroles- the optional required rolesscope- the scope to use- Throws:
IOException- if any IO error occurs- Since:
- 1.1
-
-
Method Details
-
getInputStream
Description copied from interface:SetupResourceReturn a newInputStream. This method should return a new stream each time it is called.- Returns:
- the input stream for the underlying resource (must not be null)
- Throws:
IOException- if the stream could not be opened
-