no.unit.nva.s3.ListingResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of s3 Show documentation
Show all versions of s3 Show documentation
A commons library for the NVA project
The newest version!
package no.unit.nva.s3;
import java.util.ArrayList;
import java.util.List;
import nva.commons.core.paths.UnixPath;
public class ListingResult {
private final String listingStartingPoint;
private final List files;
private final boolean truncated;
public ListingResult(List files, String listingStartingPoint, boolean isTruncated) {
this.listingStartingPoint = listingStartingPoint;
this.files = files;
this.truncated = isTruncated;
}
public static ListingResult emptyResult() {
return new ListingResult(new ArrayList<>(), null, false);
}
public String getListingStartingPoint() {
return listingStartingPoint;
}
public List getFiles() {
return files;
}
public boolean isTruncated() {
return truncated;
}
public ListingResult add(ListingResult listFiles) {
List allFiles = new ArrayList<>(this.getFiles());
allFiles.addAll(listFiles.getFiles());
return new ListingResult(allFiles,
listFiles.getListingStartingPoint(),
listFiles.isTruncated());
}
}