2 // System.Net.FtpWebResponse.cs
5 // Carlos Alberto Cortez (calberto.cortez@gmail.com)
7 // (c) Copyright 2006 Novell, Inc. (http://www.novell.com)
12 using System.Runtime.Serialization;
18 public class FtpWebResponse : WebResponse
20 Stream stream = Stream.Null;
22 FtpStatusCode statusCode;
23 DateTime lastModified = DateTime.MinValue;
24 string bannerMessage = String.Empty;
25 string welcomeMessage = String.Empty;
26 string exitMessage = String.Empty;
27 string statusDescription;
31 internal long contentLength = -1;
33 internal FtpWebResponse (Uri uri, string method, bool keepAlive)
37 //this.keepAlive = keepAlive;
40 public override long ContentLength {
46 public override WebHeaderCollection Headers {
48 return new WebHeaderCollection (true);
52 public override Uri ResponseUri {
58 public DateTime LastModified {
67 public string BannerMessage {
72 bannerMessage = value;
76 public string WelcomeMessage {
78 return welcomeMessage;
81 welcomeMessage = value;
85 public string ExitMessage {
94 public FtpStatusCode StatusCode {
103 public string StatusDescription {
105 return statusDescription;
108 statusDescription = value;
112 public override void Close ()
122 public override Stream GetResponseStream ()
124 if (method != WebRequestMethods.Ftp.DownloadFile &&
125 method != WebRequestMethods.Ftp.ListDirectory)
131 internal Stream Stream {
137 internal void UpdateStatus (FtpStatusCode code, string desc)
140 statusDescription = desc;
145 ((IDisposable) this).Dispose ();
148 void CheckDisposed ()
151 throw new ObjectDisposedException (GetType ().FullName);