Package io.ocfl.api.model
Class OcflObjectVersionFile
- java.lang.Object
-
- io.ocfl.api.model.OcflObjectVersionFile
-
public class OcflObjectVersionFile extends Object
Represents a file within an OCFL object at a specific version. The file content can be lazy-loaded.
-
-
Constructor Summary
Constructors Constructor Description OcflObjectVersionFile(FileDetails fileDetails, OcflFileRetriever fileRetriever)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<DigestAlgorithm,String>
getFixity()
Map of digest algorithm to digest value.String
getPath()
The file's logical path within the objectString
getStorageRelativePath()
The file's path relative to the storage rootFixityCheckInputStream
getStream()
Returns a new input stream of the file's content.String
toString()
-
-
-
Constructor Detail
-
OcflObjectVersionFile
public OcflObjectVersionFile(FileDetails fileDetails, OcflFileRetriever fileRetriever)
-
-
Method Detail
-
getPath
public String getPath()
The file's logical path within the object- Returns:
- logical path
-
getStorageRelativePath
public String getStorageRelativePath()
The file's path relative to the storage root- Returns:
- storage relative path
-
getFixity
public Map<DigestAlgorithm,String> getFixity()
Map of digest algorithm to digest value.- Returns:
- digest map
-
getStream
public FixityCheckInputStream 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
-
-