Table of Contents

Codeunit "TAR Archive UTCAP"

ID 70344800
Namespace: CapVision.Core.FileFormats

Lit un fichier au format TAR.

Examples

Cet exemple propose de lire la première entrée présente dans une archive .tar.gz.

``` AL
    procedure GetEntryFromTarGz(TarGzInputStream: InStream; var EntryStream: InStream) OperationsResponsePayload: JsonArray
    var
        DataCompression: Codeunit "Data Compression";
        TarArchive: Codeunit "TAR Archive UTCAP";
        TarTempBlob, TempBlob : Codeunit "Temp Blob";
        TarGzInputStream, TarInputStream : InStream;
        TarOutputStream, OutputStream : OutStream;
        TarEntries: List of [Text];
    begin
        TarTempBlob.CreateOutStream(TarOutputStream);
        DataCompression.GZipDecompress(TarGzInputStream, TarOutputStream);
        TarTempBlob.CreateInStream(TarInputStream);
    
        TarArchive.OpenArchive(TarInputStream);
        TarEntries := TarArchive.GetEntries();
    
        TempBlob.CreateOutStream(OutputStream);
        TarArchive.ExtractEntry(TarEntries.Get(1), OutputStream);
        TempBlob.CreateInStream(EntryStream);
    end;
```

Properties

Name Value
Access Public

Methods

OpenArchive

Créé une instance de ce codeunit pour l'archive spécifiée.

procedure OpenArchive(IStr: InStream)

Parameters

Name Type Description
IStr InStream

GetEntries

Obtient la liste des fichiers contenus dans l'archive TAR.

procedure GetEntries(): List of [Text]

Returns

Type Description
List of [Text]

Return value of type List of [Text].

ExtractEntry

Extrait l'entrée spécifiée dans le flux.

procedure ExtractEntry(EntryName: Text, var OutputStream: OutStream)

Parameters

Name Type Description
EntryName Text
OutputStream OutStream

See also