title: Amazon S3 - Copy pasted file path issue
body: <p>I am trying to get all file paths in a bucket. Using listobjects function I can able to achieve it. But there is a file path issue.</p>
  
  <p>Consider this is the folder structure</p>
  
  <p>SampleBucket --> A (root folder) --> B (subfolder)--> c(subfolder within B)</p>
  
  <p>What I need is </p>
  
  <p><a href="http://SampleBucket.s3.amazonaws.com/A/" rel="nofollow noreferrer">http://SampleBucket.s3.amazonaws.com/A/</a></p>
  
  <p><a href="http://SampleBucket.s3.amazonaws.com/A/B/" rel="nofollow noreferrer">http://SampleBucket.s3.amazonaws.com/A/B/</a></p>
  
  <p><a href="http://SampleBucket.s3.amazonaws.com/A/B/C" rel="nofollow noreferrer">http://SampleBucket.s3.amazonaws.com/A/B/C</a></p>
  
  <p>What I am getting is </p>
  
  <p><a href="http://SampleBucket.s3.amazonaws.com/A/" rel="nofollow noreferrer">http://SampleBucket.s3.amazonaws.com/A/</a></p>
  
  <p><a href="http://SampleBucket.s3.amazonaws.com/A/B/C" rel="nofollow noreferrer">http://SampleBucket.s3.amazonaws.com/A/B/C</a></p>
  
  <p><strong>This happened when I created "A" folder &amp; copy pasted "B" folder from my local drive to cloud berry</strong></p>
  
  <p>This is my code to get all folders &amp; files in a bucket .. </p>
  
  <pre><code>public List&lt;S3ObjectSummary&gt; getObjectslistFromFolder(String bucketName, String folderKey) {    
  AWSCredentials awsCreds = new BasicAWSCredentials(accessKey, secretKey);
  AmazonS3 s3client = new AmazonS3Client(awsCreds); 
  ObjectListing current = s3client.listObjects(bucketName,folderKey);
  List&lt;S3ObjectSummary&gt; keyList = current.getObjectSummaries();
  current = s3client.listNextBatchOfObjects(current);
  while (current.isTruncated()){
      keyList.addAll(current.getObjectSummaries());
      current = s3client.listNextBatchOfObjects(current);
  }
  keyList.addAll(current.getObjectSummaries());   
  return keyList;
  </code></pre>
  
  <p>}</p>