Package io.github.qubitpi.athena.file
Class File
java.lang.Object
io.github.qubitpi.athena.file.File
The athena representations of the file concept.
A File
has two parts
- file content wrapped inside an
InputStream
, and - file
metadata
close
the encapsulated file at any time.-
Constructor Summary
ConstructorDescriptionFile
(@NotNull MetaData metaData, @NotNull InputStream fileContent) Constructor. -
Method Summary
Modifier and TypeMethodDescription@NotNull InputStream
Returns the content of the file wrapped in anInputStream
.@NotNull MetaData
Returns an immutable representation of all metadata associated with thisFile
.
-
Constructor Details
-
File
Constructor.- Parameters:
metaData
- File metadatafileContent
- File content wrapped inside anInputStream
, which cannot beclosed
when passed in- Throws:
NullPointerException
- ifmetaData
orfileContent
isnull
-
-
Method Details
-
getMetaData
Returns an immutable representation of all metadata associated with thisFile
.- Returns:
- a read-only object
-
getFileContent
Returns the content of the file wrapped in anInputStream
.- Returns:
- an unclosed
InputStream
-