4444import com .google .common .io .BaseEncoding ;
4545import com .google .common .primitives .Ints ;
4646import com .google .gcloud .AuthCredentials .ServiceAccountAuthCredentials ;
47+ import com .google .gcloud .BasePage ;
4748import com .google .gcloud .BaseService ;
4849import com .google .gcloud .ExceptionHandler ;
4950import com .google .gcloud .ExceptionHandler .Interceptor ;
5051import com .google .gcloud .RetryHelper .RetryHelperException ;
52+ import com .google .gcloud .Page ;
5153import com .google .gcloud .spi .StorageRpc ;
5254import com .google .gcloud .spi .StorageRpc .RewriteResponse ;
5355import com .google .gcloud .spi .StorageRpc .Tuple ;
@@ -224,7 +226,7 @@ public BlobInfo get(BlobId blob) {
224226 }
225227
226228 private abstract static class BasePageFetcher <T extends Serializable >
227- implements BaseListResult .NextPageFetcher <T > {
229+ implements BasePage .NextPageFetcher <T > {
228230
229231 private static final long serialVersionUID = 8236329004030295223L ;
230232 protected final Map <StorageRpc .Option , ?> requestOptions ;
@@ -256,7 +258,7 @@ private static class BucketPageFetcher extends BasePageFetcher<BucketInfo> {
256258 }
257259
258260 @ Override
259- public ListResult <BucketInfo > nextPage () {
261+ public Page <BucketInfo > nextPage () {
260262 return listBuckets (serviceOptions , requestOptions );
261263 }
262264 }
@@ -273,17 +275,17 @@ private static class BlobPageFetcher extends BasePageFetcher<BlobInfo> {
273275 }
274276
275277 @ Override
276- public ListResult <BlobInfo > nextPage () {
278+ public Page <BlobInfo > nextPage () {
277279 return listBlobs (bucket , serviceOptions , requestOptions );
278280 }
279281 }
280282
281283 @ Override
282- public ListResult <BucketInfo > list (BucketListOption ... options ) {
284+ public Page <BucketInfo > list (BucketListOption ... options ) {
283285 return listBuckets (options (), optionMap (options ));
284286 }
285287
286- private static ListResult <BucketInfo > listBuckets (final StorageOptions serviceOptions ,
288+ private static Page <BucketInfo > listBuckets (final StorageOptions serviceOptions ,
287289 final Map <StorageRpc .Option , ?> optionsMap ) {
288290 try {
289291 Tuple <String , Iterable <com .google .api .services .storage .model .Bucket >> result = runWithRetries (
@@ -302,19 +304,19 @@ public BucketInfo apply(com.google.api.services.storage.model.Bucket bucketPb) {
302304 return BucketInfo .fromPb (bucketPb );
303305 }
304306 });
305- return new BaseListResult <>(new BucketPageFetcher (serviceOptions , cursor , optionsMap ), cursor ,
307+ return new BasePage <>(new BucketPageFetcher (serviceOptions , cursor , optionsMap ), cursor ,
306308 buckets );
307309 } catch (RetryHelperException e ) {
308310 throw StorageException .translateAndThrow (e );
309311 }
310312 }
311313
312314 @ Override
313- public ListResult <BlobInfo > list (final String bucket , BlobListOption ... options ) {
315+ public Page <BlobInfo > list (final String bucket , BlobListOption ... options ) {
314316 return listBlobs (bucket , options (), optionMap (options ));
315317 }
316318
317- private static ListResult <BlobInfo > listBlobs (final String bucket ,
319+ private static Page <BlobInfo > listBlobs (final String bucket ,
318320 final StorageOptions serviceOptions , final Map <StorageRpc .Option , ?> optionsMap ) {
319321 try {
320322 Tuple <String , Iterable <StorageObject >> result = runWithRetries (
@@ -333,7 +335,7 @@ public BlobInfo apply(StorageObject storageObject) {
333335 return BlobInfo .fromPb (storageObject );
334336 }
335337 });
336- return new BaseListResult <>(new BlobPageFetcher (bucket , serviceOptions , cursor , optionsMap ),
338+ return new BasePage <>(new BlobPageFetcher (bucket , serviceOptions , cursor , optionsMap ),
337339 cursor ,
338340 blobs );
339341 } catch (RetryHelperException e ) {
0 commit comments