@FunctionalInterface public static interface FileStore.Reader
FileStore.| Modifier and Type | Method and Description |
|---|---|
default void |
consume(FileStore.InputStreamConsumer inputStreamConsumer)
Consumes the contents of the file.
|
default InputStreamAndMeta |
getInputStreamAndMeta()
Opens an input stream and returns it with extra information such as its length.
|
InputStream |
openInputStream()
Opens a new
InputStream for the file. |
default <T> T |
read(FileStore.InputStreamExtractor<T> inputStreamExtractor)
Consumes the contents of the file and produces a result.
|
InputStream openInputStream() throws IOException, FileStoreAccessDeniedException, FileStoreNoSuchFileException
InputStream for the file.
It is the responsibility of the caller to close the stream when it is no longer required.InputStreamIOException - if the file cannot be opened for reading.FileStoreAccessDeniedException - if the required permissions to read the file are not present.FileStoreNoSuchFileException - if the file does not exist.default void consume(FileStore.InputStreamConsumer inputStreamConsumer) throws IOException, FileStoreAccessDeniedException, FileStoreNoSuchFileException
inputStreamConsumer - An FileStore.InputStreamConsumer which consumes the file contents.IOException - if the file cannot be readFileStoreAccessDeniedException - if the required permissions to read the file are not present.FileStoreNoSuchFileException - if the file does not exist.default <T> T read(FileStore.InputStreamExtractor<T> inputStreamExtractor) throws IOException, FileStoreAccessDeniedException, FileStoreNoSuchFileException
T - The type of the result.inputStreamExtractor - An FileStore.InputStreamExtractor which consumes the file contents and produces the result.IOException - If the file cannot be read.FileStoreAccessDeniedException - if the required permissions to read the file are not present.FileStoreNoSuchFileException - if the file does not exist.default InputStreamAndMeta getInputStreamAndMeta() throws IOException, FileStoreAccessDeniedException, FileStoreNoSuchFileException
InputStream if an exception is thrown after it's opened and before returning.InputStreamAndMetaIOException - if the file cannot be opened for reading.FileStoreAccessDeniedException - if the required permissions to read the file are not present.FileStoreNoSuchFileException - if the file does not exist.Copyright © 2021–2024 Atlassian. All rights reserved.