Skip to main content
Version: 10.14.x

BuildProcessing.Extensions.DirectoryInfoExtensions Class

Extension methods for DirectoryInfo. More...

Static Public Member Functions

static DirectoryInfo CopyTo (this DirectoryInfo source, string destinationPath, bool recursive=true, bool overwrite=false)
 Copies an existing directory to a new directory, optionally recursive, optionally overwriting. More...
 

Detailed Description

Extension methods for DirectoryInfo.

Member Function Documentation

◆ CopyTo()

static DirectoryInfo BFGSDK.BuildProcessing.Extensions.DirectoryInfoExtensions.CopyTo (this DirectoryInfo source,
string destinationPath,
bool recursive = true,
bool overwrite = false 
)
inlinestatic
Copies an existing directory to a new directory, optionally recursive, optionally overwriting.
Parameters
sourceDirectory to copy.
destinationPathThe desired path of the copied directory.
recursiveWhether the directory is copied recursively. If false, an IOException is thrown if the source directory is not empty.
overwriteWhether files/directories are overwritten if they already exist.
Returns
The new directory copy with a fully qualified path.
Exceptions
ArgumentNullExceptionsource is null.
ArgumentExceptiondestinationPath is invalid.
DirectoryNotFoundExceptionsource does not exist.
IOExceptionCopy is non-recursive and source is not empty.
Extension methods for DirectoryInfo. More...

Static Public Member Functions

static DirectoryInfo CopyTo (this DirectoryInfo source, string destinationPath, bool recursive=true, bool overwrite=false)
 Copies an existing directory to a new directory, optionally recursive, optionally overwriting. More...
 

Detailed Description

Extension methods for DirectoryInfo.

Member Function Documentation

◆ CopyTo()

static DirectoryInfo BFGSDK.BuildProcessing.Extensions.DirectoryInfoExtensions.CopyTo (this DirectoryInfo source,
string destinationPath,
bool recursive = true,
bool overwrite = false 
)
inlinestatic
Copies an existing directory to a new directory, optionally recursive, optionally overwriting.
Parameters
sourceDirectory to copy.
destinationPathThe desired path of the copied directory.
recursiveWhether the directory is copied recursively. If false, an IOException is thrown if the source directory is not empty.
overwriteWhether files/directories are overwritten if they already exist.
Returns
The new directory copy with a fully qualified path.
Exceptions
ArgumentNullExceptionsource is null.
ArgumentExceptiondestinationPath is invalid.
DirectoryNotFoundExceptionsource does not exist.
IOExceptionCopy is non-recursive and source is not empty.