Gets the default temp directory for the system.

@return a {@code String}, representing the path to the default temp
directory.
@see File#createTempFile
194432
public static String getTempDir() {
        synchronized (FileUtil.class) {
            if (TEMP_DIR == null) {
                // Get the 'java.io.tmpdir' property
                String tmpDir = System.getProperty("java.io.tmpdir");

                if (StringUtil.isEmpty(tmpDir)) {
                    // Stupid fallback...
                    // TODO: Delegate to FileSystem?
                    if (new File("/temp").exists()) {
                        tmpDir = "/temp";  // Windows
                    }
                    else {
                        tmpDir = "/tmp";   // Unix
                    }
                }
                TEMP_DIR = tmpDir;
            }
        }
        return TEMP_DIR;
    }
1085924
public static File createTmpDir(String folderName)
	{
		File temp = new File(System.getProperty("java.io.tmpdir"), folderName);
		if (!temp.exists()) {
			temp.mkdirs();
			temp.deleteOnExit();
		}
		return temp;
	}
381017
public static Resource temporaryDirectory() {
      File tempDir = new File(SystemInfo.JAVA_IO_TMPDIR);
      String baseName = System.currentTimeMillis() + "-";
      for (int i = 0; i < 1_000_000; i++) {
         File tmp = new File(tempDir, baseName + i);
         if (tmp.mkdir()) {
            return new FileResource(tmp);
         }
      }
      throw new RuntimeException("Unable to create temp directory");
   }
623440
def get_temp_directory():
    """"""
    # Supports all platforms supported by tempfile
    directory = os.path.join(gettempdir(), "ttkthemes")
    if not os.path.exists(directory):
        os.makedirs(directory)
    return directory
1170
public function getTempDirectory()
    {
        if (!file_exists($this->tempDirectory)) {
            mkdir($this->tempDirectory, 0777);
            chmod($this->tempDirectory, 0777);
        }

        return $this->tempDirectory;
    }
976474
public File getFile() throws IllegalStateException {
		File f = tempFile;
		if(f==null) throw new IllegalStateException();
		return f;
	}
456022
public static TemporaryFiles get(Application app) {
		TemporaryFiles instance = app.getInstance(TemporaryFiles.class);
		if (instance == null) {
			File dir = null;
			String path = app.getProperty(Application.PROPERTY_TMP_DIRECTORY);
			if (path != null) {
				dir = new File(path);
				if (!dir.exists())
					if (!dir.mkdirs())
						dir = null;
			}
			if (dir == null) {
				path = app.getProperty("java.io.tmpdir");
				if (path != null) {
					dir = new File(path);
					if (!dir.exists())
						if (!dir.mkdirs())
							dir = null;
				}
			}
			instance = new TemporaryFiles(/*app, */dir);
		}
		return instance;
	}
552441
public static File getTempFileFor(File file) {
    File parent = file.getParentFile();
    String name = file.getName();
    File result;
    int index = 0;
    do {
      result = new File(parent, name + "_" + index++);
    }
    while (result.exists());
    return result;
  }
1213319
private synchronized File createTemp(File workingDirectory) throws IOException {
        if (workingDirectory == null) {
            return createTempDir();
        }
        else {
            workingDirectory.mkdirs();
            return workingDirectory;
        }
    }
1185963
public static final File createTempDir() throws IOException
   {
      File dir = File.createTempFile("mpxj", "tmp");
      delete(dir);
      mkdirs(dir);
      return dir;
   }
837266
static function GetTempDir(){
		$temp_dir = (defined("TEMP") && strlen("TEMP")) ? (string)TEMP : sys_get_temp_dir();
		if(!strlen($temp_dir)){
			$temp_dir = "/tmp";
		}
		return $temp_dir;
	}
1175262
def _default_temporary_directory(self, prefix):
    """"""
    try:
      self.temporary_file = tempfile.NamedTemporaryFile(prefix=prefix)

    except OSError as err: # pragma: no cover
      logger.critical('Cannot create a system temporary directory: '+repr(err))
      raise securesystemslib.exceptions.Error(err)
1009101
public static File createTempDirectory(String prefix) {
	File temp = null;
	
	try {
	  temp = File.createTempFile(prefix != null ? prefix : "temp", Long.toString(System.nanoTime()));
	
	  if (!(temp.delete())) {
	    throw new IOException("Could not delete temp file: "
		  + temp.getAbsolutePath());
	  }
	
	  if (!(temp.mkdir())) {
	    throw new IOException("Could not create temp directory: "
	      + temp.getAbsolutePath());
	  }
	} catch (IOException e) {
	  throw new DukeException("Unable to create temporary directory with prefix " + prefix, e);
	}
	
	return temp;
  }
758489
public static File createTempDir() throws IllegalStateException
   {
      File baseDir = getTempDirectory();
      try
      {
         return Files.createTempDirectory(baseDir.toPath(), "tmpdir").toFile();
      }
      catch (IOException e)
      {
         throw new IllegalStateException("Error while creating temporary directory", e);
      }
   }
85234
public TempDir createTempDir(String originalName) throws IOException {
        if (!open.get()) {
            throw VFSMessages.MESSAGES.tempFileProviderClosed();
        }
        final String name = createTempName(originalName + "-", "");
        final File f = new File(providerRoot, name);
        for (int i = 0; i < RETRIES; i++) {
            if (f.mkdirs()) {
                return new TempDir(this, f);
            }
        }
        throw VFSMessages.MESSAGES.couldNotCreateDirectory(originalName,RETRIES);
    }
1052573
private static String getFolderPath(String folderPath) {
        File folder = new File(folderPath);
        if (folder.exists() && folder.isFile()) {
            String tempPath = folder.getParent();
            folder = new File(tempPath);
        }
        if (!folder.exists()) {
            folder.mkdirs();
        }
        return folder.getPath();
    }
1308443
private Path getTempDir() {
    if (this.tempDir == null) {
      if (this.dir != null) {
        this.tempDir = dir;
      } else {
        this.tempDir = getProject().getBaseDir().toPath();
      }
    }
    return tempDir;
  }