Users can upload images on my website. My servlet needs to write the uploads into directory images of my webapp. For writing it onto the disk I need to create a File() object.
One way is that I can hardcode the complete path to something like
new File("/usr/tomcat/webapps/ROOT/images/file.jpg")
Is there a way so that I can specify something like new File("images/file.jpg")
.. Can I do it using new File (URI uri ) so that I do not have to hardcode the complete path. My servlet is located inside /usr/tomcat/webapps/ROOT/WEB-INF/classes/
The images folder is not a directory. It is actually a symbolic link which is pointing to another directory on the filesystem outside tomcat