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.