Show / Hide Table of Contents

Class EpubRemoteContentFileRef

The base class for a content file reference located outside of the EPUB archive (e.g., an HTML file or an image). Unlike EpubRemoteContentFile, the classes derived from this base class contain only a reference to the file but don't contain its content.

Inheritance
object
EpubContentFileRef
EpubRemoteContentFileRef
EpubRemoteByteContentFileRef
EpubRemoteTextContentFileRef
Inherited Members
EpubContentFileRef.Key
EpubContentFileRef.ContentType
EpubContentFileRef.ContentMimeType
EpubContentFileRef.ContentFileType
EpubContentFileRef.Metadata
EpubContentFileRef.EpubContentLoader
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VersOne.Epub
Assembly: VersOne.Epub.dll
Syntax
public abstract class EpubRemoteContentFileRef : EpubContentFileRef

Constructors

View Source

EpubRemoteContentFileRef(EpubContentFileRefMetadata, IEpubContentLoader)

Initializes a new instance of the EpubRemoteContentFileRef class with a specified content file key, a content type of the file reference, a MIME type of the file's content, and content downloader options.

Declaration
protected EpubRemoteContentFileRef(EpubContentFileRefMetadata metadata, IEpubContentLoader epubContentLoader)
Parameters
Type Name Description
EpubContentFileRefMetadata metadata

Metadata of this content file reference.

IEpubContentLoader epubContentLoader

A reference to the EPUB content loader which provides methods to download the content of this file.

Exceptions
Type Condition
ArgumentNullException

The metadata parameter is null.

ArgumentNullException

The epubContentLoader parameter is null.

Properties

View Source

ContentLocation

Gets the location of the content file which is always REMOTE for remote content file references.

Declaration
public override EpubContentLocation ContentLocation { get; }
Property type: EpubContentLocation
Overrides
EpubContentFileRef.ContentLocation
View Source

Url

Gets the absolute URI of the remote content file (as it is specified in the EPUB manifest).

Declaration
public string Url { get; }
Property type: string

Methods

View Source

DownloadContentAsBytes()

Downloads the whole content of the referenced file and returns it as a byte array.

Declaration
public byte[] DownloadContentAsBytes()
Returns
Type Description
byte[]

Content of the referenced file.

View Source

DownloadContentAsBytesAsync()

Asynchronously downloads the whole content of the referenced file and returns it as a byte array.

Declaration
public Task<byte[]> DownloadContentAsBytesAsync()
Returns
Type Description
Task<byte[]>

A task that represents the asynchronous download operation. The value of the TResult parameter contains the content of the referenced file.

View Source

DownloadContentAsText()

Downloads the whole content of the referenced file and returns it as a string.

Declaration
public string DownloadContentAsText()
Returns
Type Description
string

Content of the referenced file.

View Source

DownloadContentAsTextAsync()

Asynchronously downloads the whole content of the referenced file and returns it as a string.

Declaration
public Task<string> DownloadContentAsTextAsync()
Returns
Type Description
Task<string>

A task that represents the asynchronous download operation. The value of the TResult parameter contains the content of the referenced file.

View Source

GetDownloadingContentStream()

Starts the download of the referenced file and returns a Stream to access its content.

Declaration
public Stream GetDownloadingContentStream()
Returns
Type Description
Stream

A Stream to access the referenced file's content.

View Source

GetDownloadingContentStreamAsync()

Starts the download of the referenced file and returns a Stream to access its content.

Declaration
public Task<Stream> GetDownloadingContentStreamAsync()
Returns
Type Description
Task<Stream>

A task that represents the asynchronous download operation. The value of the TResult parameter contains a Stream to access the referenced file's content.

  • View Source
In this article
Back to top Generated by DocFX