code: public static File createTempFile(String prefix, String suffix, String parentDir) throws IOException {
          File tempFile = null;
          if (parentDir != null) {
              File parent = new File(parentDir);
              if (!parent.isAbsolute()) {
                  String systemTemp = System.getProperty("java.io.tmpdir");
                  parent = new File(systemTemp, parentDir);
                  if (!parent.exists()) {
                      if (!parent.mkdirs()) {
                          return null;
                      }
                  }
              }
              tempFile = File.createTempFile(prefix, suffix, parent);
          } else {
              tempFile = File.createTempFile(prefix, suffix);
          }
          return tempFile;
      }
docs: Create the temporary file the parent directory is create by follow rules:
  1 The parentDir is relative, will create the java.io.tempdir/parentDir/tempFile;
  2 The parentDir is absolute, will create the parentDir/tempFile;
  3 The parentDir is null, will create the java.io.tempdir/tempFile.
  
  @param prefix
  @param suffix
  @param parentDir
  @return
  @throws IOException