1+ /*
2+ * ******************************************************************************
3+ * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved.
4+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
5+ * this file except in compliance with the License. A copy of the License is located at
6+ *
7+ * http://www.apache.org/licenses/LICENSE-2.0
8+ *
9+ * or in the "license" file accompanying this file.
10+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
12+ * specific language governing permissions and limitations under the License.
13+ * ****************************************************************************
14+ */
15+
16+ package com .spectralogic .ds3client .helpers .pagination ;
17+
18+ import com .spectralogic .ds3client .Ds3Client ;
19+ import com .spectralogic .ds3client .models .Contents ;
20+ import com .spectralogic .ds3client .utils .collections .LazyIterable ;
21+
22+ /**
23+ * This class is a child of {@link GetBucketKeyLoaderFactory}
24+ * that provides a sane default for mapping {@link com.spectralogic.ds3client.models.ListBucketResult}
25+ * "/" will be used for the delimiter, and {@link com.spectralogic.ds3client.models.ListBucketResult} will be mapped to
26+ * {@link LazyIterable.LazyLoader<Contents>} which was the old behavior.
27+ */
28+ public class GetBucketLoaderFactory extends GetBucketKeyLoaderFactory <Contents > {
29+
30+ /**
31+ *
32+ * @param client
33+ * @param bucket
34+ * @param keyPrefix
35+ * @param nextMarker
36+ * @param maxKeys
37+ * @param defaultListObjectsRetries
38+ */
39+ public GetBucketLoaderFactory (final Ds3Client client , final String bucket , final String keyPrefix , final String nextMarker , final int maxKeys , final int defaultListObjectsRetries ) {
40+ super (client , bucket , keyPrefix , "/" , nextMarker , maxKeys , defaultListObjectsRetries , contentsFunction );
41+ }
42+
43+ /**
44+ * @return {@link LazyIterable.LazyLoader<Contents>}
45+ */
46+ @ Override
47+ public LazyIterable .LazyLoader <Contents > create () {
48+ return super .create ();
49+ }
50+ }
0 commit comments