Class ArchiveFormatPolicy
- Namespace
- Archiver.Core.Services
- Assembly
- Archiver.Core.dll
The one classifier every operation uses to decide which engine may open an archive (T-F261): Group Policy first (AllowedFormats/BlockedFormats, then DisableTarExtraction), then what the system's tar.exe can read. Extraction, testing, listing and scanning all route through it, so no operation can drift from what another would allow or refuse.
public static class ArchiveFormatPolicy
- Inheritance
-
ArchiveFormatPolicy
- Inherited Members
Properties
NoTestCapabilityReason
The reason a tar-family archive is skipped by Test: only the ZIP engine can test.
public static string NoTestCapabilityReason { get; }
Property Value
Methods
CanOpenByExtension(string, TarCapabilities, GroupPolicyOptions)
True when path's extension names an archive that policy and tar.exe let
Pakko open — GetRefusalReason(ArchiveFormat, TarCapabilities, GroupPolicyOptions) without reading the file (T-F212).
public static bool CanOpenByExtension(string path, TarCapabilities tarCapabilities, GroupPolicyOptions policy)
Parameters
pathstringtarCapabilitiesTarCapabilitiespolicyGroupPolicyOptions
Returns
Classify(IReadOnlyList<string>, TarCapabilities, GroupPolicyOptions)
Splits paths by engine, refusing what policy or tar.exe cannot allow.
public static ArchiveFormatPolicy.Classification Classify(IReadOnlyList<string> paths, TarCapabilities tarCapabilities, GroupPolicyOptions policy)
Parameters
pathsIReadOnlyList<string>tarCapabilitiesTarCapabilitiespolicyGroupPolicyOptions
Returns
GetRefusalReason(ArchiveFormat, TarCapabilities, GroupPolicyOptions)
Why an archive of format may not be opened, or null when it may.
Policy is checked before tar.exe's capabilities, so a refused format always names the
policy — also when tar.exe was never probed because the policy disables it.
Unknown is never refused here: the ZIP engine reports it.
public static CoreText? GetRefusalReason(ArchiveFormat format, TarCapabilities tarCapabilities, GroupPolicyOptions policy)
Parameters
formatArchiveFormattarCapabilitiesTarCapabilitiespolicyGroupPolicyOptions
Returns
IsBlockedByPolicy(ArchiveFormat, GroupPolicyOptions)
True when Group Policy refuses format (BlockedFormats/AllowedFormats, or DisableTarExtraction for a tar-family format).
public static bool IsBlockedByPolicy(ArchiveFormat format, GroupPolicyOptions policy)
Parameters
formatArchiveFormatpolicyGroupPolicyOptions