Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
az ziz
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64698
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic