On Sep 17, 2009, at 14:56 , Radaven wrote:
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?
If I understand you correctly you want to access a resource from the
classpath. Then you can use getClass().getResourceAsStream("barcode-
cfg.xml"); [1]
Alex
[1]
http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]