C# Class NanoByte.Common.Storage.CopyDirectory

Copies the content of a directory to a new location preserving the original file modification times and relative Unix symlinks.
Inheritance: NanoByte.Common.Tasks.TaskBase
Exibir arquivo Open project: nano-byte/common

Public Methods

Method Description
CopyDirectory ( [ sourcePath, [ destinationPath, bool preserveDirectoryTimestamps = true, bool overwrite = false ) : System

Creates a new directory copy task.

Protected Methods

Method Description
CopyFile ( [ sourceFile, [ destinationFile ) : void

Copies a single file from one location to another. Can be overridden to modify the copying behavior.

CreateSymlink ( [ linkPath, [ linkTarget ) : void

Creates a Unix symbolic link. Can be overridden to modify the symlinking behavior.

Execute ( ) : void

Private Methods

Method Description
CopyDirectories ( IEnumerable sourceDirectories ) : void
CopyDirectoryTimestamps ( IEnumerable sourceDirectories ) : void
CopyFiles ( IEnumerable sourceFiles ) : void
PathInDestination ( FileSystemInfo element ) : string

Method Details

CopyDirectory() public method

Creates a new directory copy task.
public CopyDirectory ( [ sourcePath, [ destinationPath, bool preserveDirectoryTimestamps = true, bool overwrite = false ) : System
sourcePath [ The path of source directory. Must exist!
destinationPath [ The path of the target directory. May exist. Must be empty if is false.
preserveDirectoryTimestamps bool true to preserve the modification times for directories as well; false to preserve only the file modification times.
overwrite bool Overwrite exisiting files and directories at the . This will even replace read-only files!
return System

CopyFile() protected method

Copies a single file from one location to another. Can be overridden to modify the copying behavior.
A problem occurred while copying the file. Read access to the or write access to the is not permitted.
protected CopyFile ( [ sourceFile, [ destinationFile ) : void
sourceFile [
destinationFile [
return void

CreateSymlink() protected method

Creates a Unix symbolic link. Can be overridden to modify the symlinking behavior.
The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights). The underlying Unix subsystem failed to process the request (e.g. because of insufficient rights).
protected CreateSymlink ( [ linkPath, [ linkTarget ) : void
linkPath [ The path of the link to create.
linkTarget [ The path of the existing file or directory to point to (relative to ).
return void

Execute() protected method

protected Execute ( ) : void
return void