Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
32.3k 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 (162k points)
Could you post a snippet of the stack trace (the last few lines) so we can pinpoint where this is occurring?

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
0 votes
by
Hello!

I've located the bug:

if there is a file with blanks in the filename, there is a problem with the MAX_FIELDS. I guess it's because you parse the raw-line with blanks as delimiter...

Regards

David
0 votes
by (162k points)
Are you using 1.3.2? We fixed this problem in 1.3.2 according to the release history.

Hello!

I've located the bug:

if there is a file with blanks in the filename, there is a problem with the MAX_FIELDS. I guess it's because you parse the raw-line with blanks as delimiter...

Regards

David
0 votes
by
yes, I'm using 1.3.2. heres the stack:

java.lang.ArrayIndexOutOfBoundsException: 12:

com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:107)
com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:118)
com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1399)


and here ist the raw-line:

-rw-r--r--    1 3380     107          2187 May 19 08:45 index dann index in 5.html


thank you!
0 votes
by (162k points)
Hmm. I think we only fixed the problem for WindowsFileParser. We'll put the fix in for UnxiFileParser ASAP.

yes, I'm using 1.3.2. heres the stack:

java.lang.ArrayIndexOutOfBoundsException: 12:

com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:107)
com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:118)
com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1399)


and here ist the raw-line:

-rw-r--r--    1 3380     107          2187 May 19 08:45 index dann index in 5.html


thank you!
0 votes
by (162k points)
We've exceeded ourselves and put a fix in that should deal with this. 1.3.3 is out now. We'd appreciate it if you'd test it out

Hmm. I think we only fixed the problem for WindowsFileParser. We'll put the fix in for UnxiFileParser ASAP.
0 votes
by
Hello. Sorry for my delay but I was offline till today.

Okay, I've tested the new version and I get following exception:

com.enterprisedt.net.ftp.FTPFileParser.split(FTPFileParser.java:89)
com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:113)
com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:118)
com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1437)


The filename, where the exception is beeing thrown is "index dann index in 5.html"

Thank you for your support.

David
0 votes
by (162k points)
Sorry for the delay. Could you email a directory listing to support at enterprisedt dot com (a short one of say 10 filenames) that exhibits the problem?

Then we should be able to implement a fix.

Hello. Sorry for my delay but I was offline till today.

Okay, I've tested the new version and I get following exception:

com.enterprisedt.net.ftp.FTPFileParser.split(FTPFileParser.java:89)
com.enterprisedt.net.ftp.UnixFileParser.parse(UnixFileParser.java:113)
com.enterprisedt.net.ftp.FTPFileFactory.parse(FTPFileFactory.java:118)
com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1437)


The filename, where the exception is beeing thrown is "index dann index in 5.html"

Thank you for your support.

David
0 votes
by
Hello, how are you? ;)
0 votes
by (162k points)
We hope to have a new release out fixing this problem by Monday 14 June.

Sorry for the delay. Could you email a directory listing to support at enterprisedt dot com (a short one of say 10 filenames) that exhibits the problem?

Then we should be able to implement a fix.

Categories

...