*
* @see
* com.basho.riak.client.raw.RawClient#fetchBucketKeys(java.lang.String)
*/
public Iterable<String> listKeys(String bucketName) throws IOException {
final BucketResponse bucketResponse = client.streamBucket(bucketName);
if (bucketResponse.isSuccess()) {
final KeySource keyStream = new KeySource(bucketResponse);
return new Iterable<String>() {
public Iterator<String> iterator() {
return keyStream;
}
};
} else {
throw new IOException("stream keys for bucket " + bucketName + " failed with response code : " +
bucketResponse.getStatusCode() + ", body: " + bucketResponse.getBodyAsString());
}
}