AcManager.Tools.ContentInstallation.SharpCompressContentInstallator.CreateExtractor C# (CSharp) Method

CreateExtractor() private static method

private static CreateExtractor ( string filename, string password ) : IArchive
filename string
password string
return IArchive
        private static IArchive CreateExtractor(string filename, string password) {
            try {
                var extractor = SharpCompressExtension.Open(filename, password);
                if (extractor.HasAnyEncryptedFiles()) {
                    throw new PasswordException(password == null ? ToolsStrings.ArchiveInstallator_PasswordIsRequired :
                            ToolsStrings.ArchiveInstallator_PasswordIsInvalid);
                }
                return extractor;
            } catch (CryptographicException) {
                throw new PasswordException(password == null ? ToolsStrings.ArchiveInstallator_PasswordIsRequired :
                        ToolsStrings.ArchiveInstallator_PasswordIsInvalid);
            }
        }