How to preserve date modified when retrieving file using Apache FTPClient?

前端 未结 3 1111
情歌与酒
情歌与酒 2021-01-14 02:36

I am using org.apache.commons.net.ftp.FTPClient for retrieving files from a ftp server. It is crucial that I preserve the last modified timestamp on the file wh

3条回答
  •  孤街浪徒
    2021-01-14 03:21

    You can modify the timestamp after downloading the file.

    The timestamp can be retrieved through the LIST command, or the (non standard) MDTM command.

    You can see here how to do modify the time stamp: that: http://www.mkyong.com/java/how-to-change-the-file-last-modified-date-in-java/

提交回复
热议问题