コード例 #1
0
 public FtpResponse(FtpResponse response)
 {
     _rawText = response.RawText;
     _text = response.Text;
     _code = response.Code;
     _isInformational = response.IsInformational;
 }
コード例 #2
0
 public void Enqueue(FtpResponse item)
 {
     lock (this)
     {
         _queue.Enqueue(item);
     }
 }
コード例 #3
0
 public FtpDataConnectionTimeoutException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #4
0
 public FtpException(string message, FtpResponse response, Exception innerException)
     : base(message, innerException)
 {
     _response = response;
 }
コード例 #5
0
 public FtpException(string message, FtpResponse response)
     : base(message)
 {
     _response = response;
 }
コード例 #6
0
ファイル: FtpBase.cs プロジェクト: EncompassTechnologies/Biko
        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();
        }
コード例 #7
0
 public FtpAuthenticationException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #8
0
 public FtpProxyException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #9
0
ファイル: FtpBase.cs プロジェクト: EncompassTechnologies/Biko
 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;
 }
コード例 #10
0
 public FtpLoginException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #11
0
 public FtpDataTransferException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #12
0
 public FtpCommandResponseTimeoutException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
コード例 #13
0
 public FtpCommandResponseTimeoutException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #14
0
 public FtpConnectionClosedException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #15
0
ファイル: FtpBase.cs プロジェクト: EncompassTechnologies/Biko
        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();
        }
コード例 #16
0
ファイル: FtpBase.cs プロジェクト: EncompassTechnologies/Biko
 private void RaiseServerResponseEvent(FtpResponse response)
 {
     if (ServerResponse != null)
     {
         ServerResponse(this, new FtpResponseEventArgs(response));
     }
 }
コード例 #17
0
 public FtpConnectionOpenException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
コード例 #18
0
 public FtpCertificateValidationException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #19
0
 public FtpProxyException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
コード例 #20
0
 public FtpDataCompressionException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
コード例 #21
0
 public FtpConnectionBrokenException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #22
0
ファイル: FtpBase.cs プロジェクト: EncompassTechnologies/Biko
        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;
        }
コード例 #23
0
 public FtpResponseEventArgs(FtpResponse response)
 {
     _response = response;
 }
コード例 #24
0
 public FtpAuthenticationException(string message, FtpResponse response, Exception innerException)
     : base(message, response, innerException)
 {
 }
コード例 #25
0
 public FtpDataCompressionException(string message, FtpResponse response)
     : base(message, response)
 {
 }
コード例 #26
0
 public FtpAsynchronousOperationException(string message, FtpResponse response)
     : base(message, response)
 {
 }