I have a servlet which accepts a file upload, I'd like to store the file in a specific directory on disk. I'm using jetty. The file system looks like this:
/jetty
/bin
/contexts
/stuff
/webapps
foo.war // one web app
grok.war // another web app
start.jar
I start jetty from that start.jar file. In the context of the servlet, I'm not sure how to save the file to my desired destination, the "/stuff" folder:
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
File downloaded = new File("some/path/here/stuff"); // ?
}
Yeah - I'm not sure what path to use - is there a way I can print the current working directory in java using the File class to figure that out maybe?
Thanks