/**
* @param string $name
* @return DAV\INode|void
* @throws DAV\Exception\NotFound
*/
function getChild($name)
{
$nameParts = explode("/", $name);
$name = File::getValidFilename($nameParts[count($nameParts) - 1]);
//$name = implode("/",$nameParts);
if (is_string($name)) {
$parentPath = $this->asset->getFullPath();
if ($parentPath == "/") {
$parentPath = "";
}
if (!($asset = Asset::getByPath($parentPath . "/" . $name))) {
throw new DAV\Exception\NotFound('File not found: ' . $name);
}
} else {
if ($name instanceof Asset) {
$asset = $name;
}
}
if ($asset instanceof Asset) {
if ($asset->getType() == "folder") {
return new Asset\WebDAV\Folder($asset);
} else {
return new Asset\WebDAV\File($asset);
}
}
throw new DAV\Exception\NotFound('File not found: ' . $name);
}