예제 #1
0
        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));
        }
예제 #2
0
 public HttpFileInfo(HttpFileDescriptor descriptor, HttpClient httpClient)
 {
     Exists       = descriptor.Exists;
     IsDirectory  = descriptor.IsDirectory;
     LastModified = descriptor.LastModified;
     Length       = descriptor.Length;
     Name         = descriptor.Name;
     PhysicalPath = descriptor.PhysicalPath;
     _httpClient  = httpClient;
 }