Table of Contents

Interface IArchiveService

Namespace
Archiver.Core.Interfaces
Assembly
Archiver.Core.dll

ZIP archive/extract/test/list operations via System.IO.Compression. See ZipArchiveService for the real implementation.

public interface IArchiveService

Methods

ArchiveAsync(ArchiveOptions, IProgress<ProgressReport>?, CancellationToken)

Creates one or more ZIP archives from the provided options. Never throws — errors are captured in ArchiveResult.Errors. The one exception (T-F260): cancellation throws OperationCanceledException after cleanup, whether it lands inside one source or between two.

Task<ArchiveResult> ArchiveAsync(ArchiveOptions options, IProgress<ProgressReport>? progress = null, CancellationToken cancellationToken = default)

Parameters

options ArchiveOptions
progress IProgress<ProgressReport>
cancellationToken CancellationToken

Returns

Task<ArchiveResult>

ExtractAsync(ExtractOptions, IProgress<ProgressReport>?, CancellationToken)

Extracts one or more ZIP archives. Never throws — errors are captured in ArchiveResult.Errors. The one exception (T-F260): cancellation throws OperationCanceledException after cleanup, whether it lands inside one archive or between two.

Task<ArchiveResult> ExtractAsync(ExtractOptions options, IProgress<ProgressReport>? progress = null, CancellationToken cancellationToken = default)

Parameters

options ExtractOptions
progress IProgress<ProgressReport>
cancellationToken CancellationToken

Returns

Task<ArchiveResult>

ListEntriesAsync(string, CancellationToken)

Lists an archive's entries as a flat list, without extracting. Never throws — a failure (corrupted archive, IO error) is reported via ArchiveListResult.Success/ErrorMessage.

Task<ArchiveListResult> ListEntriesAsync(string archivePath, CancellationToken cancellationToken = default)

Parameters

archivePath string
cancellationToken CancellationToken

Returns

Task<ArchiveListResult>

TestAsync(IReadOnlyList<string>, IProgress<ProgressReport>?, Func<PasswordPromptInfo, Task<PasswordDecision>>?, CancellationToken)

Verifies every entry's CRC-32 against its declared value without writing any files to disk. Never throws — errors are captured in ArchiveResult.Errors. The one exception (T-F260, T-F268): cancellation throws OperationCanceledException, whether it lands inside one archive or between two.

Task<ArchiveResult> TestAsync(IReadOnlyList<string> archivePaths, IProgress<ProgressReport>? progress = null, Func<PasswordPromptInfo, Task<PasswordDecision>>? resolvePasswordAsync = null, CancellationToken cancellationToken = default)

Parameters

archivePaths IReadOnlyList<string>

The ZIP archives to verify.

progress IProgress<ProgressReport>

Optional overall-progress reporter.

resolvePasswordAsync Func<PasswordPromptInfo, Task<PasswordDecision>>

T-F189: invoked once per encrypted archive, mirroring ResolvePasswordAsync. Null (the default — every existing caller until T-F191/T-F192 wire this) preserves the pre-T-F189 behavior exactly: "password-protected and cannot be tested." Not folded into an options record since TestAsync takes a flat path list rather than an Options type; placed before cancellationToken (CA1068 — CancellationToken must be last).

cancellationToken CancellationToken

Cancels the operation.

Returns

Task<ArchiveResult>