Directory Methods

allContents

Get an array listing of all files and directories in a directory using recursion.

/**
 * @directory The directory
 * @filter    A string wildcard or a lambda/closure that receives the file path and should return true to include it in the returned array or not.
 * @sort      Columns by which to sort. e.g. Directory, Size DESC, DateLastModified.
 * @type      Filter the result to only include files, directories, or both. ('file|files', 'dir|directory', 'all'). Default is 'all'
 * @absolute  Local provider only: We return relative disk paths by default. If true, we return absolute paths
 *
 * @throws cbfs.DirectoryNotFoundException
 */
array function allContents(
	required directory,
	any filter,
	sort,
	type             = "all",
	boolean absolute = false
);

allContentsMap

Get an array of content from all the files from a specific directory with recursion.

allDirectories

Get an array of all directories in a directory using recursion.

allFiles

Get an array of all files in a directory using recursion. This is a shortcut to files() with a recursion argument.

allFilesMap

Get an array of structs of all recursive files in a directory and their appropriate information map: attributes, dateLastModified, directory, link, name, size, etc.

buildDiskPath

Builds the path on the provided disk from its root + incoming path with normalization, cleanup, and canonicalization.

cleanDirectory

Empty the specified directory of all files and folders.

contents

Get an array listing of all files and directories in a directory.

contentsMap

Get an array of content from all the files from a specific directory.

copyDirectory

Copies a directory to a destination. The 'filter' argument can be a closure and lambda with the format function(path ).

createDirectory

Create a new directory.

deleteDirectory

Delete one or more directory locations.

directories

Get an array of all directories in a directory.

directoryExists

Validates that a directory does exists.

directoryMissing

Validates that a directory does not exists.

files

Get an array of all files in a directory.

filesMap

Get an array of structs of all files in a directory and their appropriate information map: attributes, dateLastModified, directory, link, name, size, etc.

isDirectory

Returns a boolean determining if a path is a directory or not.

moveDirectory

Move or rename a directory.

Last updated

Was this helpful?