Table of Contents

Interface IImplementationStore

Namespace
ZeroInstall.Store.Implementations
Assembly
ZeroInstall.Store.dll

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

public interface IImplementationStore : IImplementationSink
Inherited Members
Extension Methods

Properties

Kind

Indicates what kind of access to this store is possible.

ImplementationStoreKind Kind { get; }

Property Value

ImplementationStoreKind

Path

The path to the underlying directory in the file system.

string? Path { get; }

Property Value

string

Methods

GetPath(ManifestDigest)

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

string? GetPath(ManifestDigest manifestDigest)

Parameters

manifestDigest ManifestDigest

The digest the implementation to look for.

Returns

string

A fully qualified path to the directory containing the implementation; null if the requested implementation could not be found in the store.

Exceptions

IOException

The implementation directory is missing content and could not be deleted.

UnauthorizedAccessException

The implementation directory is missing content and write access to the store is not permitted.

ListAll()

Returns a list of all implementations currently in the store.

IEnumerable<ManifestDigest> ListAll()

Returns

IEnumerable<ManifestDigest>

A list of implementations formatted as "algorithm=digest" (e.g. "sha256=123abc").

Exceptions

IOException

A problem occurred while reading from the store.

UnauthorizedAccessException

Read access to the store is not permitted.

ListTemp()

Returns a list of temporary directories currently in the store.

IEnumerable<string> ListTemp()

Returns

IEnumerable<string>

A list of fully qualified paths.

Exceptions

IOException

A problem occurred while reading from the store.

UnauthorizedAccessException

Read access to the store is not permitted.

Optimise()

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.

long Optimise()

Returns

long

The number of bytes saved by deduplication.

Remarks

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

Exceptions

OperationCanceledException

The user canceled the task.

IOException

Two files could not be hard-linked together.

UnauthorizedAccessException

Write access to the store is not permitted.

DigestMismatchException

A damaged implementation is encountered while optimizing.

Purge()

Removes all implementations and temporary directories from a store.

void Purge()

Exceptions

OperationCanceledException

The user canceled the task.

IOException

An implementation could not be deleted.

UnauthorizedAccessException

Write access to the store is not permitted.

Remove(ManifestDigest)

Removes a specific implementation from the store.

bool Remove(ManifestDigest manifestDigest)

Parameters

manifestDigest ManifestDigest

The digest of the implementation to be removed.

Returns

bool

true if the implementation was successfully removed; false if it could not be removed, e.g., because it does not exist or is locked.

Exceptions

OperationCanceledException

The user canceled the task.

NotAdminException

Needs admin rights to delete from this store.

RemoveTemp(string)

Removes a specific temporary directory from the store.

bool RemoveTemp(string path)

Parameters

path string

The fully qualified path of the directory.

Returns

bool

true if the directory was successfully removed; false if it could not be removed, e.g. because it does not exist inside the store.

Exceptions

OperationCanceledException

The user canceled the task.

IOException

The directory could not be deleted.

UnauthorizedAccessException

Write access to the store is not permitted.

Verify(ManifestDigest)

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.

void Verify(ManifestDigest manifestDigest)

Parameters

manifestDigest ManifestDigest

The digest of the implementation to be verified.

Exceptions

OperationCanceledException

The user canceled the task.

NotSupportedException

manifestDigest does not list any supported digests.

IOException

The implementation's directory could not be processed.

UnauthorizedAccessException

Read access to the implementation's directory is not permitted.

ImplementationNotFoundException

No implementation matching manifestDigest could be found in the store.