• 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

ftp question

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf (and everyone),

I did try the following and it works:



Hope this helps someone.

Tks,
Raj
 
reply
    Bookmark Topic Watch Topic
  • New Topic