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
retrievalMethodRetrievalMethodThe retrieval method.
executorICommandExecutorUsed to modify properties in an undoable fashion.
handlerITaskHandlerA callback object used when the user is to be informed about progress.
formatManifestFormatThe manifest format. Leave
nullfor 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
retrievalMethodDownloadRetrievalMethodThe retrieval method.
executorICommandExecutorUsed to modify properties in an undoable fashion.
localPathstringAn optional local file path where the
retrievalMethodhas 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
retrievalMethodDownloadRetrievalMethodThe retrieval method.
handlerITaskHandlerA callback object used when the user is to be informed about progress.
localPathstringAn optional local file path where the
retrievalMethodhas already been downloaded. Leavenullto 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.