Zero Install .NET API 2.20.0
ZeroInstall.Archives.Extractors.ArchiveExtractor Class Referenceabstract

Extracts implementation archives. More...

Inheritance diagram for ZeroInstall.Archives.Extractors.ArchiveExtractor:
ZeroInstall.Archives.Extractors.IArchiveExtractor ZeroInstall.Archives.Extractors.CabExtractor ZeroInstall.Archives.Extractors.MsiExtractor ZeroInstall.Archives.Extractors.RarExtractor ZeroInstall.Archives.Extractors.SevenZipExtractor ZeroInstall.Archives.Extractors.TarExtractor ZeroInstall.Archives.Extractors.ZipExtractor ZeroInstall.Archives.Extractors.TarBz2Extractor ZeroInstall.Archives.Extractors.TarGzExtractor ZeroInstall.Archives.Extractors.TarLzipExtractor ZeroInstall.Archives.Extractors.TarLzmaExtractor ZeroInstall.Archives.Extractors.TarXzExtractor ZeroInstall.Archives.Extractors.TarZstandardExtractor ZeroInstall.Archives.Extractors.RubyGemExtractor

Public Member Functions

abstract void Extract (IBuilder builder, Stream stream, string? subDir=null)
 Extracts an archive. More...
 

Static Public Member Functions

static void Register (string mimeType, Func< ITaskHandler, IArchiveExtractor > factory)
 Registers an additional IArchiveExtractor. More...
 
static IArchiveExtractor For (string mimeType, ITaskHandler handler)
 Creates a new IArchiveExtractor for a specific type of archive. More...
 

Protected Member Functions

void EnsureSeekable (Stream stream, [InstantHandle] Action< Stream > callback)
 Ensures that a Stream is fully seekable, creating a temporary on-disk copy if necessary. More...
 

Static Protected Member Functions

static void EnsureFile (Stream stream, [InstantHandle] Action< string > callback)
 Ensures that a Stream represents an on-disk file, creating a temporary on-disk copy if necessary. More...
 
static ? string NormalizePath (string path, string? subDir)
 Normalizes the path of an archive entry. More...
 

Protected Attributes

readonly ITaskHandler Handler
 A callback object used when the the user needs to be informed about IO tasks.
 

Properties

object? Tag [getset]
 
- Properties inherited from ZeroInstall.Archives.Extractors.IArchiveExtractor
object? Tag [getset]
 A ITask.Tag to set for see cref="ITask"/>s spawned by this extractor; can be null.
 

Detailed Description

Extracts implementation archives.

Member Function Documentation

◆ EnsureFile()

static void ZeroInstall.Archives.Extractors.ArchiveExtractor.EnsureFile ( Stream  stream,
[InstantHandle] Action< string >  callback 
)
inlinestaticprotected

Ensures that a Stream represents an on-disk file, creating a temporary on-disk copy if necessary.

Parameters
streamThe stream to read. May be Stream.Closed.
callbackCalled with the file path.

◆ EnsureSeekable()

void ZeroInstall.Archives.Extractors.ArchiveExtractor.EnsureSeekable ( Stream  stream,
[InstantHandle] Action< Stream >  callback 
)
inlineprotected

Ensures that a Stream is fully seekable, creating a temporary on-disk copy if necessary.

Parameters
streamThe stream to read.
callbackCalled with the original stream or a temporary seekable copy.

◆ Extract()

◆ For()

static IArchiveExtractor ZeroInstall.Archives.Extractors.ArchiveExtractor.For ( string  mimeType,
ITaskHandler  handler 
)
inlinestatic

Creates a new IArchiveExtractor for a specific type of archive.

Parameters
mimeTypeThe MIME type of archive format to extract.
handlerA callback object used when the the user needs to be informed about IO tasks.
Exceptions
NotSupportedExceptionNo extractor registered for mimeType .

◆ NormalizePath()

static ? string ZeroInstall.Archives.Extractors.ArchiveExtractor.NormalizePath ( string  path,
string?  subDir 
)
inlinestaticprotected

Normalizes the path of an archive entry.

Parameters
pathThe Unix-style path of the archive entry relative to the archive's root.
subDirThe Unix-style path of the subdirectory in the archive to extract; null to extract entire archive.
Returns
The relative path without the subDir ; null if the path doesn't lie within the subDir .

◆ Register()

static void ZeroInstall.Archives.Extractors.ArchiveExtractor.Register ( string  mimeType,
Func< ITaskHandler, IArchiveExtractor factory 
)
static

Registers an additional IArchiveExtractor.

Parameters
mimeTypeThe MIME type of archive format the extractor handles.
factoryCallback providing instances of the extractor.

The documentation for this class was generated from the following file: