Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
docs(api): 添加Refresh示例
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxiaocheng0201 committed Jun 11, 2024
1 parent 65b854c commit c2863bc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/com/xuxiaocheng/wlist/api/core/files/Refresh.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@
/**
* The core refresh API.
* Only after refreshing, the files/directories are indexed.
* <p>For example: <pre> {@code
* final RefreshConfirmation confirmation = Refresh.refresh(client, token, location).get();
* Refresh.confirm(client, confirmation.token()).get();
* while (true) {
* try {
* final RefreshProgress ignoredProgress = Refresh.progress(client, confirmation.token()).get();
* TimeUnit.SECONDS.sleep(1);
* } catch (final ExecutionException exception) {
* if (exception.getCause() instanceof TokenExpiredException)
* break;
* throw exception;
* }
* }
* final boolean finished = Refresh.check(client, confirmation.token()).get();
* // Assertions.assertTrue(finished);
* }</pre>
*/
public enum Refresh {;
/**
Expand Down

0 comments on commit c2863bc

Please sign in to comment.