FileSystemVirtualFiles
Assembly: ServiceStack.Common.dll
View Source
Declaration
public class FileSystemVirtualFiles : AbstractVirtualPathProviderBase, IVirtualFiles, IVirtualPathProvider
Properties
RootDirInfo
View Source
Declaration
public DirectoryInfo RootDirInfo { get; protected set; }
RootDirectory
View Source
Declaration
public override IVirtualDirectory RootDirectory { get; }
VirtualPathSeparator
View Source
Declaration
public override string VirtualPathSeparator { get; }
RealPathSeparator
View Source
Declaration
public override string RealPathSeparator { get; }
Inherited Properties
RealPathSeparator
View Source
Declaration
public abstract string RealPathSeparator { get; }
RootDirectory
View Source
Declaration
public abstract IVirtualDirectory RootDirectory { get; }
VirtualPathSeparator
View Source
Declaration
public abstract string VirtualPathSeparator { get; }
Fields
RootDir
View Source
Declaration
protected FileSystemVirtualDirectory RootDir
Methods
Initialize()
View Source
Declaration
protected sealed override void Initialize()
DirectoryExists(String)
View Source
Declaration
public override bool DirectoryExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | virtualPath |
FileExists(String)
View Source
Declaration
public override bool FileExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | virtualPath |
EnsureDirectory(String)
View Source
Declaration
public string EnsureDirectory(string dirPath)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | dirPath |
WriteFile(String, String)
View Source
Declaration
public void WriteFile(string filePath, string textContents)
Parameters
Type | Name |
---|---|
System.String | filePath |
System.String | textContents |
WriteFile(String, Stream)
View Source
Declaration
public void WriteFile(string filePath, Stream stream)
Parameters
Type | Name |
---|---|
System.String | filePath |
System.IO.Stream | stream |
WriteFileAsync(String, Object, CancellationToken)
View Source
Declaration
public override async Task WriteFileAsync(string filePath, object contents, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | filePath |
System.Object | contents |
System.Threading.CancellationToken | token |
WriteFiles(IEnumerable<IVirtualFile>, Func<IVirtualFile, String>)
View Source
Declaration
public void WriteFiles(IEnumerable<IVirtualFile> files, Func<IVirtualFile, string> toPath = null)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile> | files |
System.Func<ServiceStack.IO.IVirtualFile,System.String> | toPath |
AppendFile(String, String)
View Source
Declaration
public void AppendFile(string filePath, string textContents)
Parameters
Type | Name |
---|---|
System.String | filePath |
System.String | textContents |
AppendFile(String, Stream)
View Source
Declaration
public void AppendFile(string filePath, Stream stream)
Parameters
Type | Name |
---|---|
System.String | filePath |
System.IO.Stream | stream |
DeleteFile(String)
View Source
Declaration
public void DeleteFile(string filePath)
Parameters
Type | Name |
---|---|
System.String | filePath |
DeleteFiles(IEnumerable<String>)
View Source
Declaration
public void DeleteFiles(IEnumerable<string> filePaths)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.String> | filePaths |
DeleteFolder(String)
View Source
Declaration
public void DeleteFolder(string dirPath)
Parameters
Type | Name |
---|---|
System.String | dirPath |
DeleteDirectoryRecursive(String)
View Source
Declaration
public static void DeleteDirectoryRecursive(string path)
Parameters
Type | Name |
---|---|
System.String | path |
AssertDirectory(String, Int32)
View Source
Declaration
public static string AssertDirectory(string dirPath, int timeoutMs = 1000)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | dirPath |
System.Int32 | timeoutMs |
RecreateDirectory(String, Int32)
View Source
Declaration
public static void RecreateDirectory(string dirPath, int timeoutMs = 1000)
Parameters
Type | Name |
---|---|
System.String | dirPath |
System.Int32 | timeoutMs |
Inherited Methods
AppendFile(String, ReadOnlyMemory<Byte>)
View Source
Declaration
public virtual void AppendFile(string path, ReadOnlyMemory<byte> bytes)
Parameters
Type | Name |
---|---|
System.String | path |
ReadOnlyMemory<System.Byte> | bytes |
AppendFile(String, ReadOnlyMemory<Char>)
View Source
Declaration
public virtual void AppendFile(string path, ReadOnlyMemory<char> text)
Parameters
Type | Name |
---|---|
System.String | path |
ReadOnlyMemory<System.Char> | text |
AppendFile(String, Object)
View Source
Declaration
public virtual void AppendFile(string path, object contents)
Parameters
Type | Name |
---|---|
System.String | path |
System.Object | contents |
AssertVirtualFiles()
View Source
Declaration
protected IVirtualFiles AssertVirtualFiles()
Returns
CombineVirtualPath(String, String)
View Source
Declaration
public virtual string CombineVirtualPath(string basePath, string relativePath)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | basePath |
System.String | relativePath |
CreateContentNotSupportedException(Object)
View Source
Declaration
protected NotSupportedException CreateContentNotSupportedException(object value)
Returns
System.NotSupportedException
Parameters
Type | Name |
---|---|
System.Object | value |
DirectoryExists(String)
View Source
Declaration
public virtual bool DirectoryExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | virtualPath |
FileExists(String)
View Source
Declaration
public virtual bool FileExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | virtualPath |
GetAllFiles()
View Source
Declaration
public virtual IEnumerable<IVirtualFile> GetAllFiles()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile>
GetAllMatchingFiles(String, Int32)
View Source
Declaration
public virtual IEnumerable<IVirtualFile> GetAllMatchingFiles(string globPattern, int maxDepth = 2147483647)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile>
Parameters
Type | Name |
---|---|
System.String | globPattern |
System.Int32 | maxDepth |
GetDirectory(String)
View Source
Declaration
public virtual IVirtualDirectory GetDirectory(string virtualPath)
Returns
ServiceStack.IO.IVirtualDirectory
Parameters
Type | Name |
---|---|
System.String | virtualPath |
GetFile(String)
View Source
Declaration
public virtual IVirtualFile GetFile(string virtualPath)
Returns
Parameters
Type | Name |
---|---|
System.String | virtualPath |
GetFileHash(IVirtualFile)
View Source
Declaration
public virtual string GetFileHash(IVirtualFile virtualFile)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.IO.IVirtualFile | virtualFile |
GetFileHash(String)
View Source
Declaration
public virtual string GetFileHash(string virtualPath)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | virtualPath |
GetRootDirectories()
View Source
Declaration
public virtual IEnumerable<IVirtualDirectory> GetRootDirectories()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualDirectory>
GetRootFiles()
View Source
Declaration
public virtual IEnumerable<IVirtualFile> GetRootFiles()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile>
Initialize()
View Source
Declaration
protected abstract void Initialize()
IsSharedFile(IVirtualFile)
View Source
Declaration
public virtual bool IsSharedFile(IVirtualFile virtualFile)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IO.IVirtualFile | virtualFile |
IsViewFile(IVirtualFile)
View Source
Declaration
public virtual bool IsViewFile(IVirtualFile virtualFile)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.IO.IVirtualFile | virtualFile |
SanitizePath(String)
View Source
Declaration
public virtual string SanitizePath(string filePath)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | filePath |
ToString()
View Source
Declaration
public override string ToString()
Returns
System.String
WriteFile(String, ReadOnlyMemory<Byte>)
View Source
Declaration
public virtual void WriteFile(string path, ReadOnlyMemory<byte> bytes)
Parameters
Type | Name |
---|---|
System.String | path |
ReadOnlyMemory<System.Byte> | bytes |
WriteFile(String, ReadOnlyMemory<Char>)
View Source
Declaration
public virtual void WriteFile(string path, ReadOnlyMemory<char> text)
Parameters
Type | Name |
---|---|
System.String | path |
ReadOnlyMemory<System.Char> | text |
WriteFile(String, Object)
View Source
Declaration
public virtual void WriteFile(string path, object contents)
Parameters
Type | Name |
---|---|
System.String | path |
System.Object | contents |
WriteFileAsync(String, Object, CancellationToken)
View Source
Declaration
public virtual Task WriteFileAsync(string path, object contents, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | path |
System.Object | contents |
System.Threading.CancellationToken | token |
WriteFiles(Dictionary<String, Object>)
View Source
Declaration
public virtual void WriteFiles(Dictionary<string, object> files)
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.Object> | files |
WriteFiles(Dictionary<String, String>)
View Source
Declaration
public virtual void WriteFiles(Dictionary<string, string> textFiles)
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.String> | textFiles |