Class File

java.lang.Object
io.github.qubitpi.athena.file.File

@Immutable @ThreadSafe public class File extends Object
The athena representations of the file concept.

A File has two parts

  1. file content wrapped inside an InputStream, and
  2. file metadata
Note that an instance of it is guaranteed not to close the encapsulated file at any time.
  • Constructor Details

    • File

      public File(@NotNull @NotNull MetaData metaData, @NotNull @NotNull InputStream fileContent)
      Constructor.
      Parameters:
      metaData - File metadata
      fileContent - File content wrapped inside an InputStream, which cannot be closed when passed in
      Throws:
      NullPointerException - if metaData or fileContent is null
  • Method Details

    • getMetaData

      @NotNull public @NotNull MetaData getMetaData()
      Returns an immutable representation of all metadata associated with this File.
      Returns:
      a read-only object
    • getFileContent

      @NotNull public @NotNull InputStream getFileContent()
      Returns the content of the file wrapped in an InputStream.
      Returns:
      an unclosed InputStream