Package com.exasol.bucketfs.list
Class ListingRetriever
- java.lang.Object
-
- com.exasol.bucketfs.list.ListingRetriever
-
public class ListingRetriever extends Object
This class retrieves the list of buckets or of objects inside a bucket.
-
-
Constructor Summary
Constructors Constructor Description ListingRetriever(HttpClient httpClient)Create a new instance ofListingRetriever.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static URIpublicReadUri(String protocol, String host, int port, String suffix)static StringremoveLeadingSeparator(String path)Stream<String>retrieve(URI uri, String readPassword)Retrieve the content for the given URI as stream.
-
-
-
Constructor Detail
-
ListingRetriever
public ListingRetriever(HttpClient httpClient)
Create a new instance ofListingRetriever.- Parameters:
httpClient- HTTP client to access the BucketFS service
-
-
Method Detail
-
publicReadUri
public static URI publicReadUri(String protocol, String host, int port, String suffix)
- Parameters:
protocol- protocolhost- host name or IP address for the URIport- portsuffix- e.g. name of the bucket- Returns:
URImade up from the specified elements
-
removeLeadingSeparator
public static String removeLeadingSeparator(String path)
- Parameters:
path- remove leadingBucketConstants.PATH_SEPARATORfrom this path- Returns:
- path with potential leading
BucketConstants.PATH_SEPARATORremoved
-
retrieve
public Stream<String> retrieve(URI uri, String readPassword) throws BucketAccessException
Retrieve the content for the given URI as stream.- Parameters:
uri- URI to retrieve listing forreadPassword- read password, only relevant for non-public buckets- Returns:
- stream of strings
- Throws:
BucketAccessException- in case of failure
-
-