cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Markus <t.mar...@proventis.net>
Subject Re: Accessing resource from reader
Date Fri, 18 Sep 2009 06:19:01 GMT
Hi,

depends on file location. is it in your classpath use
getClass().getResourceAsStream()
as file inside your sitemap structure try (in BarcodeImageReader.setup )

Context context = ObjectModelHelper.getContext(objectModel);
File file = new File(context.getRealPath("barcode-cfg.xml"));

location is relative to your sitemap

regards
Thomas



Radaven schrieb:
> Hi, I am working on my BarcodeImageReader which generates barcode image. The
> parameters of barcode are loaded from xml config file (saved on same place
> as other resources like jx templates, etc.). 
>
> How can I get to this file to have it as java.io.File? I guess I cannot use
> something like 
>
> File file = new File("barcode-cfg.xml");
>
> Is there some getResource method or something like that available?
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message