ArjEntryPlain
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.zip.IArchiveFileEntry
public class ArjEntryPlain implements IArchiveFileEntry
Represents single file within ARJ archive.
Methods
Method | Description |
---|---|
extract(File file) | Extracts ARJ archive entry to a file. |
extract(OutputStream destination) | Extracts the entry to the stream provided. |
extract(String path) | Extracts the entry to the filesystem by the path provided. |
getCompressedSize() | Gets size of compressed file. |
getLength() | Gets the length of the entry in bytes. |
getName() | Gets name of the entry within archive. |
getUncompressedSize() | Gets size of original file. |
extract(File 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)
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)
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()
public final long getCompressedSize()
Gets size of compressed file.
Returns: long - size of compressed file
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()
public final String getName()
Gets name of the entry within archive.
Returns: java.lang.String - name of the entry within archive
getUncompressedSize()
public final long getUncompressedSize()
Gets size of original file.
Returns: long - size of original file