I think you want URIUtils::GetDirectory() here.