FileExtensions
Assembly: ServiceStack.dll
View Source
Declaration
public static class FileExtensions
Methods
SaveTo(IHttpFile, String)
View Source
Declaration
public static void SaveTo(this IHttpFile httpFile, string filePath)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpFile | httpFile |
System.String | filePath |
SaveTo(IHttpFile, IVirtualFiles, String)
View Source
Declaration
public static void SaveTo(this IHttpFile httpFile, IVirtualFiles vfs, string filePath)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpFile | httpFile |
ServiceStack.IO.IVirtualFiles | vfs |
System.String | filePath |
WriteTo(IHttpFile, Stream)
View Source
Declaration
public static void WriteTo(this IHttpFile httpFile, Stream stream)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpFile | httpFile |
System.IO.Stream | stream |
SaveToAsync(IHttpFile, String)
View Source
Declaration
public static async Task SaveToAsync(this IHttpFile httpFile, string filePath)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpFile | httpFile |
System.String | filePath |
SaveToAsync(IHttpFile, IVirtualFiles, String, CancellationToken)
View Source
Declaration
public static async Task SaveToAsync(this IHttpFile httpFile, IVirtualFiles vfs, string filePath, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpFile | httpFile |
ServiceStack.IO.IVirtualFiles | vfs |
System.String | filePath |
System.Threading.CancellationToken | token |
WriteToAsync(IHttpFile, Stream)
View Source
Declaration
public static async Task WriteToAsync(this IHttpFile httpFile, Stream stream)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpFile | httpFile |
System.IO.Stream | stream |
MapServerPath(String)
View Source
Declaration
public static string MapServerPath(this string relativePath)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | relativePath |
IsRelativePath(String)
View Source
Declaration
public static bool IsRelativePath(this string relativeOrAbsolutePath)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | relativeOrAbsolutePath |
ReadFully(FileInfo)
View Source
Declaration
public static byte[] ReadFully(this FileInfo file)
Returns
System.Byte[]
Parameters
Type | Name |
---|---|
System.IO.FileInfo | file |
ReadFullyAsync(FileInfo, CancellationToken)
View Source
Declaration
public static async Task<byte[]> ReadFullyAsync(this FileInfo file, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Byte[]>
Parameters
Type | Name |
---|---|
System.IO.FileInfo | file |
System.Threading.CancellationToken | token |
ReadAllText(FileInfo)
View Source
Declaration
public static string ReadAllText(this FileInfo file)
Returns
System.String
Parameters
Type | Name |
---|---|
System.IO.FileInfo | file |
ReadAllTextAsync(FileInfo, CancellationToken)
View Source
Declaration
public static async Task<string> ReadAllTextAsync(this FileInfo file, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|---|
System.IO.FileInfo | file |
System.Threading.CancellationToken | token |