Is possible to filter buckets by prefix using Spring Cloud for AWS?

99 Views Asked by At

I'm trying to use the Spring Cloud for AWS to list my buckets, but I'd like to filter the buckets as LIKE operator.

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

Version: 2.2.1.RELEASE

amazonS3Client.listBuckets();

But I'd like to do something like this, but without need to get all buckets and then filter.

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

Is it possible?

Thanks in advance

0

There are 0 best solutions below