  @Override
     public FileStatus[] listStatus(Path path) throws FileNotFoundException, IOException {
 
         ArrayList<FileStatus> returnList = new ArrayList<>();
         String key = pathToKey(path);
         FileStatus fs = getFileStatus(path);
 
 
         if(fs.isDirectory()){
 
             if(!key.isEmpty()){
                 key = key + "/";
             }
 
             ListObjectsRequest listObjectsRequest = new ListObjectsRequest(this.bucket, key, null, "/", 1000);
             ObjectListing objectListing = s3Client.listObjects(listObjectsRequest);
 
             for(S3ObjectSummary summary : objectListing.getObjectSummaries()){
 
                 FileStatus fileStatus;
                 if(isADirectory(summary.getKey(), summary.getSize())){
                     fileStatus = new FileStatus(summary.getSize(), true, 1, 0, 0, new Path("/" + key));
                 }
                 else{
                     fileStatus = new FileStatus(summary.getSize(), false, 1, 0, 0, new Path("/" + key));
                 }
 
                 returnList.add(fileStatus);
 
             }
 
         }
         else{
             returnList.add(fs);
         }
 
         return returnList.toArray(new FileStatus[returnList.size()]);
     }
 
     @Override
     public void setWorkingDirectory(Path path) {
 
     }
 
     @Override
     public Path getWorkingDirectory() {
         return null;
     }
 
     @Override
     public boolean mkdirs(Path path, FsPermission fsPermission) throws IOException {
         return false;
     }
 
     @Override
     public FileStatus getFileStatus(Path path) throws IOException {
 
         String key = pathToKey(path);
 
         System.out.println("Key : " + key);
         System.out.println("Bucket : " + this.bucket)  ;
 
         if(key.isEmpty()){
             throw new IOException("File not found.");
         }
 
         ObjectMetadata objectMetadata = s3Client.getObjectMetadata(this.bucket, key);
 
         if(isADirectory(key, objectMetadata.getContentLength())){
             return new FileStatus(0, true, 1, 0, 0, path);
         }
 
 
         return new FileStatus(0, false, 1, 0, objectMetadata.getLastModified().getTime(), path);
     }
 
 
     private String pathToKey(Path path) {
         return path.toUri().getPath().substring(1);
     }
 
     private boolean isADirectory(String name, long size) {
         return !name.isEmpty()
                && name.charAt(name.length() - 1) == '/'
                && size == 0L;
     }
 
 
