Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.3k views
in Java FTP by (320 points)
Hello,

I'm using edtiftpj 1.5.2 for several months with different ftp server and everything was working almost fine.
Now, I have a problem with an ftp server using dirDetails.
I have browsed the forum but none of the solution worked for me. Maybe I've missed something?
Can you please help me?

Here is the error i get : Unparseable date: "juil-7-2006-10:16"
And the raw line is : drwxr-xr-x 2 edti catia 512 juil 7 10:16 folder_name

Note that i'm in France and so is the ftp server.

Thank you.

13 Answers

0 votes
by (51.6k points)
Try using FTPClient.setParserLocale() to set the language used for directory parsing in dirDetails.

- Hans (EDT)
0 votes
by (320 points)
Try using FTPClient.setParserLocale() to set the language used for directory parsing in dirDetails.

- Hans (EDT)


Thanks for your answer, but as i said, i've already tested the solutions, like this one, proposed in other topics.
It seems that my problem can't be solved with that.

Any new ideas? or other tests that i can perform to find out what's wrong?
0 votes
by (162k points)
Post the log file - that way we can get a bit more info on what is going on.

Using the UnixFileParser, the raw listing certainly parses on my machine (in the UK) when Juil is replaced with July.

Perhaps the UnixFileParser isn't being used? Try forcing its use via setFTPFileFactory(new FTPFileFactory(new UnixFileParser());

Any new ideas? or other tests that i can perform to find out what's wrong?
0 votes
by (320 points)
Post the log file - that way we can get a bit more info on what is going on.

The log File looks like this :
edtFTPj version: 1.5.2
edtFTPj build timestamp: 20-Sep-2005 10:43:01 BST
Connecting to /xxx.xxx.xxx.xxx:21
220 xxx FTP server ready.
---> USER edti
331 Password required for edti.
---> PASS ********
230 User edtilogged in.
---> SYST
215 UNIX Type: L8 Version: SUNOS
---> PASV
227 Entering Passive Mode (xxx,xxx,xxx,xxx,135,50)
---> LIST *
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
Swapping Windows parser to Unix
Failed to parse listing 'drwxr-xr-x 2 edti catia 512 juil 7 10:16 523': Unparseable date: "juil-7-2006-10:16"


Using the UnixFileParser, the raw listing certainly parses on my machine (in the UK) when Juil is replaced with July.

Does it mean something must be changed on the server side to make it works?

Perhaps the UnixFileParser isn't being used? Try forcing its use via setFTPFileFactory(new FTPFileFactory(new UnixFileParser());

I've also tried with UnixFileParser.
0 votes
by (162k points)
setParserLocale() to france or whatever it is called is really the only advice I can offer. You sure you haven't tried this?
0 votes
by (320 points)
setParserLocale() to france or whatever it is called is really the only advice I can offer. You sure you haven't tried this?

Being in France, i've tried with Locale.FRENCH and Locale.FRANCE first.

Now i've also made tests with all the values returned by Locale.getAvailableLocales(), Locale.getISOCountries() and Locale.getISOLanguages(). All of them with both windows and unix parser.
Using windows parser always throws the following exception : "Unexpected number of fields" which is normal but unix parser also always throws the "Unparseable date" exception.

Did you manage to parse it without changing anything?
0 votes
by (320 points)
No idea?
0 votes
by (162k points)
No. All I can find out is that "juil-7-2006-10:16" can't be parsed by SimpleDateFormat with the format string we are using for Locale.FRENCH.

"MMM-dd-yyyy-HH:mm" is the format string. It didn't work with MMMM either.

We don't have any French speakers so we're stuck at this point. Can anyone help?

No idea?
0 votes
by (320 points)
I think i've found something :

  DateFormat df = new SimpleDateFormat( "MMM-dd-yyyy-HH:mm", Locale.FRENCH );
  System.out.println( df.format( Calendar.getInstance().getTime() ) );

Result : juillet-25-2006-10:17

  DateFormat df = new SimpleDateFormat( "MMMM-dd-yyyy-HH:mm", Locale.FRENCH );
  System.out.println( df.format( Calendar.getInstance().getTime() ) );

Result : juil.-25-2006-10:17

So the format given by the FTP server doesn't match what is expected.
Changing "juil-7-2006-10:16" to "juil.-7-2006-10:16" will parse but i still don't know how to solve the problem.
0 votes
by (140 points)
what about solutions of this problem ?

Every date the system tries to parse, an error occurs.

Have u a solution, or an idea?

" Unparseable date: "Sep-23-2005" "

/******************************************/

My locale is "French" but I forced the parser to 'UK' and it works

client.setParserLocale(Locale.UK);


NB: excuse me for my english speaking :oops: [/code]

Categories

...