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
.Core
.Resource
22 /// Represents a 'streamable' resource. Can
23 /// be a file, a resource in an assembly.
25 public interface IResource
: IDisposable
31 /// Only valid for resources that
32 /// can be obtained through relative paths
34 String FileBasePath { get; }
37 /// Returns a reader for the stream
40 /// It's up to the caller to dispose the reader.
42 /// <returns></returns>
43 TextReader
GetStreamReader();
46 /// Returns a reader for the stream
49 /// It's up to the caller to dispose the reader.
51 /// <param name="encoding"></param>
52 /// <returns></returns>
53 TextReader
GetStreamReader(Encoding encoding
);
56 /// Returns an instance of <see cref="IResource"/>
57 /// created according to the <c>relativePath</c>
58 /// using itself as the root.
60 /// <param name="relativePath"></param>
61 /// <returns></returns>
62 IResource
CreateRelative(String relativePath
);