marco giudici Messages: 168 Registered: February 2013 Location: Italy
I have the following question/need:
I would need to specify in my code the location of a file in resorces of my package "client" (as you can see in the picture below)
This file is a Excel file that I use as template to generate a report in Excel with jXLS library. The used code is the following:
Map beans = new HashMap();
XLSTransformer transformer = new XLSTransformer();
transformer.transformXLS(templateFileName, beans, destFileName);
The user can define the destination using a filechooser [destFileName]; instead the template is always the same and I thinked to put this into the resources folder of the client package, but I cannot retrieve it.
In your first screenshot there ist the resources folder (highlighted in yellow). i was suggesting that you could create a subfolder named 'templates' there which in turn would then hold all the template files that you need in your application.
The drawback of your approach is that you will need to update your application and redeploy in case a template needs to be changed. A more flexible solution would store template files in a database and provide the administrator of the application with the means to change/add/delete such templates.