AppleArchiveEntry
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.zip.IArchiveFileEntry
public final class AppleArchiveEntry implements IArchiveFileEntry
Represents a file or directory entry within an AppleArchive.
An instance of this class can represent either an entry parsed from an existing Apple Archive or an entry added to an archive being composed.
Methods
| Method | Description |
|---|---|
| extract(OutputStream destination) | Extracts the entry to the stream provided. |
| extract(String path) | Extracts Apple archive entry to a filesystem by path. |
| getLength() | Gets the uncompressed length of the entry in bytes. |
| getName() | Gets the path of the entry inside the archive. |
| isDirectory() | Gets a value indicating whether the entry represents a directory. |
| open() | Opens the entry for extraction and provides a stream with the entry content. |
extract(OutputStream destination)
public 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)
public final File extract(String path)
Extracts Apple archive entry to a filesystem by path.
try (FileInputStream aaFile = new FileInputStream("archive.aa")) {
try (AppleArchive archive = new AppleArchive(aaFile)) {
archive.getEntries().get(0).extract("extracted.bin");
}
} catch (IOException ex) {
}
**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| path | java.lang.String | Path to file which will store decompressed data. |
**Returns:**
java.io.File - FileSystemInfoInstance containing extracted data.
### getLength() {#getLength--}
public final Long getLength()
Gets the uncompressed length of the entry in bytes.
For directory entries the value is zero. For entries created from a non-seekable source stream the length can be unknown.
**Returns:**
java.lang.Long - the uncompressed length of the entry in bytes.
### getName() {#getName--}
public final String getName()
Gets the path of the entry inside the archive.
The value is the archive path recorded for the entry. Directory entries usually end with Forward slash (`/`).
**Returns:**
java.lang.String - the path of the entry inside the archive.
### isDirectory() {#isDirectory--}
public final boolean isDirectory()
Gets a value indicating whether the entry represents a directory.
**Returns:**
boolean - a value indicating whether the entry represents a directory.
### open() {#open--}
public final InputStream open()
Opens the entry for extraction and provides a stream with the entry content.
**Returns:**
java.io.InputStream - A readable stream that contains the extracted entry data.