directories.add(metaData);
if (includeChildren) {
directories.addAll(getFiles(metaData.getAbsolutePath(), true));
} else {
Collections.sort(directories, new FileMetaDataComparator());
}
}
}
for (int i = 0; i < f.length; i++) {
file = f[i];
if (file.isFile()) {
FileMetaData metaData = getFileMetaData(path.getAbsolutePath(), file.getName());
files.add(metaData);
}
}
Collections.sort(files, new FileMetaDataComparator());
}
directoriesAndFiles.addAll(directories);
directoriesAndFiles.addAll(files);