List<FileModel> models = new ArrayList<FileModel>();
for (File f : files) {
FileModel m = null;
if (f.isDirectory()) {
m = new FolderModel(f.getName(), f.getAbsolutePath());
} else {
m = new FileModel(f.getName(), f.getAbsolutePath());
m.set("size", f.length());
m.set("date", new Date(f.lastModified()));
}