try {
String rootDir = PreferenceManager.getClientPreferences()
.getDataDirectory();
File camoLib = new File(rootDir + "/images/camo");
DirectoryItems images = new DirectoryItems(camoLib, "",
ImageFileFactory.getInstance());
Iterator<String> categories = images.getCategoryNames();
Iterator<String> names = null;
String catName = null;
// Walk through the category names, listing all of the image files.
while (categories.hasNext()) {
// Get this category name, and replace null with blank.
catName = categories.next();
// Print the category.
System.out.print("Printing files in ");
if (catName.equals("")) {
System.out.print("-- General --");
} else {
System.out.print(catName);
}
System.out.println(":");
// Walk through the item names.
names = images.getItemNames(catName);
while (names.hasNext()) {
System.out.println(names.next());
}
} // Handle the next category.
} catch (Throwable err) {