Provide a constructor which allows the temporary file directory to be specified.