public void Add(FtpUploadFile file) { if (file == null || string.IsNullOrWhiteSpace(file.Name) || string.IsNullOrWhiteSpace(file.LocalPath)) { throw new FtpException("매개변수가 null 이거나 속성 값이 올바르지 않습니다."); } if (!File.Exists(file.LocalPath)) { throw new FtpException("업로드할 파일이 존재하지 않습니다."); } var exists = this._files.Exists(x => x.LocalPath == file.LocalPath && x.Name == file.Name); if (!exists) { this._files.Add(file); } }
public void Add(string fileName, string fileLocalPath) { FtpUploadFile file = new FtpUploadFile(fileName, fileLocalPath); Add(file); }