C# Class AliaSQL.Core.FileSystem

Inheritance: IFileSystem
Show file Open project: ClearMeasure/AliaSQL

Public Methods

Method Description
FileExists ( string relativePath ) : bool
FileSystem ( ) : System
FileSystem ( IFileStreamFactory streamFactory ) : System
GetAllFilesWithExtensionWithinFolder ( string folder, string fileExtension ) : string[]
ReadFileIntoStreamReader ( string filename ) : StreamReader
ReadIntoFileStream ( string path ) : Stream
ReadTextFile ( string filename ) : string
SaveFile ( string filename, byte fileContent ) : void

Private Methods

Method Description
GetEncoding ( string filename ) : Encoding

Determines a text file's encoding by analyzing its byte order mark (BOM) Defaults to ASCII when detection of the text file's endianness fails. Function originally from http://stackoverflow.com/questions/3825390/effective-way-to-find-any-files-encoding

Method Details

FileExists() public method

public FileExists ( string relativePath ) : bool
relativePath string
return bool

FileSystem() public method

public FileSystem ( ) : System
return System

FileSystem() public method

public FileSystem ( IFileStreamFactory streamFactory ) : System
streamFactory IFileStreamFactory
return System

GetAllFilesWithExtensionWithinFolder() public method

public GetAllFilesWithExtensionWithinFolder ( string folder, string fileExtension ) : string[]
folder string
fileExtension string
return string[]

ReadFileIntoStreamReader() public method

public ReadFileIntoStreamReader ( string filename ) : StreamReader
filename string
return System.IO.StreamReader

ReadIntoFileStream() public method

public ReadIntoFileStream ( string path ) : Stream
path string
return Stream

ReadTextFile() public method

public ReadTextFile ( string filename ) : string
filename string
return string

SaveFile() public method

public SaveFile ( string filename, byte fileContent ) : void
filename string
fileContent byte
return void