private Collection getKeys() {
if (groups != null) {
return Arrays.asList(groups);
} else {
FileObject files[] = fo.getChildren();
Arrays.sort(files, new FileObjectComparator());
ArrayList children = new ArrayList(files.length);
for (int i = 0; i < files.length; i++) {
FileObject file = files[i];
if (group.contains(files[i]) && file.isFolder()) {
children.add(new Key(files[i], group));
}
}
// add files
for (int i = 0; i < files.length; i++) {
FileObject file = files[i];
if (group.contains(file) && !files[i].isFolder()) {
if (filter.accept(FileUtil.toFile(file))) {
children.add(new Key(files[i], group));
}
}