public void SetContent(FileInfoContract target, Stream content, ProgressProxy progress) { if (!string.IsNullOrEmpty(encryptionKey)) { content = content.Encrypt(encryptionKey); } gateway.SetContent(rootName, target.Id, content, progress); target.Size = content.Length; InvalidateDrive(); }
public void SetContent(FileInfoContract target, Stream content) { ExecuteInSemaphore(() => { target.Size = content.Length; var gatewayContent = content.EncryptOrPass(encryptionKey); #if DEBUG gatewayContent = new TraceStream(nameof(target), target.Name, gatewayContent); #endif gateway.SetContent(rootName, target.Id, gatewayContent, null); }, nameof(SetContent), true); }
public void SetContent(FileInfoContract target, Stream content) { ExecuteInSemaphore(() => { var gatewayContent = content.EncryptOrPass(_encryptionKey); target.Size = (FileSize)content.Length; //#if DEBUG // CompositionInitializer.SatisfyImports(gatewayContent = new TraceStream(nameof(target), target.Name, gatewayContent)); //#endif _gateway.SetContent(_rootName, target.Id, gatewayContent, null); if (content != gatewayContent) { gatewayContent.Close(); } }, nameof(SetContent), true); }