public function deleteResource(PersistentResource $resource)
{
$pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());
if (!file_exists($pathAndFilename)) {
return true;
}
if (unlink($pathAndFilename) === false) {
return false;
}
Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));
return true;
}