Interface IFileAccess
Assembly: SoCore.dll
Syntax
public interface IFileAccess
Properties
ArchivePath
Declaration
string ArchivePath { get; }
Property Value
TemplatesPath
Declaration
string TemplatesPath { get; }
Property Value
TemporaryPath
Declaration
string TemporaryPath { get; }
Property Value
Methods
CreateDirectoryIfNotExists(string)
Declaration
void CreateDirectoryIfNotExists(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
CreateForWriteAsync(string, CancellationToken)
Declaration
Task<Stream> CreateForWriteAsync(string path, CancellationToken cancellationToken = default)
Parameters
Returns
DirectoryExists(string)
Declaration
bool DirectoryExists(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
DirectoryGetFileInfosAsync(string, CancellationToken)
Declaration
Task<SoFileInfo[]> DirectoryGetFileInfosAsync(string path, CancellationToken cancellationToken = default)
Parameters
Returns
DirectoryGetFilesAsync(string, string, bool, CancellationToken)
Declaration
Task<string[]> DirectoryGetFilesAsync(string path, string searchPattern, bool searchInSubdirectories = false, CancellationToken cancellationToken = default)
Parameters
Returns
EnsureAccess(Action)
Impersonation for Windows Disk File Access. For Azure File Access this is a noop.
Declaration
void EnsureAccess(Action action)
Parameters
| Type |
Name |
Description |
| Action |
action |
|
EnsureAccess(Func<Task>)
Impersonation for Windows Disk File Access. For Azure File Access this is a noop.
Declaration
Task EnsureAccess(Func<Task> func)
Parameters
Returns
EnsureAccess<T>(Func<T>)
Impersonation for Windows Disk File Access. For Azure File Access this is a noop.
Declaration
T EnsureAccess<T>(Func<T> func)
Parameters
| Type |
Name |
Description |
| Func<T> |
func |
|
Returns
Type Parameters
FileDeleteAsync(string, CancellationToken)
Declaration
Task FileDeleteAsync(string path, CancellationToken cancellationToken = default)
Parameters
Returns
FileExistsAsync(string, CancellationToken)
Declaration
Task<bool> FileExistsAsync(string path, CancellationToken cancellationToken = default)
Parameters
Returns
GetDirectoryName(string)
Declaration
string GetDirectoryName(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
GetFileName(string)
Declaration
string GetFileName(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
GetFileNameWithoutExtension(string)
Declaration
string GetFileNameWithoutExtension(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
OpenReadOnlyNoLockAsync(string, CancellationToken)
Open a file/blob for reading
Declaration
Task<Stream> OpenReadOnlyNoLockAsync(string path, CancellationToken cancellationToken = default)
Parameters
Returns
Exceptions
| Type |
Condition |
| SoFileNotFoundException |
Wraps System.IO.FileNotFoundException and Azure.RequestFailedException when Status is 404. Check for SoFileNotFoundException instead of doing FileExists before call to this method.
|
PathCombine(params string[])
Declaration
string PathCombine(params string[] paths)
Parameters
| Type |
Name |
Description |
| string[] |
paths |
|
Returns
PathGetExtension(string)
Declaration
string PathGetExtension(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
PathGetFileName(string)
Declaration
string PathGetFileName(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
PathGetInvalidFileNameChars()
Declaration
char[] PathGetInvalidFileNameChars()
Returns
SaveStreamToFileAsync(Stream, string, CancellationToken)
Save a stream to file/blob
Declaration
Task SaveStreamToFileAsync(Stream stream, string path, CancellationToken cancellationToken = default)
Parameters
Returns
Extension Methods