• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Open Source FTP Java client - Problems getting directory listing

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, my knowledge of FTP in general is quite limited so bear with me.

I have gone through 3 different open source scripts now, and each one, I get the same problem. It connects to the ftp folder fine, but cannot get the directory listing. It either times out or returns nothing.

At the moment I am using this - http://www.enterprisedt.com/products/edtftpj/

Basically, what I need to do, is connect to a predesignated ftp folder and download everything from there, to my local machine. Pretty simple. But edtftpj connects fine then when using FTPFile[] files = ftp.directoryList(); it times out.

I have a feeling it is to do with the ftp server i'm connnecting to, but I dont know enough. Does anyone have any ideas?
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,

Have you tried Apache commons-net? And yes the type of FTP server does matter, there are some subtleties between them and often you have to configure your FTP lib to talk to a particular flavour. _very_ rarely you have to write a plugin to make yours work.
 
MichaelJ McCabe
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Martijn Verburg wrote:Hi Michael,

Have you tried Apache commons-net? And yes the type of FTP server does matter, there are some subtleties between them and often you have to configure your FTP lib to talk to a particular flavour. _very_ rarely you have to write a plugin to make yours work.



Fantastic, thanks for your response. I have only been given the host, username and password for the FTP folder. But I can get more information regarding the folder if I know what to ask for... problem is, I dont know what to ask :P

What kinda things do i, or can I find out about it to get a better idea of what I need to use?
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll want to find out the host OS of the FTP server, that's usually enough to configure your client correctly. Also I assume you've logged in through a Command Line client to check your permissions, home directory etc are OK?
 
MichaelJ McCabe
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Martijn Verburg wrote:You'll want to find out the host OS of the FTP server, that's usually enough to configure your client correctly. Also I assume you've logged in through a Command Line client to check your permissions, home directory etc are OK?



I know the host OS as Windows NT, but dont see how that would affect it. I logged in through command line using the username and password provided. And when listing the directory, it shows the files in the folder using ASCII mode data connection. So I know that works...
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It being windows might make all the difference . Also what FTP server are they using? The Windows NT native one or a 3rd party? Check out Apache Commons Net documentation on connecting to the different types of servers...
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Almost forgot, very important! Check setting active vs passive mode on the connection
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!