commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sarath Ambadas" <sarath.amba...@gmail.com>
Subject Re: [NET] org.apache.commons.net.ftp.FTPFile - getTimestamp() method nullifies seconds and milliseconds
Date Wed, 08 Mar 2006 07:25:05 GMT
Hi
You can try this way.
int replyCode = ftp.sendCommand("mdtm", remoteFileName);
    if (replyCode == 213) {
     String s = ftpClient.getReplyString();
     //parse the string to get the time stamp and construct the Calender
object
    }

Thanks
Sarath

On 3/7/06, Diana Teplits <dianat@traiana.com> wrote:
>
> Hello.
>
> I'll appreciate your help with the following problem:
>
> My program is supposed to connect to ftp server from ftp client and get
> files from predefined directory.
> It works except one thing:
>
> FTPClient ftp = new FTPClient();
> .......
> .......
> FTPFile[] filesArr = ftp.listFiles();
> FTPFile ftpFile = filesArr[0];
> Calendar date = ftpFile.getTimestamp();
>
> Seconds and milliseconds inside date object have zero values instead of
> the correct values.
> Is there any way to get ftp file lastModified date including seconds and
> milliseconds?
>
>
> P.S.
>
> I tried to use FTPClientConfig.setRecentDateFormatStr(..) in order to
> solve this problem, but didn't succeed...
>
>
>
> Thanks in advance,
>
> Diana.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


--
Sarath K Ambadas
WebSphere Adapters, IBM India Software Labs,
Phone: +91-80-25044996
Mobile: +91 94483 48231

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message