| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using System.IO;
|
|---|
| 4 |
|
|---|
| 5 | namespace AllocsFixes.FileCache
|
|---|
| 6 | {
|
|---|
| 7 | // Not caching at all, simply reading from disk on each request
|
|---|
| 8 | public class DirectAccess : AbstractCache
|
|---|
| 9 | {
|
|---|
| 10 |
|
|---|
| 11 | public DirectAccess ()
|
|---|
| 12 | {
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | public override byte[] GetFileContent (string filename)
|
|---|
| 16 | {
|
|---|
| 17 | try {
|
|---|
| 18 | if (!File.Exists (filename)) {
|
|---|
| 19 | return null;
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | return File.ReadAllBytes (filename);
|
|---|
| 23 | } catch (Exception e) {
|
|---|
| 24 | Log.Out ("Error in DirectAccess.GetFileContent: " + e);
|
|---|
| 25 | }
|
|---|
| 26 | return null;
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | }
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.