Interface DownloadFilter

All Superinterfaces:
Predicate<S3Object>

public interface DownloadFilter extends Predicate<S3Object>
DownloadFilter allows you to filter out which objects should be downloaded as part of a DownloadDirectoryRequest. You could use it, for example, to only download objects of a given size, of a given file extension, of a given last-modified date, etc. Multiple DownloadFilters can be composed together via and(Predicate) and or(Predicate) methods.
  • Method Details

    • test

      boolean test(S3Object s3Object)
      Evaluate condition the remote S3Object should be downloaded.
      Specified by:
      test in interface Predicate<S3Object>
      Parameters:
      s3Object - Remote S3Object
      Returns:
      true if the object should be downloaded, false if the object should not be downloaded
    • and

      default DownloadFilter and(Predicate<? super S3Object> other)
      Returns a composed filter that represents the logical AND of this filter and another. The composed filter returns true only if both this filter and the other filter return true.
      Specified by:
      and in interface Predicate<S3Object>
      Parameters:
      other - a predicate that will be logically-ANDed with this predicate
      Returns:
      a composed filter that represents the logical AND of this filter and the other filter
      Throws:
      NullPointerException - if other is null
    • or

      default DownloadFilter or(Predicate<? super S3Object> other)
      Returns a composed filter that represents the logical OR of this filter and another. The composed filter returns true if either this filter or the other filter returns true.
      Specified by:
      or in interface Predicate<S3Object>
      Parameters:
      other - a predicate that will be logically-ORed with this predicate
      Returns:
      a composed filter that represents the logical OR of this filter and the other filter
      Throws:
      NullPointerException - if other is null
    • negate

      default DownloadFilter negate()
      Returns a filter that represents the logical negation of this predicate. The returned filter returns true when this filter returns false, and vice versa.
      Specified by:
      negate in interface Predicate<S3Object>
      Returns:
      a filter that represents the logical negation of this filter predicate
    • allObjects

      static DownloadFilter allObjects()
      A DownloadFilter that downloads all non-folder objects. A folder is a 0-byte object created when a customer uses S3 console to create a folder, and it always ends with "/".

      This is the default behavior if no filter is provided.