View Source
Class FileSystemExtensions
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public static class FileSystemExtensions
Methods
View Source
CopyFile(IFileSystem, String, String)
Declaration
public static void CopyFile(this IFileSystem fs, string path, string newPath)
Parameters
Type |
Name |
Description |
IFileSystem |
fs |
|
System.String |
path |
|
System.String |
newPath |
|
View Source
GetExtension(IFileSystem, String)
Declaration
public static string GetExtension(this IFileSystem fs, string path)
Parameters
Type |
Name |
Description |
IFileSystem |
fs |
|
System.String |
path |
|
Returns
Type |
Description |
System.String |
|
View Source
GetFileName(IFileSystem, String)
Declaration
public static string GetFileName(this IFileSystem fs, string path)
Parameters
Type |
Name |
Description |
IFileSystem |
fs |
|
System.String |
path |
|
Returns
Type |
Description |
System.String |
|
View Source
OpenReadWithRetry(FileInfo, Int32, Int32)
Attempts to open the file at
filePath
up to
maxRetries
times,
with a thread sleep time of
sleepPerRetryInMilliseconds
between retries.
Declaration
public static FileStream OpenReadWithRetry(this FileInfo file, int maxRetries = 5, int sleepPerRetryInMilliseconds = 50)
Parameters
Type |
Name |
Description |
System.IO.FileInfo |
file |
|
System.Int32 |
maxRetries |
|
System.Int32 |
sleepPerRetryInMilliseconds |
|
Returns
Type |
Description |
System.IO.FileStream |
|
View Source
Unwrap(IFileSystem)
Declaration
public static IFileSystem Unwrap(this IFileSystem filesystem)
Parameters
Returns