src/Foundation/Net/Gimela.Net.Http/Resources/FileResources.cs
/// <summary>
/// Go through all mappings and find requested Uri.
/// </summary>
/// <param name="uriPath">Uri to get local path for.</param>
/// <returns>Path if found; otherwise <c>null</c>.</returns>
Go through all mappings and find requested Uri.
Go through all mappings and find requested Uri .
private string GetFullFilePath(string uriPath)
    {
      int pos = uriPath.LastIndexOf('/');
      if (pos == -1)
        return null;
      string path = uriPath.Substring(0, pos + 1);
      string fileName = uriPath.Substring(pos + 1);
      foreach (Mapping mapping in _mappings)
      {
        if (!path.StartsWith(mapping.UriPath)) continue;
        path = path.Remove(0, mapping.UriPath.Length);
        path = path.Replace("/", PathSeparator);
        return mapping.AbsolutePath + path + fileName;
      }
      return null;
    }
private string GetFullFilePath ( string uriPath ) { int pos = uriPath . LastIndexOf ( ' ' ) ; if ( pos == - 1 ) return null ; string path = uriPath . Substring ( 0 , pos + 1 ) ; string fileName = uriPath . Substring ( pos + 1 ) ; foreach ( Mapping mapping in _mappings ) { if ( ! path . StartsWith ( mapping . UriPath ) ) continue ; path = path . Remove ( 0 , mapping . UriPath . Length ) ; path = path . Replace ( " " , PathSeparator ) ; return mapping . AbsolutePath + path + fileName ; } return null ; }
Go through all mappings and find requested Uri.
Go through all mappings and find requested Uri .
Path if found; otherwise null
Path if found ; otherwise null
uriPath
string
Uri to get local path for.
Uri to get local path for .