I need to create a Servlet that allows my webapp to view the contents of a folder that is outside of the webapp's structure on a Linux machine.
If I was doing this on Windows I would probably just provide the absolute path C:/myfolder so the webapp knows to look in here.
How would I do this for a folder under Linux in a loction like: /usr/local/myfolder ?
If it just give it the path /usr/local/myfolder then the webapp will try to find the folder under the ROOT path
Keith SmithA wrote: then the webapp will try to find the folder under the ROOT path
Sure. The root directory is the top-level directory "/". The full path /usr/local/myfolder should work. Of course, you have to make sure that the user running the web server has permission to view the files in "myfolder" and there are no security policies that would prevent access (Tomcat, for instance, has a policy that limits access to files and directories under $TOMCAT_HOME/webapps).