SenseNet.Services.WebDav.WebDavHandler.RepositoryPathToUrl C# (CSharp) Method

RepositoryPathToUrl() public method

public RepositoryPathToUrl ( string repositoryPath ) : string
repositoryPath string
return string
		public string RepositoryPathToUrl(string repositoryPath)
		{
            var repoPath = repositoryPath;
            if (repoPath.StartsWith("/Root/"))
                repoPath = repoPath.Substring(6);
            var domain = Protocol + Host;

            var url = string.IsNullOrEmpty(repoPath) ? 
                domain : 
                RepositoryPath.Combine(domain, repoPath);

            return url;
		}

Usage Example

Beispiel #1
0
        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);
        }
All Usage Examples Of SenseNet.Services.WebDav.WebDavHandler::RepositoryPathToUrl