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 |
|
CreateForWrite(String)
Declaration
Stream CreateForWrite(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
DirectoryExists(String)
Declaration
bool DirectoryExists(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
DirectoryGetFileInfos(String)
Declaration
SoFileInfo[] DirectoryGetFileInfos(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
DirectoryGetFiles(String, String, Boolean)
Declaration
string[] DirectoryGetFiles(string path, string searchPattern, bool searchInSubdirectories = false)
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<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
FileDelete(String)
Declaration
void FileDelete(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
FileExists(String)
Declaration
bool FileExists(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
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
OpenReadOnlyNoLock(String)
Open a file/blob for reading
Declaration
Stream OpenReadOnlyNoLock(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
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(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
SaveStreamToFile(Stream, String)
Save a stream to file/blob
Declaration
void SaveStreamToFile(Stream stream, string path)
Parameters
Extension Methods
EnumUtil.MapEnums<From, To>(From)