Changed the way the paths from AssemblySourceInfo will be returned, will use \ instea...
[castle.git] / MonoRail / Castle.MonoRail.Framework / Internal / UrlInfo.cs
blobf2865a3783da669c4286a84e1124b5f92abc494f
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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
17 using System;
19 /// <summary>
20 /// Represents the tokenized information from an Url.
21 /// </summary>
22 [Serializable]
23 public class UrlInfo
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;
31 /// <summary>
32 /// Initializes a new instance of the <see cref="UrlInfo"/> class.
33 /// </summary>
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)
39 this.area = area;
40 this.controller = controller;
41 this.action = action;
44 /// <summary>
45 /// Initializes a new instance of the <see cref="UrlInfo"/> class.
46 /// </summary>
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)
61 this.port = port;
62 this.domain = domain;
63 this.subdomain = subdomain;
64 this.urlRaw = urlRaw;
65 this.area = area;
66 this.controller = controller;
67 this.action = action;
68 this.extension = extension;
69 this.pathInfo = pathInfo;
70 this.appVirtualDir = appVirtualDir;
71 this.protocol = protocol;
74 /// <summary>
75 /// Gets the app virtual dir.
76 /// </summary>
77 /// <value>The app virtual dir.</value>
78 public string AppVirtualDir
80 get { return appVirtualDir; }
83 /// <summary>
84 /// Gets the port.
85 /// </summary>
86 /// <value>The port.</value>
87 public int Port
89 get { return port; }
92 /// <summary>
93 /// Gets the domain.
94 /// </summary>
95 /// <value>The domain.</value>
96 public string Domain
98 get { return domain; }
101 /// <summary>
102 /// Gets the subdomain.
103 /// </summary>
104 /// <value>The subdomain.</value>
105 public string Subdomain
107 get { return subdomain; }
110 /// <summary>
111 /// Gets the URL raw.
112 /// </summary>
113 /// <value>The URL raw.</value>
114 public string UrlRaw
116 get { return urlRaw; }
119 /// <summary>
120 /// Gets the area.
121 /// </summary>
122 /// <value>The area.</value>
123 public string Area
125 get { return area; }
128 /// <summary>
129 /// Gets the controller.
130 /// </summary>
131 /// <value>The controller.</value>
132 public string Controller
134 get { return controller; }
137 /// <summary>
138 /// Gets the action.
139 /// </summary>
140 /// <value>The action.</value>
141 public string Action
143 get { return action; }
146 /// <summary>
147 /// Gets the protocol.
148 /// </summary>
149 /// <value>The protocol.</value>
150 public string Protocol
152 get { return protocol; }
155 /// <summary>
156 /// The URL extension, without the leading dot.
157 /// </summary>
158 public string Extension
160 get { return extension; }
163 /// <summary>
164 /// Gets the path info.
165 /// </summary>
166 /// <value>The path info.</value>
167 public string PathInfo
169 get { return pathInfo; }