Esempio n. 1
0
        public FtpClient(FtpClientConfiguration configuration)
        {
            this.configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }
        }
Esempio n. 2
0
        public FtpClient(FtpClientConfiguration configuration)
        {
            this.Configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }

            dnsResolver = new DnsResolver();
        }
Esempio n. 3
0
        public void Configure(FtpClientConfiguration configuration)
        {
            Configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }

            ControlStream = new FtpControlStream(Configuration, new DnsResolver());
            Configuration.BaseDirectory = $"/{Configuration.BaseDirectory.TrimStart( '/' )}";
        }
Esempio n. 4
0
        public void Configure(FtpClientConfiguration configuration)
        {
            Configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }

            if (Uri.IsWellFormedUriString(configuration.Host, UriKind.Absolute))
            {
                configuration.Host = new Uri(configuration.Host).Host;
            }


            ControlStream = new FtpControlStream(Configuration, new DnsResolver());
            Configuration.BaseDirectory = $"/{Configuration.BaseDirectory.TrimStart( '/' )}";
        }
Esempio n. 5
0
 public FtpClient(FtpClientConfiguration configuration)
 {
     Configure(configuration);
 }