getDirectoryContents method
Enumerate a directory at the given path, if any.
Implementation
@override
DirectoryContents getDirectoryContents(String subpath) {
try {
var path = subpath.trimLeft().replaceFirst(p.separator, '');
if (p.isRootRelative(path)) {
return NotFoundDirectoryContents();
}
final fullPath = _getFullPath(path);
if (fullPath == null) {
return NotFoundDirectoryContents();
}
return PhysicalDirectoryContents(fullPath);
} catch (e) {
return NotFoundDirectoryContents();
}
}