(self, remote_path=root)
| 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 |
no test coverage detected