public void Download(string hostPath, string clientPath, bool overwrite = true) { using (var stfpBatch = new SFtpBatch(login, password, host)) { stfpBatch.Download(hostPath, clientPath, overwrite); } }
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)); } }
public bool Exists(string relativePath) { var hostPath = GetFullHostPath(relativePath); using (var stfpBatch = new SFtpBatch(login, password, host)) { return(stfpBatch.Exists(hostPath)); } }
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"); } }); } }