• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Apache Net FTP to interact with CE UNIX FTP

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to use Java FTP API from Apache to interact with CE (Corporate Enterprise) UNIX FTP.

I am not able to List files. Same code is able to list files from a regular FTP though.

Here is the code:
--------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------

The Output returned is:
file - 0 null
file - 1 null
file - 2 null

So basically the FTPFile[] array is being populated with correct number, as many files i have on FTP (i.e. 3).
BUT, the FTPFile object inside the array are NULL.

For other regular FTPs these FTP File Objects are populated correctly.
I even tried using the default parser as:
FTPListParseEngine engine = ftpClient.initiateListParsing(directory);

same output.

Please help

Thanks.
 
Inderpal Dhami
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried using a FTP Listener to get more info - ftpClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
This is what output i got:
-----------------------------------------------------------------------
TYPE I
200 Type set to I.
PASV
227 Entering Passive Mode (171,161,160,119,243,237)
LIST /EMERSELO
150 Opening BINARY mode data connection for /EMERSELO.
226 Transfer complete.
file - 0 null
file - 1 null
file - 2 null
QUIT
221 Goodbye.
-----------------------------------------------------------------------

So its not getting anything back from LIST.

Thanks.
 
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried using listFiles instead? initiateListParsing is a kind of lazy load IIRC.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic