If you have a javax.servlet.ServletContext you can call:
servletContext.getRealPath("/images/imagetosave.jpg")
to get the actual path of where the image is stored.
ServletContext can be accessed from a javax.servlet.http.HttpSession.
However, you might want to look into using:
servletContext.getResource("/images/imagetosave.jpg")
or
servletContext.getResourceAsStream("/images/imagetosave.jpg")