Show / Hide Table of Contents

Class RegularFileHandler

Inheritance
object
RegularFileHandler
Implements
IFileHandler
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ivrToolkit.Core.Util
Assembly: ivrToolkit.Core.dll
Syntax
public class RegularFileHandler : IFileHandler

Methods

| Edit this page View Source

Exists(string)

Checks to see if the path exists.

Declaration
public bool Exists(string fullPath)
Parameters
Type Name Description
string fullPath

The name of the path to check

Returns
Type Description
bool

True if the path exists

| Edit this page View Source

GetFileStream(string, FileMode, FileAccess, FileShare)

Returns the files stream for the given file.

Declaration
public Stream GetFileStream(string fileName, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
Parameters
Type Name Description
string fileName

The name of the file to read from

FileMode fileMode
FileAccess fileAccess
FileShare fileShare
Returns
Type Description
Stream

A Stream containing the contents

| Edit this page View Source

ReadAllTextAsync(string, CancellationToken)

Reads the contents of a file as one long string

Declaration
public Task<string> ReadAllTextAsync(string fileName, CancellationToken cancellationToken)
Parameters
Type Name Description
string fileName

THe name of the file to read from

CancellationToken cancellationToken

A token to monitor for cancellation requests.

Returns
Type Description
Task<string>

The contents of the file as a string

| Edit this page View Source

WriteAllBytesAsync(string, byte[], CancellationToken)

Writes out a byte array to a file

Declaration
public Task WriteAllBytesAsync(string fileName, byte[] bytes, CancellationToken cancellationToken)
Parameters
Type Name Description
string fileName

The name of the file to write out

byte[] bytes

The byte array to write into the file

CancellationToken cancellationToken

A token to monitor for cancellation requests.

Returns
Type Description
Task
| Edit this page View Source

WriteAllTextAsync(string, string, CancellationToken)

Write out a text string to a file

Declaration
public Task WriteAllTextAsync(string fileName, string text, CancellationToken cancellationToken)
Parameters
Type Name Description
string fileName

The name of the file to write out

string text

The text string to write into the file

CancellationToken cancellationToken

A token to monitor for cancellation requests.

Returns
Type Description
Task

Implements

IFileHandler

Extension Methods

ValidationExtensions.ThrowIfNull<T>(T, string)
  • View Source
In this article
Back to top Generated by DocFX