| tierno | 5c01261 | 2018-04-19 16:01:59 +0200 | [diff] [blame] | 1 | |
| 2 | from http import HTTPStatus |
| 3 | |
| 4 | __author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>" |
| 5 | |
| 6 | |
| 7 | class FsException(Exception): |
| 8 | def __init__(self, message, http_code=HTTPStatus.INTERNAL_SERVER_ERROR): |
| 9 | self.http_code = http_code |
| 10 | Exception.__init__(self, "storage exception " + message) |
| 11 | |
| 12 | |
| 13 | class FsBase(object): |
| 14 | def __init__(self): |
| 15 | pass |
| 16 | |
| 17 | def get_params(self): |
| 18 | return {} |
| 19 | |
| 20 | def fs_connect(self, config): |
| 21 | pass |
| 22 | |
| 23 | def fs_disconnect(self): |
| 24 | pass |
| 25 | |
| 26 | def mkdir(self, folder): |
| 27 | pass |
| 28 | |
| 29 | def file_exists(self, storage): |
| 30 | pass |
| 31 | |
| 32 | def file_size(self, storage): |
| 33 | pass |
| 34 | |
| 35 | def file_extract(self, tar_object, path): |
| 36 | pass |
| 37 | |
| 38 | def file_open(self, storage, mode): |
| 39 | pass |
| 40 | |
| 41 | def file_delete(self, storage, ignore_non_exist=False): |
| 42 | pass |