Wroyce Misa wrote:
I only get the last latest file but i want to get the last 12 latest file in ftp server Thank you in advance wrote:
Wroyce Misa wrote:
I only get the last latest file but i want to get the last 12 latest file in ftp server Thank you in advance wrote:
}
public static FTPFile lastFileModified(FTPFile[] files) {
Date lastMod = files[0].getTimestamp().getTime();
FTPFile choice = null;
for (FTPFile file : files) {
if (file.getTimestamp().getTime().after(lastMod)) {
choice = file;
lastMod = file.getTimestamp().getTime();
}
}
return choice;
}