Package org.apache.catalina.servlets
Class DefaultServlet.SortManager
- java.lang.Object
-
- org.apache.catalina.servlets.DefaultServlet.SortManager
-
- Enclosing class:
- DefaultServlet
protected static class DefaultServlet.SortManager extends java.lang.Object
A class encapsulating the sorting of resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultServlet.SortManager.Order
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Comparator<WebResource>
defaultResourceComparator
The default sort.protected java.util.Comparator<WebResource>
resourceLastModifiedComparator
Comparator to use when sorting resources by last-modified date.protected java.util.Comparator<WebResource>
resourceLastModifiedComparatorAsc
Comparator to use when sorting files by last-modified date, ascending (reverse).protected java.util.Comparator<WebResource>
resourceNameComparator
Comparator to use when sorting resources by name.protected java.util.Comparator<WebResource>
resourceNameComparatorAsc
Comparator to use when sorting files by name, ascending (reverse).protected java.util.Comparator<WebResource>
resourceSizeComparator
Comparator to use when sorting resources by size.protected java.util.Comparator<WebResource>
resourceSizeComparatorAsc
Comparator to use when sorting files by size, ascending (reverse).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Comparator<WebResource>
getComparator(java.lang.String order)
java.util.Comparator<WebResource>
getComparator(DefaultServlet.SortManager.Order order)
DefaultServlet.SortManager.Order
getOrder(java.lang.String order)
Gets the Order to apply given an ordering-string.void
sort(WebResource[] resources, java.lang.String order)
Sorts an array of resources according to an ordering string.
-
-
-
Field Detail
-
defaultResourceComparator
protected java.util.Comparator<WebResource> defaultResourceComparator
The default sort.
-
resourceNameComparator
protected java.util.Comparator<WebResource> resourceNameComparator
Comparator to use when sorting resources by name.
-
resourceNameComparatorAsc
protected java.util.Comparator<WebResource> resourceNameComparatorAsc
Comparator to use when sorting files by name, ascending (reverse).
-
resourceSizeComparator
protected java.util.Comparator<WebResource> resourceSizeComparator
Comparator to use when sorting resources by size.
-
resourceSizeComparatorAsc
protected java.util.Comparator<WebResource> resourceSizeComparatorAsc
Comparator to use when sorting files by size, ascending (reverse).
-
resourceLastModifiedComparator
protected java.util.Comparator<WebResource> resourceLastModifiedComparator
Comparator to use when sorting resources by last-modified date.
-
resourceLastModifiedComparatorAsc
protected java.util.Comparator<WebResource> resourceLastModifiedComparatorAsc
Comparator to use when sorting files by last-modified date, ascending (reverse).
-
-
Method Detail
-
sort
public void sort(WebResource[] resources, java.lang.String order)
Sorts an array of resources according to an ordering string.- Parameters:
resources
- The array to sort.order
- The ordering string.- See Also:
getOrder(String)
-
getComparator
public java.util.Comparator<WebResource> getComparator(java.lang.String order)
-
getComparator
public java.util.Comparator<WebResource> getComparator(DefaultServlet.SortManager.Order order)
-
getOrder
public DefaultServlet.SortManager.Order getOrder(java.lang.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.
-
-