Class ImplementationStoreUtils
- Namespace
- ZeroInstall.Store.Implementations
- Assembly
- ZeroInstall.Store.dll
Helper methods for IImplementationStores and paths.
public static class ImplementationStoreUtils
- Inheritance
-
ImplementationStoreUtils
- Inherited Members
Methods
Audit(IImplementationStore, ITaskHandler)
Checks whether all implementations in the store still matches the expected digest. Asks the user whether to delete the implementation if it does not match.
public static void Audit(this IImplementationStore store, ITaskHandler handler)
Parameters
store
IImplementationStoreThe store containing the implementation.
handler
ITaskHandlerA callback object used when the user needs to be asked questions or informed about IO tasks.
Exceptions
- OperationCanceledException
The user canceled the task.
- IOException
An implementation's directory could not be processed.
- UnauthorizedAccessException
Read access to an implementation's directory is not permitted.
GetPath(IImplementationStore, ImplementationBase)
Determines the local path of an implementation.
public static string GetPath(this IImplementationStore store, ImplementationBase implementation)
Parameters
store
IImplementationStoreThe store containing the implementation.
implementation
ImplementationBaseThe implementation to be located.
Returns
- string
A fully qualified path to the directory containing the implementation.
Exceptions
- ImplementationNotFoundException
The
implementation
is not cached yet.- UnauthorizedAccessException
Read access to the store is not permitted.
IsImplementation(string, out string?)
Determines whether a path looks like it is inside a store implementation known by ManifestFormat.
public static bool IsImplementation(string path, out string? implementationPath)
Parameters
path
stringA path to a directory that may or may not be inside a store implementation.
implementationPath
stringThe top-level of the detected store implementation directory if any;
null
otherwise.
Returns
Remarks
Performs no file system access. Only looks at the path string itself.
NeedsAdminToRemove(IImplementationStore)
Indicates whether there are implementations in the store that would throw NotAdminException on Remove(ManifestDigest).
public static bool NeedsAdminToRemove(this IImplementationStore store)
Parameters
store
IImplementationStore
Returns
Verify(string, ManifestDigest, ITaskHandler)
Checks whether an implementation directory matches the expected digest. Throws DigestMismatchException if it does not match.
public static void Verify(string path, ManifestDigest manifestDigest, ITaskHandler handler)
Parameters
path
stringThe path of the directory ot check.
manifestDigest
ManifestDigestThe expected digest.
handler
ITaskHandlerA callback object used when the user is to be informed about progress.
Exceptions
- OperationCanceledException
The user canceled the task.
- NotSupportedException
manifestDigest
does not list any supported digests.- IOException
The directory could not be processed.
- UnauthorizedAccessException
Read access to the directory is not permitted.
- DigestMismatchException
The directory does not match the expected digest