first: thanks for the very cool implementation in Java! It comes in very
handy for my application.
Second: I need to transfer files to a server and copy from them.
I can use sftp to do this or scp as explained in your examples.
I already tested this and the approach works.
However, i need to know the timestamp of the files on the server
The reason is as follows: if certain files on the server are newer than the
same files on the local computer, then these files need to be downloaded.
While using sftp, i get output like this:
-rwxr-x--- 1 user group 895 Jan 27 14:49 test.xml
This is not enough, i need the year, month, day, hour, minute and seconds to
determine the exact timestamp of the file like this:
-rwxr-x--- 1 user group 895 Fri Nov 22 14:49:59 2002 test.xml
I haven't found a way to do this while using sft so i thought of using a
command like "ls --full-time" and then capturing the output of this, parse
it and use that to make an array of files.
I tried and adjusted the examples Shell and Exec but i can't capture the
Can anybody point me in the right direction?
+-From: "Benedict Verheyen" <wsbenedictv@...>
| Date: Thu, 30 Jan 2003 17:39:37 +0100
|This is not enough, i need the year, month, day, hour, minute and
|seconds to determine the exact timestamp of the file like this:
|-rwxr-x--- 1 user group 895 Fri Nov 22 14:49:59 2002 test.xml
The sftp protocol allows us to retrieve access-time and modified-time of files,
but I have not made them to be accessible for public. Those informations
are stored in com.jcraft.jsch.ChannelSftp.ATTR class.
I'm sorry for my laziness. I will allow you to access to those data.
Please wait for a while.