title: Listing just the sub folders in an s3 bucket
body: <p>I have an s3 structure as follows:</p>
  
  <pre><code>s3bucketname -&gt; List of first level keys -&gt; List of second level keys -&gt; List of third level keys -&gt; Actual file.
  </code></pre>
  
  <p>What I need to do is that given the name of the s3bucket and an entry for the first level key, I need the names of all the second level keys that reside under the first level keys. So essentially if we look at it like a folder, I am given the name of the <code>root folder</code> which is the <code>s3bucketname</code> and the name of one of its subfolders <code>subfolder1</code>, I would like to list all the folders that reside within <code>subfolder1</code>. Just the names though, not the complete path. </p>
  
  <p>Can somebody point out how to do it in java using amazon's java sdk?</p>
  
  <p>Thanks</p>