Пример #1
0
        //----------------------------------//

        /// <summary>
        /// Initialize a web resource.
        /// </summary>
        public WebResource(HttpSite site, string path, string mime = null)
        {
            _lock = new LockShared();

            // persist the local path
            Path = path;

            // does the path indicate a web resource?
            if (Fs.IsWebPath(Path))
            {
                // persist the path
                FullPath = Path;
            }
            else
            {
                // persist the path
                FullPath = Fs.Combine(site.Path, Path);
            }

            _compression = System.Net.DecompressionMethods.None;

            // get the web resource extension if set
            MimeType = mime ?? Mime.GetType(Fs.GetExtension(FullPath));

            // the resource must be loaded to begin with
            _reset = true;
        }