I have a file at /WEB-INF/config.txt
on app engine. What is the path to the file on app engine?
eg: new File(/*What path do i put here?*/)
I have a file at /WEB-INF/config.txt
on app engine. What is the path to the file on app engine?
eg: new File(/*What path do i put here?*/)
This worked for me:
servletContext.getResourceAsStream("/WEB-INF/config.txt")
In my case, I didn't have access to ServletContext - getServletContext():
This worked for me:
I found this to be a good way to grab the entire file in a String:
There's some documentation at appengine how to add resources to your project. Check out the <resource-files> part. Some further information can be read in the description of the appengine sandbox.
When the resources are added to your project you can use the following code to read their content:
In the above example the 'path' directory is below your project's 'war' directory.
If this is part of your application and on the classpath, you should be able to load it using this.getClass().getResource().