Preserving modified timestamp of file while uploading to SFTP

Ramya M :

I need to preserve modified timestamp of my file while uploading it to SFTP site.

I am using com.enterprisedt.net.ftp.ssh.SSHFTPclient for the transfer.

Please let me know if there is any way.

Martin Prikryl :

Call SSHFTPClient.setModTime after the upload.

sshFtpClient.setModTime(remotePath, new Date(new File(localPath).lastModified());

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=21383&siteId=1