Package io.ocfl.api.model
Class OcflObjectVersionFile
java.lang.Object
io.ocfl.api.model.OcflObjectVersionFile
Represents a file within an OCFL object at a specific version. The file content can be lazy-loaded.
-
Constructor Summary
ConstructorsConstructorDescriptionOcflObjectVersionFile
(FileDetails fileDetails, OcflFileRetriever fileRetriever) -
Method Summary
Modifier and TypeMethodDescriptionMap of digest algorithm to digest value.getPath()
The file's logical path within the objectReturns an input stream of the file's content between the specified byte range.The file's path relative to the storage rootReturns a new input stream of the file's content.toString()
-
Constructor Details
-
OcflObjectVersionFile
-
-
Method Details
-
getPath
The file's logical path within the object- Returns:
- logical path
-
getStorageRelativePath
The file's path relative to the storage root- Returns:
- storage relative path
-
getFixity
Map of digest algorithm to digest value.- Returns:
- digest map
-
getStream
Returns a new input stream of the file's content. The caller is responsible for closing the stream.The caller may call
checkFixity()
on the InputStream after streaming all of that data to ensure the fixity of data.- Returns:
- FixityCheckInputStream of the file's content
-
getRange
Returns an input stream of the file's content between the specified byte range. startPosition and endPosition may be null, depending on the underlying implementation, and the meaning of a null value is also implementation dependent.The caller is responsible for closing the stream. The input stream is buffered.
- Parameters:
startPosition
- the byte offset in the file to start reading, inclusiveendPosition
- the byte offset in the file to stop reading, inclusive- Returns:
- a buffered input stream containing the specified file data
-
toString
-