internal DmgEntry(HFSCatalogRecord record, string path, long size, DmgFilePart part) { Key = path; IsDirectory = record.Type == HFSCatalogRecordType.Folder; Size = CompressedSize = size; // There is no way to get the actual compressed size or the compression type of CompressionType = CompressionType.Unknown; // a file in a DMG archive since the files are nested inside the HFS partition. Parts = part.AsEnumerable(); if (IsDirectory) { var folder = (HFSCatalogFolder)record; LastModifiedTime = (folder.AttributeModDate > folder.ContentModDate) ? folder.AttributeModDate : folder.ContentModDate; CreatedTime = folder.CreateDate; LastAccessedTime = folder.AccessDate; ArchivedTime = folder.BackupDate; } else { var file = (HFSCatalogFile)record; LastModifiedTime = (file.AttributeModDate > file.ContentModDate) ? file.AttributeModDate : file.ContentModDate; CreatedTime = file.CreateDate; LastAccessedTime = file.AccessDate; ArchivedTime = file.BackupDate; } }
internal DmgArchiveEntry(Stream?stream, DmgArchive archive, HFSCatalogRecord record, string path, DmgFilePart part) : base(record, path, stream?.Length ?? 0, part) { _stream = stream; Archive = archive; }