CabArchive
Contents
[
Hide
]CabArchive constructor (1 of 2)
Initializes a new instance of the CabArchive
class and composes entries list can be extracted from the archive.
public CabArchive(Stream sourceStream)
Parameter | Type | Description |
---|---|---|
sourceStream | Stream | The source of the archive. It must be seekable. |
Exceptions
exception | condition |
---|---|
ArgumentNullException | sourceStream is null. |
ArgumentException | sourceStream is not seekable. |
InvalidDataException | sourceStream is not valid cab archive. |
EndOfStreamException | Stream is too short. |
Remarks
This constructor does not unpack any entry. See Open
method for unpacking.
Examples
The following example shows how to extract all of the entries to a directory.
using (var archive = new CabArchive(File.OpenRead("archive.cab")))
{
archive.ExtractToDirectory("C:\extracted");
}
See Also
- class CabArchive
- namespace Aspose.Zip.Cab
- assembly Aspose.Zip
CabArchive constructor (2 of 2)
Initializes a new instance of the CabArchive
class and composes entries list can be extracted from the archive.
public CabArchive(string path)
Parameter | Type | Description |
---|---|---|
path | String | The path to the archive file. |
Exceptions
exception | condition |
---|---|
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. |
FileNotFoundException | The file is not found. |
DirectoryNotFoundException | The specified path is invalid, such as being on an unmapped drive. |
IOException | The file is already open. |
EndOfStreamException | File is too short. |
Remarks
This constructor does not unpack any entry. See Open
method for unpacking.
Examples
The following example shows how to extract all of the entries to a directory.
using (var archive = new CabArchive("archive.cab"))
{
archive.ExtractToDirectory("C:\extracted");
}
See Also
- class CabArchive
- namespace Aspose.Zip.Cab
- assembly Aspose.Zip