GistVirtualFiles
Assembly: ServiceStack.Common.dll
Declaration
public class GistVirtualFiles : AbstractVirtualPathProviderBase, IVirtualFiles, IVirtualPathProvider
Properties
Gateway
Declaration
public IGistGateway Gateway { get; }
GistId
Declaration
public string GistId { get; }
LastRefresh
Declaration
public DateTime LastRefresh { get; }
RefreshAfter
Declaration
public TimeSpan RefreshAfter { get; set; }
RootDirectory
Declaration
public override IVirtualDirectory RootDirectory { get; }
VirtualPathSeparator
Declaration
public override string VirtualPathSeparator { get; }
RealPathSeparator
Declaration
public override string RealPathSeparator { get; }
Inherited Properties
RealPathSeparator
Declaration
public abstract string RealPathSeparator { get; }
RootDirectory
Declaration
public abstract IVirtualDirectory RootDirectory { get; }
VirtualPathSeparator
Declaration
public abstract string VirtualPathSeparator { get; }
Fields
DirSep
Declaration
public const char DirSep = '\\'
Base64Modifier
Declaration
public const string Base64Modifier = "|base64"
Methods
Initialize()
Declaration
protected override void Initialize()
IsDirSep(Char)
Declaration
public static bool IsDirSep(char c)
Returns
System.Boolean
Parameters
GetGistTextContents(String, Gist, out String)
Declaration
public static bool GetGistTextContents(string filePath, Gist gist, out string text)
Returns
System.Boolean
Parameters
GetGistContents(String, Gist, out String, out MemoryStream)
Declaration
public static bool GetGistContents(string filePath, Gist gist, out string text, out MemoryStream stream)
Returns
System.Boolean
Parameters
Type | Name |
---|
System.String | filePath |
ServiceStack.Gist | gist |
System.String | text |
System.IO.MemoryStream | stream |
GetGist(Boolean)
Declaration
public Gist GetGist(bool refresh = false)
Returns
ServiceStack.Gist
Parameters
Type | Name |
---|
System.Boolean | refresh |
GetGistAsync(Boolean)
Declaration
public async Task<Gist> GetGistAsync(bool refresh = false)
Returns
System.Threading.Tasks.Task<ServiceStack.Gist>
Parameters
Type | Name |
---|
System.Boolean | refresh |
LoadAllTruncatedFilesAsync()
Declaration
public async Task LoadAllTruncatedFilesAsync()
Returns
System.Threading.Tasks.Task
ClearGist()
GetFile(String)
Declaration
public override IVirtualFile GetFile(string virtualPath)
Returns
ServiceStack.IO.IVirtualFile
Parameters
Type | Name |
---|
System.String | virtualPath |
GetDirectory(String)
Declaration
public override IVirtualDirectory GetDirectory(string virtualPath)
Returns
ServiceStack.IO.IVirtualDirectory
Parameters
Type | Name |
---|
System.String | virtualPath |
DirectoryExists(String)
Declaration
public override bool DirectoryExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|
System.String | virtualPath |
FileExists(String)
Declaration
public override bool FileExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|
System.String | virtualPath |
WriteFiles(Dictionary<String, String>)
Declaration
public override void WriteFiles(Dictionary<string, string> textFiles)
Parameters
Type | Name |
---|
System.Collections.Generic.Dictionary<System.String,System.String> | textFiles |
WriteFiles(Dictionary<String, Object>)
Declaration
public override void WriteFiles(Dictionary<string, object> files)
Parameters
Type | Name |
---|
System.Collections.Generic.Dictionary<System.String,System.Object> | files |
WriteFile(String, String)
Declaration
public void WriteFile(string virtualPath, string contents)
Parameters
Type | Name |
---|
System.String | virtualPath |
System.String | contents |
WriteFile(String, Stream)
Declaration
public void WriteFile(string virtualPath, Stream stream)
Parameters
Type | Name |
---|
System.String | virtualPath |
System.IO.Stream | stream |
ToBase64(Stream)
Declaration
public static string ToBase64(Stream stream)
Returns
System.String
Parameters
Type | Name |
---|
System.IO.Stream | stream |
ToBase64(Byte[])
Declaration
public static string ToBase64(byte[] bytes)
Returns
System.String
Parameters
Type | Name |
---|
System.Byte[] | bytes |
WriteFiles(IEnumerable<IVirtualFile>, Func<IVirtualFile, String>)
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)
Declaration
public void AppendFile(string filePath, string textContents)
Parameters
Type | Name |
---|
System.String | filePath |
System.String | textContents |
AppendFile(String, Stream)
Declaration
public void AppendFile(string filePath, Stream stream)
Parameters
Type | Name |
---|
System.String | filePath |
System.IO.Stream | stream |
ResolveGistFileName(String)
Declaration
public string ResolveGistFileName(string filePath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | filePath |
DeleteFile(String)
Declaration
public void DeleteFile(string filePath)
Parameters
Type | Name |
---|
System.String | filePath |
DeleteFiles(IEnumerable<String>)
Declaration
public void DeleteFiles(IEnumerable<string> virtualFilePaths)
Parameters
Type | Name |
---|
System.Collections.Generic.IEnumerable<System.String> | virtualFilePaths |
DeleteFolder(String)
Declaration
public void DeleteFolder(string dirPath)
Parameters
Type | Name |
---|
System.String | dirPath |
EnumerateFiles(String)
Declaration
public IEnumerable<GistVirtualFile> EnumerateFiles(string prefix = null)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.GistVirtualFile>
Parameters
Type | Name |
---|
System.String | prefix |
GetAllFiles()
Declaration
public override IEnumerable<IVirtualFile> GetAllFiles()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile>
Declaration
public IEnumerable<GistVirtualDirectory> GetImmediateDirectories(string fromDirPath)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.GistVirtualDirectory>
Parameters
Type | Name |
---|
System.String | fromDirPath |
Declaration
public IEnumerable<GistVirtualFile> GetImmediateFiles(string fromDirPath)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.GistVirtualFile>
Parameters
Type | Name |
---|
System.String | fromDirPath |
GetDirPath(String)
Declaration
public string GetDirPath(string filePath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | filePath |
Declaration
public string GetImmediateSubDirPath(string fromDirPath, string subDirPath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | fromDirPath |
System.String | subDirPath |
SanitizePath(String)
Declaration
public override string SanitizePath(string filePath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | filePath |
GetFileName(String)
Declaration
public static string GetFileName(string filePath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | filePath |
Inherited Methods
AppendFile(String, ReadOnlyMemory<Byte>)
Declaration
public virtual void AppendFile(string path, ReadOnlyMemory<byte> bytes)
Parameters
Type | Name |
---|
System.String | path |
ReadOnlyMemory<System.Byte> | bytes |
AppendFile(String, ReadOnlyMemory<Char>)
Declaration
public virtual void AppendFile(string path, ReadOnlyMemory<char> text)
Parameters
Type | Name |
---|
System.String | path |
ReadOnlyMemory<System.Char> | text |
AppendFile(String, Object)
Declaration
public virtual void AppendFile(string path, object contents)
Parameters
Type | Name |
---|
System.String | path |
System.Object | contents |
AssertVirtualFiles()
Declaration
protected IVirtualFiles AssertVirtualFiles()
Returns
ServiceStack.IO.IVirtualFiles
CombineVirtualPath(String, String)
Declaration
public virtual string CombineVirtualPath(string basePath, string relativePath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | basePath |
System.String | relativePath |
CreateContentNotSupportedException(Object)
Declaration
protected NotSupportedException CreateContentNotSupportedException(object value)
Returns
System.NotSupportedException
Parameters
Type | Name |
---|
System.Object | value |
DirectoryExists(String)
Declaration
public virtual bool DirectoryExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|
System.String | virtualPath |
FileExists(String)
Declaration
public virtual bool FileExists(string virtualPath)
Returns
System.Boolean
Parameters
Type | Name |
---|
System.String | virtualPath |
GetAllFiles()
Declaration
public virtual IEnumerable<IVirtualFile> GetAllFiles()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile>
GetAllMatchingFiles(String, Int32)
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)
Declaration
public virtual IVirtualDirectory GetDirectory(string virtualPath)
Returns
ServiceStack.IO.IVirtualDirectory
Parameters
Type | Name |
---|
System.String | virtualPath |
GetFile(String)
Declaration
public virtual IVirtualFile GetFile(string virtualPath)
Returns
ServiceStack.IO.IVirtualFile
Parameters
Type | Name |
---|
System.String | virtualPath |
GetFileHash(IVirtualFile)
Declaration
public virtual string GetFileHash(IVirtualFile virtualFile)
Returns
System.String
Parameters
GetFileHash(String)
Declaration
public virtual string GetFileHash(string virtualPath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | virtualPath |
GetRootDirectories()
Declaration
public virtual IEnumerable<IVirtualDirectory> GetRootDirectories()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualDirectory>
GetRootFiles()
Declaration
public virtual IEnumerable<IVirtualFile> GetRootFiles()
Returns
System.Collections.Generic.IEnumerable<ServiceStack.IO.IVirtualFile>
Initialize()
Declaration
protected abstract void Initialize()
IsSharedFile(IVirtualFile)
Declaration
public virtual bool IsSharedFile(IVirtualFile virtualFile)
Returns
System.Boolean
Parameters
IsViewFile(IVirtualFile)
Declaration
public virtual bool IsViewFile(IVirtualFile virtualFile)
Returns
System.Boolean
Parameters
SanitizePath(String)
Declaration
public virtual string SanitizePath(string filePath)
Returns
System.String
Parameters
Type | Name |
---|
System.String | filePath |
ToString()
Declaration
public override string ToString()
Returns
System.String
WriteFile(String, ReadOnlyMemory<Byte>)
Declaration
public virtual void WriteFile(string path, ReadOnlyMemory<byte> bytes)
Parameters
Type | Name |
---|
System.String | path |
ReadOnlyMemory<System.Byte> | bytes |
WriteFile(String, ReadOnlyMemory<Char>)
Declaration
public virtual void WriteFile(string path, ReadOnlyMemory<char> text)
Parameters
Type | Name |
---|
System.String | path |
ReadOnlyMemory<System.Char> | text |
WriteFile(String, Object)
Declaration
public virtual void WriteFile(string path, object contents)
Parameters
Type | Name |
---|
System.String | path |
System.Object | contents |
WriteFileAsync(String, Object, CancellationToken)
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>)
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>)
Declaration
public virtual void WriteFiles(Dictionary<string, string> textFiles)
Parameters
Type | Name |
---|
System.Collections.Generic.Dictionary<System.String,System.String> | textFiles |
Implements