1

我正在尝试使用 Spring Cloud for AWS 列出我的存储桶,但我想将存储桶过滤为 LIKE 运算符。

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-aws</artifactId>
        </dependency>

版本:2.2.1.RELEASE

amazonS3Client.listBuckets();

但我想做这样的事情,但不需要得到所有的桶然后过滤。

amazonS3Client.listBuckets().stream().filter(bucket -> bucket.getName().contains("filter-key")).collect(Collectors.toList());

可能吗?

提前致谢

4

0 回答 0