Class SimpleCachedContent
java.lang.Object
net.solarnetwork.central.web.support.SimpleCachedContent
- All Implemented Interfaces:
Serializable,CachedContent
Simple cached content item.
- Since:
- 1.16
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleCachedContent(org.springframework.util.MultiValueMap<String, String> headers, byte[] data) Constructor.SimpleCachedContent(org.springframework.util.MultiValueMap<String, String> headers, byte[] data, String contentEncoding) Constructor.SimpleCachedContent(org.springframework.util.MultiValueMap<String, String> headers, byte[] data, String contentEncoding, Map<String, ?> metadata) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the content.Get the content encoding.intGet the length of the content.Get header information about the content.Get metadata about the content.
-
Constructor Details
-
SimpleCachedContent
public SimpleCachedContent(org.springframework.util.MultiValueMap<String, String> headers, byte[] data) Constructor.- Parameters:
headers- the headers; must be fully serializabledata- the data
-
SimpleCachedContent
public SimpleCachedContent(org.springframework.util.MultiValueMap<String, String> headers, byte[] data, String contentEncoding) Constructor.- Parameters:
headers- the headers; must be fully serializabledata- the datacontentEncoding- the content encoding, or null
-
SimpleCachedContent
public SimpleCachedContent(org.springframework.util.MultiValueMap<String, String> headers, byte[] data, String contentEncoding, Map<String, ?> metadata) Constructor.- Parameters:
headers- the headers; must be fully serializabledata- the datacontentEncoding- the content encoding, or nullmetadata- the metadata, or null; must be fully serializable
-
-
Method Details
-
getHeaders
Description copied from interface:CachedContentGet header information about the content.- Specified by:
getHeadersin interfaceCachedContent- Returns:
- the headers
-
getMetadata
Description copied from interface:CachedContentGet metadata about the content.- Specified by:
getMetadatain interfaceCachedContent- Returns:
- the metadata, never null
-
getContentEncoding
Description copied from interface:CachedContentGet the content encoding.- Specified by:
getContentEncodingin interfaceCachedContent- Returns:
- the encoding, for example gzip or null
-
getContent
Description copied from interface:CachedContentGet the content.- Specified by:
getContentin interfaceCachedContent- Returns:
- access to the content, or null if none
- Throws:
IOException- if any IO error occurs
-
getContentLength
public int getContentLength()Description copied from interface:CachedContentGet the length of the content.- Specified by:
getContentLengthin interfaceCachedContent- Returns:
- the length
-