for (int i = 0; i < files.length; i++) {
files[i] = new FtpFile(list[i]);
File f = new File(getAbsolutePath() + File.separator + list[i]);
files[i].setSize(f.length());
String first = (f.isFile()) ? "-" : "d";
String sec = (f.canRead()) ? "r" : "-";
String third = (f.canWrite()) ? "w" : "-";
files[i].setMode(first + sec + third);
files[i].setFtpMode(false);
files[i].setAbsolutePath(getAbsolutePath() + File.separator + files[i].getName());
}