• 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

FTPClient.retrieveFileStream always comes back null

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

I'm trying to read the text of an XML file that is on a remote FTP server, however, the fileStream always comes back null.



The path to the file I'm trying to read is "ftp://mycompany.com/java/mul/735/Folder/ver.xml". The code right now is using "mycompany.com/java/mul/735/Folder/ver.xml" as the input for the retrievefileStream method, but I've tried all types of variants with no luck.

Any help tips welcome.





 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this "ftp" variable an FTPClient? If so, does it have a method to connect to the FTP server? (I ask because there isn't an FTPClient method in the standard Java API so you must be referring to some other, unspecified, FTPClient class.)

I'm guessing it does. Then you should do that first. After that, then assuming the server makes your current directory its root, the name of the file you want is "/java/mul/735/Folder/ver.xml". (Use a command-line FTP client to find out what your actual working directory is on the server, and start from there.)
 
Normally trees don't drive trucks. Does this tiny ad have a license?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic