Class BucketContentLister


  • public class BucketContentLister
    extends Object
    This class enables to list the contents of a directory in a bucket.
    • Constructor Detail

      • BucketContentLister

        public BucketContentLister​(URI bucketUri,
                                   ListingRetriever listingRetriever,
                                   String readPassword)
        Create a new instance of BucketContentLister.
        Parameters:
        bucketUri - URI of bucket to list contents for
        listingRetriever - used to retrieve the raw listing
        readPassword - password for reading non-public buckets, not relevant for public buckets
    • Method Detail

      • retrieve

        public List<String> retrieve​(String path,
                                     boolean recursive)
                              throws BucketAccessException
        Retrieve the listing.
        Parameters:
        path - path to list the contents of
        recursive - true if result should include entries in subdirectories of the specified path, too
        Returns:
        list of files and subdirectories
        Throws:
        BucketAccessException - in case of errors during retrieval of the inventory