MCPcopy Create free account
hub / github.com/CloudPolis/webdav-client-python / check

Method check

webdav/client.py:276–303  ·  view source on GitHub ↗
(self, remote_path=root)

Source from the content-addressed store, hash-verified

274 raise NotConnection(self.webdav.hostname)
275
276 def check(self, remote_path=root):
277
278 try:
279 urn = Urn(remote_path)
280 response = BytesIO()
281
282 url = {'hostname': self.webdav.hostname, 'root': self.webdav.root, 'path': urn.quote()}
283 options = {
284 'URL': "{hostname}{root}{path}".format(**url),
285 'CUSTOMREQUEST': Client.requests['check'],
286 'HTTPHEADER': self.get_header('check'),
287 'WRITEDATA': response,
288 'NOBODY': 1
289 }
290
291 request = self.Request(options=options)
292
293 request.perform()
294 code = request.getinfo(pycurl.HTTP_CODE)
295 request.close()
296
297 if int(code) == 200:
298 return True
299
300 return False
301
302 except pycurl.error:
303 raise NotConnection(self.webdav.hostname)
304
305 def mkdir(self, remote_path):
306

Callers 15

listMethod · 0.95
mkdirMethod · 0.95
download_toMethod · 0.95
download_fileMethod · 0.95
upload_fromMethod · 0.95
upload_directoryMethod · 0.95
upload_fileMethod · 0.95
copyMethod · 0.95
moveMethod · 0.95
publishMethod · 0.95
unpublishMethod · 0.95
infoMethod · 0.95

Calls 5

quoteMethod · 0.95
get_headerMethod · 0.95
RequestMethod · 0.95
UrnClass · 0.90
NotConnectionClass · 0.85

Tested by

no test coverage detected