Skip to content

Commit

Permalink
Deprecate FileSystem recursive deletion that uses a recursive paramet…
Browse files Browse the repository at this point in the history
…er: instead deleteRecursive or delete should be used
  • Loading branch information
vietj committed Mar 5, 2025
1 parent e612c87 commit c5c5f60
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/main/java/io/vertx/core/file/FileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,21 +413,59 @@ public interface FileSystem {
* @param recursive delete recursively?
* @param handler the handler that will be called on completion
* @return a reference to this, so the API can be used fluently
* @deprecated instead use {@link #deleteRecursive(String, Handler)} or {@link #delete(String, Handler)}
*/
@Deprecated
@Fluent
FileSystem deleteRecursive(String path, boolean recursive, Handler<AsyncResult<Void>> handler);

/**
* Like {@link #deleteRecursive(String, boolean, Handler)} but returns a {@code Future} of the asynchronous result
*
* @deprecated instead use {@link #deleteRecursive(String)} or {@link #delete(String)}
*/
@Deprecated
Future<Void> deleteRecursive(String path, boolean recursive);

/**
* Blocking version of {@link #deleteRecursive(String, boolean, Handler)}
*
* @deprecated instead use {@link #deleteRecursiveBlocking(String)} or {@link #deleteBlocking(String)}
*/
@Deprecated
@Fluent
FileSystem deleteRecursiveBlocking(String path, boolean recursive) ;

/**
* Deletes the file represented by the specified {@code path}, asynchronously.
* <p>
* If the path represents a directory and {@code recursive = true} then the directory and its contents will be
* deleted recursively.
*
* @param path path to the file
* @param handler the handler that will be called on completion
* @return a reference to this, so the API can be used fluently
*/
@Fluent
default FileSystem deleteRecursive(String path, Handler<AsyncResult<Void>> handler) {
return deleteRecursive(path, true, handler);
}

/**
* Like {@link #deleteRecursive(String, Handler)} but returns a {@code Future} of the asynchronous result
*/
default Future<Void> deleteRecursive(String path) {
return deleteRecursive(path, true);
}

/**
* Blocking version of {@link #deleteRecursive(String, Handler)}
*/
@Fluent
default FileSystem deleteRecursiveBlocking(String path) {
return deleteRecursiveBlocking(path, true);
}

/**
* Create the directory represented by {@code path}, asynchronously.
* <p>
Expand Down

0 comments on commit c5c5f60

Please # to comment.