Show / Hide Table of Contents

Class ResourceLoader

Loads resources from various sources.

Inheritance
object
ResourceLoader
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 resourceName.

Exceptions
Type Condition
UriFormatException

If an IResource type mapping does not exist for the supplied resourceName.

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 resourceName.

Exceptions
Type Condition
UriFormatException

If an IResource type mapping does not exist for the supplied resourceName.

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 resourceName starts with one of the known protocols; false if not, or if the supplied resourceName is itself null.

See Also

IResource
ResourceRegistry
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.