Get the location for storing temporary uploaded files (not for general temporary files)
@return the directory
@throws Exception
169660
private File getTempUploadDir() throws Exception {
        if (m_tempUploadDir == null) {
            try {
                m_tempUploadDir = getServer().getUploadDir();
            } catch (InitializationException e) {
                throw new Exception("Unable to get server: " + e.getMessage(), e);
            }
        }
        return m_tempUploadDir;
    }
916533
public function getTemporaryDirectory()
    {
        $temp = Config::get('concrete.filesystem.temp_directory');
        if ($temp && @is_dir($temp)) {
            return $temp;
        }

        if (!is_dir(DIR_FILES_UPLOADED_STANDARD . '/tmp')) {
            @mkdir(DIR_FILES_UPLOADED_STANDARD . '/tmp', Config::get('concrete.filesystem.permissions.directory'));
            @chmod(DIR_FILES_UPLOADED_STANDARD . '/tmp', Config::get('concrete.filesystem.permissions.directory'));
            @touch(DIR_FILES_UPLOADED_STANDARD . '/tmp/index.html');
        }

        if (is_dir(DIR_FILES_UPLOADED_STANDARD . '/tmp') && is_writable(DIR_FILES_UPLOADED_STANDARD . '/tmp')) {
            return DIR_FILES_UPLOADED_STANDARD . '/tmp';
        }

        if ($temp = getenv('TMP')) {
            return str_replace(DIRECTORY_SEPARATOR, '/', $temp);
        }
        if ($temp = getenv('TEMP')) {
            return str_replace(DIRECTORY_SEPARATOR, '/', $temp);
        }
        if ($temp = getenv('TMPDIR')) {
            return str_replace(DIRECTORY_SEPARATOR, '/', $temp);
        }

        $temp = @tempnam(__FILE__, '');
        if (file_exists($temp)) {
            unlink($temp);

            return str_replace(DIRECTORY_SEPARATOR, '/', dirname($temp));
        }
    }
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;
    }
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);
      }
   }
517208
public File getTempFile(@NotNull final String prefix, @NotNull final String extension) throws IOException {
        final File dir = getTempDirectory();
        final String tempFileName = String.format("%s%s.%s", prefix, UUID.randomUUID().toString(), extension);
        final File tempFile = new File(dir, tempFileName);
        if (tempFile.exists()) {
            return getTempFile(prefix, extension);
        }
        return tempFile;
    }
247921
public File getParentDirectory() {
        if (this.parentDirectory == null) {
            // the conventions are:
            // 1. jar in the function's method folder or
            // 2. in the function method's parent folder where all the method directories are children

            if (isJarInMethodFolder()) { 
                this.parentDirectory = getJarDirectory().getAbsoluteFile().getParentFile(); //up one level
            }
            this.parentDirectory = this.jarDirectory.getAbsoluteFile(); // otherwise convention #2
        }
        return this.parentDirectory;
    }
1286233
protected function getUploadTempFile()
    {
        $sUploadDir = $this->getOption('upload.default.dir');
        $sUploadDir = rtrim(trim($sUploadDir), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        $sUploadDir .= 'tmp' . DIRECTORY_SEPARATOR;
        $sUploadTempFile = $sUploadDir . $this->sTempFile . '.json';
        if(!is_readable($sUploadTempFile))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.upload.access'));
        }
        return $sUploadTempFile;
    }
131140
public File getDataDirectory() throws IOException {
        final File path = getDataFile(Settings.KEYS.DATA_DIRECTORY);
        if (path != null && (path.exists() || path.mkdirs())) {
            return path;
        }
        throw new IOException(String.format("Unable to create the data directory '%s'",
                (path == null) ? "unknown" : path.getAbsolutePath()));
    }
322467
public static String findATmpDir(){
        String osTmpDir = new Os.TmpDirFinder().get().get();
        return osTmpDir + File.separator +
                BROOKLYN_DIR + File.separator +
                Strings.makeRandomId(8);
    }
1126533
public String toFile() throws Exception {
        File file = File.createTempFile("GuiceDependencies_", ".dot");
        toFile(file);
        return file.getCanonicalPath();
    }
709628
public static String getTempDir() {
        // default is user home directory
        String tempDir = System.getProperty("user.home");
        try{
            //create a temp file
            File temp = File.createTempFile("A0393939", ".tmp");
            //Get tempropary file path
            String absolutePath = temp.getAbsolutePath();
            tempDir = absolutePath.substring(0,absolutePath.lastIndexOf(File.separator));
        }catch(IOException e){}
        return tempDir;
    }
360150
public String getDestDirectory()
	{
		String strTargetDirectory = this.getInitParameter(DESTINATION);		// Passed with WAR file
		if ((strTargetDirectory == null) || (strTargetDirectory.length() == 0))
			strTargetDirectory = System.getProperty("java.io.tmpdir");		// Temporary directory
		if ((strTargetDirectory == null) || (strTargetDirectory.length() == 0))
			strTargetDirectory = ".";										// Last choice - this directory
		return strTargetDirectory;
	}
1170
public function getTempDirectory()
    {
        if (!file_exists($this->tempDirectory)) {
            mkdir($this->tempDirectory, 0777);
            chmod($this->tempDirectory, 0777);
        }

        return $this->tempDirectory;
    }
1095667
private ProjectFile handleDatabaseInDirectory(File directory) throws Exception
   {
      byte[] buffer = new byte[BUFFER_SIZE];
      File[] files = directory.listFiles();
      if (files != null)
      {
         for (File file : files)
         {
            if (file.isDirectory())
            {
               continue;
            }

            FileInputStream fis = new FileInputStream(file);
            int bytesRead = fis.read(buffer);
            fis.close();

            //
            // If the file is smaller than the buffer we are peeking into,
            // it's probably not a valid schedule file.
            //
            if (bytesRead != BUFFER_SIZE)
            {
               continue;
            }

            if (matchesFingerprint(buffer, BTRIEVE_FINGERPRINT))
            {
               return handleP3BtrieveDatabase(directory);
            }

            if (matchesFingerprint(buffer, STW_FINGERPRINT))
            {
               return handleSureTrakDatabase(directory);
            }
         }
      }
      return null;
   }
489177
private File getTempFolder(String tempPath) {
        if (tempPath != null) {
            File folder = new File(tempPath);
            if (folder.exists()) {
                return folder;
            }
        }
        return null;
    }
1130151
@Override
    public File getServerLogDirectory() {
        String logLocation = TrConfigurator.getLogLocation();
        if (logLocation != null) {
            return new File(logLocation);
        } else {
            return null;
        }
    }
187577
protected static function tempDirectory()
    {
        $tempDir = eZSys::varDirectory() . '/webdav/tmp';
        if ( !file_exists( $tempDir ) )
        {
            eZDir::mkdir( $tempDir, eZDir::directoryPermission(), true );
        }
        return $tempDir;
    }