Commit 56d1864f authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added #getCaches to return a sorted list of system caches. JM-600

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3585 b35dd754-fafc-0310-a699-88a17e54d16e
parent 78cdc85f
...@@ -21,7 +21,7 @@ import org.jivesoftware.wildfire.user.UserManager; ...@@ -21,7 +21,7 @@ import org.jivesoftware.wildfire.user.UserManager;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.util.StringTokenizer; import java.util.*;
/** /**
* A utility bean for Wildfire admin console pages. * A utility bean for Wildfire admin console pages.
...@@ -353,4 +353,16 @@ public class WebManager extends WebBean { ...@@ -353,4 +353,16 @@ public class WebManager extends WebBean {
} }
} }
} }
public Cache[] getCaches() {
List<Cache> caches = new ArrayList<Cache>(CacheManager.getCaches());
Collections.sort(caches, new Comparator() {
public int compare(Object o1, Object o2) {
Cache cache1 = (Cache)o1;
Cache cache2 = (Cache)o2;
return cache1.getName().toLowerCase().compareTo(cache2.getName().toLowerCase());
}
});
return caches.toArray(new Cache[]{});
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment