cterasdk.edge.files.browser module#

class cterasdk.edge.files.browser.FileBrowser(edge)#

Bases: BaseCommand

Edge Filer File Browser APIs

copy(path, destination=None, overwrite=False)#

Copy a file or a folder

Parameters:
  • path (str) – Source file or folder path

  • destination (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

delete(path)#

Delete a file

Parameters:

path (str) – File path

download(path, destination=None)#

Download a file

Parameters:
  • path (str) – The file path on the Edge Filer

  • destination (str,optional) – File destination, if it is a directory, the original filename will be kept, defaults to the default directory

download_many(target, objects, destination=None)#

Download selected files and/or directories as a ZIP archive.

Warning

The provided list of objects is not validated. Only existing files and directories will be included in the resulting ZIP file.

Parameters:
  • target (str) – Path to the cloud folder containing the files and directories to download.

  • objects (list[str]) – List of file and/or directory names to include in the download.

  • destination (str) – Optional. Path to the destination file or directory. If a directory is provided, the original filename will be preserved. Defaults to the default download directory.

handle(path)#

Get File Handle.

Parameters:

path (str) – Path to a file

handle_many(directory, *objects)#

Get a Zip Archive File Handle.

Parameters:
  • directory (str) – Path to a folder

  • objects (args) – List of files and folders

listdir(path)#

List Directory

Parameters:

path (str) – Path

makedirs(path)#

Create a directory recursively

Parameters:

path (str) – Directory path

mkdir(path)#

Create a new directory

Parameters:

path (str) – Directory path

move(path, destination=None, overwrite=False)#

Move a file or a folder

Parameters:
  • path (str) – Source file or folder path

  • destination (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

static normalize(path)#
upload(name, destination, handle)#

Upload from file handle.

Parameters:
  • name (str) – File name.

  • destination (str) – Path to remote directory.

  • handle (object) – Handle.

upload_file(path, destination)#

Upload a file.

Parameters:
  • path (str) – Local path

  • destination (str) – Remote path