-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update file(s) "/." from "aspose-zip/Aspose.ZIP-API-References"
- Loading branch information
1 parent
d099d42
commit bce6d6b
Showing
111 changed files
with
456 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
159 changes: 159 additions & 0 deletions
159
content/sites/aspose/zip/english/java/com.aspose.zip/arjarchive/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
--- | ||
title: ArjArchive | ||
second_title: Aspose.ZIP for Java API Reference | ||
description: This class represents ARJ archive file. | ||
type: docs | ||
weight: 21 | ||
url: /java/com.aspose.zip/arjarchive/ | ||
--- | ||
|
||
**Inheritance:** | ||
java.lang.Object | ||
|
||
**All Implemented Interfaces:** | ||
[com.aspose.zip.IArchive](../../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 | ||
|
||
| Constructor | Description | | ||
| --- | --- | | ||
| [ArjArchive(InputStream extractionSource)](#ArjArchive-java.io.InputStream-) | Initializes a new instance of the [ArjArchive](../../com.aspose.zip/arjarchive) class and composes entries list can be extracted from the archive. | | ||
| [ArjArchive(String path)](#ArjArchive-java.lang.String-) | Initializes a new instance of the [ArjArchive](../../com.aspose.zip/arjarchive) class and composes entries list can be extracted from the archive. | | ||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [close()](#close--) | \{@inheritDoc\} | | ||
| [extractToDirectory(String destinationDirectory)](#extractToDirectory-java.lang.String-) | Extracts all entries to the specified directory. | | ||
| [getCommentary()](#getCommentary--) | Gets the commentary. | | ||
| [getEntries()](#getEntries--) | Gets entries of [ArjEntryPlain](../../com.aspose.zip/arjentryplain) type constituting the ARJ archive. | | ||
| [getFileEntries()](#getFileEntries--) | Gets entries of [IArchiveFileEntry](../../com.aspose.zip/iarchivefileentry) type constituting the archive. | | ||
| [getName()](#getName--) | Gets the original name. | | ||
### ArjArchive(InputStream extractionSource) {#ArjArchive-java.io.InputStream-} | ||
``` | ||
public ArjArchive(InputStream extractionSource) | ||
``` | ||
|
||
|
||
Initializes a new instance of the [ArjArchive](../../com.aspose.zip/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)](../../com.aspose.zip/arjentryplain\#extract-java.io.OutputStream-) method for decompressing. | ||
|
||
**Parameters:** | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| extractionSource | java.io.InputStream | the source of the archive | | ||
|
||
### ArjArchive(String path) {#ArjArchive-java.lang.String-} | ||
``` | ||
public ArjArchive(String path) | ||
``` | ||
|
||
|
||
Initializes a new instance of the [ArjArchive](../../com.aspose.zip/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)](../../com.aspose.zip/arjentryplain\#extract-java.io.OutputStream-) method for decompressing. | ||
|
||
**Parameters:** | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| path | java.lang.String | the path to the archive file | | ||
|
||
### close() {#close--} | ||
``` | ||
public void close() | ||
``` | ||
|
||
|
||
|
||
|
||
### extractToDirectory(String destinationDirectory) {#extractToDirectory-java.lang.String-} | ||
``` | ||
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:** | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| destinationDirectory | java.lang.String | the directory to extract the entries to | | ||
|
||
### getCommentary() {#getCommentary--} | ||
``` | ||
public final String getCommentary() | ||
``` | ||
|
||
|
||
Gets the commentary. | ||
|
||
**Returns:** | ||
java.lang.String - the commentary. | ||
### getEntries() {#getEntries--} | ||
``` | ||
public final List<ArjEntryPlain> getEntries() | ||
``` | ||
|
||
|
||
Gets entries of [ArjEntryPlain](../../com.aspose.zip/arjentryplain) type constituting the ARJ archive. | ||
|
||
**Returns:** | ||
java.util.List<com.aspose.zip.ArjEntryPlain> - entries of [ArjEntryPlain](../../com.aspose.zip/arjentryplain) type constituting the ARJ archive. | ||
### getFileEntries() {#getFileEntries--} | ||
``` | ||
public final Iterable<IArchiveFileEntry> getFileEntries() | ||
``` | ||
|
||
|
||
Gets entries of [IArchiveFileEntry](../../com.aspose.zip/iarchivefileentry) type constituting the archive. | ||
|
||
**Returns:** | ||
java.lang.Iterable<com.aspose.zip.IArchiveFileEntry> - entries of [IArchiveFileEntry](../../com.aspose.zip/iarchivefileentry) type constituting the archive | ||
### getName() {#getName--} | ||
``` | ||
public final String getName() | ||
``` | ||
|
||
|
||
Gets the original name. | ||
|
||
**Returns:** | ||
java.lang.String - the original name. |
140 changes: 140 additions & 0 deletions
140
content/sites/aspose/zip/english/java/com.aspose.zip/arjentryplain/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
--- | ||
title: ArjEntryPlain | ||
second_title: Aspose.ZIP for Java API Reference | ||
description: Represents single file within ARJ archive. | ||
type: docs | ||
weight: 22 | ||
url: /java/com.aspose.zip/arjentryplain/ | ||
--- | ||
|
||
**Inheritance:** | ||
java.lang.Object | ||
|
||
**All Implemented Interfaces:** | ||
[com.aspose.zip.IArchiveFileEntry](../../com.aspose.zip/iarchivefileentry) | ||
``` | ||
public class ArjEntryPlain implements IArchiveFileEntry | ||
``` | ||
|
||
Represents single file within ARJ archive. | ||
## Methods | ||
|
||
| Method | Description | | ||
| --- | --- | | ||
| [extract(File file)](#extract-java.io.File-) | Extracts ARJ archive entry to a file. | | ||
| [extract(OutputStream destination)](#extract-java.io.OutputStream-) | Extracts the entry to the stream provided. | | ||
| [extract(String path)](#extract-java.lang.String-) | Extracts the entry to the filesystem by the path provided. | | ||
| [getCompressedSize()](#getCompressedSize--) | Gets size of compressed file. | | ||
| [getLength()](#getLength--) | Gets the length of the entry in bytes. | | ||
| [getName()](#getName--) | Gets name of the entry within archive. | | ||
| [getUncompressedSize()](#getUncompressedSize--) | Gets size of original file. | | ||
### extract(File file) {#extract-java.io.File-} | ||
``` | ||
public final void extract(File file) | ||
``` | ||
|
||
|
||
Extracts ARJ archive entry to a file. | ||
|
||
``` | ||
try (FileInputStream arjFile = new FileInputStream("sourceFileName")) { | ||
try (ArjArchive archive = new ArjArchive(arjFile)) { | ||
archive.getEntries().get(0).extract(new File("extracted.bin")); | ||
} | ||
} catch (IOException ex) { | ||
} | ||
``` | ||
|
||
|
||
|
||
**Parameters:** | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| file | java.io.File | java.io.File for storing decompressed data | | ||
|
||
### extract(OutputStream destination) {#extract-java.io.OutputStream-} | ||
``` | ||
public final void extract(OutputStream destination) | ||
``` | ||
|
||
|
||
Extracts the entry to the stream provided. | ||
|
||
**Parameters:** | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| destination | java.io.OutputStream | Destination stream. Must be writable. | | ||
|
||
### extract(String path) {#extract-java.lang.String-} | ||
``` | ||
public final File extract(String path) | ||
``` | ||
|
||
|
||
Extracts the entry to the filesystem by the path provided. | ||
|
||
Extract two entries of rar archive. | ||
|
||
``` | ||
try (FileInputStream arjFile = new FileInputStream("archive.arj")) { | ||
try (ArjArchive archive = new ArjArchive(arjFile)) { | ||
archive.getEntries().get(0).extract("first.bin"); | ||
archive.getEntries().get(1).extract("second.bin"); | ||
} | ||
} catch (IOException ex) { | ||
} | ||
``` | ||
|
||
|
||
|
||
**Parameters:** | ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| path | java.lang.String | the path to destination file. If the file already exists, it will be overwritten | | ||
|
||
**Returns:** | ||
java.io.File - the file info of composed file | ||
### getCompressedSize() {#getCompressedSize--} | ||
``` | ||
public final long getCompressedSize() | ||
``` | ||
|
||
|
||
Gets size of compressed file. | ||
|
||
**Returns:** | ||
long - size of compressed file | ||
### getLength() {#getLength--} | ||
``` | ||
public final Long getLength() | ||
``` | ||
|
||
|
||
Gets the length of the entry in bytes. | ||
|
||
**Returns:** | ||
java.lang.Long - the length of the entry in bytes | ||
### getName() {#getName--} | ||
``` | ||
public final String getName() | ||
``` | ||
|
||
|
||
Gets name of the entry within archive. | ||
|
||
**Returns:** | ||
java.lang.String - name of the entry within archive | ||
### getUncompressedSize() {#getUncompressedSize--} | ||
``` | ||
public final long getUncompressedSize() | ||
``` | ||
|
||
|
||
Gets size of original file. | ||
|
||
**Returns:** | ||
long - size of original file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.