Skip to main content

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
TypeName
ServiceStack.Web.IHttpFilehttpFile
System.StringfilePath

SaveTo(IHttpFile, IVirtualFiles, String)

View Source
Declaration
public static void SaveTo(this IHttpFile httpFile, IVirtualFiles vfs, string filePath)
Parameters
TypeName
ServiceStack.Web.IHttpFilehttpFile
ServiceStack.IO.IVirtualFilesvfs
System.StringfilePath

WriteTo(IHttpFile, Stream)

View Source
Declaration
public static void WriteTo(this IHttpFile httpFile, Stream stream)
Parameters
TypeName
ServiceStack.Web.IHttpFilehttpFile
System.IO.Streamstream

SaveToAsync(IHttpFile, String)

View Source
Declaration
public static async Task SaveToAsync(this IHttpFile httpFile, string filePath)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IHttpFilehttpFile
System.StringfilePath

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
TypeName
ServiceStack.Web.IHttpFilehttpFile
ServiceStack.IO.IVirtualFilesvfs
System.StringfilePath
System.Threading.CancellationTokentoken

WriteToAsync(IHttpFile, Stream)

View Source
Declaration
public static async Task WriteToAsync(this IHttpFile httpFile, Stream stream)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Web.IHttpFilehttpFile
System.IO.Streamstream

MapServerPath(String)

View Source
Declaration
public static string MapServerPath(this string relativePath)
Returns

System.String

Parameters
TypeName
System.StringrelativePath

IsRelativePath(String)

View Source
Declaration
public static bool IsRelativePath(this string relativeOrAbsolutePath)
Returns

System.Boolean

Parameters
TypeName
System.StringrelativeOrAbsolutePath

ReadFully(FileInfo)

View Source
Declaration
public static byte[] ReadFully(this FileInfo file)
Returns

System.Byte[]

Parameters
TypeName
System.IO.FileInfofile

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
TypeName
System.IO.FileInfofile
System.Threading.CancellationTokentoken

ReadAllText(FileInfo)

View Source
Declaration
public static string ReadAllText(this FileInfo file)
Returns

System.String

Parameters
TypeName
System.IO.FileInfofile

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
TypeName
System.IO.FileInfofile
System.Threading.CancellationTokentoken