Table of Contents

Class DownloadRetrievalMethod

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

Represents a retrieval method that downloads data from the net.

[Equatable]
public abstract class DownloadRetrievalMethod : RetrievalMethod, IEquatable<XmlUnknown>, IEquatable<FeedElement>, ICloneable<RetrievalMethod>, IRecipeStep, ICloneable<IRecipeStep>, IEquatable<DownloadRetrievalMethod>
Inheritance
DownloadRetrievalMethod
Implements
Derived
Inherited Members

Properties

DownloadSize

The effective size of the file on the server.

[Browsable(false)]
public virtual long DownloadSize { get; }

Property Value

long

Href

The URL to download the file from. Relative URLs are only allowed in local feed files.

[Browsable(false)]
public required Uri Href { get; set; }

Property Value

Uri

Size

The size of the file in bytes. The file must have the given size or it will be rejected.

public long Size { get; set; }

Property Value

long

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(DownloadRetrievalMethod?)

protected bool Equals(DownloadRetrievalMethod? other)

Parameters

other DownloadRetrievalMethod

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Normalize(FeedUri?)

Sets missing default values and handles legacy elements.

public override void Normalize(FeedUri? feedUri = null)

Parameters

feedUri FeedUri

The feed the data was originally loaded from.

Exceptions

UriFormatException

Href is relative and feedUri is a remote URI.

InvalidDataException

A required property is not set or invalid.

Operators

operator ==(DownloadRetrievalMethod?, DownloadRetrievalMethod?)

Indicates whether the object on the left is equal to the object on the right.

public static bool operator ==(DownloadRetrievalMethod? left, DownloadRetrievalMethod? right)

Parameters

left DownloadRetrievalMethod

The left object

right DownloadRetrievalMethod

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(DownloadRetrievalMethod?, DownloadRetrievalMethod?)

Indicates whether the object on the left is not equal to the object on the right.

public static bool operator !=(DownloadRetrievalMethod? left, DownloadRetrievalMethod? right)

Parameters

left DownloadRetrievalMethod

The left object

right DownloadRetrievalMethod

The right object

Returns

bool

true if the objects are not equal; otherwise, false.