protected override async Task <IResourceInfo> PutAsyncInternal(UriString uri, Stream value, IImmutableSession metadata) { ValidateRequest(ExtractMethodName(nameof(PutAsync)), uri, metadata, Stream.Null, RequestValidator); using (var fileStream = new FileStream(uri.ToUnc(), FileMode.CreateNew, FileAccess.Write)) { await value.Rewind().CopyToAsync(fileStream); await fileStream.FlushAsync(); } return(await GetAsync(uri, metadata)); }
protected override Task <IResourceInfo> DeleteAsyncInternal(UriString uri, IImmutableSession metadata) { File.Delete(uri.ToUnc()); return(Task.FromResult <IResourceInfo>(new PhysicalFileInfo(uri))); }