Class LhaArchiveEntry
Namespace: Aspose.Zip.Lha
Assembly: Aspose.Zip.dll (25.2.0)
Represents single file within Lha archive.
public class LhaArchiveEntry : IArchiveFileEntry
Inheritance
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
IsDirectory
Gets a value indicating whether this entry directory.
public bool IsDirectory { get; }
Property Value
LastModified
Gets the last modified time of the entry.
[Obsolete("This property will be removed in a future release. Please use ModificationTime instead.")]
public DateTime LastModified { get; }
Property Value
Length
Gets the length of the entry in bytes.
public long? Length { get; }
Property Value
long?
ModificationTime
Gets the last modified time of the entry.
public DateTime ModificationTime { get; }
Property Value
Name
Gets name of the entry.
public string Name { get; }
Property Value
Remarks
Archives for compression only, such as gzip, bzip2, lzip, lzma, xz, z has name “File.bin” unless another name can be found in headers.
Path
Gets the full path to the entry.
public string Path { get; }
Property Value
Methods
Extract(string)
Extracts Lha archive entry to a filesystem by path.
public FileSystemInfo Extract(string path)
Parameters
path
string
Path to file which will store decompressed data.
Returns
System.IO.FileSystemInfoInstance containing extracted data.
Examples
using (FileStream lhaFile = File.Open(sourceFileName, FileMode.Open))
{
using (var archive = new LhaArchive(lhaFile))
{
archive.Entries[0].Extract("extracted.bin");
}
}
Exceptions
Archive headers and service information were not read.
path
is null.
The caller does not have the required permission to access.
The path
is empty, contains only white spaces, or contains invalid characters.
Access to file path
is denied.
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.
File at path
contains a colon (:) in the middle of the string.
Extract(Stream)
Extracts the entry to the stream provided.
public void Extract(Stream destination)
Parameters
destination
Stream
Destination stream. Must be writable.
Remarks
Does nothing for directory entry.
Exceptions
destination
does not support writing.
Extract(FileInfo)
Extracts Lha archive entry to a file.
public void Extract(FileInfo fileInfo)
Parameters
fileInfo
FileInfo
FileInfo for storing decompressed data.
Examples
using (var lhaFile = File.Open(sourceFileName, FileMode.Open))
{
using (var archive = new LhaArchive(lhaFile))
{
archive.Entries[0].Extract(new FileInfo("extracted.bin"));
}
}
Remarks
Does nothing for directory entry.
Exceptions
Archive headers and service information were not read.
The caller does not have the required permission to open the fileInfo
.
File path is empty or contains only white spaces.
The file is not found.
Path to file is read-only or is a directory.
fileInfo
is null.
The specified path is invalid, such as being on an unmapped drive.
The file is already open.