parent property

  1. @override
Directory get parent
override

The parent directory of this entity.

Implementation

@override
Directory get parent {
	final segments = uri.pathSegments;
	if (segments.isEmpty || (segments.first == '' && segments.length == 1)) {
		throw FileSystemException('Cannot get parent of root directory');
	}
	return Directory(segments.take(segments.length - 1).join('/'));
}