ArjArchive

Inheritance: java.lang.Object

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

public class ArjArchive implements IArchive, AutoCloseable

This class represents an ARJ archive file.

Only the 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 an entry list can be extracted from the archive.
ArjArchive(InputStream extractionSource, ArjLoadOptions loadOptions)Initializes a new instance of the ArjArchive class and composes an entry list can be extracted from the archive.
ArjArchive(String path)Initializes a new instance of the ArjArchive class and composes an entry list can be extracted from the archive.
ArjArchive(String path, ArjLoadOptions loadOptions)Initializes a new instance of the ArjArchive class and composes an entry 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.
getFormat()Gets the archive format.
getName()Gets the original name.

ArjArchive(InputStream extractionSource)

public ArjArchive(InputStream extractionSource)

Initializes a new instance of the ArjArchive class and composes an entry 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(InputStream extractionSource, ArjLoadOptions loadOptions)

public ArjArchive(InputStream extractionSource, ArjLoadOptions loadOptions)

Initializes a new instance of the ArjArchive class and composes an entry 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
loadOptionsArjLoadOptionsOptions to load existing archive with.

ArjArchive(String path)

public ArjArchive(String path)

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

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


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

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

ArjArchive(String path, ArjLoadOptions loadOptions)

public ArjArchive(String path, ArjLoadOptions loadOptions)

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

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


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

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
loadOptionsArjLoadOptionsOptions to load existing archive with.

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

getFormat()

public final ArchiveFormat getFormat()

Gets the archive format.

Returns: ArchiveFormat - the archive format

getName()

public final String getName()

Gets the original name.

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