def _extract_metadata_for_file(
        self, item: Dict[str, Any], access_token: Optional[str] = None
    ) -> Dict[str, str]:
        """
        Extracts metadata related to the file.

        Parameters
        ----------
        - item (Dict[str, str]): Dictionary containing file metadata.

        Returns
        -------
        - Dict[str, str]: A dictionary containing the extracted metadata.

        """
        # Extract the required metadata for file.
        created_by = item.get("createdBy", {})
        modified_by = item.get("lastModifiedBy", {})
        parent_dir = item.get("parentReference", {}).get("path")
        file_name = item.get("name")
        file_path = file_name
        if parent_dir and file_name:
            file_path = os.path.join(parent_dir, file_name)
            file_path = file_path.replace("/drive/root:", "")

        permission = {}

        if self.attach_permission_metadata:
            permission = self._get_permissions_info(
                item, self.userprincipalname, access_token
            )

        return {
            "file_id": item.get("id"),
            "file_name": file_name,
            "file_size": item.get("size"),
            "file_path": file_path,
            "created_by_user": created_by.get("user", {}).get("displayName"),
            "created_by_app": created_by.get("application", {}).get("displayName"),
            "created_dateTime": item.get("createdDateTime"),
            "last_modified_by_user": modified_by.get("user", {}).get("displayName"),
            "last_modified_by_app": modified_by.get("application", {}).get(
                "displayName"
            ),
            "last_modified_datetime": item.get("lastModifiedDateTime"),
            **permission,
        }

        Extracts metadata related to the file.

        Parameters
        ----------
        - item (Dict[str, str]): Dictionary containing file metadata.

        Returns
        -------
        - Dict[str, str]: A dictionary containing the extracted metadata.

        
llama-index-integrations/readers/llama-index-readers-microsoft-onedrive/llama_index/readers/microsoft_onedrive/base.py