diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java index 8bcac3b84..1608ff39c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java @@ -291,10 +291,6 @@ public abstract Iterable listObjects(final String bucket, final String */ public abstract Iterable removePrefixFromDs3ObjectsList(final Iterable objectsList, final String prefix); - public Iterable toDs3Iterable(final Iterable objects) { - return toDs3Iterable(objects, null); - } - @SafeVarargs public final Iterable toDs3Iterable(final Iterable objects, final Predicate... filters) { @@ -305,17 +301,19 @@ public boolean apply(@Nullable final Contents input) { } }); - for (final Predicate filter : filters) { - fluentIterable = fluentIterable.filter(new com.google.common.base.Predicate() { - @Override - public boolean apply(@Nullable final Contents input) { - if (filter != null) { - return filter.test(input); - } else { - return true; // do not filter anything if filter is null + if (filters != null) { + for (final Predicate filter : filters) { + fluentIterable = fluentIterable.filter(new com.google.common.base.Predicate() { + @Override + public boolean apply(@Nullable final Contents input) { + if (filter != null) { + return filter.test(input); + } else { + return true; // do not filter anything if filter is null + } } - } - }); + }); + } } return fluentIterable.transform(new Function() {