Example #1
0
 /// <summary>
 /// Deletes a file at the specified URI.
 /// </summary>
 /// <param name="serverUri">FTP File URI.</param>
 /// <param name="settings">The settings.</param>
 public void DeleteFile(Uri serverUri, FtpSettings settings)
 {
     if (serverUri == null)
     {
         throw new ArgumentNullException(nameof(serverUri), "Server URI is null.");
     }
     if (string.IsNullOrWhiteSpace(settings.Username))
     {
         throw new ArgumentNullException(nameof(settings.Username), "Username is null.");
     }
     if (string.IsNullOrWhiteSpace(settings.Password))
     {
         throw new ArgumentNullException(nameof(settings.Password), "Password is null.");
     }
     if (serverUri.Scheme != Uri.UriSchemeFtp)
     {
         throw new ArgumentOutOfRangeException(nameof(serverUri), "Server URI scheme is not FTP.");
     }
     _ftpService.DeleteFile(serverUri, settings.Username, settings.Password);
 }
Example #2
0
        /// <summary>
        /// Deletes a file at the specified URI.
        /// </summary>
        /// <param name="serverUri">FTP File URI.</param>
        /// <param name="settings">The settings.</param>
        public void DeleteFile(Uri serverUri, FtpSettings settings)
        {
            CheckParams(serverUri, settings);

            _ftpService.DeleteFile(serverUri, settings.Username, settings.Password);
        }