Interface IResource
Interface for access to different types of resources that can provide a System.IO.Stream to read from.
Namespace: Tangosol.IO.Resources
Assembly: Coherence.dll
Syntax
public interface IResource
Remarks
This interface encapsulates a resource descriptor that abstracts away from the underlying type of resource; possible resource types include files, URLs, web resources and assmbly embedded resources.
Properties
AbsolutePath
Gets an absolute path of this resource.
Declaration
string AbsolutePath { get; }
Property Value
Type | Description |
---|---|
string | The absolute path of this resource. |
Remarks
The exact value returned will depend on the specific resource implementation.
For example, file system-based resources that support relative path resolution, such as FileResource, should return an absolute path of the resource on the file system. Other resource types should return fully qualified URI for the resource, which is basically the value of the Uri property.Uri
Gets the fully qualified URI for this IResource.
Declaration
string Uri { get; }
Property Value
Type | Description |
---|---|
string | The fully qualified resource URI. |
Remarks
Fuly qualified URI for a resource is the name of the resource as specified, with a protocol name prepended if necessary.
Methods
GetStream()
Opens an input stream for this resource.
Declaration
Stream GetStream()
Returns
Type | Description |
---|---|
Stream | A System.IO.Stream. |
Remarks
caution
Clients of this interface must be aware that every call of this method will create a freshSystem.IO.Stream; it is the responsibility of the calling code to close any such System.IO.Stream.
Exceptions
Type | Condition |
---|---|
IOException | If the stream could not be opened. |