Show / Hide Table of Contents

Class AbstractResource

Asbtract base class for other IResource implementations.

Inheritance
object
AbstractResource
EmbeddedResource
FileResource
UrlResource
Implements
IResource
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.IO.Resources
Assembly: Coherence.dll
Syntax
public abstract class AbstractResource : IResource

Constructors

AbstractResource(string)

Constructor that takes resource name and creates a new instance of the AbstractResource class.

Declaration
protected AbstractResource(string resourceName)
Parameters
Type Name Description
string resourceName

A String representing the resource.

Remarks

Since this is an abstract class it does not expose any public constructors.

Exceptions
Type Condition
ArgumentNullException

If resourceName is null or it contains only whitespace character(s).

Properties

AbsolutePath

Gets an absolute path of this resource.

Declaration
public string AbsolutePath { get; set; }
Property Value
Type Description
string
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
public virtual 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.

See Also
Uri

Methods

Equals(object)

Compares specified with the current object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The IResource object to compare to.

Returns
Type Description
bool

true if this resource and the passed object are equivalent.

Overrides
object.Equals(object)
Remarks

This implementation compares AbsolutePath values.

See Also
Uri

GetHashCode()

A hash function that returns the hashcode for this type, that is suitable for use in hashing algorithms and data structures like a hash table.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for this instance.

Overrides
object.GetHashCode()

GetResourceNameWithoutProtocol(string)

Strips protocol name (if present) from the resourceName.

Declaration
protected static string GetResourceNameWithoutProtocol(string resourceName)
Parameters
Type Name Description
string resourceName

Resource name.

Returns
Type Description
string

Resource name without the protocol name.

GetStream()

Opens an input stream for this resource.

Declaration
public abstract Stream GetStream()
Returns
Type Description
Stream

A System.IO.Stream.

Exceptions
Type Condition
IOException

If the stream could not be opened.

See Also
IResource

ToString()

Returns the textual information about this resource.

Declaration
public override string ToString()
Returns
Type Description
string

Human readable description of this resource.

Overrides
object.ToString()

Implements

IResource

See Also

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