protected function checkFilePermissions()
    {
        foreach ($this->requiredWritableFolders as $folder) {
            $folderPath = FLOW_PATH_ROOT . $folder;
            if (!is_dir($folderPath) && !\Neos\Utility\Files::is_link($folderPath)) {
                try {
                    \Neos\Utility\Files::createDirectoryRecursively($folderPath);
                } catch (\Neos\Flow\Utility\Exception $exception) {
                    return new Error('Unable to create folder "%s". Check your file permissions (did you use flow:core:setfilepermissions?).', 1330363887, [$folderPath]);
                }
            }
            if (!is_writable($folderPath)) {
                return new Error('The folder "%s" is not writable. Check your file permissions (did you use flow:core:setfilepermissions?)', 1330372964, [$folderPath]);
            }
        }

        return null;
    }