Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

creating in memory files and folders

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

My requirement is to create a set of xml files and folders and then download all of them as compressed attachment.
I have started with Download Servlet, i am able to get download dialog with the attachment in windows machine, but not in linux machine.
The reason for this being i have used the path as // and the folder name.

How can i make sure that this download servlet works in both windows and linux machines ?

is there a way that i create the folders and files in memory , zip them and download .

or how to create a folder and files from servlet in the web application context so that i can access them in both environments.

any help is appreciated.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I have started with Download Servlet, i am able to get download dialog with the attachment in windows machine, but not in linux machine.
The reason for this being i have used the path as // and the folder name.


Not sure I follow this - if the problem is the folder name (and I'm maybe missing why this is the case) could you not just change it?


is there a way that i create the folders and files in memory , zip them and download


Yes. You could just create your zip folder in the Servlet container's temporary file space then stream the resulting file to the user.
 
Ravikanth Reddy Bapathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

How is that i can create in servlet containers tmp space?
Could you please provide me more details on how to do the same?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic