Hi! Do you have any idea how to access files in WEB-INF/index folder from my application? I'm using OpenCMS for my application and I want to open a Lucene search index (with the help of Lucene IndexReader class) located at WEB-INF/index folder. Lucene jar is stored in WEB-INF/lib folder.
A:
If you want to lookup a file on the RFS (real file system) under the WEB-INF folder, you can get the path via:
String filepath = pageContext.getServletContext().getRealPath("/") + "WEB-INF" + java.io.File.separator + "index";
and then use the common java file methods to read it.
Mathias Lin
2010-06-12 15:58:20
A:
What do you intend to do with those index files?
OpenCms uses Lucene for its search engine. It is possible to use Lucene from within OpenCms for other purposes without any hassle if the index files are in the "correct" folder.
Andreas Kuckartz
2010-09-01 05:29:58