public DownloadFileOperation(SMBItem smbItem, string dstPath) { if (smbItem.IsDirectory) { throw new ArgumentException("Must not be a directory", nameof(smbItem)); } if (!Path.IsPathFullyQualified(dstPath)) { throw new ArgumentException("Must be a fully qualified path", nameof(dstPath)); } SMBItem = smbItem; DstPath = dstPath; }
private void CreateOperationsForDirectory(SMBItem item, string dstPath) { AddOperation(new CreateDirectoryOperation(dstPath)); foreach (var child in smbFileShare.RetrieveItems(item)) { if (item.IsDirectory) { CreateOperationsForDirectory(item, Path.Combine(dstPath, item.Name)); } else { AddOperation(new CopyFileOperation(child, Path.Combine(dstPath, item.Name))); } } }
public void CreateOperationsForDirectory(SMBItem smbItem, string dstPath) { AddOperation(new CreateDownloadDirectoryOperation(dstPath)); foreach (var item in smbFileShare.RetrieveItems(smbItem)) { if (item.IsDirectory) { CreateOperationsForDirectory(item, Path.Combine(dstPath, item.Name)); } else { AddOperation(new DownloadFileOperation(item, Path.Combine(dstPath, item.Name))); } } }
public CopyFileOperation(SMBItem item, string dstPath) { Item = item; DstPath = dstPath; }
public List <SMBItem> RetrieveItems(SMBItem smbItem) { return(RetrieveItems(smbItem.Path)); }