unsandbox method

Directory unsandbox({
  1. String? path,
})

Unsandbox a file system, returning the root directory of the sandbox. return currentDirectory if not sandboxed.

Implementation

Directory unsandbox({String? path}) {
  if (this is FsShimSandboxedFileSystem) {
    /// Handle absolute file
    if (path != null && path.startsWith(this.path.separator)) {
      path = path.substring(1);
    }
    return (this as FsShimSandboxedFileSystem).rootDirectory.directoryWith(
      path: path,
    );
  } else {
    return currentDirectory.directoryWith(path: path);
  }
}