MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / get_file

Method get_file

server/projects/analysis/util/fileserver.py:114–124  ·  view source on GitHub ↗

获取指定路径文件数据,返回该文件的路径信息

(self, file_url)

Source from the content-addressed store, hash-verified

112
113 @RetryDecor()
114 def get_file(self, file_url):
115 """获取指定路径文件数据,返回该文件的路径信息"""
116 try:
117 rsp = self._http_client.get(file_url, headers=self.get_auth_headers())
118 except Exception as err:
119 raise ServerError(errcode.E_SERVER_FILE_SERVICE_ERROR, ' get file exception: %s' % err)
120 if rsp.status == self.OK_STATUS:
121 return rsp.data
122 else:
123 raise ServerError(errcode.E_SERVER_FILE_SERVICE_ERROR,
124 'return code %d when get file %s' % (rsp.status, file_url))
125
126 def delete_file(self, file_url):
127 """删除指定路径文件"""

Callers 2

get_fileFunction · 0.45
get_fileFunction · 0.45

Calls 3

get_auth_headersMethod · 0.95
ServerErrorClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected