websocket-server – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System; |
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | |||
6 | namespace WebSockets.Server.Http |
||
7 | { |
||
8 | internal class MimeTypesFactory |
||
9 | { |
||
10 | private static Dictionary<string, MimeTypes> _mimeTypes = new Dictionary<string, MimeTypes>(); |
||
11 | |||
12 | public static MimeTypes GetMimeTypes(string webRoot) |
||
13 | { |
||
14 | lock (_mimeTypes) |
||
15 | { |
||
16 | MimeTypes mimeTypes; |
||
17 | if (!_mimeTypes.TryGetValue(webRoot, out mimeTypes)) |
||
18 | { |
||
19 | mimeTypes = new MimeTypes(webRoot); |
||
20 | _mimeTypes.Add(webRoot, mimeTypes); |
||
21 | } |
||
22 | |||
23 | return mimeTypes; |
||
24 | } |
||
25 | } |
||
26 | } |
||
27 | } |