Class SingleFile
- Namespace
- ZeroInstall.Model
- Assembly
- ZeroInstall.Model.dll
Retrieves an implementation by downloading a single file.
[Serializable]
[Equatable]
public sealed class SingleFile : DownloadRetrievalMethod, IEquatable<XmlUnknown>, IEquatable<FeedElement>, ICloneable<RetrievalMethod>, IRecipeStep, ICloneable<IRecipeStep>, IEquatable<DownloadRetrievalMethod>, IEquatable<SingleFile>
- Inheritance
-
SingleFile
- Implements
- Inherited Members
Properties
Destination
The file's target path relative to the implementation root as a Unix-style path.
public required string Destination { get; set; }
Property Value
Executable
Set this to true
to mark the file as executable.
public bool Executable { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this SingleFile instance.
public override RetrievalMethod Clone()
Returns
- RetrievalMethod
The new copy of the SingleFile.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
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
FeedUriThe 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.
ToString()
Returns the file in the form "Location (Size) => Destination". Not safe for parsing!
public override string ToString()
Returns
Operators
operator ==(SingleFile?, SingleFile?)
Indicates whether the object on the left is equal to the object on the right.
public static bool operator ==(SingleFile? left, SingleFile? right)
Parameters
left
SingleFileThe left object
right
SingleFileThe right object
Returns
- bool
true if the objects are equal; otherwise, false.
operator !=(SingleFile?, SingleFile?)
Indicates whether the object on the left is not equal to the object on the right.
public static bool operator !=(SingleFile? left, SingleFile? right)
Parameters
left
SingleFileThe left object
right
SingleFileThe right object
Returns
- bool
true if the objects are not equal; otherwise, false.