aspose file tools*
The moose likes Struts and the fly likes How to search a file in a file server and serve from servlets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to search a file in a file server and serve from servlets?" Watch "How to search a file in a file server and serve from servlets?" New topic
Author

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

az ziz
Ranch Hand

Joined: Dec 17, 2008
Posts: 50
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

Joined: Jan 10, 2002
Posts: 61626
    
  67

What information do you have with which to find the file? How will you know it when you find it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
az ziz
Ranch Hand

Joined: Dec 17, 2008
Posts: 50
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to search a file in a file server and serve from servlets?