LhaArchiveEntry.Extract
Contents
[
Hide
]Extract(string)
Extracts Lha archive entry to a filesystem by path.
public FileSystemInfo Extract(string path)
Parameter | Type | Description |
---|---|---|
path | String | Path to file which will store decompressed data. |
Return Value
FileSystemInfoInstance containing extracted data.
Exceptions
exception | condition |
---|---|
InvalidOperationException | Archive headers and service information were not read. |
ArgumentNullException | path is null. |
SecurityException | The caller does not have the required permission to access. |
ArgumentException | The path is empty, contains only white spaces, or contains invalid characters. |
UnauthorizedAccessException | Access to file path is denied. |
PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
NotSupportedException | File at path contains a colon (:) in the middle of the string. |
OperationCanceledException | In .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token. |
Examples
using (FileStream lhaFile = File.Open(sourceFileName, FileMode.Open))
{
using (var archive = new LhaArchive(lhaFile))
{
archive.Entries[0].Extract("extracted.bin");
}
}
See Also
- class LhaArchiveEntry
- namespace Aspose.Zip.Lha
- 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. |
OperationCanceledException | In .NET Framework 4.0 and above: Thrown when the extraction is canceled via the provided cancellation token. |
Remarks
Does nothing for directory entry.
See Also
- class LhaArchiveEntry
- namespace Aspose.Zip.Lha
- assembly Aspose.Zip
Extract(FileInfo)
Extracts Lha 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. |
Remarks
Does nothing for directory entry.
Examples
using (var lhaFile = File.Open(sourceFileName, FileMode.Open))
{
using (var archive = new LhaArchive(lhaFile))
{
archive.Entries[0].Extract(new FileInfo("extracted.bin"));
}
}
See Also
- class LhaArchiveEntry
- namespace Aspose.Zip.Lha
- assembly Aspose.Zip