Javadoc cleanup

This commit is contained in:
Andrea Cavalli 2020-09-24 11:51:41 +02:00
parent 78a966a1ad
commit c0fd317fcb
4 changed files with 19 additions and 13 deletions

View File

@ -29,12 +29,14 @@ public interface FileAccessor {
/**
* Request file deletion
*
* @param fileURI File URI
*/
void delete(@NotNull FileURI fileURI);
/**
* Get file content
*
* @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
*/

View File

@ -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 <b>download request</b> has been found,
* or the timeout time elapsed
* @return empty if no pending <b>download requests</b> 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
* <b>download request</b> has been found, or the timeout time elapsed
* @return empty if no pending <b>download requests</b> has been found, true if the signal can be sent, false
* otherwise
*/
Optional<Boolean> 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 <b>delete request</b> has been found,
* or the timeout time elapsed
* @return empty if no pending <b>delete requests</b> 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
* <b>delete request</b> has been found, or the timeout time elapsed
* @return empty if no pending <b>delete requests</b> has been found, true if the signal can be sent, false otherwise
*/
Optional<Boolean> deleteNextFile(FileURI fileURI, @Nullable Duration timeout);
}

View File

@ -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.
* <p>
* {@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.
* <p>
* {@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);
}

View File

@ -29,6 +29,7 @@ public interface FileSpongeClient extends FileAccessor {
/**
* Get this instance but without special methods
*
* @return limited instance of itself
*/
default FileAccessor asFileAccessor() {