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, IDisposableInheritance
Implements
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
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
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
Apple Archive entry instance.
Exceptions
The archive has been disposed.
name is empty.
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
Apple Archive entry instance.
Exceptions
The archive has been disposed.
name is empty.
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
Apple Archive entry instance.
Exceptions
The archive has been disposed.
name is empty.
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
The archive has been disposed.
output is null.
output is not writable.
Configured LZ4 block size is not positive.
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
The archive has been disposed.
destinationFileName is invalid.
destinationFileName is null.
Configured LZ4 block size is not positive.
Compression settings are missing or unsupported, direct composition uses a non-seekable stream, or entry/archive size exceeds current Apple Archive limits.