commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject [NET] Re: Please Help me !! listFiles() return null
Date Wed, 24 Mar 2004 10:14:20 GMT
Fabio Cuomo wrote:

> i get a null pointer...java.lang.NullPointerException...listFiles() 
> return null pointer while if i use

It would be great if you could post the stacktrace to see where it is 
thrown.
Is it really listFiles() which throws the excpetion?

On what operating system do the ftp-server run?
I have tried your example and it worked fine with my linux host.

If one of the FTPFile Entries are null and this cause your 
NullPointerException, than this is due to a bug in UnixFtpEntryParser.
Currently files with permissions other than "rwx" cause the FTPClient to 
return null values.

I already filed a bug about this 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=27858)

As a workaround you could copy UnixFtpEntryParser and change the regexp
+ "(((r|-)(w|-)(x|-))((r|-)(w|-)(x|-))((r|-)(w|-)(x|-)))\\s+"
to
+ 
"(((r|-)(w|-)(x|X|s|S|t|-))((r|-)(w|-)(x|X|s|S|t|-))((r|-)(w|-)(x|X|s|S|t|-)))\\s+"

You have to pass this parser to listFiles then.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message