String filterExpression = config.getString("filter");
File[] files = DirectoryScanner.listFiles(directory, filterExpression);
if (files != null) {
ArrayList<CRResolvableBean> result = new ArrayList<CRResolvableBean>();
for (File file : files) {
CRResolvableBean bean = new CRResolvableBean();
bean.set("filename", file.getName());
bean.set("pub_dir", directory.toURI().relativize(file.toURI()));
bean.set("obj_type", FileTypeDetector.getObjType(file));
bean.set("timestamp", file.lastModified() / 1000);
//TODO add the content of the file as stream in the right attribute
}
return result;
}
return new ArrayList<CRResolvableBean>(0);