parent method
Returns the parent path of resourcePath.
If resourcePath is null or empty, returns an empty string.
Implementation
String parent(String? resourcePath) {
if (resourcePath?.isEmpty ?? true) {
return '';
}
final pathSegments = resourcePath!.split('/');
pathSegments.removeLast();
return pathSegments.join('/');
}