Path dir = pwd.lookup(filename);
if (! dir.isDirectory())
throw error(L.l("`{0}' is not a directory for resin:include-directory. The href for resin:include-directory must refer to a directory.",
dir.getNativePath()));
String []list = dir.list();
Arrays.sort(list);
for (int i = list.length - 1; i >= 0; i--) {
if (list[i].startsWith(".") ||
extension != null && ! list[i].endsWith(extension))
continue;