From c0fd317fcb88bdec2a5e055824ee441bb24c5e1d Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 24 Sep 2020 11:51:41 +0200 Subject: [PATCH] Javadoc cleanup --- .../org/warp/filesponge/api/FileAccessor.java | 5 ++++- .../org/warp/filesponge/api/FileActor.java | 17 +++++++---------- .../org/warp/filesponge/api/FileSource.java | 9 +++++++-- .../warp/filesponge/api/FileSpongeClient.java | 1 + 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/lombok/org/warp/filesponge/api/FileAccessor.java b/src/main/lombok/org/warp/filesponge/api/FileAccessor.java index 6246346..b8e4589 100644 --- a/src/main/lombok/org/warp/filesponge/api/FileAccessor.java +++ b/src/main/lombok/org/warp/filesponge/api/FileAccessor.java @@ -29,13 +29,15 @@ public interface FileAccessor { /** * Request file deletion + * * @param fileURI File URI */ void delete(@NotNull FileURI fileURI); /** * Get file content - * @param fileURI File URI + * + * @param fileURI File URI * @param offlineOnly true to get the file from cache * @return content if found. If the request is offline the future will complete instantly */ @@ -43,6 +45,7 @@ public interface FileAccessor { /** * Get file status + * * @param fileURI File URI * @return status of this file */ diff --git a/src/main/lombok/org/warp/filesponge/api/FileActor.java b/src/main/lombok/org/warp/filesponge/api/FileActor.java index f0e9141..d72ca97 100644 --- a/src/main/lombok/org/warp/filesponge/api/FileActor.java +++ b/src/main/lombok/org/warp/filesponge/api/FileActor.java @@ -55,11 +55,10 @@ public interface FileActor { * Send a "download file" signal * * @param fileURI File URI - * @param timeout if it's null the method will return immediately, - * if it's set the method will wait until a file download request has been found, - * or the timeout time elapsed - * @return empty if no pending download requests has been found, - * true if the signal can be sent, false otherwise + * @param timeout if it's null the method will return immediately, if it's set the method will wait until a file + * download request has been found, or the timeout time elapsed + * @return empty if no pending download requests has been found, true if the signal can be sent, false + * otherwise */ Optional downloadNextFile(FileURI fileURI, @Nullable Duration timeout); @@ -67,11 +66,9 @@ public interface FileActor { * Send a "delete file" signal * * @param fileURI File URI - * @param timeout if it's null the method will return immediately, - * if it's set the method will wait until a file delete request has been found, - * or the timeout time elapsed - * @return empty if no pending delete requests has been found, - * true if the signal can be sent, false otherwise + * @param timeout if it's null the method will return immediately, if it's set the method will wait until a file + * delete request has been found, or the timeout time elapsed + * @return empty if no pending delete requests has been found, true if the signal can be sent, false otherwise */ Optional deleteNextFile(FileURI fileURI, @Nullable Duration timeout); } diff --git a/src/main/lombok/org/warp/filesponge/api/FileSource.java b/src/main/lombok/org/warp/filesponge/api/FileSource.java index 4cf84f2..42b3bab 100644 --- a/src/main/lombok/org/warp/filesponge/api/FileSource.java +++ b/src/main/lombok/org/warp/filesponge/api/FileSource.java @@ -42,12 +42,17 @@ public interface FileSource { boolean onNewFile(@NotNull FileURI fileURI, @NotNull FileExtension fileExtension); /** - * Called when the mirror notifies you details about a file + * Called when the mirror notifies you details about a file. + *

+ * {@link this#onNewFile(FileURI, FileExtension)} must have been already called */ void onFile(@NotNull FileURI fileURI, @NotNull FileSourceAvailability fileAvailability, long totalSize); /** - * Called when the mirror notifies you the bytes of a part of a file + * Called when the mirror notifies you the bytes of a part of a file. + *

+ * {@link this#onNewFile(FileURI, FileExtension)} and {@link this#onFile(FileURI, FileSourceAvailability, long)} must + * have been already called */ void onFilePiece(@NotNull FileURI fileURI, long offset, long size, @NotNull ByteBuffer piece); } diff --git a/src/main/lombok/org/warp/filesponge/api/FileSpongeClient.java b/src/main/lombok/org/warp/filesponge/api/FileSpongeClient.java index adc4f07..0bad767 100644 --- a/src/main/lombok/org/warp/filesponge/api/FileSpongeClient.java +++ b/src/main/lombok/org/warp/filesponge/api/FileSpongeClient.java @@ -29,6 +29,7 @@ public interface FileSpongeClient extends FileAccessor { /** * Get this instance but without special methods + * * @return limited instance of itself */ default FileAccessor asFileAccessor() {