• Post Reply Bookmark Topic Watch Topic
  • New Topic

FTP file copy problem with timestamp?  RSS feed

 
prem kanna
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can any one tell me how to set file lastModifiedTime after copying files through FTP. I am using commons-net-1.4.1.jar to copy files from local system to server.
Eg: local file name “test.doc” (Today, December 29, 2009, 5:09:33 PM) when I moving this file to server, the files are moved successfully but the time is updated as server current time. But I need local file time like (Today, December 29, 2009, 5:09:33 PM). Below code I am using for uploading files to server.




Can any one please help me to overcome this issue?
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think the FTP protocol supports this. Any FTP program I've used so far simply sets the last modified date as "now".
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you might be able to tar them up, ftp the tarball, then untar them on the destination machine. I think that would preserve the timestamps.
 
prem kanna
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i didnt get any answer for my problem. can any one please give some Suggestion to solve my problem.

Thanks in advance.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you try what I suggested?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!