All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.unit.nva.s3.ListingResult Maven / Gradle / Ivy

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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy