commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goebel, Martin (BREKOM)" <MGoe...@BREKOM.BREMEN.de>
Subject FTPClient fails to parse file-list
Date Wed, 07 Sep 2005 12:55:32 GMT
Hi!

I have to deal with a strange behaviour of FTPClient. I don't get it.

I Connect to a ReliantUnix and want to get a FileList.

ftp = new FTPClient();
FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
conf.setServerLanguageCode("en");
ftp.configure(conf);

[...]

FTPListParseEngine engine = ftp.initiateListParsing(directory);
FTPFile[] result = engine.getFiles();

Three files of a longer Filelist can not be parsed, the resulting FTPFile is
null.

This is one of the lines that works:
-rw-rw-rw-   1 gcu      agc     3913149 Sep  7 06:00 ge05-09-07.txt
And these can not be parsed:
drwxrwxrwx   2 gcudat   gcudat        96 Okt 15  2001 GCUIMPORT
-rw-r-----   1 agc      agc       688128 Apr  8 10:40 SAVEGCDATA.sav
-rw-r-----   1 gcuftp   other     688128 Apr  6 10:52 SAVERSfile.sav

I can not see the significant difference!?!

To track down the problem, I called the parser directly with the content and
it works, like this:

UnixFTPEntryParser parse = new UnixFTPEntryParser();
ftpFile = parse.parseFTPEntry("-rw-r-----   1 agc      agc       688128 Apr
8 10:40 SAVEGCDATA.sav");
System.out.println(ftpFile.getName());

If I adjust my FTPClient to SYST_UNIX, isn't that the used parser?

If then, I use the FTPFileEntryParser, it fails, on all my entrys.

This is the output, of the method, that revealed the Problem:

i=69/75 -rw-rw-rw-   1 gcu      agc      4176135 Sep  6 06:00 ge05-09-06.txt
i=70/75 -rw-rw-rw-   1 gcu      agc      3913149 Sep  7 06:00 ge05-09-07.txt
i=71/75 -rw-r--r--   1 root     other       2221 Jul 29  2002 pg
Can't read File-List java.lang.NullPointerException

This is the next line on wich it fails:
drwxrwxrwx   2 gcudat   gcudat        96 Okt 15  2001 GCUIMPORT


Any ideas? thanks...

Bye, mago

 

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