FileComp fileComp = new FileComp(intOrder);
Arrays.sort(fileList, fileComp);
List<FileType> ls = new ArrayList<FileType>();
Long longTemp = new Long(0);
StringBuffer strTemp = new StringBuffer("");
ls.add(new FileType());
for (File fl : fileList) {
if (fl.isFile()) {
ls.add(new FileType(fl));
longTemp += fl.length();
strTemp.append(fl.getName() + ",");
}
}
String strName = strTemp.toString();
if (!strName.equals("") && strName.length() > 0) {
FileType ft = new FileType();
ft.setStrName(strName.substring(0, strName.length() - 1));
ft.setLongLength(longTemp);
ls.set(0, ft);
}
return ls;
}