Bloom.Api.ApiRequest.LocalPath C# (CSharp) Метод

LocalPath() публичный Метод

Get the actual local path that the server would retrieve given a Bloom URL that ends up at a local file. For now it is mainly useful for things in the book folder; it doesn't have all the smarts to locate files shipped with the application, it is just concerned with reversing the various tricks we use to encode paths as URLs.
public LocalPath ( ) : string
Результат string
        public string LocalPath()
        {
            return ServerBase.GetLocalPathWithoutQuery(this._requestInfo);
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Called by the server to handle API calls for page thumbnails.
 /// </summary>
 public void HandleThumbnailRequest(ApiRequest request)
 {
     var filePath = request.LocalPath().Replace("api/pageTemplateThumbnail/","");
     var pathToExistingOrGeneratedThumbnail = FindOrGenerateThumbnail(filePath);
     if(string.IsNullOrEmpty(pathToExistingOrGeneratedThumbnail) || !File.Exists(pathToExistingOrGeneratedThumbnail))
     {
         request.Failed("Could not make a page thumbnail for "+filePath);
         return;
     }
     request.ReplyWithImage(pathToExistingOrGeneratedThumbnail);
 }
All Usage Examples Of Bloom.Api.ApiRequest::LocalPath