File system
The ZeroInstall.Store.FileSystem namespace provides interfaces and methods for building and reading file system structures.
The IBuilder interface represents a implementation directory being constructed.
IForwardOnlyBuilder is a more limited subset, that only allows the addition of files but not the modification of files that have already been added.
There are various implementations of IBuilder:
- DirectoryBuilder for creating a real on-disk directory
- ManifestBuilder for calculating an in-memory manifest of the directory
- ZeroInstall.Archives.Builders for creating archives (
.zip
,.tar
, etc.)
Implementation store
When adding an implementation to an IImplementationStore the caller is provided an IBuilder via a callback:
store.Add(manifestDigest, builder =>
{
builder.AddFile(...);
builder.AddFile(...);
});
This allows the implementation store to control how and where the implementation gets constructed (usually via a composite of a DirectoryBuilder and a ManifestBuilder).
Retrieval methods
BuilderExtensions and BuilderExtensions provide extension methods for applying RetrievalMethods to an IBuilder. These methods internally pass the IBuilder to ReadDirectory, ZeroInstall.Archives.Extractors, etc..