public void HandleMethod()
{
_handler.Context.Response.StatusCode = 207;
_handler.Context.Response.ContentType = "text/xml";
_handler.Context.Response.CacheControl = "no-cache";
_handler.Context.Response.AddHeader("Content-Location", _handler.RepositoryPathToUrl(_handler.Path));
RequestDepth = Common.GetDepth(_handler.Context.Request.Headers["Depth"]);
switch (RequestDepth)
{
case Depth.Current:
{
ProcessCurrent();
break;
}
case Depth.Children:
{
ProcessChildren();
break;
}
case Depth.Infinity:
{
ProcessChildren();
break;
//throw (new NotImplementedException("Infinity request is not implemented."));
}
}
if (_writer == null)
{
return;
}
_writer.Flush();
_writer.BaseStream.Seek(0, System.IO.SeekOrigin.Begin);
var reader = new System.IO.StreamReader(_writer.BaseStream, System.Text.Encoding.UTF8);
string ret = reader.ReadToEnd();
_writer.Close();
#region Debug
System.Diagnostics.Debug.Write(string.Concat("RESPONSE: ", ret));
#endregion
_handler.Context.Response.Write(ret);
}