Skip to content

Commit

Permalink
Remove vertx.getOrCreateContext() call
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 committed Aug 19, 2024
1 parent 1229372 commit 31febb4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private Future<List<String>> listFiles(String prefix) {
.prefix(prefix)
.build();

return Future.fromCompletionStage(asyncClient.listObjects(listObjectsRequest), vertx.getOrCreateContext())
return Future.fromCompletionStage(asyncClient.listObjects(listObjectsRequest))
.map(response -> response.contents().stream()
.map(S3Object::key)
.collect(Collectors.toList()));
Expand All @@ -147,9 +147,7 @@ private Future<List<String>> listFiles(String prefix) {
private Future<Tuple2<String, String>> downloadFile(String key) {
final GetObjectRequest request = GetObjectRequest.builder().bucket(bucket).key(key).build();

return Future.fromCompletionStage(
asyncClient.getObject(request, AsyncResponseTransformer.toBytes()),
vertx.getOrCreateContext())
return Future.fromCompletionStage(asyncClient.getObject(request, AsyncResponseTransformer.toBytes()))
.map(content -> Tuple2.of(key, content.asUtf8String()));
}

Expand Down

0 comments on commit 31febb4

Please sign in to comment.