public function getChild($name) { $path = $this->path . '/' . $name; if (!M::file_exists($path)) { throw new Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located'); } if (M::is_dir($path)) { return new MongoDirectory($path); } else { return new MongoFile($path); } }