Exemplo n.º 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();
 }
Exemplo n.º 2
0
 public void Dispose()
 {
     if (ftp != null)
     {
         ftp.Dispose();
         ftp = null;
     }
 }
Exemplo n.º 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));
     }
 }
Exemplo n.º 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);
 }
Exemplo n.º 5
0
 public FtpClientPoolArxOne(int maxPoolSize, FtpConfig ftpConfig)
     : base(ftpConfig, maxPoolSize)
 {
     _client    = _getClient();
     _semaphore = new SemaphoreSlim(maxPoolSize, maxPoolSize);
 }
Exemplo n.º 6
0
 public FtpClientPoolArxOne(int maxPoolSize, Uri uri, NetworkCredential credentials)
     : base(uri, credentials, maxPoolSize)
 {
     _client    = _getClient();
     _semaphore = new SemaphoreSlim(maxPoolSize, maxPoolSize);
 }
Exemplo n.º 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;
 }