source: binary-improvements/7dtd-server-fixes/src/FileCache/DirectAccess.cs@ 255

Last change on this file since 255 was 199, checked in by alloc, 10 years ago

fixes

File size: 537 bytes
RevLine 
[199]1using System;
2using System.Collections.Generic;
3using System.IO;
4
5namespace 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.