Last change
on this file since 436 was 402, checked in by alloc, 22 months ago |
- Major refactoring
- Using Utf8Json for (de)serialization
- Moving APIs to REST
- Removing dependencies from WebServer and MapRenderer to ServerFixes
|
File size:
504 bytes
|
Rev | Line | |
---|
[199] | 1 | using System;
|
---|
| 2 | using System.IO;
|
---|
| 3 |
|
---|
[402] | 4 | namespace Webserver.FileCache {
|
---|
[199] | 5 | // Not caching at all, simply reading from disk on each request
|
---|
[325] | 6 | public class DirectAccess : AbstractCache {
|
---|
[351] | 7 | public override byte[] GetFileContent (string _filename) {
|
---|
[199] | 8 | try {
|
---|
[391] | 9 | return File.Exists (_filename) ? File.ReadAllBytes (_filename) : null;
|
---|
[199] | 10 | } catch (Exception e) {
|
---|
[402] | 11 | Log.Out ($"Error in DirectAccess.GetFileContent: {e}");
|
---|
[199] | 12 | }
|
---|
[325] | 13 |
|
---|
[199] | 14 | return null;
|
---|
| 15 | }
|
---|
[392] | 16 |
|
---|
| 17 | public override (int, int) Invalidate () {
|
---|
| 18 | return (0, 0);
|
---|
| 19 | }
|
---|
[199] | 20 | }
|
---|
[325] | 21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.