ArjArchive

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.zip.IArchive, java.lang.AutoCloseable

public class ArjArchive implements IArchive, AutoCloseable

This class represents ARJ archive file.

Only following compression methods are supported:

| ------ | ------------------------------------------------------------ |
| Method | Explanation                                                  |
| 0      | Uncompressed                                                 |
| 1      | Combination of LZ77 and adaptive Huffman coding. Best ratio. |
| 2      | Combination of LZ77 and adaptive Huffman coding.             |
| 3      | Combination of LZ77 and adaptive Huffman coding. Best speed. |

Constructors

ConstructorDescription
ArjArchive(InputStream extractionSource)Initializes a new instance of the ArjArchive class and composes entries list can be extracted from the archive.
ArjArchive(String path)Initializes a new instance of the ArjArchive class and composes entries list can be extracted from the archive.

Methods

MethodDescription
close(){@inheritDoc}
extractToDirectory(String destinationDirectory)Extracts all entries to the specified directory.
getCommentary()Gets the commentary.
getEntries()Gets entries of ArjEntryPlain type constituting the ARJ archive.
getFileEntries()Gets entries of IArchiveFileEntry type constituting the archive.
getName()Gets the original name.

ArjArchive(InputStream extractionSource)

public ArjArchive(InputStream extractionSource)

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

This constructor does not decompress any entry. See ArjEntryPlain.extract(java.io.OutputStream) method for decompressing.

Parameters:

ParameterTypeDescription
extractionSourcejava.io.InputStreamthe source of the archive

ArjArchive(String path)

public ArjArchive(String path)

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

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");
 }
 

This constructor does not unpack any entry. See ArjEntryPlain.extract(java.io.OutputStream) method for decompressing.

Parameters:

ParameterTypeDescription
pathjava.lang.Stringthe path to the archive file

close()

public void close()

extractToDirectory(String destinationDirectory)

public final void extractToDirectory(String destinationDirectory)

Extracts all entries to the specified directory.

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


     try (ArjArchive archive = new ArjArchive(new FileInputStream("archive.arj"))) {
         archive.extractToDirectory("C:\\extracted");
     } catch (IOException ex) {
     }
 

Parameters:

ParameterTypeDescription
destinationDirectoryjava.lang.Stringthe directory to extract the entries to

getCommentary()

public final String getCommentary()

Gets the commentary.

Returns: java.lang.String - the commentary.

getEntries()

public final List<ArjEntryPlain> getEntries()

Gets entries of ArjEntryPlain type constituting the ARJ archive.

Returns: java.util.List<com.aspose.zip.ArjEntryPlain> - entries of ArjEntryPlain type constituting the ARJ archive.

getFileEntries()

public final Iterable<IArchiveFileEntry> getFileEntries()

Gets entries of IArchiveFileEntry type constituting the archive.

Returns: java.lang.Iterable<com.aspose.zip.IArchiveFileEntry> - entries of IArchiveFileEntry type constituting the archive

getName()

public final String getName()

Gets the original name.

Returns: java.lang.String - the original name.