/// <summary> /// Initializes a new instance of the /// <see cref="BytesRoad.Net.Ftp.FtpProtocolException">FtpProtocolException</see> /// class with the specified message and additional information. /// </summary> /// <param name="message">The error message string.</param> /// <param name="respone">An instance of the /// <see cref="BytesRoad.Net.Ftp.FtpResponse">FtpResponse</see> /// class which represents the malformed response. /// </param> /// <param name="line"> /// Index of malformed line in response. /// </param> /// <param name="pos"> /// Position in line, where the error occurs. /// </param> public FtpProtocolException(string message, FtpResponse respone, int line, int pos) : base(message) { _response = Response; _line = line; _pos = pos; }
override internal void OnNewResponseLine(FtpResponse ctx, FtpResponseLine line) { if (FtpResponseLineType.Single == line.Type) { ctx.ChangeState(new FtpResponseCompleted()); } else if (FtpResponseLineType.First == line.Type) { ctx.ChangeState(new FtpResponseIntermediate()); } else { ctx.ChangeState(new FtpResponseFormatError()); throw new FtpProtocolException("Unexpected response line received.", null, -1, -1); //throw new FtpResponseFormatException("Unexpected respone line received.", ctx.CurrentLineNumber); } }
/// <summary> /// Initializes a new instance of the /// <see cref="BytesRoad.Net.Ftp.FtpAbortedException">FtpAbortedException</see> /// class with the specified message and additional information. /// </summary> /// <param name="message">The error message string.</param> /// <param name="response"> /// An instance of the /// <see cref="BytesRoad.Net.Ftp.FtpResponse">FtpResponse</see> /// class which represents the response from the FTP server. /// </param> public FtpAbortedException(string message, FtpResponse response) : base(message, response) { }
internal void SetResponse(FtpResponse r) { _response = r; }
/// <summary> /// Initializes a new instance of the /// <see cref="BytesRoad.Net.Ftp.FtpErrorException">FtpErrorException</see> /// class with the specified message and additional information. /// </summary> /// <param name="message">The error message string.</param> /// <param name="response"> /// An instance of the /// <see cref="BytesRoad.Net.Ftp.FtpResponse">FtpResponse</see> /// class which represents the negative response. /// </param> public FtpErrorException(string message, FtpResponse response) : base(message) { _response = response; }
/// <summary> /// Initializes a new instance of the /// <see cref="BytesRoad.Net.Ftp.FtpAccountRequiredException">FtpAccountRequiredException</see> /// class with the specified message and additional information. /// </summary> /// <param name="message">The error message string.</param> /// <param name="response"> /// An instance of the /// <see cref="BytesRoad.Net.Ftp.FtpResponse">FtpResponse</see> /// class which represents the response from the FTP server. /// </param> public FtpAccountRequiredException(string message, FtpResponse response) : base(message, response) { }
/// <summary> /// Initializes a new instance of the /// <see cref="BytesRoad.Net.Ftp.FtpRestartNotSupportedException">FtpRestartNotSupportedException</see> /// class with the specified message and additional information. /// </summary> /// <param name="message">The error message string.</param> /// <param name="response"> /// An instance of the /// <see cref="BytesRoad.Net.Ftp.FtpResponse">FtpResponse</see> /// class which represents the negative response. /// </param> public FtpRestartNotSupportedException(string message, FtpResponse response) : base(message, response) { }
abstract internal void OnNewResponseLine(FtpResponse ctx, FtpResponseLine line);
override internal void OnNewResponseLine(FtpResponse ctx, FtpResponseLine line) { throw new InvalidOperationException("Invalid response can't be modified"); }