public IDirectoryContents GetDirectoryContents(string subpath)
        {
            string url     = $"{_baseAddress}/{subpath.TrimStart('/')}?dir-meta";
            string content = _httpClient.GetStringAsync(url).Result;
            HttpDirectoryContentsDescriptor descriptor = JsonConvert.DeserializeObject <HttpDirectoryContentsDescriptor>(content);

            return(new HttpDirectoryContents(descriptor, _httpClient));
        }
Exemple #2
0
 public HttpDirectoryContents(HttpDirectoryContentsDescriptor descriptor, HttpClient httpClient)
 {
     Exists     = descriptor.Exists;
     _fileInfos = descriptor.FileDescriptors.Select(file => file.ToFileInfo(httpClient));
 }