Skip to content

Commit f6aa494

Browse files
authored
Merge pull request #492 from scribe/JSDK-247
JSDK-247 - Ensuring method signature compatability
2 parents d232c34 + 5e60bee commit f6aa494

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoaderFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public FileSystemKey apply(@Nullable final CommonPrefixes input) {
6464
private final int defaultListObjectsRetries;
6565
private final Function<ListBucketResult, Iterable<T>> function;
6666

67+
6768
public GetBucketKeyLoaderFactory(final Ds3Client client, final String bucket, final String keyPrefix, final String delimiter, final String nextMarker, final int maxKeys, final int defaultListObjectsRetries, final Function<ListBucketResult, Iterable<T>> function) {
6869
this.client = client;
6970
this.bucket = bucket;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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

Comments
 (0)