Class LastModifiedResourceComparator

java.lang.Object
org.springframework.batch.support.LastModifiedResourceComparator
All Implemented Interfaces:
Comparator<org.springframework.core.io.Resource>

public class LastModifiedResourceComparator extends Object implements Comparator<org.springframework.core.io.Resource>
Comparator to sort resources by the file last modified time.
Author:
Dave Syer
  • Constructor Details

    • LastModifiedResourceComparator

      public LastModifiedResourceComparator()
  • Method Details

    • compare

      public int compare(org.springframework.core.io.Resource r1, org.springframework.core.io.Resource r2)
      Compare the two resources by last modified time, so that a sorted list of resources will have oldest first.
      Specified by:
      compare in interface Comparator<org.springframework.core.io.Resource>
      Throws:
      IllegalArgumentException - if one of the resources doesn't exist or its last modified date cannot be determined
      See Also: