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;
 }
예제 #2
0
        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)));
                }
            }
        }
예제 #3
0
        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)));
                }
            }
        }
예제 #4
0
 public CopyFileOperation(SMBItem item, string dstPath)
 {
     Item    = item;
     DstPath = dstPath;
 }
예제 #5
0
 public List <SMBItem> RetrieveItems(SMBItem smbItem)
 {
     return(RetrieveItems(smbItem.Path));
 }