• Post Reply Bookmark Topic Watch Topic
  • New Topic

FTPClient.retrieveFileStream always comes back null  RSS feed

 
rick simpson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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.





 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!