Class ExtractionRouter
- Namespace
- Archiver.Core.Services
- Assembly
- Archiver.Core.dll
Routes ExtractAsync calls to IArchiveService (ZIP) or ITarService (tar-family) per archive, based on ArchiveFormatDetector, and merges the results. Never throws — all errors are captured in ArchiveResult.Errors.
public sealed class ExtractionRouter : IExtractionRouter
- Inheritance
-
ExtractionRouter
- Implements
- Inherited Members
Constructors
ExtractionRouter(IArchiveService, ITarService, TarCapabilities, GroupPolicyOptions)
Creates the router over both engines, with the capabilities of tar.exe already known.
public ExtractionRouter(IArchiveService archiveService, ITarService tarService, TarCapabilities tarCapabilities, GroupPolicyOptions groupPolicyOptions)
Parameters
archiveServiceIArchiveServicetarServiceITarServicetarCapabilitiesTarCapabilitiesgroupPolicyOptionsGroupPolicyOptions
Methods
ExtractAsync(ExtractOptions, IProgress<ProgressReport>?, CancellationToken)
Extracts one or more archives, routed per-archive by format. Cancellation in either engine throws OperationCanceledException (T-F260); nothing is merged then.
public Task<ArchiveResult> ExtractAsync(ExtractOptions options, IProgress<ProgressReport>? progress = null, CancellationToken cancellationToken = default)
Parameters
optionsExtractOptionsprogressIProgress<ProgressReport>cancellationTokenCancellationToken
Returns
TestAsync(IReadOnlyList<string>, IProgress<ProgressReport>?, Func<PasswordPromptInfo, Task<PasswordDecision>>?, bool, CancellationToken)
Verifies archives without writing anything (T-F261): ZIP archives through IArchiveService.TestAsync; tar-family archives are skipped, since tar.exe has no test mode; archives refused by Group Policy or tar.exe's capabilities are skipped with that reason. Never starts tar.exe. Cancellation throws OperationCanceledException.
With verifyRecoveryData (T-F275 step 3), each archive is also
checked against a PAR2 set found next to it, a .par2 path stands for the archive its
set protects, and a tar-family archive with a usable set is checked by it instead of being
skipped; RecoveryChecks says what each set found. Under
DisableRecoveryData no set is looked for and a .par2
path is refused.
public Task<ArchiveResult> TestAsync(IReadOnlyList<string> archivePaths, IProgress<ProgressReport>? progress = null, Func<PasswordPromptInfo, Task<PasswordDecision>>? resolvePasswordAsync = null, bool verifyRecoveryData = false, CancellationToken cancellationToken = default)
Parameters
archivePathsIReadOnlyList<string>progressIProgress<ProgressReport>resolvePasswordAsyncFunc<PasswordPromptInfo, Task<PasswordDecision>>verifyRecoveryDataboolcancellationTokenCancellationToken