commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aclaval <>
Subject File with leading "-" in the fileName not found by FTPClient.ListFile(String)
Date Mon, 26 Apr 2010 13:24:05 GMT

I'm using and the method 
listFile(String) to fetch some file.
All is working fine since a long time.

But i begin to encounter file with a leading "-" in the file name. So my 
code continue to pass the filename to listFile(fileName). But i get a 
empty array in place of the correct FTPFile[].
The file with a leading "-" in the name do exist on the FTP server.
I get can it if i call a FTPClient.listFile()  ( no parameter )

The documentation says :

*Parameters:* |pathname| - The file or directory to list. Since the 
server may or  may not expand glob expressions, using them here is not 
recommended   and may well cause this method to fail.

I'm not sure about glob expression. But the "-" doest seams to have a 
special meaning.

I was using the 1.4.X version. I have test with the 2.0. The issues is 
the same.

So, is that normal ?

For now, i have wrap the FTPClient in another object, override 
listFile(String), and when i got a file with a leading "-", i use 
listFile() and parse the result. But i'm sure theire is a better way to 
do this.

Thanks in advance,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message