In my comments about issue  IO-813 LastModifiedFileComparator should not throw 
exceptions, period, I made a suggestion that I thought I'd repeat here. I was 
thinking of adding these two methods to AbstractFileComparator.
  
​
  
​        public static Comparator<File>  missingFilesFirst(Comparator<File>  
comparator)
  
  
​        public static Comparator<File>  missingFilesLast(Comparator<File>  
comparator)
  
  
​These would work like Comparator.nullsFirst() and Comparator.nullsLast(). They 
would allow users to work with collections of Files that might not point to 
valid files, without having to worry about IOExceptions.
  
​
  
​I'm not sure if AbstractFileComparator is the best place to put it. It's not a 
public class, but the methods would be available from any of the subclasses. A 
better place might be in FileUtils, although that's in a different package.
  
​
  
​What do you think?
  
​
  
​-- Miguel Muñoz
     

Reply via email to