1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
20 /// Represents the tokenized information from an Url.
25 private readonly int port
;
26 private readonly string domain
, subdomain
, appVirtualDir
, protocol
;
27 private readonly string urlRaw
;
28 private readonly string area
, controller
, action
, extension
;
29 private readonly string pathInfo
;
32 /// Initializes a new instance of the <see cref="UrlInfo"/> class.
34 /// <param name="area">The area.</param>
35 /// <param name="controller">The controller.</param>
36 /// <param name="action">The action.</param>
37 public UrlInfo(string area
, string controller
, string action
)
40 this.controller
= controller
;
45 /// Initializes a new instance of the <see cref="UrlInfo"/> class.
47 /// <param name="domain">The domain (host).</param>
48 /// <param name="subdomain">The subdomain (first token on the domain).</param>
49 /// <param name="appVirtualDir">The application virtual dir.</param>
50 /// <param name="protocol">Protocol (http/https)</param>
51 /// <param name="port">The port.</param>
52 /// <param name="urlRaw">The raw URL.</param>
53 /// <param name="area">The area, or empty.</param>
54 /// <param name="controller">The controller name.</param>
55 /// <param name="action">The action name.</param>
56 /// <param name="extension">The file extension.</param>
57 /// <param name="pathInfo">The path info.</param>
58 public UrlInfo(string domain
, string subdomain
, string appVirtualDir
, string protocol
, int port
, string urlRaw
,
59 string area
, string controller
, string action
, string extension
, string pathInfo
)
63 this.subdomain
= subdomain
;
66 this.controller
= controller
;
68 this.extension
= extension
;
69 this.pathInfo
= pathInfo
;
70 this.appVirtualDir
= appVirtualDir
;
71 this.protocol
= protocol
;
75 /// Gets the app virtual dir.
77 /// <value>The app virtual dir.</value>
78 public string AppVirtualDir
80 get { return appVirtualDir; }
86 /// <value>The port.</value>
95 /// <value>The domain.</value>
98 get { return domain; }
102 /// Gets the subdomain.
104 /// <value>The subdomain.</value>
105 public string Subdomain
107 get { return subdomain; }
111 /// Gets the URL raw.
113 /// <value>The URL raw.</value>
116 get { return urlRaw; }
122 /// <value>The area.</value>
129 /// Gets the controller.
131 /// <value>The controller.</value>
132 public string Controller
134 get { return controller; }
140 /// <value>The action.</value>
143 get { return action; }
147 /// Gets the protocol.
149 /// <value>The protocol.</value>
150 public string Protocol
152 get { return protocol; }
156 /// The URL extension, without the leading dot.
158 public string Extension
160 get { return extension; }
164 /// Gets the path info.
166 /// <value>The path info.</value>
167 public string PathInfo
169 get { return pathInfo; }