title: AWS S3 - Listing all objects inside a folder without the prefix
body: <p>I'm having problems retrieving all objects(filenames) inside a folder in AWS S3. Here's my code:</p>
  
  <pre><code>ListObjectsRequest listObjectsRequest = new ListObjectsRequest()
              .withBucketName(bucket)
              .withPrefix(folderName + "/")
              .withMarker(folderName + "/")
  
      ObjectListing objectListing = amazonWebService.s3.listObjects(listObjectsRequest)
  
      for (S3ObjectSummary summary : objectListing.getObjectSummaries()) {
          print summary.getKey()
      }
  </code></pre>
  
  <p>It returns the correct object but with the prefix in it, e.g. foldename/filename</p>
  
  <p>I know I can just use java perhaps substring to exclude the prefix but I just wanted to know if there is a method for it in AWS SDK.</p>