Class AppleArchive

Class AppleArchive

Namespace: Aspose.Zip.Apple
Assembly: Aspose.Zip.dll (26.4.0)

This class represents an Apple Archive (.aar) file. Use it to compose Apple Archive files.

public class AppleArchive : IArchive, IDisposable

Inheritance

object AppleArchive

Implements

IArchive , IDisposable

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Remarks

Apple and Apple Archive are trademarks of Apple Inc.

Constructors

AppleArchive(AppleArchiveEntrySettings)

Initializes a new instance of the Aspose.Zip.Apple.AppleArchive class with settings used for composed entries.

public AppleArchive(AppleArchiveEntrySettings newEntrySettings = null)

Parameters

newEntrySettings AppleArchiveEntrySettings

Settings used when composing a new Apple Archive.

Properties

Entries

Gets entries constituting the archive.

public ReadOnlyCollection<AppleArchiveEntry> Entries { get; }

Property Value

ReadOnlyCollection < AppleArchiveEntry >

NewEntrySettings

Gets settings used for newly composed entries.

public AppleArchiveEntrySettings NewEntrySettings { get; }

Property Value

AppleArchiveEntrySettings

Methods

CreateEntries(DirectoryInfo, bool)

Adds to the archive all files and directories recursively in the directory given.

public AppleArchive CreateEntries(DirectoryInfo directory, bool includeRootDirectory = true)

Parameters

directory DirectoryInfo

Directory to compress.

includeRootDirectory bool

Indicates whether to include the root directory itself or not.

Returns

AppleArchive

The archive with entries composed.

CreateEntry(string, string, bool)

Creates a single entry within the archive.

public AppleArchiveEntry CreateEntry(string name, string path, bool openImmediately = false)

Parameters

name string

The name of the entry.

path string

The path to the file to compress.

openImmediately bool

True, if open the file immediately, otherwise open the file on archive saving.

Returns

AppleArchiveEntry

Apple Archive entry instance.

Exceptions

ObjectDisposedException

The archive has been disposed.

ArgumentException

name is empty.

ArgumentNullException

path is null.

CreateEntry(string, Stream)

Creates a single entry within the archive.

public AppleArchiveEntry CreateEntry(string name, Stream source)

Parameters

name string

The name of the entry.

source Stream

The input stream for the entry.

Returns

AppleArchiveEntry

Apple Archive entry instance.

Exceptions

ObjectDisposedException

The archive has been disposed.

ArgumentException

name is empty.

ArgumentNullException

source is null.

CreateEntry(string, FileInfo, bool)

Creates a single entry within the archive.

public AppleArchiveEntry CreateEntry(string name, FileInfo fileInfo, bool openImmediately = false)

Parameters

name string

The name of the entry.

fileInfo FileInfo

The metadata of file to be compressed.

openImmediately bool

True, if open the file immediately, otherwise open the file on archive saving.

Returns

AppleArchiveEntry

Apple Archive entry instance.

Exceptions

ObjectDisposedException

The archive has been disposed.

ArgumentException

name is empty.

ArgumentNullException

fileInfo is null.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases resources used by the archive.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

True when called from Aspose.Zip.Apple.AppleArchive.Dispose.

Save(Stream)

Saves archive to the stream provided.

public void Save(Stream output)

Parameters

output Stream

Destination stream.

Remarks

output must be writable. Some compression settings, such as LZ4, also require a seekable stream.

Exceptions

ObjectDisposedException

The archive has been disposed.

ArgumentNullException

output is null.

ArgumentException

output is not writable.

ArgumentOutOfRangeException

Configured LZ4 block size is not positive.

NotSupportedException

Compression settings are missing or unsupported, direct composition uses a non-seekable stream, or entry/archive size exceeds current Apple Archive limits.

Save(string)

Saves archive to a destination file provided.

public void Save(string destinationFileName)

Parameters

destinationFileName string

The path of the archive to be created.

Exceptions

ObjectDisposedException

The archive has been disposed.

ArgumentException

destinationFileName is invalid.

ArgumentNullException

destinationFileName is null.

ArgumentOutOfRangeException

Configured LZ4 block size is not positive.

NotSupportedException

Compression settings are missing or unsupported, direct composition uses a non-seekable stream, or entry/archive size exceeds current Apple Archive limits.