Class RetrievalMethodExtensions
- Namespace
- ZeroInstall.Publish
- Assembly
- ZeroInstall.Publish.dll
Helpers for setting missing properties on RetrievalMethods.
public static class RetrievalMethodExtensions
- Inheritance
-
RetrievalMethodExtensions
- Inherited Members
Methods
CalculateDigest(RetrievalMethod, ICommandExecutor, ITaskHandler, ManifestFormat?)
Calculates a ManifestDigest for a retrieval method. Sets missing properties in the process.
public static ManifestDigest CalculateDigest(this RetrievalMethod retrievalMethod, ICommandExecutor executor, ITaskHandler handler, ManifestFormat? format = null)
Parameters
retrievalMethod
RetrievalMethodThe retrieval method.
executor
ICommandExecutorUsed to modify properties in an undoable fashion.
handler
ITaskHandlerA callback object used when the user is to be informed about progress.
format
ManifestFormatThe manifest format. Leave
null
for default.
Returns
- ManifestDigest
The generated digest.
Exceptions
- OperationCanceledException
The user canceled the task.
- WebException
A file could not be downloaded from the internet.
SetMissing(DownloadRetrievalMethod, ICommandExecutor, string?)
Sets missing properties on the retrieval method if they can be inferred.
public static void SetMissing(this DownloadRetrievalMethod retrievalMethod, ICommandExecutor executor, string? localPath = null)
Parameters
retrievalMethod
DownloadRetrievalMethodThe retrieval method.
executor
ICommandExecutorUsed to modify properties in an undoable fashion.
localPath
stringAn optional local file path where the
retrievalMethod
has already been downloaded.
ToTempDir(DownloadRetrievalMethod, ITaskHandler, string?)
Creates a temporary directory from a retrieval method. Sets missing properties in the process.
[MustDisposeResource]
public static TemporaryDirectory ToTempDir(this DownloadRetrievalMethod retrievalMethod, ITaskHandler handler, string? localPath = null)
Parameters
retrievalMethod
DownloadRetrievalMethodThe retrieval method.
handler
ITaskHandlerA callback object used when the user is to be informed about progress.
localPath
stringAn optional local file path where the
retrievalMethod
has already been downloaded. Leavenull
to download automatically.
Returns
- TemporaryDirectory
A temporary directory built using the retrieval method.
Exceptions
- OperationCanceledException
The user canceled the task.
- WebException
A file could not be downloaded from the internet.
- IOException
There is a problem writing a temporary file.
- UnauthorizedAccessException
Write access to a temporary file is not permitted.