Accessing resource file in Java module | jeckels | 2014-06-20 09:42 |
Status: Closed | ||
Hi Bront, A couple of options to try, both of which will give you an InputStream: 1. Put the file in the "resources/web" directory for your module. Use ViewServlet.getViewServletContext().getResourceAsStream() with the relative path under that directory. Note that this will also expose the file directly via HTTP as part of the webapp. 2. Put the file under your Java source root. Use getClass().getClassLoader().getResourceAsStream() with the relative path under the source root. Thanks, Josh |
||