Class RetrievalMethodExtensions
Helpers for setting missing properties on RetrievalMethods.
Namespace: ZeroInstall.Publish
Assembly: ZeroInstall.Publish.dll
Syntax
public static class RetrievalMethodExtensions : Object
Methods
CalculateDigest(RetrievalMethod, ICommandExecutor, ITaskHandler, ManifestFormat)
Calculates a ManifestDigest for a retrieval method. Sets missing properties in the process.
Declaration
public static ManifestDigest CalculateDigest(this RetrievalMethod retrievalMethod, ICommandExecutor executor, ITaskHandler handler, ManifestFormat format = null)
Parameters
Type | Name | Description |
---|---|---|
RetrievalMethod | retrievalMethod | The retrieval method. |
ICommandExecutor | executor | Used to modify properties in an undoable fashion. |
ITaskHandler | handler | A callback object used when the the user is to be informed about progress. |
ManifestFormat | format | The manifest format. Leave |
Returns
Type | Description |
---|---|
ManifestDigest | The generated digest. |
Exceptions
Type | Condition |
---|---|
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.
Declaration
public static void SetMissing(this DownloadRetrievalMethod retrievalMethod, ICommandExecutor executor, string localPath = null)
Parameters
Type | Name | Description |
---|---|---|
DownloadRetrievalMethod | retrievalMethod | The retrieval method. |
ICommandExecutor | executor | Used to modify properties in an undoable fashion. |
String | localPath | An optional local file path where the |
ToTempDir(DownloadRetrievalMethod, ITaskHandler, String)
Creates a temporary directory from a retrieval method. Sets missing properties in the process.
Declaration
public static TemporaryDirectory ToTempDir(this DownloadRetrievalMethod retrievalMethod, ITaskHandler handler, string localPath = null)
Parameters
Type | Name | Description |
---|---|---|
DownloadRetrievalMethod | retrievalMethod | The retrieval method. |
ITaskHandler | handler | A callback object used when the the user is to be informed about progress. |
String | localPath | An optional local file path where the |
Returns
Type | Description |
---|---|
TemporaryDirectory | A temporary directory built using the retrieval method. |
Exceptions
Type | Condition |
---|---|
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. |