In Java, I'm trying to log into an FTP server and find all the files newer than x for retrieval.
Currently I have an input stream that's reading in the directory contents and printing them out, line by line, which is all well and good, but the output is fairly vague... it looks like this...
-rw------- 1 vuser 4773 Jun 10 2008 .bash_history
-rw-r--r-- 1 vuser 1012 Dec 9 2007 .bashrc
lrwxrwxrwx 1 root 7 Dec 9 2007 .profile -> .bashrc
drwx------ 2 vuser 4096 Jan 30 01:08 .spamassassin
drwxr-xr-x 2 vuser 4096 Dec 9 2007 backup.upgrade_3_7
dr-xr-xr-x 2 root 4096 Dec 10 2007 bin
etc...
however, I need the actual timestamp in seconds or milliseconds so that I can determine if I want that file or not.
I assume this has something to do with the FTP server's configuration? but I'm kind of stumped.
Maybe worth having a look at the Jakarta Commons Net API which has FTP functionality.
I think with it you can use list files which will give you file objects that you can do getTimeStamp's on, you then should be able to get just the ones you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With