Show / Hide Table of Contents

Class FileResource

File resource implementation of IResource.

Inheritance
object
AbstractResource
FileResource
Implements
IResource
Inherited Members
AbstractResource.Uri
AbstractResource.AbsolutePath
AbstractResource.GetResourceNameWithoutProtocol(string)
AbstractResource.ToString()
AbstractResource.Equals(object)
AbstractResource.GetHashCode()
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.IO.Resources
Assembly: Coherence.dll
Syntax
public class FileResource : AbstractResource, IResource
Remarks

Supports both a System.IO.FileInfo and a System.Uri.

Constructors

FileResource(string)

Creates a FileResource class using the resource name supplied.

Declaration
public FileResource(string resourceName)
Parameters
Type Name Description
string resourceName

The name of the file system resource.

Exceptions
Type Condition
ArgumentNullException

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

Methods

GetFileHandle(string)

Gets the System.IO.FileInfo for the specified resourceName.

Declaration
protected virtual FileInfo GetFileHandle(string resourceName)
Parameters
Type Name Description
string resourceName

The name of the file system resource.

Returns
Type Description
FileInfo

The System.IO.FileInfo for this FileResource.

GetStream()

Gets a stream for this IResource.

Declaration
public override Stream GetStream()
Returns
Type Description
Stream

A System.IO.Stream.

Overrides
AbstractResource.GetStream()
Exceptions
Type Condition
IOException

If the stream can not be opened.

FileNotFoundException

If the file can not be found.

See Also
IResource

Implements

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