String parent(String? resourcePath) { if (resourcePath?.isEmpty ?? true) { return ''; } final pathSegments = resourcePath!.split('/'); pathSegments.removeLast(); return pathSegments.join('/'); }