Sdl.Web.Tridion/Providers/GraphQLContentProvider.cs
/// <summary>
/// Gets a Static Content Item for a given URL path.
/// </summary>
/// <param name="urlPath">The URL path (unescaped).</param>
/// <param name="localization">The context Localization.</param>
/// <returns>The Static Content Item.</returns>
Gets a Static Content Item for a given URL path.
Gets a Static Content Item for a given URL path .
public virtual StaticContentItem GetStaticContentItem(string urlPath, ILocalization localization)
        {
            using (new Tracer(urlPath, localization))
            {
                string localFilePath = BinaryFileManager.Instance.GetCachedFile(urlPath, localization);
                return new StaticContentItem(
                    new FileStream(localFilePath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.SequentialScan),
                    MimeMapping.GetMimeMapping(localFilePath),
                    File.GetLastWriteTime(localFilePath),
                    Encoding.UTF8
                    );
            }
        }
public virtual StaticContentItem GetStaticContentItem ( string urlPath , ILocalization localization ) { using ( new Tracer ( urlPath , localization ) ) { string localFilePath = BinaryFileManager . Instance . GetCachedFile ( urlPath , localization ) ; return new StaticContentItem ( new FileStream ( localFilePath , FileMode . Open , FileAccess . Read , FileShare . Read , 4096 , FileOptions . SequentialScan ) , MimeMapping . GetMimeMapping ( localFilePath ) , File . GetLastWriteTime ( localFilePath ) , Encoding . UTF8 ) ; } }
Gets a Static Content Item for a given URL path.
Gets a Static Content Item for a given URL path .
The Static Content Item.
The Static Content Item .
urlPath
string
The URL path (unescaped).
The URL path ( unescaped ) .
localization
ILocalization
The context Localization.
The context Localization .