Esempio n. 1
0
 public void Download(string hostPath, string clientPath, bool overwrite = true)
 {
     using (var stfpBatch = new SFtpBatch(login, password, host))
     {
         stfpBatch.Download(hostPath, clientPath, overwrite);
     }
 }
Esempio n. 2
0
 public bool Upload(string relativePath)
 {
     using (var stfpBatch = new SFtpBatch(login, password, host))
     {
         var clientPath = GetFullClientPath(relativePath);
         var hostPath   = GetFullHostPath(relativePath);
         return(stfpBatch.Upload(clientPath, hostPath));
     }
 }
Esempio n. 3
0
        public bool Exists(string relativePath)
        {
            var hostPath = GetFullHostPath(relativePath);

            using (var stfpBatch = new SFtpBatch(login, password, host))
            {
                return(stfpBatch.Exists(hostPath));
            }
        }
Esempio n. 4
0
 public void UploadBatch(IEnumerable <string> relativePaths)
 {
     using (var stfpBatch = new SFtpBatch(login, password, host))
     {
         Parallel.ForEach(relativePaths, relativePath =>
         {
             var clientPath = GetFullClientPath(relativePath);
             var hostPath   = GetFullHostPath(relativePath);
             if (stfpBatch.Upload(clientPath, hostPath))
             {
                 Console.WriteLine($"{relativePath} Uploaded");
             }
         });
     }
 }