org.apache.camel.component.file
Class GenericFileDefaultSorter

java.lang.Object
  extended by org.apache.camel.component.file.GenericFileDefaultSorter

public final class GenericFileDefaultSorter
extends Object

Default file sorter.


Method Summary
static Comparator<Exchange> sortByFileLanguage(CamelContext context, String expression, boolean reverse)
          Returns a new sory by file language expression
static Comparator<Exchange> sortByFileLanguage(CamelContext context, String expression, boolean reverse, boolean ignoreCase)
          Returns a new sory by file language expression
static Comparator<Exchange> sortByFileLanguage(CamelContext context, String expression, boolean reverse, boolean ignoreCase, Comparator<Exchange> nested)
          Returns a new sort by file language expression
static Comparator<GenericFile> sortByLastModified(boolean reverse)
          Returns a new sort by last modified (newest first)
static Comparator<GenericFile> sortByName(boolean reverse)
          Returns a new sort by name
static Comparator<GenericFile> sortByPathName(boolean reverse)
          Returns a new sort by path name
static Comparator<GenericFile> sortBySize(boolean reverse)
          Returns a new sort by file size (smallest first)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sortByName

public static Comparator<GenericFile> sortByName(boolean reverse)
Returns a new sort by name


sortByPathName

public static Comparator<GenericFile> sortByPathName(boolean reverse)
Returns a new sort by path name


sortByLastModified

public static Comparator<GenericFile> sortByLastModified(boolean reverse)
Returns a new sort by last modified (newest first)


sortBySize

public static Comparator<GenericFile> sortBySize(boolean reverse)
Returns a new sort by file size (smallest first)


sortByFileLanguage

public static Comparator<Exchange> sortByFileLanguage(CamelContext context,
                                                      String expression,
                                                      boolean reverse)
Returns a new sory by file language expression

Parameters:
context - the camel context
expression - the file language expression
reverse - true to reverse order
Returns:
the comparator

sortByFileLanguage

public static Comparator<Exchange> sortByFileLanguage(CamelContext context,
                                                      String expression,
                                                      boolean reverse,
                                                      boolean ignoreCase)
Returns a new sory by file language expression

Parameters:
context - the camel context
expression - the file language expression
reverse - true to reverse order
ignoreCase - ignore case if comparing strings
Returns:
the comparator

sortByFileLanguage

public static Comparator<Exchange> sortByFileLanguage(CamelContext context,
                                                      String expression,
                                                      boolean reverse,
                                                      boolean ignoreCase,
                                                      Comparator<Exchange> nested)
Returns a new sort by file language expression

Parameters:
context - the camel context
expression - the file language expression
reverse - true to reverse order
ignoreCase - ignore case if comparing strings
nested - nested comparator for sub group sorting, can be null
Returns:
the comparator


Apache CAMEL