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) { }
public FtpException(string message, FtpResponse response, Exception innerException) : base(message, innerException) { _response = response; }
public FtpException(string message, FtpResponse response) : base(message) { _response = response; }
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) { }
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) { }
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(); }
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) { }
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) { }