/** * Previously in t3lib_extFileFunc::folder_delete() * * @param \TYPO3\CMS\Core\Resource\Folder $folderObject * @param bool $deleteRecursively * @throws \RuntimeException * @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException * @return boolean */ public function deleteFolder($folderObject, $deleteRecursively = FALSE) { if (!$this->checkFolderActionPermission('remove', $folderObject)) { throw new \TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException('You are not allowed to access the folder "' . $folderObject->getIdentifier() . '\'', 1323423953); } if ($this->driver->isFolderEmpty($folderObject) && !$deleteRecursively) { throw new \RuntimeException('Could not delete folder "' . $folderObject->getIdentifier() . '" because it is not empty.', 1325952534); } $this->emitPreFolderDeleteSignal($folderObject); $result = $this->driver->deleteFolder($folderObject, $deleteRecursively); $this->emitPostFolderDeleteSignal($folderObject); return $result; }