protected function createTemporaryDirectory($temporaryDirectoryBase)
    {
        $temporaryDirectoryBase = Files::getUnixStylePath($temporaryDirectoryBase);
        if (substr($temporaryDirectoryBase, -1, 1) !== '/') {
            $temporaryDirectoryBase .= '/';
        }
        $temporaryDirectory = $temporaryDirectoryBase . str_replace('/', '/SubContext', (string)$this->context) . '/';

        if (!is_dir($temporaryDirectory) && !is_link($temporaryDirectory)) {
            try {
                Files::createDirectoryRecursively($temporaryDirectory);
            } catch (ErrorException $exception) {
                throw new UtilityException('The temporary directory "' . $temporaryDirectory . '" could not be created. Please make sure permissions are correct for this path or define another temporary directory in your Settings.yaml with the path "Neos.Flow.utility.environment.temporaryDirectoryBase".', 1335382361);
            }
        }

        if (!is_writable($temporaryDirectory)) {
            throw new UtilityException('The temporary directory "' . $temporaryDirectory . '" is not writable. Please make this directory writable or define another temporary directory in your Settings.yaml with the path "Neos.Flow.utility.environment.temporaryDirectoryBase".', 1216287176);
        }

        return $temporaryDirectory;
    }