Class FileSystemResources
Resources stores on the file system and accesible via File
Inherited Members
Namespace: FakeHttp.Resources
Assembly: FakeHttp.dll
Syntax
public sealed class FileSystemResources : IResources, IReadOnlyResources
Constructors
| Improve this Doc View SourceFileSystemResources(String)
Declaration
public FileSystemResources(string storeFolder)
Parameters
Type | Name | Description |
---|---|---|
String | storeFolder | The root folder where resources reside |
Exceptions
Type | Condition |
---|---|
ArgumentException | If storeFolder is null or empty |
Methods
| Improve this Doc View SourceExists(String, String)
Checks whether the specified file exists
Declaration
public bool Exists(string folder, string fileName)
Parameters
Type | Name | Description |
---|---|---|
String | folder | The folder name |
String | fileName | The file name |
Returns
Type | Description |
---|---|
Boolean | Flag indicating whether file exists |
Implements
| Improve this Doc View SourceLoadAsStream(String, String)
Loads a given file as a stream
Declaration
public Stream LoadAsStream(string folder, string fileName)
Parameters
Type | Name | Description |
---|---|---|
String | folder | The folder name |
String | fileName | The file name |
Returns
Type | Description |
---|---|
Stream | The file's contents as a Stream |
Implements
Exceptions
Type | Condition |
---|---|
FileLoadException |
LoadAsString(String, String)
Loads a given file as a string
Declaration
public string LoadAsString(string folder, string fileName)
Parameters
Type | Name | Description |
---|---|---|
String | folder | The folder name |
String | fileName | The file name |
Returns
Type | Description |
---|---|
String | The file's contents as a String |
Implements
Exceptions
Type | Condition |
---|---|
FileLoadException |
Store(String, String, Stream)
Stores a data stream in the corresponding folder and file
Declaration
public void Store(string folder, string fileName, Stream data)
Parameters
Type | Name | Description |
---|---|---|
String | folder | The folder name |
String | fileName | The file name |
Stream | data | The data to store |
Implements
Exceptions
Type | Condition |
---|---|
IOException |
Store(String, String, String)
Stores a data string in the corresponding folder and file
Declaration
public void Store(string folder, string fileName, string data)
Parameters
Type | Name | Description |
---|---|---|
String | folder | The folder name |
String | fileName | The file name |
String | data | The data to store |
Implements
Exceptions
Type | Condition |
---|---|
IOException |