• 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

How to search a file in a file server and serve from servlets?

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear all,

i have a requirement like this, i had successfully generated a scheduler which generates the pdf reports periodically and put it into a file server. Now these files are the one to be served to the client through the servlets. the user searches for a report, if found in the db displays the info about the report in a table grid. user selects the reports and clicks print. now i need to find this report in the file system, if found read it and write to the client. How do i search in the file server for a file from the servlet, and also effectively?
How do i do it? which design pattern may i use to implement this search? suggested oo way? may i use cache?

Thanks

Vijay
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What information do you have with which to find the file? How will you know it when you find it?
 
az ziz
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for replying, Bibeault. there will be a jsp page which will allow the user to key-in the report name. grid in the jsp will display the details of the report stored from the database. the user selects an item in the grid and press print. The details of the report requested to be printed will be sent to the struts action. That action will fwd to me, with all the information like which class does it belong, im thinking of keeping an xml file which has the configuration of which class of files stored where. with this information in hand my module should find the file read it and write to the client. sometimes i may need to join more than one report together and send it, (this is not the problem now). the thing is i wish to implement it as a small framework or according to the OO pattern

thanks
V
 
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic