def METHOD_NAME(self, filepath: pathlib.Path) -> pathlib.Path:
    """Extract the charm content to a temp directory."""
    tmpdir = pathlib.Path(tempfile.mkdtemp())
    try:
        zf = zipfile.ZipFile(str(filepath))
        zf.extractall(path=str(tmpdir))
    except Exception as exc:
        raise CraftError(f"Cannot open charm file {str(filepath)!r}: {exc!r}.")
    # fix permissions as extractall does not keep them (see https://bugs.python.org/issue15795)
    for name in zf.namelist():
        info = zf.getinfo(name)
        inside_zip_mode = info.external_attr >> 16
        extracted_file = tmpdir / name
        current_mode = extracted_file.stat().st_mode
        if current_mode != inside_zip_mode:
            extracted_file.chmod(inside_zip_mode)
    return tmpdir