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
Inherited Members
Namespace: VersOne.Epub
Assembly: VersOne.Epub.dll
Syntax
public abstract class EpubRemoteContentFileRef : EpubContentFileRef
Constructors
View SourceEpubRemoteContentFileRef(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 |
ArgumentNullException | The |
Properties
View SourceContentLocation
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
View SourceUrl
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 SourceDownloadContentAsBytes()
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. |
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. |
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. |
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. |
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. |
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. |