How can I access or create a file or folder in the current directory from inside a servlet?

Alex Chaffee

Since there's no telling which directory the servlet engine was launched from, you should always use absolute pathnames from inside a servlet. Usually I pass in the root directory in an InitParameter, and create File objects relative to that directory.