Added RedirectUsingNamedRoute
[castle.git] / Core / Castle.Core / Resource / IResource.cs
blob712951485dc7b3155c24968bd1533266f64ec0fb
1 // Copyright 2004-2008 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.Core.Resource
17 using System;
18 using System.IO;
19 using System.Text;
21 /// <summary>
22 /// Represents a 'streamable' resource. Can
23 /// be a file, a resource in an assembly.
24 /// </summary>
25 public interface IResource : IDisposable
27 /// <summary>
28 ///
29 /// </summary>
30 /// <remarks>
31 /// Only valid for resources that
32 /// can be obtained through relative paths
33 /// </remarks>
34 String FileBasePath { get; }
36 /// <summary>
37 /// Returns a reader for the stream
38 /// </summary>
39 /// <remarks>
40 /// It's up to the caller to dispose the reader.
41 /// </remarks>
42 /// <returns></returns>
43 TextReader GetStreamReader();
45 /// <summary>
46 /// Returns a reader for the stream
47 /// </summary>
48 /// <remarks>
49 /// It's up to the caller to dispose the reader.
50 /// </remarks>
51 /// <param name="encoding"></param>
52 /// <returns></returns>
53 TextReader GetStreamReader(Encoding encoding);
55 /// <summary>
56 /// Returns an instance of <see cref="IResource"/>
57 /// created according to the <c>relativePath</c>
58 /// using itself as the root.
59 /// </summary>
60 /// <param name="relativePath"></param>
61 /// <returns></returns>
62 IResource CreateRelative(String relativePath);