public function hasChildren($path)
{
if (null === $this->json) {
$this->load();
}
$path = $this->sanitizePath($path);
$results = $this->getReferencesInDirectory($path, self::STOP_ON_FIRST);
if (empty($results)) {
$pathResults = $this->getReferencesForPath($path);
if (empty($pathResults)) {
throw ResourceNotFoundException::forPath($path);
}
return false;
}
return true;
}