Class ZipResources
Resources stored in a ZipArchive
Inherited Members
Namespace: FakeHttp.Resources
Assembly: FakeHttp.dll
Syntax
public sealed class ZipResources : IReadOnlyResources, IDisposable
Constructors
| Improve this Doc View SourceZipResources(String)
Opens the ZipArchive located at archiveFilePath. The archive will remain opened until Dispose() is called
Declaration
public ZipResources(string archiveFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| String | archiveFilePath | full or relative path to the zip archive file |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | archiveFilePath is null or empty |
| FileLoadException | archiveFilePath cannot be opened as a ZipArchive |
Methods
| Improve this Doc View SourceDispose()
Dispose()
Disposes the underlying ZipArchive
Declaration
public void Dispose()
Implements
| 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 | 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 |