Class Resource

Class Resource

Namespace: Aspose.Html.Saving
Assembly: Aspose.HTML.dll (25.2.0)

This class describes a resource and provides methods for processing it.

[ComVisible(true)]
public class Resource

Inheritance

objectResource

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

MimeType

Returns the Aspose.Html.MimeType of this resource. Can be null if the resource was not found.

public MimeType MimeType { get; }

Property Value

MimeType

OriginalReference

Returns a string containing the original reference to this resource.

public string OriginalReference { get; }

Property Value

string

OriginalUrl

Returns a URL indicating where this resource was located.

public Url OriginalUrl { get; }

Property Value

Url

OutputUrl

Gets or sets the URL indicating where the resource will be located after processing.

public Url OutputUrl { get; set; }

Property Value

Url

Status

Returns the current status of the resource.

public ResourceStatus Status { get; }

Property Value

ResourceStatus

Methods

Embed(ResourceHandlingContext)

Embeds this resource within its parent by encoding it as Base64. The encoding result will be written to Aspose.Html.Saving.Resource.OutputUrl.

public Resource Embed(ResourceHandlingContext context)

Parameters

context ResourceHandlingContext

Resource handling context.

Returns

Resource

This resource so that you can chain calls.

Exceptions

InvalidOperationException

Raised if there is no Aspose.Html.Saving.ResourceHandlingContext.ParentResource because there is nowhere to embed the result.

Save(Stream, ResourceHandlingContext)

Saves the resource to the provided stream.

public Resource Save(Stream stream, ResourceHandlingContext context)

Parameters

stream Stream

The stream in which the resource will be saved.

context ResourceHandlingContext

Resource handling context.

Returns

Resource

This resource so that you can chain calls.

Exceptions

InvalidOperationException

Raised if Aspose.Html.Saving.Resource.OutputUrl is null. Aspose.Html.Saving.Resource.OutputUrl should be specified before saving the resource because otherwise it is impossible to specify the correct reference in the resources referencing this one.

WithOutputUrl(Url)

Specifies the new URL indicating where the resource will be located after processing.

public Resource WithOutputUrl(Url outputUrl)

Parameters

outputUrl Url

The new URL indicating where the resource will be located after processing.

Returns

Resource

This resource so that you can chain calls.