예제 #1
0
 public FtpWrapper(IEnumerable <ApplicationFileInfo> localSet, string rootDirectory = null, string[] skipFiles = null)
 {
     this.localSet      = localSet;
     this.rootDirectory = rootDirectory;
     this.skipFiles     = skipFiles;
     this.ftp           = null;
     scanLocalSet();
 }
예제 #2
0
 public void Dispose()
 {
     if (ftp != null)
     {
         ftp.Dispose();
         ftp = null;
     }
 }
예제 #3
0
 private IEnumerable <ArxOne.Ftp.FtpEntry> _list(ArxOne.Ftp.FtpClient client, string path)
 {
     if (client.ServerFeatures.HasFeature("MLSD"))
     {
         return(client.MlsdEntries(path));
     }
     else
     {
         return(client.ListEntries(path));
     }
 }
예제 #4
0
 public bool Connect(string host, int port, string username, string password)
 {
     try
     {
         ftp = new ArxOne.Ftp.FtpClient(new Uri($"ftp://{host}:{port}"), new NetworkCredential(username, password));
         return(true);
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.Message);
     }
     return(false);
 }
예제 #5
0
 public FtpClientPoolArxOne(int maxPoolSize, FtpConfig ftpConfig)
     : base(ftpConfig, maxPoolSize)
 {
     _client    = _getClient();
     _semaphore = new SemaphoreSlim(maxPoolSize, maxPoolSize);
 }
예제 #6
0
 public FtpClientPoolArxOne(int maxPoolSize, Uri uri, NetworkCredential credentials)
     : base(uri, credentials, maxPoolSize)
 {
     _client    = _getClient();
     _semaphore = new SemaphoreSlim(maxPoolSize, maxPoolSize);
 }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FtpConnection"/> class.
 /// </summary>
 /// <param name="client">The FTP client.</param>
 public FtpConnection(FtpClient client)
 {
     Client = client;
 }