File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Java Products and Servers and the fly likes FTPClient.listFiles() is not working.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "FTPClient.listFiles() is not working.." Watch "FTPClient.listFiles() is not working.." New topic

FTPClient.listFiles() is not working..

Tapan Thakkar

Joined: Mar 09, 2010
Posts: 24
hey guys..

i am writing an application which uploads file to FTPServer.

in which i need to check whether a file exist on FTPServer or not , if yes then append new data to that file else create new file.

first time it creates new file check whether file already exists on server i am using this code..

FTPClient client = new FTpClient();

final String _cwdFTP = client.printWorkingDirectory();
final FTPFile[] list = client.listFiles(_cwdFTP);

but list always comes null and this happens when i am connected through WIRELESS CONNECTION. but same code works fine when i am connected through LAN CABLE.

please help me to solve this problem.


Tapan Thakkar.
I agree. Here's the link:
subject: FTPClient.listFiles() is not working..
It's not a secret anymore!