Class MoveDirectory
Moves the content of a directory to a new location preserving file timestamps, symlinks and hard links.
public class MoveDirectory : CopyDirectory, ITask
- Inheritance
-
objectMarshalByRefObjectMoveDirectory
- Implements
- Inherited Members
- Extension Methods
Constructors
MoveDirectory(string, string)
Moves the content of a directory to a new location preserving file timestamps, symlinks and hard links.
public MoveDirectory(string sourcePath, string destinationPath)
Parameters
sourcePathstringThe path of source directory. Must exist!
destinationPathstringThe path of the target directory. May exist.
Methods
CopyFile(FileInfo, FileInfo)
Copies a single file from one location to another. Can be overridden to modify the copying behavior.
protected override void CopyFile(FileInfo sourceFile, FileInfo destinationFile)
Parameters
sourceFileFileInfodestinationFileFileInfo
Exceptions
- IOException
A problem occurred while copying the file.
- UnauthorizedAccessException
Read access to the
sourceFileor write access to thedestinationFileis not permitted.
Execute()
The actual code to be executed.
protected override void Execute()
Remarks
State is automatically set to Started before calling this method, to Complete after a successful exit and to an appropriate error state in case on an exception. You can set additional TaskStates during execution.