Class ResourceLoader
Loads resources from various sources.
Inherited Members
Namespace: Tangosol.IO.Resources
Assembly: Coherence.dll
Syntax
public class ResourceLoader
Remarks
Protocol name in the resource URI is used to determine the appropriate resource handler.
Fields
PROTOCOL_SEPARATOR
The separator between the protocol name and the resource name.
Declaration
public const string PROTOCOL_SEPARATOR = "://"
Field Value
Type | Description |
---|---|
string |
Methods
GetResource(string)
Returns an IResource that has been mapped to the
protocol of the supplied resourceName
.
Declaration
public static IResource GetResource(string resourceName)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the resource. |
Returns
Type | Description |
---|---|
IResource | A new IResource instance for the supplied
|
Exceptions
Type | Condition |
---|---|
UriFormatException | If an IResource type mapping does not exist for the
supplied |
Exception | In the case of any errors arising from the instantiation of the returned IResource instance. |
GetResource(string, bool)
Returns an IResource that has been mapped to the
protocol of the supplied resourceName
.
Declaration
public static IResource GetResource(string resourceName, bool relative)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the resource. |
bool | relative | If true the returned IResource will be relative to the application base directory or web application root. |
Returns
Type | Description |
---|---|
IResource | A new IResource instance for the supplied
|
Exceptions
Type | Condition |
---|---|
UriFormatException | If an IResource type mapping does not exist for the
supplied |
Exception | In the case of any errors arising from the instantiation of the returned IResource instance. |
HasProtocol(string)
Checks that the supplied resourceName
starts
with one of the protocol names currently mapped by this
ResourceLoader instance.
Declaration
public static bool HasProtocol(string resourceName)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the resource. |
Returns
Type | Description |
---|---|
bool | true if the supplied |