如何从ftp检索文件创建日期 [英] How to retrieve the file creation date from ftp

查看:148
本文介绍了如何从ftp检索文件创建日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用库com.enterprisedt.net.ftp.FileTransferClient从ftp服务器下载文件.

I am using the library com.enterprisedt.net.ftp.FileTransferClient to download the files from ftp server.

我正在尝试使用方法FileTransferClient getModifiedTime(java.lang.String remoteFileName)

但是收到以下错误:

com.enterprisedt.net.ftp.FTPException:550命令MDTM不是 可用于"AAAA.BBBB.CCCC.DDDDDD.EEEEEEEEEE(0)"

com.enterprisedt.net.ftp.FTPException: 550 command MDTM is not available for 'AAAA.BBBB.CCCC.DDDDDD.EEEEEEEEEE(0)'

我尝试从命令行和相同的响应中使用命令quote mdtm 'filename'.

I tried using the command quote mdtm 'filename' from command line and same response.

查看了两个链接

  1. http://www.nsftools.com/tips/RawFTP.htm

http://www.nsftools.com/tips/MSFTP.htm

但是找不到任何替代方法或解决方法.有什么想法吗?

But could not find any alternative or workaround for this..Any thoughts?

尝试了命令remotehelp,下面是响应:

Tried the command remotehelp and below is the response :

214-server-FTP命令为:214-ABOR,* ACCT,* ALLO,APPE,CDUP, CWD,DELE,FEAT,HELP,LANG,LIST,MDTM,MKD 214-MODE,NLST,NOOP, OPTS,PASS,PASV,PORT,PWD,QUIT,REIN,REST,RETR,RMD 214-RNFR, RNTO,SITE,SIZE, SMNT,SYST,STAT,STOR,STOU,STRU,TYPE,USER 214-ADAT,AUTH,CCC,PBSZ,PROT,EPSV,EPRT 214-前面的命令 ''未实现

214-The server-FTP commands are: 214-ABOR,*ACCT,*ALLO, APPE, CDUP, CWD, DELE, FEAT, HELP, LANG, LIST, MDTM, MKD 214-MODE, NLST, NOOP, OPTS, PASS, PASV, PORT, PWD, QUIT, REIN, REST, RETR, RMD 214-RNFR, RNTO, SITE, SIZE, SMNT, SYST, STAT, STOR, STOU, STRU, TYPE, USER 214-ADAT, AUTH, CCC, PBSZ, PROT, EPSV, EPRT 214-The commands preceded by '' are not implemented

按照响应服务器的要求,应该支持命令MDTM ..我在这里做错什么了吗?

As per the response server should support the command MDTM..Am i doing anything wrong here?

推荐答案

我认为有人可以使用

getRaw();

Javadoc告诉:

Javadoc tells:

getRaw()

getRaw()

公共java.lang.String getRaw()

public java.lang.String getRaw()

返回:

返回原始服务器字符串.

Returns the raw server string.

因此,如果您使用"LIST"查询服务器,则应该从所有文件中获得一份清单,包括上次修改时间. 您必须手动解析修改时间.

So if you query the server with "LIST", you should get a List off all files including last modification time. The you have to parse out the modification time manually.

这篇关于如何从ftp检索文件创建日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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