コード例 #1
0
        public WebServerFile(WebServerFileSystem fileSystem, string path)
        {
            FileSystem = fileSystem;

            FullName = path; // FileSystem.CombinePath(FileSystem.RootUri.ToString(), path);

            //get the filename from the path, will just have a flat memory structure?
            //TODO better/more secure filename extraction? escaping of characters
            string filename = FileSystem.CombinePath(CacheDirectory, path.Substring(path.LastIndexOf('/') + 1));

            //if the file exists in memory, then set the file stream
            if (FileSystem.InMemoryCache.FileExists(filename))
            {
                IFile cachedFile = FileSystem.InMemoryCache.GetFile(filename);
                _cachedFileStream = cachedFile.Open(FileMode.Open);
            }
        }
コード例 #2
0
 public WebServerFile(WebServerFileSystem fileSystem, string path)
 {
     FileSystem = fileSystem;
     FullName = FileSystem.CombinePath(FileSystem.RootUri.ToString(), path);
 }