This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Rather than using getRealPath, I would suggest that you find out a directory on the server that your provider lets you write to, and include it as a property in your web app.
ie rather than using the ServletContext getRealPath method, retrieve it from a parameter you have set.
Agreed, it makes the installation of your site more complicated, as you now need to configure an additional piece of information somewhere, but it does have the advantage that you can specify anywhere - not just within the application path.
Possible places to put the property:
- in a properties file under the WEB-INF directory
- in the web.xml as a context property
- in a database
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com