return createTempFile (prefix, suffix, null);
if (directory == null) { String dirname = tmpdir; if (dirname == null) throw new IOException("Cannot determine system temporary directory");  directory = new File(dirname); if (!directory.exists()) throw new IOException("System temporary directory " + directory.getName() + " does not exist."); if (!directory.isDirectory()) throw new IOException("System temporary directory " + directory.getName() + " is not really a directory."); }  if (prefix.length () < 3) throw new IllegalArgumentException ("Prefix too short: " + prefix); if (suffix == null) suffix = ".tmp";    if (prefix.length () + 6 + suffix.length () > maxPathLen) { int suf_len = 0; if (suffix.charAt(0) == '.') suf_len = 4; suffix = suffix.substring(0, suf_len); if (prefix.length () + 6 + suf_len > maxPathLen) prefix = prefix.substring(0, maxPathLen - 6 - suf_len); }  File f;   for (int i = 0; i < 100; ++i) {  String t = "ZZZZZZ" + nextValue (); String l = prefix + t.substring(t.length() - 6) + suffix; try { f = new File(directory, l); if (f.createNewFile()) return f; } catch (IOException ignored) { } }  throw new IOException ("cannot create temporary file");
  public static File createTempFile (String prefix, String suffix)    throws IOException  {    return createTempFile (prefix, suffix, null);  }