Package net.solarnetwork.io
Class ResourceWithMetadata
java.lang.Object
net.solarnetwork.io.ResourceWithMetadata
- All Implemented Interfaces:
ResourceMetadataHolder,org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class ResourceWithMetadata
extends Object
implements org.springframework.core.io.Resource, ResourceMetadataHolder
A
Resource and ResourceMetadataHolder combination, to allow
ResourceMetadata to be associated with a Resource.- Since:
- 1.54
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionResourceWithMetadata(org.springframework.core.io.Resource delegate, ResourceMetadata metadata) Constructor. -
Method Summary
-
Constructor Details
-
ResourceWithMetadata
public ResourceWithMetadata(org.springframework.core.io.Resource delegate, ResourceMetadata metadata) Constructor.- Parameters:
delegate- the delegate resourcemetadata- the associated metadata
-
-
Method Details
-
getMetadata
Description copied from interface:ResourceMetadataHolderGet the resource metadata.- Specified by:
getMetadatain interfaceResourceMetadataHolder- Returns:
- the metadata, or null if not available
-
getInputStream
- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource- Throws:
IOException
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.springframework.core.io.Resource
-
isReadable
public boolean isReadable()- Specified by:
isReadablein interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.springframework.core.io.Resource
-
getURL
- Specified by:
getURLin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getURI
- Specified by:
getURIin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFile
- Specified by:
getFilein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
contentLength
- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
lastModified
- Specified by:
lastModifiedin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
createRelative
- Specified by:
createRelativein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFilename
- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource
-
getDescription
- Specified by:
getDescriptionin interfaceorg.springframework.core.io.Resource
-