• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Open Source FTP Java client - Problems getting directory listing

 
MichaelJ McCabe
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?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 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
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 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
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 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
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Almost forgot, very important! Check setting active vs passive mode on the connection
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic