AppleArchiveEntry
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.zip.IArchiveFileEntry
public final class AppleArchiveEntry implements IArchiveFileEntry
Representerar en fil- eller katalogpost inom ett AppleArchive.
En instans av den här klassen kan representera antingen en post som parsats från ett befintligt Apple-arkiv eller en post som lagts till i ett arkiv som komponeras.
Metoder
| Metod | Beskrivning |
|---|---|
| extract(OutputStream destination) | Extraherar posten till den angivna strömmen. |
| extract(String path) | Extraherar Apple-arkivpost till ett filsystem enligt sökväg. |
| getLength() | Hämtar den okomprimerade längden på posten i byte. |
| getName() | Hämtar sökvägen för posten i arkivet. |
| isDirectory() | Hämtar ett värde som indikerar om posten representerar en katalog. |
| open() | Öppnar posten för extrahering och tillhandahåller en ström med postens innehåll. |
extract(OutputStream destination)
public void extract(OutputStream destination)
Extraherar posten till den angivna strömmen.
Parameters:
| Parameter | Typ | Beskrivning |
|---|---|---|
| mål | java.io.OutputStream | destinationsström. Måste vara skrivbar |
extract(String path)
public final File extract(String path)
Extraherar Apple-arkivpost till ett filsystem enligt sökväg.
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.