sanitizedChildDirectory method
Implementation
Directory sanitizedChildDirectory(String basename) {
final segments = p.absolute(path, p.normalize(basename)).split(p.separator)
..removeWhere((element) => element == '..');
final relative =
p.relative('${p.separator}${p.joinAll(segments)}', from: path);
return childDirectory(relative);
}