• Post Reply Bookmark Topic Watch Topic
  • New Topic

Option tor read FTP file to string variable.  RSS feed

 
Yashwant Palkar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have requirement in which we need to connect Secure FTP to download file and send that file content to another web service.
and vice versa to get data from web service and write in file on Secure FTP.
For Secure FTP purpose we are going to use ftp4j lib.But in ftp4j there is no method to read file content separately.
Whenever I have to read file from SFTP I have to store that content in local file.

Can anybody guide me to overcome this problem?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about this method? I would assume that one could use a restartAt value of 0.
 
Yashwant Palkar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Joe,
Which method you are mentioning?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Click on the link I posted.
 
Yashwant Palkar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have checked those methods.
Download method can be used to download a remote file from the server to a local file.
but I just want to read content of that remote file into any of the String Variable without storing it into local file.
Is there any way??
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you looked close enough.
Most of the download methods take a File argument. The one I pointed you to takes an OutputStream. If you have an OutputStream, you can divert the data into a String.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!