From 8fb299635f1758b8e6b1144b65850df8091cd70e Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Mon, 11 Jan 2021 14:43:38 +0100 Subject: [PATCH] Add documentation --- .../org/warp/filesponge/api/FileStorage.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/lombok/org/warp/filesponge/api/FileStorage.java b/src/main/lombok/org/warp/filesponge/api/FileStorage.java index c09bac0..c66148c 100644 --- a/src/main/lombok/org/warp/filesponge/api/FileStorage.java +++ b/src/main/lombok/org/warp/filesponge/api/FileStorage.java @@ -30,8 +30,27 @@ public interface FileStorage newFile(@NotNull FURI fileURI, @NotNull FTYPE fileType); + /** + * Read file data. + * Fails if not all the file data is available. + * @param fileURI File URI + * @return read-only file data + * @throws java.util.NoSuchElementException if file is not existing, or some requested data is missing + */ Mono readFileData(@NotNull FURI fileURI); + /** + * Read a part of file data. + * Fails if not all the requested file data is available. + * @param fileURI File URI + * @param offset offset of the current data segment + * @param size current data segment size + * @return read-only file data part + * @throws java.util.NoSuchElementException if file is not existing, or some requested data is missing + * @throws org.warp.commonutils.error.IndexOutOfBoundsException if requested offset or size is not valid + */ + Mono readFileDataPart(@NotNull FURI fileURI, long offset, long size); + /** * Set a part of file data. * If file size is 0, the file will be deleted.