Zero Install .NET API  2.21.0
ZeroInstall.Store.Implementations.ImplementationStoreUtils Class Reference

Helper methods for IImplementationStores and paths. More...

Static Public Member Functions

static string GetPath (this IImplementationStore store, ImplementationBase implementation)
 Determines the local path of an implementation. More...
 
static bool IsImplementation (string path, [NotNullWhen(true)] out string? implementationPath)
 Determines whether a path looks like it is inside a store implementation known by ManifestFormat. More...
 
static void Verify (string path, ManifestDigest manifestDigest, ITaskHandler handler)
 Checks whether an implementation directory matches the expected digest. Throws DigestMismatchException if it does not match. More...
 

Static Package Functions

static ? Manifest Verify (Manifest manifest, string expectedDigest)
 Checks whether a Manifest matches the expected digest. Returns the original manifest or one with backwards-compatability modifications applied if it matches. More...
 
static ? IDisposable TryUnseal (string path)
 Tries to temporarily remove the write protection of an implementation. More...
 

Detailed Description

Helper methods for IImplementationStores and paths.

Member Function Documentation

◆ GetPath()

static string ZeroInstall.Store.Implementations.ImplementationStoreUtils.GetPath ( this IImplementationStore  store,
ImplementationBase  implementation 
)
inlinestatic

Determines the local path of an implementation.

Parameters
storeThe store containing the implementation.
implementationThe implementation to be located.
Returns
A fully qualified path to the directory containing the implementation.
Exceptions
ImplementationNotFoundExceptionThe implementation is not cached yet.
UnauthorizedAccessExceptionRead access to the store is not permitted.

◆ IsImplementation()

static bool ZeroInstall.Store.Implementations.ImplementationStoreUtils.IsImplementation ( string  path,
[NotNullWhen(true)] out string?  implementationPath 
)
inlinestatic

Determines whether a path looks like it is inside a store implementation known by ManifestFormat.

Parameters
pathA path to a directory that may or may not be inside a store implementation.
implementationPathThe top-level of the detected store implementation directory if any; null otherwise.

Performs no file system access. Only looks at the path string itself.

◆ TryUnseal()

static ? IDisposable ZeroInstall.Store.Implementations.ImplementationStoreUtils.TryUnseal ( string  path)
inlinestaticpackage

Tries to temporarily remove the write protection of an implementation.

Parameters
pathA path inside an implementation store.
Returns
A token that can be IDisposable.Disposed to restore the write protection. null if the write protection could not be removed.

◆ Verify() [1/2]

static ? Manifest ZeroInstall.Store.Implementations.ImplementationStoreUtils.Verify ( Manifest  manifest,
string  expectedDigest 
)
inlinestaticpackage

Checks whether a Manifest matches the expected digest. Returns the original manifest or one with backwards-compatability modifications applied if it matches.

Parameters
manifestThe manifest to check.
expectedDigestThe expected digest.
Returns
The Manifest if it matches; null otherwise.

◆ Verify() [2/2]

static void ZeroInstall.Store.Implementations.ImplementationStoreUtils.Verify ( string  path,
ManifestDigest  manifestDigest,
ITaskHandler  handler 
)
inlinestatic

Checks whether an implementation directory matches the expected digest. Throws DigestMismatchException if it does not match.

Parameters
pathThe path of the directory ot check.
manifestDigestThe expected digest.
handlerA callback object used when the the user is to be informed about progress.
Exceptions
OperationCanceledExceptionThe user canceled the task.
NotSupportedExceptionmanifestDigest does not list any supported digests.
IOExceptionThe directory could not be processed.
UnauthorizedAccessExceptionRead access to the directory is not permitted.
DigestMismatchExceptionThe directory does not match the expected digest

The documentation for this class was generated from the following file: