title: How to filter keys in AWS using prefix or delimiter on ListObjectsV2Request?
body: <p>I have the following options for keys:</p>
  
  <pre><code>cat/dog/&lt;random_value&gt;/ShortMetadata
  cat/dog/&lt;random_value&gt;/bird/LongMetadata
  cat/dog/&lt;random_value&gt;/values
  cat/dog/bird/frog
  cat/dog/&lt;random_value&gt;/bird/&lt;random_value&gt;/HalfMetadata
  </code></pre>
  
  <p>I want to filter only the metadatas -> ShortMetadata, LongMetadata and HalfMetadata.
  Can't figure out how to do it in a nice way using pattern matches.
  I looked at the options given on <code>ListObjectsV2Request</code> but saw that I can use only <code>.prefix</code> or <code>.delimiter</code> (I think that i'm looking for is suffix..)</p>
  
  <p>something to look like : </p>
  
  <pre><code>ListObjectsV2Request().withBucketName(bucketName).withPrefix(Pattern.compile("*/*Metadata"));
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>ListObjectsV2Request().withBucketName(bucketName).withPrefix("cat/dog/" + "*" + "Metadata"));
  </code></pre>
  
  <p>Can someone please advise what do to?</p>