Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
31.1k views
in Java FTP by
Hello there,

if I'm listing directories with a large amount of files (here about 2000 files) by using

FTPFile[] files = ftp_client.dirDetails(".")


I get an ArrayIndexOutOfBoundsException =(

With smaller directories, there is no problem.

Someone has a suggestion to solve this?

Thank you

David

38 Answers

0 votes
by (158k points)
We're looking at it. The problem seems to be it is using the Windows parser but the server is supplying Unix format listings.

Can you look at the log file and see if you can see a message starting with "Rotated parser", and tell us what it is?

If it detects Windows, the Windows parser is used, and if an exception is thrown, it rotates to the Unix parser.

Hi again. Sorry to bother you at this frequency, but have you been able to solve the issue with the parser on Windows? I have not yet found it in the history list, so can I assume you are still working on it?
If I can do anything to assist, please let me know.

Chris Schuit
0 votes
by (158k points)
Also, try this quick fix:

ftp = new FTPClient(...);
ftp.setFTPFileFactory(new FTPFileFactory(new UnixFileParser()));

this sets the Unix parser instead of trying to detect it.

We're looking at it. The problem seems to be it is using the Windows parser but the server is supplying Unix format listings.

Can you look at the log file and see if you can see a message starting with "Rotated parser", and tell us what it is?

If it detects Windows, the Windows parser is used, and if an exception is thrown, it rotates to the Unix parser.

0 votes
by (460 points)
Hi

I can't find the message you are looking for. It there a way to increase the log level? I may assume that unless otherwise specified the log info is written to the standard out?

Thnx, Chris Schuit
________
Gift cards
0 votes
by (158k points)
Logger.setLevel(Level.DEBUG);

Try the quick hack as well to see if it works.

Hi

I can't find the message you are looking for. It there a way to increase the log level? I may assume that unless otherwise specified the log info is written to the standard out?

Thnx, Chris Schuit
0 votes
by (460 points)
The quick fix results in this:
java.text.ParseException: Unexpected number of fields in listing '' - expected minimum 8 fields but found 0 fields 
at com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:125) 
at com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:159) 
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1726) 


The log level does not put any info in the standard out.

Any other actions I can take to test this? Thnx, Chris
________
Franco Comotti
0 votes
by (158k points)
You are using 1.4.4 aren't you?

Can you email the directory listing to support at enterprisedt dot com and we'll take a look

The quick fix results in this:
java.text.ParseException: Unexpected number of fields in listing '' - expected minimum 8 fields but found 0 fields 
at com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:125) 
at com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:159) 
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1726) 


The log level does not put any info in the standard out.

Any other actions I can take to test this? Thnx, Chris
0 votes
by
Hello,

I have the same problem parsing
that server ftp.lrz-muenchen.de

Remote FTP Server: UNIX Type: L8
Folder: / [0/0]
ErrorMessage(1) Index was outside the bounds of the array.
ErrorMessage(2) System.IndexOutOfRangeException: Index was outside the bounds of
the array.
at EnterpriseDT.Net.Ftp.UnixFileParser.Parse(String raw)
at EnterpriseDT.Net.Ftp.FTPFileFactory.Parse(String[] files)
at EnterpriseDT.Net.Ftp.FTPClient.DirDetails(String dirname)
at Demo.Main(String[] args)

I am using C#
0 votes
by (158k points)
For a start, post on the edtftp.net.technical group.

I am using C#

Categories

...