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);
BufferedReader br = new BufferedReader(new
InputStreamReader(din));
String line;
while ((line = br.readLine()) != null) {
//TODO ...
}
din.close();
} catch (Exception e) {
throw new TapestryException(e.getMessage(),
resources.getLocation(), e);
}
Angelo Chen ha scritto:
Hi,
I put a robots.txt under resources, it is under classes after build, then
I'd like to access it from the code:
private final class RobotsTxtStreamResponse implements StreamResponse {
public InputStream getStream() throws IOException {
return new FileInputStream("robots.txt");
}
}
it does not work, any idea how to access that? thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org