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

Describes an object that allows the storage and retrieval of Implementation directories. More...

Inheritance diagram for ZeroInstall.Store.Implementations.IImplementationStore:
ZeroInstall.Store.Implementations.CompositeImplementationStore ZeroInstall.Store.Implementations.DiskImplementationStore

Public Member Functions

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...
 
bool Contains (ManifestDigest manifestDigest)
 Determines whether the store contains a local copy of an implementation identified by a specific ManifestDigest. More...
 
bool Contains (string directory)
 Determines whether the store contains a specific directory. More...
 
void Flush ()
 Clears any in-memory caches. More...
 
string? GetPath (ManifestDigest manifestDigest)
 Determines the local path of an implementation with a given ManifestDigest. More...
 
string AddDirectory (string path, ManifestDigest manifestDigest, ITaskHandler handler)
 Copies a directory containing an implementation into the store if it matches the provided ManifestDigest. More...
 
string AddArchives (IEnumerable< ArchiveFileInfo > archiveInfos, ManifestDigest manifestDigest, ITaskHandler handler)
 Extracts multiple archives, that together contain the files of an implementation, into the same folder, compares that folder's manifest to manifestDigest and adds it to the store. 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...
 
void Verify (ManifestDigest manifestDigest, ITaskHandler handler)
 Recalculates the digests for an entry in the store and ensures it is correct. Will delete damaged implementations after user confirmation. More...
 

Properties

ImplementationStoreKind Kind [get]
 Indicates what kind of access to this store is possible. More...
 
string? DirectoryPath [get]
 The directory containing the cached Implementations. May be null for some IImplementationStore types. More...
 

Detailed Description

Describes an object that allows the storage and retrieval of Implementation directories.

A store caches Implementations identified by their ManifestDigests.

Member Function Documentation

◆ AddArchives()

string ZeroInstall.Store.Implementations.IImplementationStore.AddArchives ( IEnumerable< ArchiveFileInfo archiveInfos,
ManifestDigest  manifestDigest,
ITaskHandler  handler 
)

Extracts multiple archives, that together contain the files of an implementation, into the same folder, compares that folder's manifest to manifestDigest and adds it to the store.

Parameters
archiveInfosMultiple parameter objects providing the information to extract each archive.
manifestDigestThe digest the implementation is supposed to match.
handlerA callback object used when the the user is to be informed about progress.
Returns
The final location of the directory the archives were extracted into.
Exceptions
OperationCanceledExceptionThe user canceled the task.
NotSupportedExceptionAn archive type is unknown or not supported.
IOExceptionOne of the archives cannot be extracted.
ImplementationAlreadyInStoreExceptionThere is already an Implementation with the specified manifestDigest in the store.
UnauthorizedAccessExceptionRead access to one of the archives or write access to the store is not permitted.
DigestMismatchExceptionThe archives content doesn't match the manifestDigest .

Implemented in ZeroInstall.Store.Implementations.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ AddDirectory()

string ZeroInstall.Store.Implementations.IImplementationStore.AddDirectory ( string  path,
ManifestDigest  manifestDigest,
ITaskHandler  handler 
)

Copies a directory containing an implementation into the store if it matches the provided ManifestDigest.

Parameters
pathThe directory containing the implementation.
manifestDigestThe digest the implementation is supposed to match.
handlerA callback object used when the the user is to be informed about progress.
Returns
The final location of the directory in the store.
Exceptions
OperationCanceledExceptionThe user canceled the task.
IOExceptionpath cannot be moved or the digest cannot be calculated.
ImplementationAlreadyInStoreExceptionThere is already an Implementation with the specified manifestDigest in the store.
UnauthorizedAccessExceptionRead access to path or write access to the store is not permitted.
DigestMismatchExceptionpath doesn't match the manifestDigest .

Implemented in ZeroInstall.Store.Implementations.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ Contains() [1/2]

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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ Contains() [2/2]

bool ZeroInstall.Store.Implementations.IImplementationStore.Contains ( string  directory)

Determines whether the store contains a specific directory.

Parameters
directoryThe name of the directory to check for.
Returns
true if the specified directory is located in the store; false if the specified directory is not located 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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ Flush()

void ZeroInstall.Store.Implementations.IImplementationStore.Flush ( )

◆ 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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ 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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ 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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ 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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ 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.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

◆ Verify()

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

Recalculates the digests for an entry in the store and ensures it is correct. Will delete damaged implementations after user confirmation.

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.
ImplementationNotFoundExceptionNo implementation matching manifestDigest could be found in the store.
IOExceptionThe entry's directory could not be processed.
UnauthorizedAccessExceptionRead access to the entry's directory is not permitted.

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

Implemented in ZeroInstall.Store.Implementations.DiskImplementationStore, and ZeroInstall.Store.Implementations.CompositeImplementationStore.

Property Documentation

◆ DirectoryPath

string? ZeroInstall.Store.Implementations.IImplementationStore.DirectoryPath
get

The directory containing the cached Implementations. May be null for some IImplementationStore types.

◆ Kind

ImplementationStoreKind ZeroInstall.Store.Implementations.IImplementationStore.Kind
get

Indicates what kind of access to this store is possible.


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