joinPath static method

Uri joinPath(
  1. Uri base, [
  2. Iterable? pathSegments
])

Create a new uri which path is the result of joining the path of the base uri with the provided path segments.

  • Note 1: joinPath only affects the path component and all other components (scheme, authority, query, and fragment) are left as they are.
  • Note 2: The base uri must have a path; an error is thrown otherwise.

The path segments are normalized in the following ways:

  • sequences of path separators (/ or \) are replaced with a single separator
  • for file-uris on windows, the backslash-character (\) is considered a path-separator
  • the ..-segment denotes the parent segment, the . denotes the current segment
  • paths have a root which always remains, for instance on windows drive-letters are roots so that is true: joinPath(Uri.file('file:///c:/root'), '../../other').fsPath === 'c:/other'

Implementation

static _i3.Uri joinPath(
  _i3.Uri base, [
  _i2.Iterable<_i2.dynamic>? pathSegments,
]) =>
    _i5.callMethod(
      _declaredUri,
      'joinPath',
      [
        base,
        ...?pathSegments,
      ],
    );