public HttpContent(HttpCachedFile file, Dictionary <string, HttpContent> baseContent) { this.baseContent = baseContent; this.content = file.Data; this.ParsingRequired = file.ParsingRequired; this.LastModified = file.LastModified; this.ContentType = file.ContentType; this.ETag = file.ETag; }
public HttpCachedFile Get(string filePath) { if (this.cache.ContainsKey(filePath)) { return(this.cache[filePath]); } // TODO: this doesn't work if (File.Exists(filePath)) { var request = filePath.Substring(server.Root.Length + 1).ToLower(); var newFile = new HttpCachedFile(filePath); this.cache.Add(request, newFile); return(newFile); } throw new FileNotFoundException(filePath); }
public HttpContent(HttpCachedFile file) : this(file, new Dictionary <string, HttpContent>()) { }