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
-
MoveDirectory
- 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
sourcePath
stringThe path of source directory. Must exist!
destinationPath
stringThe 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
Exceptions
- IOException
A problem occurred while copying the file.
- UnauthorizedAccessException
Read access to the
sourceFile
or write access to thedestinationFile
is 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.
Exceptions
- OperationCanceledException
The operation was canceled.
- IOException
The task ended with IOError.
- WebException
The task ended with WebError.