使用FTPClient.getModificationTime获取FTP服务器中文件的上次修改日期为空 [英] Fetching last modified date of a file in FTP server using FTPClient.getModificationTime yields null

查看:499
本文介绍了使用FTPClient.getModificationTime获取FTP服务器中文件的上次修改日期为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



通过使用 ftpClient。 getModificationTime(File path)我得到 null 使用 FTPFile .getTimestamp()。getTime()我得到最后修改错误(即真正的最后修改是今天和我得到 Wed Feb 18 02:55: 22 EST 2004 )。



如何获得正确的上次修改? FTP档案



预先致谢。

解决方案

我发现了我在做的错误。



我正在使用SFTP环境而不是FTP环境。我必须使用jar文件和SFTP的其他功能,而不是FTP。



谢谢。


I am trying to fetch last modified date of a file from FTP environment.The result is not as expected.

By using ftpClient.getModificationTime("File path") I am getting null.

By using FTPFile.getTimestamp().getTime() I am getting wrong last modified (i.e. real last modified is of today and I am getting Wed Feb 18 02:55:22 EST 2004).

How to get correct last modified?File at FTP

Thanks in advance.

解决方案

I found the mistake I was doing.

I was working on a SFTP Environment instead of FTP Environment. I had to use jar files and other functions of SFTP not of FTP.

Thanks.

这篇关于使用FTPClient.getModificationTime获取FTP服务器中文件的上次修改日期为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆