Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.0k views
in Java FTP by (260 points)
Hi!
I've got a problem using your package. When i trying to get dirDetails he throws a following exception (it was on ftp.gtn.ru)
java.text.ParseException: Unparseable date: "Apr-7-1998"
   at java.text.DateFormat.parse(DateFormat.java:335)
   at com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:139)
   at com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:118)
   at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1399)

I'm using version 1.3.1 of your libroary and jdk 1.4

3 Answers

0 votes
by (260 points)
To make my topic more popular i'll speak here with myself:)
I found source of this error. It's becouse i'm from Russia. In classes UnixFileParsers and WindowsFileParcer used constructor
 private final static SimpleDateFormat formatter =
        new SimpleDateFormat("MM-dd-yy hh:mma");

But SimpleDataFormat use Local options for names of the months, and FTPServer using english names, so here must be
 private final static SimpleDateFormat formatter =
        new SimpleDateFormat("MM-dd-yy hh:mma",Locale.US);

I hope in next version author will change it!
Sorry for my English.
0 votes
by
What will happen if your FTP server returns Russian names?

To make my topic more popular i'll speak here with myself:)
I found source of this error. It's becouse i'm from Russia. In classes UnixFileParsers and WindowsFileParcer used constructor
 private final static SimpleDateFormat formatter =
        new SimpleDateFormat("MM-dd-yy hh:mma");

But SimpleDataFormat use Local options for names of the months, and FTPServer using english names, so here must be
 private final static SimpleDateFormat formatter =
        new SimpleDateFormat("MM-dd-yy hh:mma",Locale.US);

I hope in next version author will change it!
Sorry for my English.
0 votes
by (260 points)
What will happen if your FTP server returns Russian names?

It works fine with Russian names to. But may be it's becouse Localization Settings of my JRE. Anyway i have not changed anythink in your lib except bug with spaces and constructors invokations as stated above and now it works fine with FTPServers with Russian names of dirs and files.
Try to scan ftp.tms.dp.ua. In dir incoming one of subdirs got russian name.

Categories

...