Class ArjArchive

Class ArjArchive

Namespace: Aspose.Zip.Arj
Assembly: Aspose.Zip.dll (25.2.0)

This class represents ARJ archive file.

public class ArjArchive : IArchive, IDisposable

Inheritance

objectArjArchive

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

Only following compression methods are supported:

MethodExplanation
0Uncompressed
1Combination of LZ77 and adaptive Huffman coding. Best ratio.
2Combination of LZ77 and adaptive Huffman coding.
3Combination of LZ77 and adaptive Huffman coding. Best speed.

Constructors

ArjArchive(Stream)

Initializes a new instance of the Aspose.Zip.Arj.ArjArchive class and composes entries list can be extracted from the archive.

public ArjArchive(Stream extractionSource)

Parameters

extractionSource Stream

The source of the archive.

Remarks

This constructor does not decompress any entry. See Aspose.Zip.Arj.ArjEntryPlain.Extract(System.IO.Stream) method for decompressing.

Exceptions

ArgumentNullException

extractionSource is null.

ArgumentException

>extractionSource does not support seeking.

InvalidDataException

Wrong signature for archive. - or - The file is not an ARJ archive.

NotSupportedException

Archive is garbled.

ArjArchive(string)

Initializes a new instance of the Aspose.Zip.Arj.ArjArchive class and composes entries list can be extracted from the archive.

public ArjArchive(string path)

Parameters

path string

The path to the archive file.

Examples

The following example shows how to extract all of the entries to a directory.

using (var archive = new ArjArchive("archive.arj")) 
{ 
   archive.ExtractToDirectory("C:\extracted");
}

Remarks

This constructor does not unpack any entry. See Aspose.Zip.Arj.ArjEntryPlain.Extract(System.IO.Stream) method for decompressing.

Exceptions

ArgumentNullException

path is null.

SecurityException

The caller does not have the required permission to access.

ArgumentException

The path is empty, contains only white spaces, or contains invalid characters.

UnauthorizedAccessException

Access to file path is denied.

PathTooLongException

The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.

NotSupportedException

File at path contains a colon (:) in the middle of the string.

FileNotFoundException

The file is not found.

DirectoryNotFoundException

The specified path is invalid, such as being on an unmapped drive.

IOException

The file is already open.

Properties

Commentary

Gets the commentary.

public string Commentary { get; }

Property Value

string

Entries

Gets entries of Aspose.Zip.Arj.ArjEntryPlain type constituting the ARJ archive.

public ReadOnlyCollection<arjentryplain> Entries { get; }

Property Value

ReadOnlyCollection<ArjEntryPlain&gt;

Name

Gets the original name.

public string Name { get; }

Property Value

string

Methods

Dispose()

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

public void Dispose()

ExtractToDirectory(string)

Extracts all entries to the specified directory.

public void ExtractToDirectory(string destinationDirectory)

Parameters

destinationDirectory string

The directory to extract the entries to.

Examples

The following example shows how to extract all entries to a directory:

using (var archive = new ArjArchive(File.OpenRead("archive.arj")))
{ 
   archive.ExtractToDirectory("C:\\extracted");
}

Exceptions

ArgumentNullException

Thrown when the destinationDirectory is null.

 English