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

com.github.awsjavakit.s3.ListingResult Maven / Gradle / Ivy

package com.github.awsjavakit.s3;

import com.github.awsjavakit.misc.paths.UnixPath;
import java.util.ArrayList;
import java.util.List;

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