PathUtil class

An utility class for file path operations.

Methods

getDirectories(string)

Get sub folders in a directory

getFiles(string, boolean)

Get files in a directory

isDirectory(string)

Check if a path is a directory

Method Details

getDirectories(string)

Get sub folders in a directory

static function getDirectories(path: string): string[]

Parameters

path

string

Path of root directory.

Returns

string[]

Sub folders in the directory.

getFiles(string, boolean)

Get files in a directory

static function getFiles(path: string, includeSubFolders?: boolean): string[]

Parameters

path

string

Path of root directory.

includeSubFolders

boolean

Whether include its sub folders.

Returns

string[]

The files in the directory.

isDirectory(string)

Check if a path is a directory

static function isDirectory(path: string): boolean

Parameters

path

string

Path of the directory.

Returns

boolean

True if the path is a directory; false otherwise.