MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / _get_file_url

Method _get_file_url

core/storage.py:655–666  ·  view source on GitHub ↗
(self, save_path, name)

Source from the content-addressed store, hash-verified

653 return f"https://{p1}.sharepoint.com/personal/{p2}/_layouts/52/download.aspx?share={p3}"
654
655 def _get_file_url(self, save_path, name):
656 path = self._get_path_str(save_path)
657 remote_file = self.root_path.get_by_path(path + "/" + name)
658 expiration_datetime = datetime.datetime.now(
659 tz=datetime.timezone.utc
660 ) + datetime.timedelta(hours=1)
661 expiration_datetime = expiration_datetime.strftime(
662 "%Y-%m-%dT%H:%M:%SZ")
663 permission = remote_file.create_link(
664 "view", "anonymous", expiration_datetime=expiration_datetime
665 ).execute_query()
666 return self._convert_link_to_download_link(permission.link.webUrl)
667
668 async def get_file_response(self, file_code: FileCodes):
669 try:

Callers

nothing calls this directly

Calls 2

_get_path_strMethod · 0.95

Tested by

no test coverage detected