use of util.StringComparator in project coprhd-controller by CoprHD.
the class EditCatalog method loadImageOptions.
private static List<Option> loadImageOptions() {
VirtualFile imageDir = Play.getVirtualFile("public/img/serviceCatalog");
List<Option> images = Lists.newArrayList();
for (VirtualFile f : imageDir.list()) {
String label = f.getName().replaceAll("(icon_|.png)", "");
images.add(new Option(f.getName(), label));
}
for (CatalogImageRestRep image : CatalogImageUtils.getCatalogImages()) {
String filename = StringUtils.substringBeforeLast(image.getName(), ".");
images.add(new Option(image.getId().toString(), filename));
}
Collections.sort(images, new BeanComparator("value", new StringComparator(false)));
return images;
}
Aggregations