diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs b/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs index d633c823..26184462 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IFileSystem.cs | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Extensibility.Services | 3 | namespace WixToolset.Extensibility.Services |
| 4 | { | 4 | { |
| 5 | using System; | ||
| 6 | |||
| 5 | /// <summary> | 7 | /// <summary> |
| 6 | /// Abstracts basic file system operations. | 8 | /// Abstracts basic file system operations. |
| 7 | /// </summary> | 9 | /// </summary> |
| @@ -16,10 +18,27 @@ namespace WixToolset.Extensibility.Services | |||
| 16 | void CopyFile(string source, string destination, bool allowHardlink); | 18 | void CopyFile(string source, string destination, bool allowHardlink); |
| 17 | 19 | ||
| 18 | /// <summary> | 20 | /// <summary> |
| 21 | /// Deletes a file. | ||
| 22 | /// </summary> | ||
| 23 | /// <param name="source">The file to delete.</param> | ||
| 24 | /// <param name="throwOnError">Indicates the file must be deleted. Default is a best effort delete.</param> | ||
| 25 | /// <param name="maxRetries">Maximum retry attempts. Default is 4.</param> | ||
| 26 | void DeleteFile(string source, bool throwOnError = false, int maxRetries = 4); | ||
| 27 | |||
| 28 | /// <summary> | ||
| 19 | /// Moves a file. | 29 | /// Moves a file. |
| 20 | /// </summary> | 30 | /// </summary> |
| 21 | /// <param name="source">The file to move.</param> | 31 | /// <param name="source">The file to move.</param> |
| 22 | /// <param name="destination">The destination file.</param> | 32 | /// <param name="destination">The destination file.</param> |
| 23 | void MoveFile(string source, string destination); | 33 | void MoveFile(string source, string destination); |
| 34 | |||
| 35 | /// <summary> | ||
| 36 | /// Executes an action and retries on any exception a few times with short pause | ||
| 37 | /// between each attempt. Primarily intended for use with file system operations | ||
| 38 | /// that might get interrupted by external systems (usually anti-virus). | ||
| 39 | /// </summary> | ||
| 40 | /// <param name="action">Action to execute.</param> | ||
| 41 | /// <param name="maxRetries">Maximum retry attempts. Default is 4.</param> | ||
| 42 | void ExecuteWithRetries(Action action, int maxRetries = 4); | ||
| 24 | } | 43 | } |
| 25 | } | 44 | } |
