ArjEntryPlain.Extract
Contents
[
Hide
]Extract(string)
Extracts the entry to the filesystem by the path provided.
public FileInfo Extract(string path)
| Parameter | Type | Description |
|---|---|---|
| path | String | The path to destination file. If the file already exists, it will be overwritten. |
Return Value
The file info of a composed file.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | path is null or empty. |
Examples
Extract two entries of rar archive.
using (FileStream arjFile = File.Open("archive.arj", FileMode.Open))
{
using (ArjArchive archive = new ArjArchive(arjFile))
{
archive.Entries[0].Extract("first.bin");
archive.Entries[1].Extract("second.bin");
}
}
See Also
- class ArjEntryPlain
- namespace Aspose.Zip.Arj
- assembly Aspose.Zip
Extract(FileInfo)
Extracts ARJ archive entry to a file.
public void Extract(FileInfo fileInfo)
| Parameter | Type | Description |
|---|---|---|
| fileInfo | FileInfo | FileInfo for storing decompressed data. |
Exceptions
| exception | condition |
|---|---|
| InvalidOperationException | Archive headers and service information were not read. |
| SecurityException | The caller does not have the required permission to open the fileInfo. |
| ArgumentException | The file path is empty or contains only white spaces. |
| FileNotFoundException | The file is not found. |
| UnauthorizedAccessException | Path to file is read-only or is a directory. |
| ArgumentNullException | fileInfo is null. |
| DirectoryNotFoundException | The specified path is invalid, such as being on an unmapped drive. |
| IOException | The file is already open. |
| OperationCanceledException | In .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token. |
Examples
using (var arjFile = File.Open(sourceFileName, FileMode.Open))
{
using (var archive = new ArjArchive(arjFile))
{
archive.Entries[0].Extract(new FileInfo("extracted.bin"));
}
}
See Also
- class ArjEntryPlain
- namespace Aspose.Zip.Arj
- assembly Aspose.Zip
Extract(Stream)
Extracts the entry to the stream provided.
public void Extract(Stream destination)
| Parameter | Type | Description |
|---|---|---|
| destination | Stream | Destination stream. Must be writable. |
Exceptions
| exception | condition |
|---|---|
| ArgumentException | destination does not support writing. |
| InvalidDataException | Checksum mismatch for headers or data. - or - Archive is corrupted. |
| NotImplementedException | Entry compressed with method 4. |
| OperationCanceledException | In .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token. |
See Also
- class ArjEntryPlain
- namespace Aspose.Zip.Arj
- assembly Aspose.Zip