public IFileInfo GetFileInfo(string subpath) { string url = $"{_baseAddress}/{subpath.TrimStart('/')}?file-meta"; string content = _httpClient.GetStringAsync(url).Result; HttpFileDescriptor descriptor = JsonConvert.DeserializeObject <HttpFileDescriptor>(content); return(descriptor.ToFileInfo(_httpClient)); }
// public bool Exists => throw new NotImplementedException(); public HttpFileInfo(HttpFileDescriptor descriptor, HttpClient httpClient) { this.Exists = descriptor.Exists; IsDirectory = descriptor.IsDirectory; LastModified = descriptor.LastModified; Length = descriptor.Length; Name = descriptor.Name; PhysicalPath = descriptor.PhysicalPath; _httpClient = httpClient; }