protected function getParentPath($path)
{
if ($path === '/') {
return '';
}
$endIndex = strrpos($path, '/');
$index = strpos($path, '/');
// path is something like /nodeInRootSpace
if ($index === $endIndex) {
return '/';
} else {
// node is something like /node/not/in/root/space
return substr($path, 0, $endIndex);
}
}