0

How to read the latest modified file from default users downloaded path using java?

public static void GetModifiedFile() {

     String source = "C:/users" + system.getProperty(User.name) + "Downloads/the lastest modified file"; 

}

Could anyone please help me on this?

TryinHard
  • 4,078
  • 3
  • 28
  • 54
Saran3g
  • 29
  • 5
  • Please clarify what you mean. Where does this code run? If it is on the server and the user is on the client, you do not have access to that information. If this runs in an applet, you won't be able to access the filesystem without explicit permission from the user. With so little context we cannot tell what you are trying to accomplish. – Jim Garrison Jul 01 '15 at 06:38
  • This code can be executed from any local system using Testng and Eclipse IDE. – Saran3g Jul 01 '15 at 06:42
  • If you can access this user's download directory you would need something like this: http://stackoverflow.com/questions/2064694/how-do-i-find-the-last-modified-file-in-a-directory-in-java – Sebastian S. Jul 01 '15 at 06:43
  • I found it thanks Sebastian – Saran3g Jul 08 '15 at 07:20

0 Answers0