1 // Copyright 2004-2008 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="area">The area.</param>
48 /// <param name="controller">The controller.</param>
49 /// <param name="action">The action.</param>
50 /// <param name="appVirtualDir">The app virtual dir.</param>
51 /// <param name="extension">The extension.</param>
52 public UrlInfo(string area
, string controller
, string action
, string appVirtualDir
, string extension
)
55 this.controller
= controller
;
57 this.appVirtualDir
= appVirtualDir
;
58 this.extension
= extension
;
62 /// Initializes a new instance of the <see cref="UrlInfo"/> class.
64 /// <param name="domain">The domain (host).</param>
65 /// <param name="subdomain">The subdomain (first token on the domain).</param>
66 /// <param name="appVirtualDir">The application virtual dir.</param>
67 /// <param name="protocol">Protocol (http/https)</param>
68 /// <param name="port">The port.</param>
69 /// <param name="urlRaw">The raw URL.</param>
70 /// <param name="area">The area, or empty.</param>
71 /// <param name="controller">The controller name.</param>
72 /// <param name="action">The action name.</param>
73 /// <param name="extension">The file extension.</param>
74 /// <param name="pathInfo">The path info.</param>
75 public UrlInfo(string domain
, string subdomain
, string appVirtualDir
, string protocol
, int port
, string urlRaw
,
76 string area
, string controller
, string action
, string extension
, string pathInfo
)
80 this.subdomain
= subdomain
;
83 this.controller
= controller
;
85 this.extension
= extension
;
86 this.pathInfo
= pathInfo
;
87 this.appVirtualDir
= appVirtualDir
;
88 this.protocol
= protocol
;
92 /// Gets the app virtual dir.
94 /// <value>The app virtual dir.</value>
95 public string AppVirtualDir
97 get { return appVirtualDir; }
103 /// <value>The port.</value>
112 /// <value>The domain.</value>
115 get { return domain; }
119 /// Gets the subdomain.
121 /// <value>The subdomain.</value>
122 public string Subdomain
124 get { return subdomain; }
128 /// Gets the URL raw.
130 /// <value>The URL raw.</value>
133 get { return urlRaw; }
139 /// <value>The area.</value>
146 /// Gets the controller.
148 /// <value>The controller.</value>
149 public string Controller
151 get { return controller; }
157 /// <value>The action.</value>
160 get { return action; }
164 /// Gets the protocol.
166 /// <value>The protocol.</value>
167 public string Protocol
169 get { return protocol; }
173 /// The URL extension, without the leading dot.
175 public string Extension
177 get { return extension; }
181 /// Gets the path info.
183 /// <value>The path info.</value>
184 public string PathInfo
186 get { return pathInfo; }