Class DefaultServlet.SortManager

java.lang.Object
org.apache.catalina.servlets.DefaultServlet.SortManager
Enclosing class:
DefaultServlet

protected static class DefaultServlet.SortManager extends Object
A class encapsulating the sorting of resources.
  • Field Details

    • defaultResourceComparator

      protected Comparator<WebResource> defaultResourceComparator
      The default sort.
    • resourceNameComparator

      protected Comparator<WebResource> resourceNameComparator
      Comparator to use when sorting resources by name.
    • resourceNameComparatorAsc

      protected Comparator<WebResource> resourceNameComparatorAsc
      Comparator to use when sorting files by name, ascending (reverse).
    • resourceSizeComparator

      protected Comparator<WebResource> resourceSizeComparator
      Comparator to use when sorting resources by size.
    • resourceSizeComparatorAsc

      protected Comparator<WebResource> resourceSizeComparatorAsc
      Comparator to use when sorting files by size, ascending (reverse).
    • resourceLastModifiedComparator

      protected Comparator<WebResource> resourceLastModifiedComparator
      Comparator to use when sorting resources by last-modified date.
    • resourceLastModifiedComparatorAsc

      protected Comparator<WebResource> resourceLastModifiedComparatorAsc
      Comparator to use when sorting files by last-modified date, ascending (reverse).
  • Method Details

    • sort

      public void sort(WebResource[] resources, String order)
      Sorts an array of resources according to an ordering string.
      Parameters:
      resources - The array to sort.
      order - The ordering string.
      See Also:
    • getComparator

      public Comparator<WebResource> getComparator(String order)
      Get the comparator for the given order string.
      Parameters:
      order - The order string
      Returns:
      the comparator
    • getComparator

      Get the comparator for the given order.
      Parameters:
      order - The order specification
      Returns:
      the comparator
    • getOrder

      public DefaultServlet.SortManager.Order getOrder(String order)
      Gets the Order to apply given an ordering-string. This ordering-string matches a subset of the ordering-strings supported by Apache httpd.
      Parameters:
      order - The ordering-string provided by the client.
      Returns:
      An Order specifying the column and ascending/descending to be applied to resources.