Re: How to get resource handle in AppModule.java

2011-12-15 Thread hese
Great, that worked, thanks. public EmailTemplate buildEmailTemplate(@Inject AssetSource assetSource) throws IOException { Asset asset = assetSource.getContextAsset("/templates/billing.stg", new Locale("en")); EmailTemplate emailTemplate = new EmailTemplate(asset.getResource().op

Re: How to get resource handle in AppModule.java

2011-12-15 Thread Thiago H. de Paula Figueiredo
On Thu, 15 Dec 2011 19:39:26 -0200, hese <1024h...@gmail.com> wrote: Hi, Hi! public EmailTemplate buildEmailTemplate() { InputStream is = ?? // I want to get a handle to a text file residing in my context path. // obviously FileInputStream("/templates/billing.stg"); throws a file

Re: How to get resource handle in AppModule.java

2011-12-15 Thread Lenny Primak
@Inject AssetSource, and go from there. This should get you started. On Dec 15, 2011, at 4:39 PM, hese wrote: > > Hi, > > I want to access a resource file from AppModule.java buildXXX method. Can > anyone guide me how to go about it? > > public EmailTemplate buildEmailTemplate() { >Input

How to get resource handle in AppModule.java

2011-12-15 Thread hese
Hi, I want to access a resource file from AppModule.java buildXXX method. Can anyone guide me how to go about it? public EmailTemplate buildEmailTemplate() { InputStream is = ?? // I want to get a handle to a text file residing in my context path. // obviously FileInputStream("/tem