Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get the last 10 file in ftp server using ftp client

 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


}

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;
}
 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
}
 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wroyce Misa wrote:
 
Wroyce Misa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Dave Tolls
Ranch Hand
Posts: 2295
25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why the multiple posts?

Print out the timestamps for all the files.
 
Acetylsalicylic acid is aspirin. This could be handy too:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!