/// <inheritdoc cref="ArchivingOperation{T}.SetAlgorithm"/>
        protected override void SetAlgorithm(DecompressionInfo info)
        {
            var fileType = FileUtils.GetFileNameExtension(info.Item.Archive.Name);

            // try to get enum type by filename extension, which is the key
            if (Archives.ArchiveFileTypes.TryGetValue(fileType, out Archives.ArchiveType value) ||
                Archives.ArchiveExtendedFileTypes.TryGetValue(fileType, out value))
            {
                Algorithm = Archives.DetermineAlgorithm(value);
            }
            else
            {
                throw new InvalidArchiveTypeException(
                          I18N.Resources.GetString("FileFormatNotSupported/Text"));
            }
        }
Example #2
0
 /// <inheritdoc cref="ArchivingOperation{T}.SetAlgorithm"/>
 protected override void SetAlgorithm(CompressionInfo info)
 {
     Algorithm = Archives.DetermineAlgorithm(info.ArchiveType);
 }