Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
        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);
        }
Example #4
0
 public HttpContent(HttpCachedFile file) : this(file, new Dictionary <string, HttpContent>())
 {
 }
Example #5
0
 public HttpContent(HttpCachedFile file)
     : this(file, new Dictionary<string, HttpContent>())
 {
 }
Example #6
0
        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);
        }