Convert a virtual path to its corresponding path on the host. This method partialy normalizes the virtual path and does not resolve references to parent directories neither virtual symbolic links
(self, virtpath: Union[str, AnyPurePath])
| 222 | return acc_vpath |
| 223 | |
| 224 | def __virtual_to_host_path(self, virtpath: Union[str, AnyPurePath]) -> Path: |
| 225 | """Convert a virtual path to its corresponding path on the host. |
| 226 | |
| 227 | This method partialy normalizes the virtual path and does not resolve |
| 228 | references to parent directories neither virtual symbolic links |
| 229 | """ |
| 230 | |
| 231 | absvpath = self.__virtual_abspath(virtpath) |
| 232 | |
| 233 | # remove path anchor to allow path to be rebased |
| 234 | vpath = absvpath.relative_to(absvpath.anchor) |
| 235 | |
| 236 | # rebase virtual path on top of rootfs to get the host path |
| 237 | return self._rootfs_path / vpath |
| 238 | |
| 239 | def __is_safe_host_path(self, hostpath: Path, strict: bool = False) -> bool: |
| 240 | """Sanitize the specified host path and make sure it does not traverse out |
no test coverage detected