Config2_FolderManager

Provides the APIs for managing folders in CompleteFTP.

Instances of this class are obtained from:

Properties

PropertyTypeDescription
applicationPaths Config2_ApplicationPaths

Application paths object providing CompleteFTP application directory paths.

Methods

MethodReturnsDescription
add() Config2_Folder

Adds a folder of the given type.

get() Config2_Folder

Returns a Config2_Folder object for the given path.

list() Array.<Config2_Folder>

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

listAll() Array.<Config2_Folder>

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

listWindowsDirectory() Array

Returns a listing of the given Windows folder (in the Windows file-system) in the form of an array of objects with name, lastWriteTime, and type properties.

move() void

Moves the given folder to another path.

remove() void

Deletes the given folder.

Property Details

applicationPaths :Config2_ApplicationPaths

Description:
  • Application paths object providing CompleteFTP application directory paths.

Application paths object providing CompleteFTP application directory paths.

Type:

Method Details

add(path, type, mappingPath) → {Config2_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:

  • 'Virtual'
  • 'Windows'
  • 'WindowsSpecial'
  • 'NetworkMacro'
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 or environment variables:
    • %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 Config2_Folder object for the added folder.

Type
Config2_Folder

get(path) → {Config2_Folder|null}

Description:
Parameters:
Name Type Description
path String

Absolute path of the folder in virtual file-system.

Returns:

Folder object or null if not found.

Type
Config2_Folder | null

list() → {Array.<Config2_Folder>}

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

Returns:

Array of root folder objects.

Type
Array.<Config2_Folder>

listAll() → {Array.<Config2_Folder>}

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

Returns:

Array of all folder objects.

Type
Array.<Config2_Folder>

listWindowsDirectory(windowsPath, includeFiles) → {Array}

Description:
  • Returns a listing of the given Windows folder (in the Windows file-system) in the form of an array of objects with name, lastWriteTime, and type properties.

Parameters:
Name Type Description
windowsPath String

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

includeFiles Boolean

If true, files within the folder are also included.

Returns:

Array of objects with name, lastWriteTime, and type properties.

Type
Array

move(folder, parentFolder)

Description:
  • Moves the given folder to another path.

Parameters:
Name Type Description
folder String | Config2_Folder

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

parentFolder String | Config2_Folder

Virtual file-system path or Config2_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, recursive)

Description:
  • Deletes the given folder.

Parameters:
Name Type Description
folder String | Config2_Folder

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

recursive Boolean

If true, the folder will be deleted recursively.