Esempio n. 1
0
 public FtpResponse(FtpResponse response)
 {
     _rawText = response.RawText;
     _text = response.Text;
     _code = response.Code;
     _isInformational = response.IsInformational;
 }
 public void Enqueue(FtpResponse item)
 {
     lock (this)
     {
         _queue.Enqueue(item);
     }
 }
 public FtpDataConnectionTimeoutException(string message, FtpResponse response)
     : base(message, response)
 {
 }
Esempio n. 4
0
 public FtpException(string message, FtpResponse response, Exception innerException)
     : base(message, innerException)
 {
     _response = response;
 }
Esempio n. 5
0
 public FtpException(string message, FtpResponse response)
     : base(message)
 {
     _response = response;
 }
Esempio n. 6
0
        private void DontWaitForHappyCodes()
        {
            if (_responseQueue.Count == 0)
            {
                return;
            }

            _responseList.Clear();

            while (_responseQueue.Count > 0)
            {
                FtpResponse response = _responseQueue.Dequeue();
                _responseList.Add(response);
                RaiseServerResponseEvent(new FtpResponse(response));
            }

            _response = _responseList.GetLast();
        }
 public FtpAuthenticationException(string message, FtpResponse response)
     : base(message, response)
 {
 }
 public FtpProxyException(string message, FtpResponse response)
     : base(message, response)
 {
 }
Esempio n. 9
0
 private bool IsUnhappyResponse(FtpResponse response)
 {
     if (response.Code == FtpResponseCode.ServiceNotAvailableClosingControlConnection || response.Code == FtpResponseCode.CannotOpenDataConnection || response.Code == FtpResponseCode.ConnectionClosedSoTransferAborted || response.Code == FtpResponseCode.RequestedFileActionNotTaken || response.Code == FtpResponseCode.RequestedActionAbortedDueToLocalErrorInProcessing || response.Code == FtpResponseCode.RequestedActionNotTakenInsufficientStorage || response.Code == FtpResponseCode.SyntaxErrorCommandUnrecognized || response.Code == FtpResponseCode.SyntaxErrorInParametersOrArguments || response.Code == FtpResponseCode.CommandNotImplemented || response.Code == FtpResponseCode.BadSequenceOfCommands || response.Code == FtpResponseCode.CommandNotImplementedForThatParameter || response.Code == FtpResponseCode.NotLoggedIn || response.Code == FtpResponseCode.NeedAccountForStoringFiles || response.Code == FtpResponseCode.RequestedActionNotTakenFileUnavailable || response.Code == FtpResponseCode.RequestedActionAbortedPageTypeUnknown || response.Code == FtpResponseCode.RequestedFileActionAbortedExceededStorageAllocation || response.Code == FtpResponseCode.RequestedActionNotTakenFileNameNotAllowed)
         return true;
     else
         return false;
 }
 public FtpLoginException(string message, FtpResponse response)
     : base(message, response)
 {
 }
 public FtpDataTransferException(string message, FtpResponse response)
     : base(message, response)
 {
 }
 public FtpCommandResponseTimeoutException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
 public FtpCommandResponseTimeoutException(string message, FtpResponse response)
     : base(message, response)
 {
 }
 public FtpConnectionClosedException(string message, FtpResponse response)
     : base(message, response)
 {
 }
Esempio n. 15
0
        protected internal void WaitForHappyCodes(int timeout, params FtpResponseCode[] happyResponseCodes)
        {
            _responseList.Clear();

            do
            {
                FtpResponse response = GetNextCommandResponse(timeout);
                _responseList.Add(response);
                RaiseServerResponseEvent(new FtpResponse(response));

                if (!response.IsInformational)
                {
                    if (IsHappyResponse(response, happyResponseCodes))
                    {
                        break;
                    }

                    if (IsUnhappyResponse(response))
                    {
                        _response = response;
                        throw new FtpResponseException("FTP command failed.", response);
                    }
                }
            } while (true);

            _response = _responseList.GetLast();
        }
Esempio n. 16
0
 private void RaiseServerResponseEvent(FtpResponse response)
 {
     if (ServerResponse != null)
     {
         ServerResponse(this, new FtpResponseEventArgs(response));
     }
 }
 public FtpConnectionOpenException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
 public FtpCertificateValidationException(string message, FtpResponse response)
     : base(message, response)
 {
 }
 public FtpProxyException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
 public FtpDataCompressionException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
 public FtpConnectionBrokenException(string message, FtpResponse response)
     : base(message, response)
 {
 }
Esempio n. 22
0
        private bool IsHappyResponse(FtpResponse response, FtpResponseCode[] happyResponseCodes)
        {
            if (happyResponseCodes.Length == 0)
            {
                return true;
            }

            for (int j = 0; j < happyResponseCodes.Length; j++)
            {
                if (happyResponseCodes[j] == response.Code)
                {
                    return true;
                }
            }

            return false;
        }
 public FtpResponseEventArgs(FtpResponse response)
 {
     _response = response;
 }
 public FtpAuthenticationException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
 public FtpDataCompressionException(string message, FtpResponse response)
     : base(message, response)
 {
 }
 public FtpAsynchronousOperationException(string message, FtpResponse response)
     : base(message, response)
 {
 }