Class FileManager
Files manager class.
Implements
Inherited Members
Namespace: EduCATS.Helpers.Files
Assembly: EduCATS.dll
Syntax
public class FileManager : IFileManager
Methods
Append(string, string)
Append to file.
Declaration
public void Append(string path, string data)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path. |
| string | data | Contents to append. |
Create(string)
Create file.
Declaration
public void Create(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path. |
Delete(string)
Delete file.
Declaration
public void Delete(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path. |
Exists(string)
Check if file exists.
Declaration
public bool Exists(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetFileSize(string)
Get file size in MB.
Declaration
public double GetFileSize(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path. |
Returns
| Type | Description |
|---|---|
| double | File size (MB). |
Read(string)
Get file contents.
Declaration
public string Read(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path. |
Returns
| Type | Description |
|---|---|
| string | File contents. |
ReadDemoEmbeddedResource(string, string)
Get demo embedded resource contents.
Declaration
public string ReadDemoEmbeddedResource(string file, string extension = "json")
Parameters
| Type | Name | Description |
|---|---|---|
| string | file | Resource name. |
| string | extension | Extension (default is ).
|
Returns
| Type | Description |
|---|---|
| string | Demo embedded resource contents. |