• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ftp question

 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have this ques, please help:

I wrote the a program using jdom to create an xml file which works fine. Following are the main steps:



Now, I need to have this application on the web and do a ftp of the file. I do not want to have the new xml files be first put on the originating server or some network file server and then ftp'ed to the destination.

Is there a good way to create the xml file in memory and then do an ftp ?

I'm new to java, so looking at the jdom api, i think this can be used:



and in apache commons net api for the ftp part, I can see this:



Basically I don't know how to add these things up and get something that just goes from doc -> outputstream/inputstream -> ftp.
I don't want to have a copy of all files on my end.

Any hints or suggestions ?
Thanks a lot!

Raj
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about

void output(Document doc, storeFileStream(String remote));

I think the javadocs of the storeFileStream method are confusing about that the file has to exist on the server. Give it a try and let us know how you make out.
 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf (and everyone),

I did try the following and it works:



Hope this helps someone.

Tks,
Raj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic