Re: t5: accessing a text file under resources

2009-01-14 Thread Angelo Chen
Thanks, I found something similar: public InputStream getStream() throws IOException { String fn = this.getClass().getResource("/robots.txt").getFile(); return new FileInputStream(fn); } Tapestry Infodea wrote: > > Hi, > try something like this: > > private st

Re: t5: accessing a text file under resources

2009-01-14 Thread Tapestry Infodea
Hi, try something like this: private static final String WEB_BASED_PATH = "resources/robots.txt"; try { InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(WEB_BASED_PATH); DataInputStream din = new DataInputStream(is);