if (parent.exists()) {
File[] files;
files = parent.listFiles();
Arrays.sort(files, new FileComparator());
List<FileWrap> list = new ArrayList<FileWrap>(files.length);
CmsFile file;
for (File f : files) {
file=fileMng.findByPath(f.getName());
if(valid!=null){
if(file!=null){
if(file.getFileIsvalid().equals(valid)){
list.add(new FileWrap(f, realPathResolver.get(""),null,valid));
}
}else{
if(valid.equals(false)){
list.add(new FileWrap(f, realPathResolver.get(""),null,false));
}
}
}else{
if(file!=null){
list.add(new FileWrap(f, realPathResolver.get(""),null,file.getFileIsvalid()));
}else{
list.add(new FileWrap(f, realPathResolver.get(""),null,false));
}
}
}