def thumbnail(self, path, width, height): params = dict(root=self.session.root, path=to_str(path), width=to_str(width), height=to_str(height)) url = self.session.build_url(self.session.CONV_HOST, "/1/fileops/thumbnail", params=params) ret = http_client.ConverFile(url) return ret
def document_view(self, path, view, type, zip=0): params = dict(root=self.session.root, path=to_str(path), view=view, type=type, zip=to_str(zip)) url = self.session.build_url(self.session.CONV_HOST, "/1/fileops/documentView", params=params) ret = http_client.ConverFile(url) return ret
def upload_file(self, path, data, overwrite): if not self.host: self.host = self.get_upload_locate() overwrite = "True" if overwrite else "False" params = dict(root = self.session.root, path = to_str(path), overwrite = overwrite) url = self.session.build_url(self.host, "1/fileops/upload_file", params = params, http_method = "POST") ret = http_client.MultiPartPost(url, data, "kfile") return ret
def upload_file(self, path, data, overwrite): if not self.host: self.host = self.get_upload_locate() overwrite = "True" if overwrite else "False" params = dict(root=self.session.root, path=to_str(path), overwrite=overwrite) url = self.session.build_url(self.host, "1/fileops/upload_file", params=params, http_method="POST") ret = http_client.MultiPartPost(url, data, "kfile") return ret
def document_view(self, path, view, type, zip = 0): params = dict(root = self.session.root, path = to_str(path), view = view, type = type, zip = to_str(zip)) url = self.session.build_url(self.session.CONV_HOST, "/1/fileops/documentView", params = params) ret = http_client.ConverFile(url) return ret
def thumbnail(self, path, width, height): params = dict(root = self.session.root, path = to_str(path), width = to_str(width), height = to_str(height)) url = self.session.build_url(self.session.CONV_HOST, "/1/fileops/thumbnail", params = params) ret = http_client.ConverFile(url) return ret
def download_file(self, path): params = dict(root = self.session.root, path = to_str(path)) url = self.session.build_url(self.session.CONTENT_HOST, "/1/fileops/download_file", params = params) return http_client.DownloadFile(url)
def copy(self, from_path, to_path): params = dict(root = self.session.root, from_path = to_str(from_path), to_path = to_str(to_path)) return self.request("/1/fileops/copy", params)
def delete(self, path, to_recycle=True): params = dict(root = self.session.root, path = to_str(path), to_recycle = to_str(to_recycle)) return self.request("/1/fileops/delete", params)
def create_folder(self, path): params = dict(root = self.session.root, path = to_str(path)) return self.request("/1/fileops/create_folder", params)
def copy(self, from_path, to_path): params = dict(root=self.session.root, from_path=to_str(from_path), to_path=to_str(to_path)) return self.request("/1/fileops/copy", params)
def delete(self, path, to_recycle=True): params = dict(root=self.session.root, path=to_str(path), to_recycle=to_str(to_recycle)) return self.request("/1/fileops/delete", params)
def create_folder(self, path): params = dict(root=self.session.root, path=to_str(path)) return self.request("/1/fileops/create_folder", params)
def download_file(self, path): params = dict(root=self.session.root, path=to_str(path)) url = self.session.build_url(self.session.CONTENT_HOST, "/1/fileops/download_file", params=params) return http_client.DownloadFile(url)
def delete(self, path): params = dict(root=self.session.root, path=to_str(path)) return self.request("/1/fileops/delete", params)
def delete(self, path): params = dict(root = self.session.root, path = to_str(path)) return self.request("/1/fileops/delete", params)