public void Execute(SMBFileShare smbFileShare, Progress progress) { using var srcStream = smbFileShare.OpenRead(Item.Path); using var dstStream = smbFileShare.OpenWrite(DstPath); int bufferSize = (int)Math.Min(smbFileShare.MaxReadSize, smbFileShare.MaxWriteSize); srcStream.CopyTo(dstStream, bufferSize, progress); progress.Report(1); }
public void Execute(SMBFileShare smbFileShare, Progress progress) { int bufferSize = (int)smbFileShare.MaxWriteSize; using var fileStream = File.OpenRead(); using var dstStream = smbFileShare.OpenWrite(DstPath); fileStream.CopyTo(dstStream, bufferSize, progress); progress.Report(1); }
public void Execute(SMBFileShare smbFileShare, Progress?progress = null) { if (File.Exists(DstPath)) { throw new IOException($"{DstPath} already exists"); } int bufferSize = (int)smbFileShare.MaxReadSize; using var srcStream = smbFileShare.OpenRead(SMBItem.Path); using var dstStream = File.OpenWrite(DstPath); dstStream.SetLength(0); dstStream.Position = 0; srcStream.CopyTo(dstStream, bufferSize, progress); progress?.Report(1); }
public void Execute(SMBFileShare smbFileShare, Progress progress) { Directory.CreateDirectory(Path); progress.Report(ProgressAmount); }
public UploadTask(SMBFileShare smbFileShare, IEnumerable <FileSystemInfo> fileSystemItems, string dstPath) : base(smbFileShare) { this.fileSystemItems = fileSystemItems; this.dstPath = dstPath; }
public CopyTask(SMBFileShare smbFileShare, IEnumerable <SMBItem> items, string dstPath) : base(smbFileShare) { this.items = items; this.dstPath = dstPath; }
protected TaskBase(SMBFileShare smbFileShare) { this.smbFileShare = smbFileShare; }