public static function createTemporary($extension = NULL) {
    $tmpfile = tempnam(sys_get_temp_dir(), mb_substr(uniqid(),0,3));

    if ($extension) {
      rename($tmpfile, $tmpfile = $tmpfile.'.'.ltrim($extension, '.'));
    }

    return new static($tmpfile);
  }