code: public void init(ServletConfig config) throws ServletException {
  		super.init(config);
  
  		if (!(tmpDir.isDirectory() && tmpDir.canWrite())) {
  			throw new ServletException(tmpDir.getAbsolutePath() + " is not a writable directory");
  		}
  
  		if (!(destinationDir.isDirectory() && destinationDir.canWrite())) {
  			throw new ServletException(destinationDir.getAbsolutePath() + " is not a writable directory");
  		}
  	}
docs: ------------------------------------------------------------------------