Class SortingUtils

java.lang.Object
org.dawb.common.util.io.SortingUtils

public class SortingUtils extends Object
  • Field Details

    • NATURAL_SORT

      public static final Comparator<File> NATURAL_SORT
    • NATURAL_SORT_CASE_INSENSITIVE

      public static final Comparator<File> NATURAL_SORT_CASE_INSENSITIVE
    • DATE_SORT

      public static final Comparator<File> DATE_SORT
    • DATE_SORT_BACKWARDS

      public static final Comparator<File> DATE_SORT_BACKWARDS
    • DEFAULT_COMPARATOR

      public static final Comparator<File> DEFAULT_COMPARATOR
    • DEFAULT_COMPARATOR_DIRS_FIRST

      public static final Comparator<File> DEFAULT_COMPARATOR_DIRS_FIRST
  • Constructor Details

    • SortingUtils

      public SortingUtils()
  • Method Details

    • getSortedFileList

      public static List<File> getSortedFileList(File dir)
      Parameters:
      dir -
      Returns:
      List
    • getSortedFileList

      public static List<File> getSortedFileList(File dir, Comparator<File> comp)
      Parameters:
      dir -
      comp -
      Returns:
      List
    • getSortedFileList

      public static List<File> getSortedFileList(File dir, FileFilter fileFilter, Comparator<File> comp)
      Parameters:
      dir -
      fileFilter -
      comp -
      Returns:
      List
    • getSortedFileList

      public static List<File> getSortedFileList(File dir, FileFilter fileFilter)
      Parameters:
      dir -
      fileFilter -
      Returns:
      List
    • getSortedFileList

      public static List<File> getSortedFileList(File[] fa, Comparator<File> comp)
      Parameters:
      comp -
      Returns:
      List
    • getSortedFileList

      public static List<File> getSortedFileList(File dir, boolean dirsFirst)
      Lists folders before files
      Parameters:
      dir -
      Returns:
      List
    • getSortedPathList

      public static List<Path> getSortedPathList(Path dir, boolean dirsFirst) throws IOException
      Supposed to be faster than getting the list and sorting it. Sort as we go.
      Parameters:
      dir -
      dirsFirst -
      Returns:
      Throws:
      IOException
    • removeIgnoredNames

      public static void removeIgnoredNames(Collection<String> sets, Collection<Pattern> patterns)