Package org.fcrepo.storage.ocfl
Class ResourceContent
java.lang.Object
org.fcrepo.storage.ocfl.ResourceContent
- All Implemented Interfaces:
AutoCloseable
Encapsulates a resource's content and its headers.
- Author:
- pwinckles
-
Constructor Summary
ConstructorsConstructorDescriptionResourceContent(InputStream contentStream, ResourceHeaders headers) Creates a new instanceResourceContent(Optional<InputStream> contentStream, ResourceHeaders headers) Creates a new instance -
Method Summary
-
Constructor Details
-
ResourceContent
Creates a new instance- Parameters:
contentStream- the resource's content, may be nullheaders- the resource's headers
-
ResourceContent
Creates a new instance- Parameters:
contentStream- the resource's contentheaders- the resource's headers
-
-
Method Details
-
getContentStream
- Returns:
- the resource's content
-
getHeaders
- Returns:
- the resource's headers
-
close
Closes the underlying resource content stream.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if the stream is not closed cleanly
-