Home » Core Java » apache » commons » io » comparator

comparator

org.apache.commons.io.comparator.DirectoryFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. DirectoryFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by directories and files. The File class’s isDirectory() method is used for comparing two files. This article shows ...

Read More »

org.apache.commons.io.comparator.LastModifiedFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. LastModifiedFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their last modified date/time. The File class’s lastModified() method is used for comparing two files; the method ...

Read More »

org.apache.commons.io.comparator.NameFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. NameFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their name. The File class’s getName() method is used for comparing two files; the method returns the ...

Read More »

org.apache.commons.io.comparator.PathFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. PathFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by their path. The path value is a String returned from the File class’s getPath() method. The sort ...

Read More »

org.apache.commons.io.comparator.CompositeFileComparator Example

Apache Commons IO is a library of utilities to assist with developing IO functionality. org.apache.commons.io.comparator package provides various Comparator implementations for Files. CompositeFileComparator is one of the classes. This class can be used to sort lists or arrays of files (File objects) by combining a number of other comparators defined within the same package (DirectoryFileComparator, ExtensionFileComparator, LastModifiedFileComparator, NameFileComparator, PathFileComparator, SizeFileComparator). ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns