private function isEmptyFolder(Path $p)
{
$folderPath = $this->baseDir . $p->getPath();
$entries = glob($folderPath . '*', GLOB_ERR);
if (false === $entries) {
throw new DocumentStorageException('unable to read folder');
}
return 0 === count($entries);
}