Config1_FolderManager

Provides the APIs for managing folders in CompleteFTP. Instances of this class should be obtained using Config1.folders.

Methods

MethodReturnsDescription
add() Config1_Folder

Adds a folder of the given type.

get() Config1_Folder

Returns a Config1_Folder object for the given path.

list() Array.<Config1_Folder>

Returns an array of Config1_Folder objects representing all root folders in the virtual file-system including inbuilt ones.

listAll() Array.<Config1_Folder>

Returns an array of Config1_Folder objects representing all folders in the virtual file-system regardless of their location in the folder-tree including inbuilt ones.

listWindowsDirectory() Array.<Config1_WindowsFile>

Returns a listing of the given Windows folder (in the Windows file-system) in the form of an array of Config1_WindowsFile objects.

move() void

Moves the given folder to another path.

remove() void

Deletes the given folder.

Method Details

add(path, type, mappingPath) → {Config1_Folder}

Description:
  • Adds a folder of the given type.

Parameters:
Name Type Description
path String

Absolute path of the folder in the virtual file-system.

type String

Type of the folder. Currently, the following types are supported:

  • 'VirtualFolder'
  • 'WindowsFolder'
  • 'WindowsSpecialFolder'
  • 'NetworkMacroFolder'
mappingPath String

Controls how the folder is mapped to the underlying file-system.
Notes:

  • This parameter is not required for Virtual folders.
  • For Windows folders and Network/Macro folders, mappingPaths are Windows file-system paths. In addition, Network/Macro folders' mappingPaths may include macros (listed below) or an environment variable.
    • %UserName% - User-name (without domain).
    • %DomainName% - Domain name.
    • %HomeBaseFolder% - Windows path of Home folder (i.e. parent of users' home folders).
    • %ExternalHomeFolder% - [Database users only] Path read from user database.
  • For Windows special folders, valid values should be:
    • 'Home' (User's home folder)
    • 'Personal' (User's My Documents folders)
    • 'DesktopDirectory' (User's Desktop folder)
    • 'MyPictures' (User's Pictures folder)
    • 'MyMusic' (User's My Music folder)
Returns:

A Config1_Folder object for the added folder.

Type
Config1_Folder

get(path) → {Config1_Folder}

Description:
Parameters:
Name Type Description
path String

Absolute path of the folder in virtual file-system.

Returns:
Type
Config1_Folder

list() → {Array.<Config1_Folder>}

Description:
  • Returns an array of Config1_Folder objects representing all root folders in the virtual file-system including inbuilt ones.

Returns:
Type
Array.<Config1_Folder>

listAll() → {Array.<Config1_Folder>}

Description:
  • Returns an array of Config1_Folder objects representing all folders in the virtual file-system regardless of their location in the folder-tree including inbuilt ones.

Returns:
Type
Array.<Config1_Folder>

listWindowsDirectory(path, includeFilesopt) → {Array.<Config1_WindowsFile>}

Description:
  • Returns a listing of the given Windows folder (in the Windows file-system) in the form of an array of Config1_WindowsFile objects.

Parameters:
Name Type Attributes Default Description
path String

Absolute path of the folder in the Windows file-system.

includeFiles Boolean <optional>
false

If true, files within the folder are also included.

Returns:
Type
Array.<Config1_WindowsFile>

move(folder, parentFolder)

Description:
  • Moves the given folder to another path.

Parameters:
Name Type Description
folder String | Config1_Folder

Virtual file-system path or Config1_Folder object of the folder to be moved.

parentFolder String | Config1_Folder

Virtual file-system path or Config1_Folder object of the folder to move it to. Note that to move the folder to root level, this parameter needs to be set to '/'.

remove(folder, recursiveopt)

Description:
  • Deletes the given folder.

Parameters:
Name Type Attributes Default Description
folder String | Config1_Folder

Virtual file-system path or Config1_Folder object of the folder to be deleted.

recursive Boolean <optional>
false

If true, the folder will be deleted recursively.