Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jakarta commons net API listNames() HANGS!!!  RSS feed

 
Ramesh VL
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Jakarta Commons Net 1.4.1 API to download some files from the FTP Server. The logic is that we are connecting to the FTP Server, changing to a directory, getting the list of all the files in that directory and downloading only the latest file based on the file timestamp.

The method [ listNames() or listFiles() ] is usually taking around 50-60 seconds to get a list of all files from a directory. Sometimes (which is not predictable), the program hangs while getting this list of files.

Is there a solution to the problem ?
Is there an alternative for these methods ?

Please reply soon since the solution is badly required.

Thanks in advance,

regards,
Ramesh V L
 
Paul Clapham
Sheriff
Posts: 22480
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not found that to be the case, and we are using that FTP API to do real work in my company. So before looking for a solution to the problem, you should back up a step and find out what the problem is. I suppose there is only one server where this problem exists? Perhaps you could ask the people who run that server to help you out by seeing what happens there when your program hangs.
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick google search turned up this example which seems to point to a class loading issue. Make sure you have the correct version of Jakarta-ORO for your Jakarta-Net library.
 
Aalok Pandit
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am also using jakarta commons-net 1.4.1 API

i use the listFiles() method to check whether the file to be transfered exists on the server or not, but my code is working fine.

the issue might be regarding the jakarta-oro classes as mentioned earlier.
 
Ramesh VL
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone for replying.
I am using the correct ORO jar in the classpath (jakarta-oro-2.0.8.jar).
The problem may be due to the fact that the directory contains around 8000-9000 files. But the question is about how to handle it?
Please let me know your suggestions.

Thanks,
Ramesh V L
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!