Zero Install .NET API 2.20.0
ZeroInstall.Store.Implementations.IImplementationStore Interface Reference

Manages a directory that stores implementations. Also known as an implementation cache. More...

Inheritance diagram for ZeroInstall.Store.Implementations.IImplementationStore:
ZeroInstall.Store.Implementations.IImplementationSink ZeroInstall.Store.Implementations.CompositeImplementationStore ZeroInstall.Store.Implementations.ImplementationStore ZeroInstall.Store.Implementations.ServiceImplementationStore

Public Member Functions

bool Contains (ManifestDigest manifestDigest)
 Determines whether the store contains a local copy of an implementation identified by a specific ManifestDigest. More...
 
string? GetPath (ManifestDigest manifestDigest)
 Determines the local path of an implementation with a given ManifestDigest. More...
 
IEnumerable< ManifestDigestListAll ()
 Returns a list of all implementations currently in the store. More...
 
IEnumerable< string > ListAllTemp ()
 Returns a list of temporary directories currently in the store. More...
 
void Verify (ManifestDigest manifestDigest, ITaskHandler handler)
 Checks whether an implementation in the store still matches the expected digest. Asks the user whether to delete the implementation if it does not match. More...
 
bool Remove (ManifestDigest manifestDigest, ITaskHandler handler)
 Removes a specific implementation from the cache. More...
 
long Optimise (ITaskHandler handler)
 Reads in all the manifest files in the store and looks for duplicates (files with the same permissions, modification time and digest). When it finds a pair, it deletes one and replaces it with a hard-link to the other. More...
 
- Public Member Functions inherited from ZeroInstall.Store.Implementations.IImplementationSink
void Add (ManifestDigest manifestDigest, [InstantHandle] Action< IBuilder > build)
 Adds a new implementation. More...
 

Properties

ImplementationStoreKind Kind [get]
 Indicates what kind of access to this store is possible.
 
string Path [get]
 The path to the underlying directory in the file system.
 

Detailed Description

Manages a directory that stores implementations. Also known as an implementation cache.

Member Function Documentation

◆ Contains()

bool ZeroInstall.Store.Implementations.IImplementationStore.Contains ( ManifestDigest  manifestDigest)

Determines whether the store contains a local copy of an implementation identified by a specific ManifestDigest.

Parameters
manifestDigestThe digest of the implementation to check for.
Returns
true if the specified implementation is available in the store; false if the specified implementation is not available in the store or if read access to the store is not permitted.

If read access to the store is not permitted, no exception is thrown.

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.

◆ GetPath()

string? ZeroInstall.Store.Implementations.IImplementationStore.GetPath ( ManifestDigest  manifestDigest)

Determines the local path of an implementation with a given ManifestDigest.

Parameters
manifestDigestThe digest the implementation to look for.
Exceptions
UnauthorizedAccessExceptionRead access to the store is not permitted.
Returns
A fully qualified path to the directory containing the implementation; null if the requested implementation could not be found in the store.

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.

◆ ListAll()

IEnumerable< ManifestDigest > ZeroInstall.Store.Implementations.IImplementationStore.ListAll ( )

Returns a list of all implementations currently in the store.

Exceptions
UnauthorizedAccessExceptionRead access to the store is not permitted.
Returns
A list of implementations formatted as "algorithm=digest" (e.g. "sha256=123abc").

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.

◆ ListAllTemp()

IEnumerable< string > ZeroInstall.Store.Implementations.IImplementationStore.ListAllTemp ( )

Returns a list of temporary directories currently in the store.

Exceptions
UnauthorizedAccessExceptionRead access to the store is not permitted.
Returns
A list of fully qualified paths.

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.

◆ Optimise()

long ZeroInstall.Store.Implementations.IImplementationStore.Optimise ( ITaskHandler  handler)

Reads in all the manifest files in the store and looks for duplicates (files with the same permissions, modification time and digest). When it finds a pair, it deletes one and replaces it with a hard-link to the other.

Parameters
handlerA callback object used when the the user is to be informed about progress.
Returns
The number of bytes saved by deduplication.
Exceptions
OperationCanceledExceptionThe user canceled the task.
IOExceptionTwo files could not be hard-linked together.
UnauthorizedAccessExceptionWrite access to the store is not permitted.
DigestMismatchExceptionA damaged implementation is encountered while optimizing.

If the store does not support optimising this method call may be silently ignored.

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.

◆ Remove()

bool ZeroInstall.Store.Implementations.IImplementationStore.Remove ( ManifestDigest  manifestDigest,
ITaskHandler  handler 
)

Removes a specific implementation from the cache.

Parameters
manifestDigestThe digest of the implementation to be removed.
handlerA callback object used when the the user is to be informed about progress.
Returns
true if the implementation was successfully removed; false if it could not be removed, e.g. because no implementation matching manifestDigest was found.
Exceptions
OperationCanceledExceptionThe user canceled the task.
IOExceptionThrown if the implementation could not be deleted.
UnauthorizedAccessExceptionThrown if write access to the store is not permitted.

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.

◆ Verify()

void ZeroInstall.Store.Implementations.IImplementationStore.Verify ( ManifestDigest  manifestDigest,
ITaskHandler  handler 
)

Checks whether an implementation in the store still matches the expected digest. Asks the user whether to delete the implementation if it does not match.

Parameters
manifestDigestThe digest of the implementation to be verified.
handlerA callback object used when the the user is to be informed about progress or asked questions.
Exceptions
OperationCanceledExceptionThe user canceled the task.
NotSupportedExceptionmanifestDigest does not list any supported digests.
IOExceptionThe implementation's directory could not be processed.
UnauthorizedAccessExceptionRead access to the implementation's directory is not permitted.
ImplementationNotFoundExceptionNo implementation matching manifestDigest could be found in the store.

Implemented in ZeroInstall.Store.Implementations.CompositeImplementationStore, ZeroInstall.Store.Implementations.ImplementationStore, and ZeroInstall.Store.Implementations.ServiceImplementationStore.


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