File Browser

Obtaining Access to the Gateway’s File System

filer = Gateway('vGateway-0dbc')

filer.login('USERNAME', 'PASSWORD')

file_browser = filer.files # the field is an instance of FileBrowser class object

List

static FileBrowser.ls(_path)

Download

FileBrowser.download(path, destination=None)

Download a file

Parameters:
  • path (str) – The file’s path on the gateway
  • destination (str,optional) – File destination, if it is a directory, the original filename will be kept, defaults to the default directory
file_browser.download('cloud/users/Service Account/My Files/Documents/Sample.docx')

Create Directory

FileBrowser.mkdir(path, recurse=False)

Create a new directory

Parameters:
  • path (str) – The path of the new directory
  • recurse (bool,optional) – Create subdirectories if missing, defaults to False
file_browser.mkdir('cloud/users/Service Account/My Files/Documents')

file_browser.mkdir('cloud/users/Service Account/My Files/The/quick/brown/fox', recurse = True)

Delete

FileBrowser.delete(path)

Delete a file

Parameters:path (str) – The file’s path on the gateway
file_browser.delete('cloud/users/Service Account/My Files/Documents')