KitchenArchive¶
Namespace Nfty.Core.Formats in assembly Nfty.Core.
Reads and writes the .ktn workspace file. Same shape as the other three archives — a ZIP with a manifest.json — even though a Kitchen holds no images. Consistency buys the shared ArchiveIo path, the schema gate, and one more case in Archives.KindOf() rather than one more concept; and a future Kitchen-level asset has somewhere to go.
Methods¶
Read(ZipArchive)¶
Reads the manifest from an already-open archive.
Parameters
zip(ZipArchive) - The open archive.
Returns. The manifest.
Exceptions
InvalidDataException- The archive, or a manifest or image inside it, is missing or unreadable.UnsupportedSchemaVersionException- A manifest declares a schema this build does not read: newer thanSchema.Current, or older thanSchema.Oldest.
Read(string)¶
Reads a .ktn.
Parameters
path(string) - Archive path.
Returns. The manifest.
Exceptions
InvalidDataException- The archive, or a manifest or image inside it, is missing or unreadable.UnsupportedSchemaVersionException- A manifest declares a schema this build does not read: newer thanSchema.Current, or older thanSchema.Oldest.
ReadAsync(string, CancellationToken)¶
public static Task<KitchenManifest> ReadAsync(string path, CancellationToken cancellationToken = default);
Reads a .ktn.
Parameters
path(string) - Archive path.cancellationToken(CancellationToken) - Cancels the read.
Returns. The manifest.
Exceptions
InvalidDataException- The archive, or a manifest or image inside it, is missing or unreadable.UnsupportedSchemaVersionException- A manifest declares a schema this build does not read: newer thanSchema.Current, or older thanSchema.Oldest.OperationCanceledException-cancellationTokenwas canceled.
Write(ZipArchive, KitchenManifest)¶
Writes the manifest into an already-open archive.
Parameters
zip(ZipArchive) - The open archive.manifest(KitchenManifest) - The workspace's identity.
Write(string, KitchenManifest)¶
Writes a .ktn.
Parameters
path(string) - Destination path.manifest(KitchenManifest) - The workspace's identity.
WriteAsync(string, KitchenManifest, CancellationToken)¶
public static Task WriteAsync(string path, KitchenManifest manifest, CancellationToken cancellationToken = default);
Writes a .ktn.
Parameters
path(string) - Destination path.manifest(KitchenManifest) - The workspace's identity.cancellationToken(CancellationToken) - Cancels the write.
Returns. A task that completes when it is written.