code: public void setTempDirectory(File dir) throws IOException {
          File td = dir.getCanonicalFile();
          if (td.isDirectory()) {
              _temp_directory = td;
          }
      }
docs: Override directory to create temporary file in.
  Does not affect already open temp file.
  @param dir File object representing temporary directory.
  May be null which means that system default
  (java.io.tmpdir system property) should be used.
  @throws IOException