diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/TinyOPDS.csproj b/TinyOPDS.csproj new file mode 100644 index 0000000..66344df --- /dev/null +++ b/TinyOPDS.csproj @@ -0,0 +1,235 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D4508020-1E2C-4D8E-B879-77D5C213E8EC} + WinExe + Properties + TinyOPDS + TinyOPDS + v4.0 + 512 + false + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + Svn + Svn + Svn + SubversionScc + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + bin\Debug\TinyOPDS.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + false + + + bin\Release\ + TRACE + true + pdbonly + AnyCPU + bin\Release\TinyOPDS.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + true + + + TinyOPDS.ico + + + true + bin\Debug\ + CODE_ANALYSIS;DEBUG;TRACE + full + AnyCPU + false + bin\Debug\TinyOPDS.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + TinyOPDS.Program + + + + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + SQL Server Compact 3.5 SP2 + true + + + False + Windows Installer 3.1 + true + + + + + {49A128D3-C3F2-46B1-8F7A-EECD209EA860} + Zip Reduced + + + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB} + ePubReader + + + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F} + FB2Library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TinyOPDS.sln b/TinyOPDS.sln new file mode 100644 index 0000000..0fea374 --- /dev/null +++ b/TinyOPDS.sln @@ -0,0 +1,80 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyOPDS", "TinyOPDS\TinyOPDS.csproj", "{D4508020-1E2C-4D8E-B879-77D5C213E8EC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ePubReader", "ePubReader\ePubReader\ePubReader.csproj", "{B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FB2Library", "fb2library\FB2Library.csproj", "{4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zip Reduced", "dotNetZip\Zip Reduced\Zip Reduced.csproj", "{49A128D3-C3F2-46B1-8F7A-EECD209EA860}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyOPDSConsole", "TinyOPDSConsole\TinyOPDSConsole.csproj", "{5A92FA9B-B91C-48F4-9488-77103868D226}" +EndProject +Global + GlobalSection(SubversionScc) = preSolution + Svn-Managed = True + Manager = AnkhSVN - Subversion Support for Visual Studio + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Full debug|Any CPU = Full debug|Any CPU + Full debug|x86 = Full debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Debug|x86.ActiveCfg = Debug|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Full debug|Any CPU.ActiveCfg = Full debug|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Full debug|Any CPU.Build.0 = Full debug|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Full debug|x86.ActiveCfg = Full debug|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Release|Any CPU.Build.0 = Release|Any CPU + {D4508020-1E2C-4D8E-B879-77D5C213E8EC}.Release|x86.ActiveCfg = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Full debug|Any CPU.ActiveCfg = Full debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Full debug|Any CPU.Build.0 = Full debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Full debug|x86.ActiveCfg = Full debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|Any CPU.Build.0 = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|x86.ActiveCfg = Release|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Debug|x86.ActiveCfg = Debug|x86 + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Debug|x86.Build.0 = Debug|x86 + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Full debug|Any CPU.ActiveCfg = Full debug|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Full debug|Any CPU.Build.0 = Full debug|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Full debug|x86.ActiveCfg = Full debug|x86 + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Full debug|x86.Build.0 = Full debug|x86 + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Release|Any CPU.Build.0 = Release|Any CPU + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Release|x86.ActiveCfg = Release|x86 + {4DEC5888-E71A-4D00-93B7-7F11C92D0A3F}.Release|x86.Build.0 = Release|x86 + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|x86.ActiveCfg = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Full debug|Any CPU.ActiveCfg = Full debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Full debug|Any CPU.Build.0 = Full debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Full debug|x86.ActiveCfg = Full debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|Any CPU.Build.0 = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|x86.ActiveCfg = Release|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Debug|x86.ActiveCfg = Debug|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Full debug|Any CPU.ActiveCfg = Release|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Full debug|Any CPU.Build.0 = Release|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Full debug|x86.ActiveCfg = Release|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Release|Any CPU.Build.0 = Release|Any CPU + {5A92FA9B-B91C-48F4-9488-77103868D226}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TinyOPDS/TinyOPDS.csproj b/TinyOPDS/TinyOPDS.csproj index d0a0ab5..6278090 100644 --- a/TinyOPDS/TinyOPDS.csproj +++ b/TinyOPDS/TinyOPDS.csproj @@ -43,7 +43,6 @@ true GlobalSuppressions.cs prompt - MinimumRecommendedRules.ruleset ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets true ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules @@ -60,7 +59,6 @@ true GlobalSuppressions.cs prompt - MinimumRecommendedRules.ruleset ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets true ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules diff --git a/dotNetZip/.tfs-ignore b/dotNetZip/.tfs-ignore new file mode 100644 index 0000000..278ac78 --- /dev/null +++ b/dotNetZip/.tfs-ignore @@ -0,0 +1,32 @@ + + bin + obj + TestResults + notused + _UpgradeReport_Files + Backup + UpgradeLog.XML + CodePlex-Readme.txt + License.rtf + FixProps.ps1 + makeSrcZip.bat + MakeReleaseZips.bat + clean.ps1 + AppNote.txt + Todo.txt + MakeZipUtils.ps1 + SetVersion.ps1 + Help + LastBuild.log + _Resharper* + Debug + Release + *.resharper + *.cache + *.suo + *.user + #*.*# + *.*~ + *.zip + + \ No newline at end of file diff --git a/dotNetZip/AppNote.iz.txt b/dotNetZip/AppNote.iz.txt new file mode 100644 index 0000000..362f31f --- /dev/null +++ b/dotNetZip/AppNote.iz.txt @@ -0,0 +1,3686 @@ +[Info-ZIP note, 20040528: this file is based on PKWARE's appnote.txt of + 15 February 1996, taking into account PKWARE's revised appnote.txt + version 6.2.0 of 26 April 2004. It has been unofficially corrected + and extended by Info-ZIP without explicit permission by PKWARE. + Although Info-ZIP believes the information to be accurate and complete, + it is provided under a disclaimer similar to the PKWARE disclaimer below, + differing only in the substitution of "Info-ZIP" for "PKWARE". In other + words, use this information at your own risk, but we think it's correct. + + Specification info from PKWARE that was obviously wrong has been corrected + silently (e.g. missing structure fields, wrong numbers). + As of PKZIPW 2.50, two new incompatibilities have been introduced by PKWARE; + they are noted below. Note that the "NTFS tag" conflict is currently not + real; PKZIPW 2.50 actually tags NTFS files as having come from a FAT + file system, too.] + +File: APPNOTE.TXT - .ZIP File Format Specification +Version: 6.2.0 - NOTIFICATION OF CHANGE +Revised: 04/26/2004 [2004-05-28 Info-ZIP] +Copyright (c) 1989 - 2004 PKWARE Inc., All Rights Reserved. + +I. Purpose +---------- + +This specification is intended to define a cross-platform, +interoperable file format. Since its first publication +in 1989, PKWARE has remained committed to ensuring the +interoperability of the .ZIP file format through this +specification. We trust that all .ZIP compatible vendors +and application developers that have adopted this format +will share and support this commitment. + + +II. Disclaimer +-------------- + +Although PKWARE will attempt to supply current and accurate +information relating to its file formats, algorithms, and the +subject programs, the possibility of error or omission can not +be eliminated. PKWARE therefore expressly disclaims any warranty +that the information contained in the associated materials relating +to the subject programs and/or the format of the files created or +accessed by the subject programs and/or the algorithms used by +the subject programs, or any other matter, is current, correct or +accurate as delivered. Any risk of damage due to any possible +inaccurate information is assumed by the user of the information. +Furthermore, the information relating to the subject programs +and/or the file formats created or accessed by the subject +programs and/or the algorithms used by the subject programs is +subject to change without notice. + +If the version of this file is marked as a NOTIFICATION OF CHANGE, +the content defines an Early Feature Specification (EFS) change +to the .ZIP file format that may be subject to modification prior +to publication of the Final Feature Specification (FFS). This +document may also contain information on Planned Feature +Specifications (PFS) defining recognized future extensions. + + +III. Change Log +--------------- + +Version Change Description Date +------- ------------------ ---------- +5.2 -Single Password Symmetric Encryption 06/02/2003 + storage + +6.1.0 -Smart Card compatibility 01/20/2004 + -Documentation on certificate storage + +6.2.0 -Introduction of Central Directory 04/26/2004 + Encryption for encrypting metadata + -Added OS/X to Version Made By values + + +IV. General Format of a .ZIP file +--------------------------------- + + Files stored in arbitrary order. Large .ZIP files can span multiple + diskette media or be split into user-defined segment sizes. [The + minimum user-defined segment size for a split .ZIP file is 64K. + (removed by PKWare 2003-06-01)] + + Overall .ZIP file format: + + [local file header 1] + [file data 1] + [data descriptor 1] + . + . + . + [local file header n] + [file data n] + [data descriptor n] + [archive decryption header] (EFS) + [archive extra data record] (EFS) + [central directory] + [zip64 end of central directory record] + [zip64 end of central directory locator] + [end of central directory record] + + + A. Local file header: + + local file header signature 4 bytes (0x04034b50) + version needed to extract 2 bytes + general purpose bit flag 2 bytes + compression method 2 bytes + last mod file time 2 bytes + last mod file date 2 bytes + crc-32 4 bytes + compressed size 4 bytes + uncompressed size 4 bytes + file name length 2 bytes + extra field length 2 bytes + + file name (variable size) + extra field (variable size) + + + B. File data + + Immediately following the local header for a file + is the compressed or stored data for the file. + The series of [local file header][file data][data + descriptor] repeats for each file in the .ZIP archive. + + + C. Data descriptor: + + [Info-ZIP discrepancy: + The Info-ZIP zip program starts the data descriptor with a 4-byte + PK-style signature. Despite the specification, none of the PKWARE + programs supports the data descriptor. PKZIP 4.0 -fix function + (and PKZIPFIX 2.04) ignores the data descriptor info even when bit 3 + of the general purpose bit flag is set. + data descriptor signature 4 bytes (0x08074b50) + ] + crc-32 4 bytes + compressed size 4 bytes + uncompressed size 4 bytes + + This descriptor exists only if bit 3 of the general + purpose bit flag is set (see below). It is byte aligned + and immediately follows the last byte of compressed data. + This descriptor is used only when it was not possible to + seek in the output .ZIP file, e.g., when the output .ZIP file + was standard output or a non seekable device. For Zip64 format + archives, the compressed and uncompressed sizes are 8 bytes each. + + + D. Archive decryption header: (EFS) + + The Archive Decryption Header is introduced in version 6.2 + of the ZIP format specification. This record exists in support + of the Central Directory Encryption Feature implemented as part of + the Strong Encryption Specification as described in this document. + When the Central Directory Structure is encrypted, this decryption + header will precede the encrypted data segment. The encrypted + data segment will consist of the Archive extra data record (if + present) and the encrypted Central Directory Structure data. + The format of this data record is identical to the Decryption + header record preceding compressed file data. If the central + directory structure is encrypted, the location of the start of + this data record is determined using the Start of Central Directory + field in the Zip64 End of Central Directory record. Refer to the + section on the Strong Encryption Specification for information + on the fields used in the Archive Decryption Header record. + + + E. Archive extra data record: (EFS) + + archive extra data signature 4 bytes (0x08064b50) + extra field length 4 bytes + extra field data (variable size) + + The Archive Extra Data Record is introduced in version 6.2 + of the ZIP format specification. This record exists in support + of the Central Directory Encryption Feature implemented as part of + the Strong Encryption Specification as described in this document. + When present, this record immediately precedes the central + directory data structure. The size of this data record will be + included in the Size of the Central Directory field in the + End of Central Directory record. If the central directory structure + is compressed, but not encrypted, the location of the start of + this data record is determined using the Start of Central Directory + field in the Zip64 End of Central Directory record. + + + F. Central directory structure: + + [file header 1] + . + . + . + [file header n] + [digital signature] + + File header: + + central file header signature 4 bytes (0x02014b50) + version made by 2 bytes + version needed to extract 2 bytes + general purpose bit flag 2 bytes + compression method 2 bytes + last mod file time 2 bytes + last mod file date 2 bytes + crc-32 4 bytes + compressed size 4 bytes + uncompressed size 4 bytes + file name length 2 bytes + extra field length 2 bytes + file comment length 2 bytes + disk number start 2 bytes + internal file attributes 2 bytes + external file attributes 4 bytes + relative offset of local header 4 bytes + + file name (variable size) + extra field (variable size) + file comment (variable size) + + Digital signature: + + header signature 4 bytes (0x05054b50) + size of data 2 bytes + signature data (variable size) + + With the introduction of the Central Directory Encryption + feature in version 6.2 of this specification, the Central + Directory Structure may be stored both compressed and encrypted. + Although not required, it is assumed when encrypting the + Central Directory Structure, that it will be compressed + for greater storage efficiency. Information on the + Central Directory Encryption feature can be found in the section + describing the Strong Encryption Specification. The Digital + Signature record will be neither compressed nor encrypted. + + + G. Zip64 end of central directory record + + zip64 end of central dir + signature 4 bytes (0x06064b50) + size of zip64 end of central + directory record 8 bytes + version made by 2 bytes + version needed to extract 2 bytes + number of this disk 4 bytes + number of the disk with the + start of the central directory 4 bytes + total number of entries in the + central directory on this disk 8 bytes + total number of entries in the + central directory 8 bytes + size of the central directory 8 bytes + offset of start of central + directory with respect to + the starting disk number 8 bytes + zip64 extensible data sector (variable size) + + The above record structure defines Version 1 of the + Zip64 end of central directory record. Version 1 was + implemented in versions of this specification preceding + 6.2 in support of the ZIP64(tm) large file feature. The + introduction of the Central Directory Encryption feature + implemented in version 6.2 as part of the Strong Encryption + Specification defines Version 2 of this record structure. + Refer to the section describing the Strong Encryption + Specification for details on the version 2 format for + this record. + + + H. Zip64 end of central directory locator + + zip64 end of central dir locator + signature 4 bytes (0x07064b50) + number of the disk with the + start of the zip64 end of + central directory 4 bytes + relative offset of the zip64 + end of central directory record 8 bytes + total number of disks 4 bytes + + + I. End of central directory record: + + end of central dir signature 4 bytes (0x06054b50) + number of this disk 2 bytes + number of the disk with the + start of the central directory 2 bytes + total number of entries in the + central directory on this disk 2 bytes + total number of entries in + the central directory 2 bytes + size of the central directory 4 bytes + offset of start of central + directory with respect to + the starting disk number 4 bytes + .ZIP file comment length 2 bytes + .ZIP file comment (variable size) + + + J. Explanation of fields: + + version made by (2 bytes) + + [PKWARE describes "OS made by" now (since 1998) as follows: + The upper byte indicates the compatibility of the file + attribute information. If the external file attributes + are compatible with MS-DOS and can be read by PKZIP for + DOS version 2.04g then this value will be zero. If these + attributes are not compatible, then this value will + identify the host system on which the attributes are + compatible.] + The upper byte indicates the host system (OS) for the + file. Software can use this information to determine + the line record format for text files etc. The current + mappings are: + + 0 - FAT file system (DOS, OS/2, NT) + PKWARE 2.50+ VFAT, NTFS + 1 - Amiga + 2 - OpenVMS + 3 - Unix + 4 - VM/CMS + 5 - Atari ST + 6 - HPFS file system (OS/2, NT 3.x) + 7 - Macintosh + 8 - Z-System + 9 - CP/M + --------------------------------------------------------------------- + PKWARE assignment | Info-ZIP assignment + -----------------------------------|--------------------------------- + 10 - Windows NTFS | TOPS-20 + (since PKZIPW 2.50, but | (assigned Oct-1992, + not used by any PKWARE prog) | no longer used) + 11 - MVS | NTFS file system (WinNT) + | (actively used by Info-ZIP's + | Zip for NT since Sep-1993) + 12 - VSE | SMS/QDOS + --------------------------------------------------------------------- + 13 - Acorn RISC OS + 14 - VFAT file system (Win95, NT) [Info-ZIP reservation, unused] + 15 - MVS [PKWARE describes this assignment as "alternate MVS"] + 16 - BeOS (BeBox or PowerMac) + 17 - Tandem + 18 - OS/400 (IBM) | THEOS + 19 - OS/X (Darwin) + 20 thru 29 - unused + 30 - AtheOS/Syllable + 31 thru 255 - unused + + The lower byte indicates the ZIP specification version + (the version of this document) supported by the software + used to encode the file. The value/10 indicates the major + version number, and the value mod 10 is the minor version + number. + + version needed to extract (2 bytes) + + The minimum supported ZIP specification version needed to + extract the file, mapped as above. This value is based on + the specific format features a ZIP program must support to + be able to extract the file. If multiple features are + applied to a file, the minimum version should be set to the + feature having the highest value. New features or feature + changes affecting the published format specification will be + implemented using higher version numbers than the last + published value to avoid conflict. + + Current minimum feature versions are as defined below: + + 1.0 - Default value + 1.1 - File is a volume label + 2.0 - File is a folder (directory) + 2.0 - File is compressed using Deflate compression + 2.0 - File is encrypted using traditional PKWARE encryption + 2.1 - File is compressed using Deflate64(tm) + 2.5 - File is compressed using PKWARE DCL Implode + 2.7 - File is a patch data set + 4.5 - File uses ZIP64 format extensions + 4.6 - File is compressed using BZIP2 compression* + 5.0 - File is encrypted using DES + 5.0 - File is encrypted using 3DES + 5.0 - File is encrypted using original RC2 encryption + 5.0 - File is encrypted using RC4 encryption + 5.1 - File is encrypted using AES encryption + 5.1 - File is encrypted using corrected RC2 encryption** + 5.2 - File is encrypted using corrected RC2-64 encryption** + 6.1 - File is encrypted using non-OAEP key wrapping*** + 6.2 - Central directory encryption + + + * Early 7.x (pre-7.2) versions of PKZIP incorrectly set the + version needed to extract for BZIP2 compression to be 50 + when it should have been 46. + + ** Refer to the section on Strong Encryption Specification + for additional information regarding RC2 corrections. + + *** Certificate encryption using non-OAEP key wrapping is the + intended mode of operation for all versions beginning with 6.1. + Support for OAEP key wrapping should only be used for + backward compatibility when sending ZIP files to be opened by + versions of PKZIP older than 6.1 (5.0 or 6.0). + + When using ZIP64 extensions, the corresponding value in the + Zip64 end of central directory record should also be set. + This field currently supports only the value 45 to indicate + ZIP64 extensions are present. + + general purpose bit flag: (2 bytes) + + Bit 0: If set, indicates that the file is encrypted. + + (For Method 6 - Imploding) + Bit 1: If the compression method used was type 6, + Imploding, then this bit, if set, indicates + an 8K sliding dictionary was used. If clear, + then a 4K sliding dictionary was used. + Bit 2: If the compression method used was type 6, + Imploding, then this bit, if set, indicates + 3 Shannon-Fano trees were used to encode the + sliding dictionary output. If clear, then 2 + Shannon-Fano trees were used. + + (For Methods 8 and 9 - Deflating) + Bit 2 Bit 1 + 0 0 Normal (-en) compression option was used. + 0 1 Maximum (-exx/-ex) compression option was used. + 1 0 Fast (-ef) compression option was used. + 1 1 Super Fast (-es) compression option was used. + + Note: Bits 1 and 2 are undefined if the compression + method is any other. + + Bit 3: If this bit is set, the fields crc-32, compressed + size and uncompressed size are set to zero in the + local header. The correct values are put in the + data descriptor immediately following the compressed + data. (Note: PKZIP version 2.04g for DOS only + recognizes this bit for method 8 compression, newer + versions of PKZIP recognize this bit for any + compression method.) + [Info-ZIP note: This bit was introduced by PKZIP 2.04 for + DOS. In general, this feature can only be reliably used + together with compression methods that allow intrinsic + detection of the "end-of-compressed-data" condition. From + the set of compression methods described in this Zip archive + specification, only "deflate" and "bzip2" fulfill this + requirement. + Especially, the method STORED does not work! + The Info-ZIP tools recognize this bit regardless of the + compression method; but, they rely on correctly set + "compressed size" information in the central directory entry.] + + Bit 4: Reserved for use with method 8, for enhanced + deflating. + + Bit 5: If this bit is set, this indicates that the file is + compressed patched data. (Note: Requires PKZIP + version 2.70 or greater) + + Bit 6: Strong encryption. If this bit is set, you should + set the version needed to extract value to at least + 50 and you must also set bit 0. If AES encryption + is used, the version needed to extract value must + be at least 51. + + Bit 7: Currently unused. + + Bit 8: Currently unused. + + Bit 9: Currently unused. + + Bit 10: Currently unused. + + Bit 11: Currently unused. + + Bit 12: Reserved by PKWARE for enhanced compression. + + Bit 13: Used when encrypting the Central Directory to indicate + selected data values in the Local Header are masked to + hide their actual values. See the section describing + the Strong Encryption Specification for details. + + Bit 14: Reserved by PKWARE. + + Bit 15: Reserved by PKWARE. + + compression method: (2 bytes) + + (see accompanying documentation for algorithm + descriptions) + + 0 - The file is stored (no compression) + 1 - The file is Shrunk + 2 - The file is Reduced with compression factor 1 + 3 - The file is Reduced with compression factor 2 + 4 - The file is Reduced with compression factor 3 + 5 - The file is Reduced with compression factor 4 + 6 - The file is Imploded + 7 - Reserved for Tokenizing compression algorithm + 8 - The file is Deflated + 9 - Enhanced Deflating using Deflate64(tm) + 10 - PKWARE Data Compression Library Imploding + 11 - Reserved by PKWARE + 12 - File is compressed using BZIP2 algorithm + + date and time fields: (2 bytes each) + + The date and time are encoded in standard MS-DOS format. + If input came from standard input, the date and time are + those at which compression was started for this data. + If encrypting the central directory and general purpose bit + flag 13 is set indicating masking, the value stored in the + Local Header will be zero. + + CRC-32: (4 bytes) + + The CRC-32 algorithm was generously contributed by + David Schwaderer and can be found in his excellent + book "C Programmers Guide to NetBIOS" published by + Howard W. Sams & Co. Inc. The 'magic number' for + the CRC is 0xdebb20e3. The proper CRC pre and post + conditioning is used, meaning that the CRC register + is pre-conditioned with all ones (a starting value + of 0xffffffff) and the value is post-conditioned by + taking the one's complement of the CRC residual. + If bit 3 of the general purpose flag is set, this + field is set to zero in the local header and the correct + value is put in the data descriptor and in the central + directory. If encrypting the central directory and general + purpose bit flag 13 is set indicating masking, the value + stored in the Local Header will be zero. + + compressed size: (4 bytes) + uncompressed size: (4 bytes) + + The size of the file compressed and uncompressed, + respectively. If bit 3 of the general purpose bit flag + is set, these fields are set to zero in the local header + and the correct values are put in the data descriptor and + in the central directory. If an archive is in zip64 format + and the value in this field is 0xFFFFFFFF, the size will be + in the corresponding 8 byte zip64 extended information + extra field. If encrypting the central directory and general + purpose bit flag 13 is set indicating masking, the value stored + for the uncompressed size in the Local Header will be zero. + + file name length: (2 bytes) + extra field length: (2 bytes) + file comment length: (2 bytes) + + The length of the file name, extra field, and comment + fields respectively. The combined length of any + directory record and these three fields should not + generally exceed 65,535 bytes. If input came from standard + input, the file name length is set to zero. + + [Info-ZIP note: + This feature is not yet supported by any PKWARE version of ZIP + (at least not in PKZIP for DOS and PKZIP for Windows/WinNT). + The Info-ZIP programs handle standard input differently: + If input came from standard input, the filename is set to "-" + (length one).] + + + disk number start: (2 bytes) + + The number of the disk on which this file begins. If an + archive is in zip64 format and the value in this field is + 0xFFFF, the size will be in the corresponding 4 byte zip64 + extended information extra field. + + internal file attributes: (2 bytes) + + Bits 1 and 2 are reserved for use by PKWARE. + + The lowest bit of this field indicates, if set, that + the file is apparently an ASCII or text file. If not + set, that the file apparently contains binary data. + The remaining bits are unused in version 1.0. + + The 0x0002 bit of this field indicates, if set, that a + 4 byte variable record length control field precedes each + logical record indicating the length of the record. This + flag is independent of text control characters, and if used + in conjunction with text data, includes any control + characters in the total length of the record. This value is + provided for mainframe data transfer support. + + external file attributes: (4 bytes) + + The mapping of the external attributes is + host-system dependent (see 'version made by'). For + MS-DOS, the low order byte is the MS-DOS directory + attribute byte. If input came from standard input, this + field is set to zero. + + relative offset of local header: (4 bytes) + + This is the offset from the start of the first disk on + which this file appears, to where the local header should + be found. If an archive is in zip64 format and the value + in this field is 0xFFFFFFFF, the size will be in the + corresponding 8 byte zip64 extended information extra field. + + file name: (Variable) + + The name of the file, with optional relative path. + The path stored should not contain a drive or + device letter, or a leading slash. All slashes + should be forward slashes '/' as opposed to + backwards slashes '\' for compatibility with Amiga + and Unix file systems etc. If input came from standard + input, there is no file name field. If encrypting + the central directory and general purpose bit flag 13 is set + indicating masking, the file name stored in the Local Header + will not be the actual file name. A masking value consisting + of a unique hexadecimal value will be stored. This value will + be sequentially incremented for each file in the archive. See + the section on the Strong Encryption Specification for details + on retrieving the encrypted file name. + [Info-ZIP discrepancy: + If input came from standard input, the file name is set + to "-" (without the quotes). + As far as we know, the PKWARE specification for "input from + stdin" is not supported by PKZIP/PKUNZIP for DOS, OS/2, Windows + Windows NT.] + + extra field: (Variable) + + This is for expansion. If additional information + needs to be stored for special needs or for specific + platforms, it should be stored here. Earlier versions + of the software can then safely skip this file, and + find the next file or header. This field will be 0 + length in version 1.0. + + In order to allow different programs and different types + of information to be stored in the 'extra' field in .ZIP + files, the following structure should be used for all + programs storing data in this field: + + header1+data1 + header2+data2 . . . + + Each header should consist of: + + Header ID - 2 bytes + Data Size - 2 bytes + + Note: all fields stored in Intel low-byte/high-byte order. + + The Header ID field indicates the type of data that is in + the following data block. + + Header ID's of 0 thru 31 are reserved for use by PKWARE. + The remaining ID's can be used by third party vendors for + proprietary usage. + + The current Header ID mappings defined by PKWARE are: + + 0x0001 ZIP64 extended information extra field + 0x0007 AV Info + 0x0008 Reserved for future Unicode file name data (PFS) + 0x0009 OS/2 extended attributes (also Info-ZIP) + 0x000a NTFS (Win9x/WinNT FileTimes) + 0x000c OpenVMS (also Info-ZIP) + 0x000d Unix + 0x000e Reserved for file stream and fork descriptors + 0x000f Patch Descriptor + 0x0014 PKCS#7 Store for X.509 Certificates + 0x0015 X.509 Certificate ID and Signature for + individual file + 0x0016 X.509 Certificate ID for Central Directory + 0x0017 Strong Encryption Header + 0x0018 Record Management Controls + 0x0019 PKCS#7 Encryption Recipient Certificate List + 0x0065 IBM S/390 (Z390), AS/400 (I400) attributes + - uncompressed + 0x0066 Reserved for IBM S/390 (Z390), AS/400 (I400) + attributes - compressed + + The Header ID mappings defined by Info-ZIP and third parties are: + + 0x07c8 Info-ZIP Macintosh (old, J. Lee) + 0x2605 ZipIt Macintosh (first version) + 0x2705 ZipIt Macintosh v 1.3.5 and newer (w/o full filename) + 0x2805 ZipIt Macintosh 1.3.5+ + 0x334d Info-ZIP Macintosh (new, D. Haase's 'Mac3' field) + 0x4154 Tandem NSK + 0x4341 Acorn/SparkFS (David Pilling) + 0x4453 Windows NT security descriptor (binary ACL) + 0x4704 VM/CMS + 0x470f MVS + 0x4854 Theos, old inofficial port + 0x4b46 FWKCS MD5 (see below) + 0x4c41 OS/2 access control list (text ACL) + 0x4d49 Info-ZIP OpenVMS (obsolete) + 0x4d63 Macintosh SmartZIP, by Macro Bambini + 0x4f4c Xceed original location extra field + 0x5356 AOS/VS (binary ACL) + 0x5455 extended timestamp + 0x554e Xceed unicode extra field + 0x5855 Info-ZIP Unix (original; also OS/2, NT, etc.) + 0x6542 BeOS (BeBox, PowerMac, etc.) + 0x6854 Theos + 0x7441 AtheOS (AtheOS/Syllable attributes) + 0x756e ASi Unix + 0x7855 Info-ZIP Unix (new) + 0xfb4a SMS/QDOS + + Detailed descriptions of Extra Fields defined by third + party mappings will be documented as information on + these data structures is made available to PKWARE. + PKWARE does not guarantee the accuracy of any published + third party data. + + The Data Size field indicates the size of the following + data block. Programs can use this value to skip to the + next header block, passing over any data blocks that are + not of interest. + + Note: As stated above, the size of the entire .ZIP file + header, including the file name, comment, and extra + field should not exceed 64K in size. + + In case two different programs should appropriate the same + Header ID value, it is strongly recommended that each + program place a unique signature of at least two bytes in + size (and preferably 4 bytes or bigger) at the start of + each data area. Every program should verify that its + unique signature is present, in addition to the Header ID + value being correct, before assuming that it is a block of + known type. + + In the following descriptions, note that "Short" means two bytes, + "Long" means four bytes, and "Long-Long" means eight bytes, + regardless of their native sizes. Unless specifically noted, all + integer fields should be interpreted as unsigned (non-negative) + numbers. + + + -ZIP64 Extended Information Extra Field (0x0001): + =============================================== + + The following is the layout of the ZIP64 extended + information "extra" block. If one of the size or + offset fields in the Local or Central directory + record is too small to hold the required data, + a ZIP64 extended information record is created. + The order of the fields in the ZIP64 extended + information record is fixed, but the fields will + only appear if the corresponding Local or Central + directory record field is set to 0xFFFF or 0xFFFFFFFF. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (ZIP64) 0x0001 2 bytes Tag for this "extra" block type + Size 2 bytes Size of this "extra" block + Original + Size 8 bytes Original uncompressed file size + Compressed + Size 8 bytes Size of compressed data + Relative Header + Offset 8 bytes Offset of local header record + Disk Start + Number 4 bytes Number of the disk on which + this file starts + + This entry in the Local header must include BOTH original + and compressed file sizes. + + + -OS/2 Extended Attributes Extra Field (0x0009): + ============================================= + + The following is the layout of the OS/2 extended attributes "extra" + block. (Last Revision 19960922) + + Note: all fields stored in Intel low-byte/high-byte order. + + Local-header version: + + Value Size Description + ----- ---- ----------- + (OS/2) 0x0009 Short tag for this extra block type + TSize Short total data size for this block + BSize Long uncompressed EA data size + CType Short compression type + EACRC Long CRC value for uncompressed EA data + (var.) variable compressed EA data + + Central-header version: + + Value Size Description + ----- ---- ----------- + (OS/2) 0x0009 Short tag for this extra block type + TSize Short total data size for this block (4) + BSize Long size of uncompressed local EA data + + The value of CType is interpreted according to the "compression + method" section above; i.e., 0 for stored, 8 for deflated, etc. + + The OS/2 extended attribute structure (FEA2LIST) is + compressed and then stored in its entirety within this + structure. There will only ever be one "block" of data in + the variable-length field. + + + -OS/2 Access Control List Extra Field: + ==================================== + + The following is the layout of the OS/2 ACL extra block. + (Last Revision 19960922) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (ACL) 0x4c41 Short tag for this extra block type ("AL") + TSize Short total data size for this block + BSize Long uncompressed ACL data size + CType Short compression type + EACRC Long CRC value for uncompressed ACL data + (var.) variable compressed ACL data + + Central-header version: + + Value Size Description + ----- ---- ----------- + (ACL) 0x4c41 Short tag for this extra block type ("AL") + TSize Short total data size for this block (4) + BSize Long size of uncompressed local ACL data + + The value of CType is interpreted according to the "compression + method" section above; i.e., 0 for stored, 8 for deflated, etc. + + The uncompressed ACL data consist of a text header of the form + "ACL1:%hX,%hd\n", where the first field is the OS/2 ACCINFO acc_attr + member and the second is acc_count, followed by acc_count strings + of the form "%s,%hx\n", where the first field is acl_ugname (user + group name) and the second acl_access. This block type will be + extended for other operating systems as needed. + + + -Windows NT Security Descriptor Extra Field (0x4453): + =================================================== + + The following is the layout of the NT Security Descriptor (another + type of ACL) extra block. (Last Revision 19960922) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (SD) 0x4453 Short tag for this extra block type ("SD") + TSize Short total data size for this block + BSize Long uncompressed SD data size + Version Byte version of uncompressed SD data format + CType Short compression type + EACRC Long CRC value for uncompressed SD data + (var.) variable compressed SD data + + Central-header version: + + Value Size Description + ----- ---- ----------- + (SD) 0x4453 Short tag for this extra block type ("SD") + TSize Short total data size for this block (4) + BSize Long size of uncompressed local SD data + + The value of CType is interpreted according to the "compression + method" section above; i.e., 0 for stored, 8 for deflated, etc. + Version specifies how the compressed data are to be interpreted + and allows for future expansion of this extra field type. Currently + only version 0 is defined. + + For version 0, the compressed data are to be interpreted as a single + valid Windows NT SECURITY_DESCRIPTOR data structure, in self-relative + format. + + + -PKWARE Win95/WinNT Extra Field (0x000a): + ======================================= + + The following description covers PKWARE's "NTFS" attributes + "extra" block, introduced with the release of PKZIP 2.50 for + Windows. (Last Revision 20001118) + + (Note: At this time the Mtime, Atime and Ctime values may + be used on any WIN32 system.) + [Info-ZIP note: In the current implementations, this field has + a fixed total data size of 32 bytes and is only stored as local + extra field.] + + Value Size Description + ----- ---- ----------- + (NTFS) 0x000a Short Tag for this "extra" block type + TSize Short Total Data Size for this block + Reserved Long for future use + Tag1 Short NTFS attribute tag value #1 + Size1 Short Size of attribute #1, in bytes + (var.) SubSize1 Attribute #1 data + . + . + . + TagN Short NTFS attribute tag value #N + SizeN Short Size of attribute #N, in bytes + (var.) SubSizeN Attribute #N data + + For NTFS, values for Tag1 through TagN are as follows: + (currently only one set of attributes is defined for NTFS) + + Tag Size Description + ----- ---- ----------- + 0x0001 2 bytes Tag for attribute #1 + Size1 2 bytes Size of attribute #1, in bytes (24) + Mtime 8 bytes 64-bit NTFS file last modification time + Atime 8 bytes 64-bit NTFS file last access time + Ctime 8 bytes 64-bit NTFS file creation time + + The total length for this block is 28 bytes, resulting in a + fixed size value of 32 for the TSize field of the NTFS block. + + The NTFS filetimes are 64-bit unsigned integers, stored in Intel + (least significant byte first) byte order. They determine the + number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", + which is "01-Jan-1601 00:00:00 UTC". + + + -PKWARE OpenVMS Extra Field (0x000c): + =================================== + + The following is the layout of PKWARE's OpenVMS attributes + "extra" block. (Last Revision 12/17/91) + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (VMS) 0x000c Short Tag for this "extra" block type + TSize Short Total Data Size for this block + CRC Long 32-bit CRC for remainder of the block + Tag1 Short OpenVMS attribute tag value #1 + Size1 Short Size of attribute #1, in bytes + (var.) Size1 Attribute #1 data + . + . + . + TagN Short OpenVMS attribute tage value #N + SizeN Short Size of attribute #N, in bytes + (var.) SizeN Attribute #N data + + Rules: + + 1. There will be one or more of attributes present, which + will each be preceded by the above TagX & SizeX values. + These values are identical to the ATR$C_XXXX and + ATR$S_XXXX constants which are defined in ATR.H under + OpenVMS C. Neither of these values will ever be zero. + + 2. No word alignment or padding is performed. + + 3. A well-behaved PKZIP/OpenVMS program should never produce + more than one sub-block with the same TagX value. Also, + there will never be more than one "extra" block of type + 0x000c in a particular directory record. + + + -Info-ZIP VMS Extra Field: + ======================== + + The following is the layout of Info-ZIP's VMS attributes extra + block for VAX or Alpha AXP. The local-header and central-header + versions are identical. (Last Revision 19960922) + + Value Size Description + ----- ---- ----------- + (VMS2) 0x4d49 Short tag for this extra block type ("JM") + TSize Short total data size for this block + ID Long block ID + Flags Short info bytes + BSize Short uncompressed block size + Reserved Long (reserved) + (var.) variable compressed VMS file-attributes block + + The block ID is one of the following unterminated strings: + + "VFAB" struct FAB + "VALL" struct XABALL + "VFHC" struct XABFHC + "VDAT" struct XABDAT + "VRDT" struct XABRDT + "VPRO" struct XABPRO + "VKEY" struct XABKEY + "VMSV" version (e.g., "V6.1"; truncated at hyphen) + "VNAM" reserved + + The lower three bits of Flags indicate the compression method. The + currently defined methods are: + + 0 stored (not compressed) + 1 simple "RLE" + 2 deflated + + The "RLE" method simply replaces zero-valued bytes with zero-valued + bits and non-zero-valued bytes with a "1" bit followed by the byte + value. + + The variable-length compressed data contains only the data corre- + sponding to the indicated structure or string. Typically multiple + VMS2 extra fields are present (each with a unique block type). + + + -Info-ZIP Macintosh Extra Field: + ============================== + + The following is the layout of the (old) Info-ZIP resource-fork extra + block for Macintosh. The local-header and central-header versions + are identical. (Last Revision 19960922) + + Value Size Description + ----- ---- ----------- + (Mac) 0x07c8 Short tag for this extra block type + TSize Short total data size for this block + "JLEE" beLong extra-field signature + FInfo 16 bytes Macintosh FInfo structure + CrDat beLong HParamBlockRec fileParam.ioFlCrDat + MdDat beLong HParamBlockRec fileParam.ioFlMdDat + Flags beLong info bits + DirID beLong HParamBlockRec fileParam.ioDirID + VolName 28 bytes volume name (optional) + + All fields but the first two are in native Macintosh format + (big-endian Motorola order, not little-endian Intel). The least + significant bit of Flags is 1 if the file is a data fork, 0 other- + wise. In addition, if this extra field is present, the filename + has an extra 'd' or 'r' appended to indicate data fork or resource + fork. The 28-byte VolName field may be omitted. + + + -ZipIt Macintosh Extra Field (long): + ================================== + + The following is the layout of the ZipIt extra block for Macintosh. + The local-header and central-header versions are identical. + (Last Revision 19970130) + + Value Size Description + ----- ---- ----------- + (Mac2) 0x2605 Short tag for this extra block type + TSize Short total data size for this block + "ZPIT" beLong extra-field signature + FnLen Byte length of FileName + FileName variable full Macintosh filename + FileType Byte[4] four-byte Mac file type string + Creator Byte[4] four-byte Mac creator string + + + -ZipIt Macintosh Extra Field (short, for files): + ============================================== + + The following is the layout of a shortened variant of the + ZipIt extra block for Macintosh (without "full name" entry). + This variant is used by ZipIt 1.3.5 and newer for entries of + files (not directories) that do not have a MacBinary encoded + file. The local-header and central-header versions are identical. + (Last Revision 20030602) + + Value Size Description + ----- ---- ----------- + (Mac2b) 0x2705 Short tag for this extra block type + TSize Short total data size for this block (min. 12) + "ZPIT" beLong extra-field signature + FileType Byte[4] four-byte Mac file type string + Creator Byte[4] four-byte Mac creator string + fdFlags beShort attributes from FInfo.frFlags, + may be omitted + 0x0000 beShort reserved, may be omitted + + + -ZipIt Macintosh Extra Field (short, for directories): + ==================================================== + + The following is the layout of a shortened variant of the + ZipIt extra block for Macintosh used only for directory + entries. This variant is used by ZipIt 1.3.5 and newer to + save some optional Mac-specific information about directories. + The local-header and central-header versions are identical. + + Value Size Description + ----- ---- ----------- + (Mac2c) 0x2805 Short tag for this extra block type + TSize Short total data size for this block (12) + "ZPIT" beLong extra-field signature + frFlags beShort attributes from DInfo.frFlags, may + be omitted + View beShort ZipIt view flag, may be omitted + + + The View field specifies ZipIt-internal settings as follows: + + Bits of the Flags: + bit 0 if set, the folder is shown expanded (open) + when the archive contents are viewed in ZipIt. + bits 1-15 reserved, zero; + + + -Info-ZIP Macintosh Extra Field (new): + ==================================== + + The following is the layout of the (new) Info-ZIP extra + block for Macintosh, designed by Dirk Haase. + All values are in little-endian. + (Last Revision 19981005) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (Mac3) 0x334d Short tag for this extra block type ("M3") + TSize Short total data size for this block + BSize Long uncompressed finder attribute data size + Flags Short info bits + fdType Byte[4] Type of the File (4-byte string) + fdCreator Byte[4] Creator of the File (4-byte string) + (CType) Short compression type + (CRC) Long CRC value for uncompressed MacOS data + Attribs variable finder attribute data (see below) + + + Central-header version: + + Value Size Description + ----- ---- ----------- + (Mac3) 0x334d Short tag for this extra block type ("M3") + TSize Short total data size for this block + BSize Long uncompressed finder attribute data size + Flags Short info bits + fdType Byte[4] Type of the File (4-byte string) + fdCreator Byte[4] Creator of the File (4-byte string) + + The third bit of Flags in both headers indicates whether + the LOCAL extra field is uncompressed (and therefore whether CType + and CRC are omitted): + + Bits of the Flags: + bit 0 if set, file is a data fork; otherwise unset + bit 1 if set, filename will be not changed + bit 2 if set, Attribs is uncompressed (no CType, CRC) + bit 3 if set, date and times are in 64 bit + if zero date and times are in 32 bit. + bit 4 if set, timezone offsets fields for the native + Mac times are omitted (UTC support deactivated) + bits 5-15 reserved; + + + Attributes: + + Attribs is a Mac-specific block of data in little-endian format with + the following structure (if compressed, uncompress it first): + + Value Size Description + ----- ---- ----------- + fdFlags Short Finder Flags + fdLocation.v Short Finder Icon Location + fdLocation.h Short Finder Icon Location + fdFldr Short Folder containing file + + FXInfo 16 bytes Macintosh FXInfo structure + FXInfo-Structure: + fdIconID Short + fdUnused[3] Short unused but reserved 6 bytes + fdScript Byte Script flag and number + fdXFlags Byte More flag bits + fdComment Short Comment ID + fdPutAway Long Home Dir ID + + FVersNum Byte file version number + may be not used by MacOS + ACUser Byte directory access rights + + FlCrDat ULong date and time of creation + FlMdDat ULong date and time of last modification + FlBkDat ULong date and time of last backup + These time numbers are original Mac FileTime values (local time!). + Currently, date-time width is 32-bit, but future version may + support be 64-bit times (see flags) + + CrGMTOffs Long(signed!) difference "local Creat. time - UTC" + MdGMTOffs Long(signed!) difference "local Modif. time - UTC" + BkGMTOffs Long(signed!) difference "local Backup time - UTC" + These "local time - UTC" differences (stored in seconds) may be + used to support timestamp adjustment after inter-timezone transfer. + These fields are optional; bit 4 of the flags word controls their + presence. + + Charset Short TextEncodingBase (Charset) + valid for the following two fields + + FullPath variable Path of the current file. + Zero terminated string (C-String) + Currently coded in the native Charset. + + Comment variable Finder Comment of the current file. + Zero terminated string (C-String) + Currently coded in the native Charset. + + + -SmartZIP Macintosh Extra Field: + ==================================== + + The following is the layout of the SmartZIP extra + block for Macintosh, designed by Marco Bambini. + + Local-header version: + + Value Size Description + ----- ---- ----------- + 0x4d63 Short tag for this extra block type ("cM") + TSize Short total data size for this block (64) + "dZip" beLong extra-field signature + fdType Byte[4] Type of the File (4-byte string) + fdCreator Byte[4] Creator of the File (4-byte string) + fdFlags beShort Finder Flags + fdLocation.v beShort Finder Icon Location + fdLocation.h beShort Finder Icon Location + fdFldr beShort Folder containing file + CrDat beLong HParamBlockRec fileParam.ioFlCrDat + MdDat beLong HParamBlockRec fileParam.ioFlMdDat + frScroll.v Byte vertical pos. of folder's scroll bar + fdScript Byte Script flag and number + frScroll.h Byte horizontal pos. of folder's scroll bar + fdXFlags Byte More flag bits + FileName Byte[32] full Macintosh filename (pascal string) + + All fields but the first two are in native Macintosh format + (big-endian Motorola order, not little-endian Intel). + The extra field size is fixed to 64 bytes. + The local-header and central-header versions are identical. + + + -Acorn SparkFS Extra Field: + ========================= + + The following is the layout of David Pilling's SparkFS extra block + for Acorn RISC OS. The local-header and central-header versions are + identical. (Last Revision 19960922) + + Value Size Description + ----- ---- ----------- + (Acorn) 0x4341 Short tag for this extra block type ("AC") + TSize Short total data size for this block (20) + "ARC0" Long extra-field signature + LoadAddr Long load address or file type + ExecAddr Long exec address + Attr Long file permissions + Zero Long reserved; always zero + + The following bits of Attr are associated with the given file + permissions: + + bit 0 user-writable ('W') + bit 1 user-readable ('R') + bit 2 reserved + bit 3 locked ('L') + bit 4 publicly writable ('w') + bit 5 publicly readable ('r') + bit 6 reserved + bit 7 reserved + + + -VM/CMS Extra Field: + ================== + + The following is the layout of the file-attributes extra block for + VM/CMS. The local-header and central-header versions are + identical. (Last Revision 19960922) + + Value Size Description + ----- ---- ----------- + (VM/CMS) 0x4704 Short tag for this extra block type + TSize Short total data size for this block + flData variable file attributes data + + flData is an uncompressed fldata_t struct. + + + -MVS Extra Field: + =============== + + The following is the layout of the file-attributes extra block for + MVS. The local-header and central-header versions are identical. + (Last Revision 19960922) + + Value Size Description + ----- ---- ----------- + (MVS) 0x470f Short tag for this extra block type + TSize Short total data size for this block + flData variable file attributes data + + flData is an uncompressed fldata_t struct. + + + -PKWARE Unix Extra Field (0x000d): + ================================ + + The following is the layout of PKWARE's Unix "extra" block. + It was introduced with the release of PKZIP for Unix 2.50. + Note: all fields are stored in Intel low-byte/high-byte order. + (Last Revision 19980901) + + This field has a minimum data size of 12 bytes and is only stored + as local extra field. + + Value Size Description + ----- ---- ----------- + (Unix0) 0x000d Short Tag for this "extra" block type + TSize Short Total Data Size for this block + AcTime Long time of last access (UTC/GMT) + ModTime Long time of last modification (UTC/GMT) + UID Short Unix user ID + GID Short Unix group ID + (var) variable Variable length data field + + The variable length data field will contain file type + specific data. Currently the only values allowed are + the original "linked to" file names for hard or symbolic + links, and the major and minor device node numbers for + character and block device nodes. Since device nodes + cannot be either symbolic or hard links, only one set of + variable length data is stored. Link files will have the + name of the original file stored. This name is NOT NULL + terminated. Its size can be determined by checking TSize - + 12. Device entries will have eight bytes stored as two 4 + byte entries (in little-endian format). The first entry + will be the major device number, and the second the minor + device number. + + [Info-ZIP note: The fixed part of this field has the same layout as + Info-ZIP's abandoned "Unix1 timestamps & owner ID info" extra field; + only the two tag bytes are different.] + + + -PATCH Descriptor Extra Field (0x000f): + ===================================== + + The following is the layout of the Patch Descriptor "extra" + block. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (Patch) 0x000f Short Tag for this "extra" block type + TSize Short Size of the total "extra" block + Version Short Version of the descriptor + Flags Long Actions and reactions (see below) + OldSize Long Size of the file about to be patched + OldCRC Long 32-bit CRC of the file about to be patched + NewSize Long Size of the resulting file + NewCRC Long 32-bit CRC of the resulting file + + + Actions and reactions + + Bits Description + ---- ---------------- + 0 Use for auto detection + 1 Treat as a self-patch + 2-3 RESERVED + 4-5 Action (see below) + 6-7 RESERVED + 8-9 Reaction (see below) to absent file + 10-11 Reaction (see below) to newer file + 12-13 Reaction (see below) to unknown file + 14-15 RESERVED + 16-31 RESERVED + + Actions + + Action Value + ------ ----- + none 0 + add 1 + delete 2 + patch 3 + + Reactions + + Reaction Value + -------- ----- + ask 0 + skip 1 + ignore 2 + fail 3 + + Patch support is provided by PKPatchMaker(tm) technology and is + covered under U.S. Patents and Patents Pending. + + + -PKCS#7 Store for X.509 Certificates (0x0014): + ============================================ + + This field contains information about each of the certificates + files may be signed with. When the Central Directory Encryption + feature is enabled for a ZIP file, this record will appear in + the Archive Extra Data Record, otherwise it will appear in the + first central directory record and will be ignored in any + other record. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (Store) 0x0014 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the store data + SData TSize Data about the store + + SData + Value Size Description + ----- ---- ----------- + Version 2 bytes Version number, 0x0001 for now + StoreD (variable) Actual store data + + The StoreD member is suitable for passing as the pbData + member of a CRYPT_DATA_BLOB to the CertOpenStore() function + in Microsoft's CryptoAPI. The SSize member above will be + cbData + 6, where cbData is the cbData member of the same + CRYPT_DATA_BLOB. The encoding type to pass to + CertOpenStore() should be + PKCS_7_ANS_ENCODING | X509_ASN_ENCODING. + + + -X.509 Certificate ID and Signature for individual file (0x0015): + =============================================================== + + This field contains the information about which certificate in + the PKCS#7 store was used to sign a particular file. It also + contains the signature data. This field can appear multiple + times, but can only appear once per certificate. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (CID) 0x0015 2 bytes Tag for this "extra" block type + CSize 2 bytes Size of Method + Method (variable) + + Method + Value Size Description + ----- ---- ----------- + Version 2 bytes Version number, for now 0x0001 + AlgID 2 bytes Algorithm ID used for signing + IDSize 2 bytes Size of Certificate ID data + CertID (variable) Certificate ID data + SigSize 2 bytes Size of Signature data + Sig (variable) Signature data + + CertID + Value Size Description + ----- ---- ----------- + Size1 4 bytes Size of CertID, should be (IDSize - 4) + Size1 4 bytes A bug in version one causes this value + to appear twice. + IssSize 4 bytes Issuer data size + Issuer (variable) Issuer data + SerSize 4 bytes Serial Number size + Serial (variable) Serial Number data + + The Issuer and IssSize members are suitable for creating a + CRYPT_DATA_BLOB to be the Issuer member of a CERT_INFO + struct. The Serial and SerSize members would be the + SerialNumber member of the same CERT_INFO struct. This + struct would be used to find the certificate in the store + the file was signed with. Those structures are from the MS + CryptoAPI. + + Sig and SigSize are the actual signature data and size + generated by signing the file with the MS CryptoAPI using a + hash created with the given AlgID. + + + -X.509 Certificate ID and Signature for central directory (0x0016): + ================================================================= + + This field contains the information about which certificate in + the PKCS#7 store was used to sign the central directory structure. + When the Central Directory Encryption feature is enabled for a + ZIP file, this record will appear in the Archive Extra Data Record, + otherwise it will appear in the first central directory record, + along with the store. The data structure is the + same as the CID, except that SigSize will be 0, and there + will be no Sig member. + + This field is also kept after the last central directory + record, as the signature data (ID 0x05054b50, it looks like + a central directory record of a different type). This + second copy of the data is the Signature Data member of the + record, and will have a SigSize that is non-zero, and will + have Sig data. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (CDID) 0x0016 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of data that follows + TData TSize Data + + + -Strong Encryption Header (0x0017) (EFS): + =============================== + + Value Size Description + ----- ---- ----------- + 0x0017 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of data that follows + Format 2 bytes Format definition for this record + AlgID 2 bytes Encryption algorithm identifier + Bitlen 2 bytes Bit length of encryption key + Flags 2 bytes Processing flags + CertData TSize-8 Certificate decryption extra field data + (refer to the explanation for CertData + in the section describing the + Certificate Processing Method under + the Strong Encryption Specification) + + + -Record Management Controls (0x0018): + =================================== + + Value Size Description + ----- ---- ----------- +(Rec-CTL) 0x0018 2 bytes Tag for this "extra" block type + CSize 2 bytes Size of total extra block data + Tag1 2 bytes Record control attribute 1 + Size1 2 bytes Size of attribute 1, in bytes + Data1 Size1 Attribute 1 data + . + . + . + TagN 2 bytes Record control attribute N + SizeN 2 bytes Size of attribute N, in bytes + DataN SizeN Attribute N data + + + -PKCS#7 Encryption Recipient Certificate List (0x0019): (EFS) + ===================================================== + + This field contains the information about each of the certificates + that files may be encrypted with. This field should only appear + in the archive extra data record. This field is not required and + serves only to aide archive modifications by preserving public + encryption data. Individual security requirements may dictate + that this data be omitted to deter information exposure. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (CStore) 0x0019 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the store data + TData TSize Data about the store + + TData: + + Value Size Description + ----- ---- ----------- + Version 2 bytes Format version number - must 0x0001 at this time + CStore (var) PKCS#7 data blob + + + -MVS Extra Field (PKWARE, 0x0065): + ================================ + + The following is the layout of the MVS "extra" block. + Note: Some fields are stored in Big Endian format. + All text is in EBCDIC format unless otherwise specified. + + Value Size Description + ----- ---- ----------- + (MVS) 0x0065 2 bytes Tag for this "extra" block type + TSize 2 bytes Size for the following data block + ID 4 bytes EBCDIC "Z390" 0xE9F3F9F0 or + "T4MV" for TargetFour + (var) TSize-4 Attribute data + + + -OS/400 Extra Field (0x0065): + =========================== + + The following is the layout of the OS/400 "extra" block. + Note: Some fields are stored in Big Endian format. + All text is in EBCDIC format unless otherwise specified. + + Value Size Description + ----- ---- ----------- + (OS400) 0x0065 2 bytes Tag for this "extra" block type + TSize 2 bytes Size for the following data block + ID 4 bytes EBCDIC "I400" 0xC9F4F0F0 or + "T4MV" for TargetFour + (var) TSize-4 Attribute data + + + -Extended Timestamp Extra Field: + ============================== + + The following is the layout of the extended-timestamp extra block. + (Last Revision 19970118) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (time) 0x5455 Short tag for this extra block type ("UT") + TSize Short total data size for this block + Flags Byte info bits + (ModTime) Long time of last modification (UTC/GMT) + (AcTime) Long time of last access (UTC/GMT) + (CrTime) Long time of original creation (UTC/GMT) + + Central-header version: + + Value Size Description + ----- ---- ----------- + (time) 0x5455 Short tag for this extra block type ("UT") + TSize Short total data size for this block + Flags Byte info bits (refers to local header!) + (ModTime) Long time of last modification (UTC/GMT) + + The central-header extra field contains the modification time only, + or no timestamp at all. TSize is used to flag its presence or + absence. But note: + + If "Flags" indicates that Modtime is present in the local header + field, it MUST be present in the central header field, too! + This correspondence is required because the modification time + value may be used to support trans-timezone freshening and + updating operations with zip archives. + + The time values are in standard Unix signed-long format, indicating + the number of seconds since 1 January 1970 00:00:00. The times + are relative to Coordinated Universal Time (UTC), also sometimes + referred to as Greenwich Mean Time (GMT). To convert to local time, + the software must know the local timezone offset from UTC/GMT. + + The lower three bits of Flags in both headers indicate which time- + stamps are present in the LOCAL extra field: + + bit 0 if set, modification time is present + bit 1 if set, access time is present + bit 2 if set, creation time is present + bits 3-7 reserved for additional timestamps; not set + + Those times that are present will appear in the order indicated, but + any combination of times may be omitted. (Creation time may be + present without access time, for example.) TSize should equal + (1 + 4*(number of set bits in Flags)), as the block is currently + defined. Other timestamps may be added in the future. + + + -Info-ZIP Unix Extra Field (type 1): + ================================== + + The following is the layout of the old Info-ZIP extra block for + Unix. It has been replaced by the extended-timestamp extra block + (0x5455) and the Unix type 2 extra block (0x7855). + (Last Revision 19970118) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (Unix1) 0x5855 Short tag for this extra block type ("UX") + TSize Short total data size for this block + AcTime Long time of last access (UTC/GMT) + ModTime Long time of last modification (UTC/GMT) + UID Short Unix user ID (optional) + GID Short Unix group ID (optional) + + Central-header version: + + Value Size Description + ----- ---- ----------- + (Unix1) 0x5855 Short tag for this extra block type ("UX") + TSize Short total data size for this block + AcTime Long time of last access (GMT/UTC) + ModTime Long time of last modification (GMT/UTC) + + The file access and modification times are in standard Unix signed- + long format, indicating the number of seconds since 1 January 1970 + 00:00:00. The times are relative to Coordinated Universal Time + (UTC), also sometimes referred to as Greenwich Mean Time (GMT). To + convert to local time, the software must know the local timezone + offset from UTC/GMT. The modification time may be used by non-Unix + systems to support inter-timezone freshening and updating of zip + archives. + + The local-header extra block may optionally contain UID and GID + info for the file. The local-header TSize value is the only + indication of this. Note that Unix UIDs and GIDs are usually + specific to a particular machine, and they generally require root + access to restore. + + This extra field type is obsolete, but it has been in use since + mid-1994. Therefore future archiving software should continue to + support it. Some guidelines: + + An archive member should either contain the old "Unix1" + extra field block or the new extra field types "time" and/or + "Unix2". + + If both the old "Unix1" block type and one or both of the new + block types "time" and "Unix2" are found, the "Unix1" block + should be considered invalid and ignored. + + Unarchiving software should recognize both old and new extra + field block types, but the info from new types overrides the + old "Unix1" field. + + Archiving software should recognize "Unix1" extra fields for + timestamp comparison but never create it for updated, freshened + or new archive members. When copying existing members to a new + archive, any "Unix1" extra field blocks should be converted to + the new "time" and/or "Unix2" types. + + + -Info-ZIP Unix Extra Field (type 2): + ================================== + + The following is the layout of the new Info-ZIP extra block for + Unix. (Last Revision 19960922) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (Unix2) 0x7855 Short tag for this extra block type ("Ux") + TSize Short total data size for this block (4) + UID Short Unix user ID + GID Short Unix group ID + + Central-header version: + + Value Size Description + ----- ---- ----------- + (Unix2) 0x7855 Short tag for this extra block type ("Ux") + TSize Short total data size for this block (0) + + The data size of the central-header version is zero; it is used + solely as a flag that UID/GID info is present in the local-header + extra field. If additional fields are ever added to the local + version, the central version may be extended to indicate this. + + Note that Unix UIDs and GIDs are usually specific to a particular + machine, and they generally require root access to restore. + + + -ASi Unix Extra Field: + ==================== + + The following is the layout of the ASi extra block for Unix. The + local-header and central-header versions are identical. + (Last Revision 19960916) + + Value Size Description + ----- ---- ----------- + (Unix3) 0x756e Short tag for this extra block type ("nu") + TSize Short total data size for this block + CRC Long CRC-32 of the remaining data + Mode Short file permissions + SizDev Long symlink'd size OR major/minor dev num + UID Short user ID + GID Short group ID + (var.) variable symbolic link filename + + Mode is the standard Unix st_mode field from struct stat, containing + user/group/other permissions, setuid/setgid and symlink info, etc. + + If Mode indicates that this file is a symbolic link, SizDev is the + size of the file to which the link points. Otherwise, if the file + is a device, SizDev contains the standard Unix st_rdev field from + struct stat (includes the major and minor numbers of the device). + SizDev is undefined in other cases. + + If Mode indicates that the file is a symbolic link, the final field + will be the name of the file to which the link points. The file- + name length can be inferred from TSize. + + [Note that TSize may incorrectly refer to the data size not counting + the CRC; i.e., it may be four bytes too small.] + + + -BeOS Extra Field: + ================ + + The following is the layout of the file-attributes extra block for + BeOS. (Last Revision 19970531) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (BeOS) 0x6542 Short tag for this extra block type ("Be") + TSize Short total data size for this block + BSize Long uncompressed file attribute data size + Flags Byte info bits + (CType) Short compression type + (CRC) Long CRC value for uncompressed file attribs + Attribs variable file attribute data + + Central-header version: + + Value Size Description + ----- ---- ----------- + (BeOS) 0x6542 Short tag for this extra block type ("Be") + TSize Short total data size for this block (5) + BSize Long size of uncompr. local EF block data + Flags Byte info bits + + The least significant bit of Flags in both headers indicates whether + the LOCAL extra field is uncompressed (and therefore whether CType + and CRC are omitted): + + bit 0 if set, Attribs is uncompressed (no CType, CRC) + bits 1-7 reserved; if set, assume error or unknown data + + Currently the only supported compression types are deflated (type 8) + and stored (type 0); the latter is not used by Info-ZIP's Zip but is + supported by UnZip. + + Attribs is a BeOS-specific block of data in big-endian format with + the following structure (if compressed, uncompress it first): + + Value Size Description + ----- ---- ----------- + Name variable attribute name (null-terminated string) + Type Long attribute type (32-bit unsigned integer) + Size Long Long data size for this sub-block (64 bits) + Data variable attribute data + + The attribute structure is repeated for every attribute. The Data + field may contain anything--text, flags, bitmaps, etc. + + + -AtheOS Extra Field: + ================== + + The following is the layout of the file-attributes extra block for + AtheOS. This field is a very close spin-off from the BeOS e.f. + The only differences are: + - a new extra field signature + - numeric field in the attributes data are stored in little-endian + format ("i386" was initial hardware for AtheOS) + (Last Revision 20040908) + + Local-header version: + + Value Size Description + ----- ---- ----------- + (AtheOS) 0x7441 Short tag for this extra block type ("At") + TSize Short total data size for this block + BSize Long uncompressed file attribute data size + Flags Byte info bits + (CType) Short compression type + (CRC) Long CRC value for uncompressed file attribs + Attribs variable file attribute data + + Central-header version: + + Value Size Description + ----- ---- ----------- + (AtheOS) 0x7441 Short tag for this extra block type ("At") + TSize Short total data size for this block (5) + BSize Long size of uncompr. local EF block data + Flags Byte info bits + + The least significant bit of Flags in both headers indicates whether + the LOCAL extra field is uncompressed (and therefore whether CType + and CRC are omitted): + + bit 0 if set, Attribs is uncompressed (no CType, CRC) + bits 1-7 reserved; if set, assume error or unknown data + + Currently the only supported compression types are deflated (type 8) + and stored (type 0); the latter is not used by Info-ZIP's Zip but is + supported by UnZip. + + Attribs is a AtheOS-specific block of data in little-endian format + with the following structure (if compressed, uncompress it first): + + Value Size Description + ----- ---- ----------- + Name variable attribute name (null-terminated string) + Type Long attribute type (32-bit unsigned integer) + Size Long Long data size for this sub-block (64 bits) + Data variable attribute data + + The attribute structure is repeated for every attribute. The Data + field may contain anything--text, flags, bitmaps, etc. + + + -SMS/QDOS Extra Field: + ==================== + + The following is the layout of the file-attributes extra block for + SMS/QDOS. The local-header and central-header versions are identical. + (Last Revision 19960929) + + Value Size Description + ----- ---- ----------- + (QDOS) 0xfb4a Short tag for this extra block type + TSize Short total data size for this block + LongID Long extra-field signature + (ExtraID) Long additional signature/flag bytes + QDirect 64 bytes qdirect structure + + LongID may be "QZHD" or "QDOS". In the latter case, ExtraID will + be present. Its first three bytes are "02\0"; the last byte is + currently undefined. + + QDirect contains the file's uncompressed directory info (qdirect + struct). Its elements are in native (big-endian) format: + + d_length beLong file length + d_access byte file access type + d_type byte file type + d_datalen beLong data length + d_reserved beLong unused + d_szname beShort size of filename + d_name 36 bytes filename + d_update beLong time of last update + d_refdate beLong file version number + d_backup beLong time of last backup (archive date) + + + -AOS/VS Extra Field: + ================== + + The following is the layout of the extra block for Data General + AOS/VS. The local-header and central-header versions are identical. + (Last Revision 19961125) + + Value Size Description + ----- ---- ----------- + (AOSVS) 0x5356 Short tag for this extra block type ("VS") + TSize Short total data size for this block + "FCI\0" Long extra-field signature + Version Byte version of AOS/VS extra block (10 = 1.0) + Fstat variable fstat packet + AclBuf variable raw ACL data ($MXACL bytes) + + Fstat contains the file's uncompressed fstat packet, which is one of + the following: + + normal fstat packet (P_FSTAT struct) + DIR/CPD fstat packet (P_FSTAT_DIR struct) + unit (device) fstat packet (P_FSTAT_UNIT struct) + IPC file fstat packet (P_FSTAT_IPC struct) + + AclBuf contains the raw ACL data; its length is $MXACL. + + + -Tandem NSK Extra Field: + ====================== + + The following is the layout of the file-attributes extra block for + Tandem NSK. The local-header and central-header versions are + identical. (Last Revision 19981221) + + Value Size Description + ----- ---- ----------- + (TA) 0x4154 Short tag for this extra block type ("TA") + TSize Short total data size for this block (20) + NSKattrs 20 Bytes NSK attributes + + + -THEOS Extra Field: + ================= + + The following is the layout of the file-attributes extra block for + Theos. The local-header and central-header versions are identical. + (Last Revision 19990206) + + Value Size Description + ----- ---- ----------- + (Theos) 0x6854 Short 'Th' signature + size Short size of extra block + flags Byte reserved for future use + filesize Long file size + fileorg Byte type of file (see below) + keylen Short key length for indexed and keyed files, + data segment size for 16 bits programs + reclen Short record length for indexed,keyed and direct, + text segment size for 16 bits programs + filegrow Byte growing factor for indexed,keyed and direct + protect Byte protections (see below) + reserved Short reserved for future use + + File types + ========== + + 0x80 library (keyed access list of files) + 0x40 directory + 0x10 stream file + 0x08 direct file + 0x04 keyed file + 0x02 indexed file + 0x0e reserved + 0x01 16 bits real mode program (obsolete) + 0x21 16 bits protected mode program + 0x41 32 bits protected mode program + + Protection codes + ================ + + User protection + --------------- + 0x01 non readable + 0x02 non writable + 0x04 non executable + 0x08 non erasable + + Other protection + ---------------- + 0x10 non readable + 0x20 non writable + 0x40 non executable Theos before 4.0 + 0x40 modified Theos 4.x + 0x80 not hidden + + + -THEOS old inofficial Extra Field: + ================================ + + The following is the layout of an inoffical former version of a + Theos file-attributes extra blocks. This layout was never published + and is no longer created. However, UnZip can optionally support it + when compiling with the option flag OLD_THEOS_EXTRA defined. + Both the local-header and central-header versions are identical. + (Last Revision 19990206) + + Value Size Description + ----- ---- ----------- + (THS0) 0x4854 Short 'TH' signature + size Short size of extra block + flags Short reserved for future use + filesize Long file size + reclen Short record length for indexed,keyed and direct, + text segment size for 16 bits programs + keylen Short key length for indexed and keyed files, + data segment size for 16 bits programs + filegrow Byte growing factor for indexed,keyed and direct + reserved 3 Bytes reserved for future use + + + -FWKCS MD5 Extra Field (0x4b46): + ============================== + + The FWKCS Contents_Signature System, used in automatically + identifying files independent of filename, optionally adds + and uses an extra field to support the rapid creation of + an enhanced contents_signature. + There is no local-header version; the following applies + only to the central header. (Last Revision 19961207) + + Central-header version: + + Value Size Description + ----- ---- ----------- + (MD5) 0x4b46 Short tag for this extra block type ("FK") + TSize Short total data size for this block (19) + "MD5" 3 bytes extra-field signature + MD5hash 16 bytes 128-bit MD5 hash of uncompressed data + (low byte first) + + When FWKCS revises a .ZIP file central directory to add + this extra field for a file, it also replaces the + central directory entry for that file's uncompressed + file length with a measured value. + + FWKCS provides an option to strip this extra field, if + present, from a .ZIP file central directory. In adding + this extra field, FWKCS preserves .ZIP file Authenticity + Verification; if stripping this extra field, FWKCS + preserves all versions of AV through PKZIP version 2.04g. + + FWKCS, and FWKCS Contents_Signature System, are + trademarks of Frederick W. Kantor. + + (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer + Science and RSA Data Security, Inc., April 1992. + ll.76-77: "The MD5 algorithm is being placed in the + public domain for review and possible adoption as a + standard." + + + file comment: (Variable) + + The comment for this file. + + number of this disk: (2 bytes) + + The number of this disk, which contains central + directory end record. If an archive is in zip64 format + and the value in this field is 0xFFFF, the size will + be in the corresponding 4 byte zip64 end of central + directory field. + + number of the disk with the start of the central directory: (2 bytes) + + The number of the disk on which the central + directory starts. If an archive is in zip64 format + and the value in this field is 0xFFFF, the size will + be in the corresponding 4 byte zip64 end of central + directory field. + + total number of entries in the central dir on this disk: (2 bytes) + + The number of central directory entries on this disk. + If an archive is in zip64 format and the value in + this field is 0xFFFF, the size will be in the + corresponding 8 byte zip64 end of central + directory field. + + total number of entries in the central dir: (2 bytes) + + The total number of files in the .ZIP file. If an + archive is in zip64 format and the value in this field + is 0xFFFF, the size will be in the corresponding 8 byte + zip64 end of central directory field. + + size of the central directory: (4 bytes) + + The size (in bytes) of the entire central directory. + If an archive is in zip64 format and the value in + this field is 0xFFFFFFFF, the size will be in the + corresponding 8 byte zip64 end of central + directory field. + + offset of start of central directory with respect to + the starting disk number: (4 bytes) + + Offset of the start of the central directory on the + disk on which the central directory starts. If an + archive is in zip64 format and the value in this + field is 0xFFFFFFFF, the size will be in the + corresponding 8 byte zip64 end of central + directory field. + + .ZIP file comment length: (2 bytes) + + The length of the comment for this .ZIP file. + + .ZIP file comment: (Variable) + + The comment for this .ZIP file. ZIP file comment data + is stored unsecured. No encryption or data authentication + is applied to this area at this time. Confidential information + should not be stored in this section. + + zip64 extensible data sector (variable size) + + (currently reserved for use by PKWARE) + + + K. General notes: + + 1) All fields unless otherwise noted are unsigned and stored + in Intel low-byte:high-byte, low-word:high-word order. + + 2) String fields are not null terminated, since the + length is given explicitly. + + 3) Local headers should not span disk boundaries. Also, even + though the central directory can span disk boundaries, no + single record in the central directory should be split + across disks. + + 4) The entries in the central directory may not necessarily + be in the same order that files appear in the .ZIP file. + + 5) Spanned/Split archives created using PKZIP for Windows + (V2.50 or greater), PKZIP Command Line (V2.50 or greater), + or PKZIP Explorer will include a special spanning + signature as the first 4 bytes of the first segment of + the archive. This signature (0x08074b50) will be + followed immediately by the local header signature for + the first file in the archive. A special spanning + marker may also appear in spanned/split archives if the + spanning or splitting process starts but only requires + one segment. In this case the 0x08074b50 signature + will be replaced with the temporary spanning marker + signature of 0x30304b50. Spanned/split archives + created with this special signature are compatible with + all versions of PKZIP from PKWARE. Split archives can + only be uncompressed by other versions of PKZIP that + know how to create a split archive. + + 6) If one of the fields in the end of central directory + record is too small to hold required data, the field + should be set to -1 (0xFFFF or 0xFFFFFFFF) and the + Zip64 format record should be created. + + 7) The end of central directory record and the + Zip64 end of central directory locator record must + reside on the same disk when splitting or spanning + an archive. + +V. UnShrinking - Method 1 +------------------------- + +Shrinking is a Dynamic Ziv-Lempel-Welch compression algorithm +with partial clearing. The initial code size is 9 bits, and +the maximum code size is 13 bits. Shrinking differs from +conventional Dynamic Ziv-Lempel-Welch implementations in several +respects: + +1) The code size is controlled by the compressor, and is not + automatically increased when codes larger than the current + code size are created (but not necessarily used). When + the decompressor encounters the code sequence 256 + (decimal) followed by 1, it should increase the code size + read from the input stream to the next bit size. No + blocking of the codes is performed, so the next code at + the increased size should be read from the input stream + immediately after where the previous code at the smaller + bit size was read. Again, the decompressor should not + increase the code size used until the sequence 256,1 is + encountered. + +2) When the table becomes full, total clearing is not + performed. Rather, when the compressor emits the code + sequence 256,2 (decimal), the decompressor should clear + all leaf nodes from the Ziv-Lempel tree, and continue to + use the current code size. The nodes that are cleared + from the Ziv-Lempel tree are then re-used, with the lowest + code value re-used first, and the highest code value + re-used last. The compressor can emit the sequence 256,2 + at any time. + + +VI. Expanding - Methods 2-5 +--------------------------- + +The Reducing algorithm is actually a combination of two +distinct algorithms. The first algorithm compresses repeated +byte sequences, and the second algorithm takes the compressed +stream from the first algorithm and applies a probabilistic +compression method. + +The probabilistic compression stores an array of 'follower +sets' S(j), for j=0 to 255, corresponding to each possible +ASCII character. Each set contains between 0 and 32 +characters, to be denoted as S(j)[0],...,S(j)[m], where m<32. +The sets are stored at the beginning of the data area for a +Reduced file, in reverse order, with S(255) first, and S(0) +last. + +The sets are encoded as { N(j), S(j)[0],...,S(j)[N(j)-1] }, +where N(j) is the size of set S(j). N(j) can be 0, in which +case the follower set for S(j) is empty. Each N(j) value is +encoded in 6 bits, followed by N(j) eight bit character values +corresponding to S(j)[0] to S(j)[N(j)-1] respectively. If +N(j) is 0, then no values for S(j) are stored, and the value +for N(j-1) immediately follows. + +Immediately after the follower sets, is the compressed data +stream. The compressed data stream can be interpreted for the +probabilistic decompression as follows: + + +let Last-Character <- 0. +loop until done + if the follower set S(Last-Character) is empty then + read 8 bits from the input stream, and copy this + value to the output stream. + otherwise if the follower set S(Last-Character) is non-empty then + read 1 bit from the input stream. + if this bit is not zero then + read 8 bits from the input stream, and copy this + value to the output stream. + otherwise if this bit is zero then + read B(N(Last-Character)) bits from the input + stream, and assign this value to I. + Copy the value of S(Last-Character)[I] to the + output stream. + + assign the last value placed on the output stream to + Last-Character. +end loop + + +B(N(j)) is defined as the minimal number of bits required to +encode the value N(j)-1. + + +The decompressed stream from above can then be expanded to +re-create the original file as follows: + + +let State <- 0. + +loop until done + read 8 bits from the input stream into C. + case State of + 0: if C is not equal to DLE (144 decimal) then + copy C to the output stream. + otherwise if C is equal to DLE then + let State <- 1. + + 1: if C is non-zero then + let V <- C. + let Len <- L(V) + let State <- F(Len). + otherwise if C is zero then + copy the value 144 (decimal) to the output stream. + let State <- 0 + + 2: let Len <- Len + C + let State <- 3. + + 3: move backwards D(V,C) bytes in the output stream + (if this position is before the start of the output + stream, then assume that all the data before the + start of the output stream is filled with zeros). + copy Len+3 bytes from this position to the output stream. + let State <- 0. + end case +end loop + + +The functions F,L, and D are dependent on the 'compression +factor', 1 through 4, and are defined as follows: + +For compression factor 1: + L(X) equals the lower 7 bits of X. + F(X) equals 2 if X equals 127 otherwise F(X) equals 3. + D(X,Y) equals the (upper 1 bit of X) * 256 + Y + 1. +For compression factor 2: + L(X) equals the lower 6 bits of X. + F(X) equals 2 if X equals 63 otherwise F(X) equals 3. + D(X,Y) equals the (upper 2 bits of X) * 256 + Y + 1. +For compression factor 3: + L(X) equals the lower 5 bits of X. + F(X) equals 2 if X equals 31 otherwise F(X) equals 3. + D(X,Y) equals the (upper 3 bits of X) * 256 + Y + 1. +For compression factor 4: + L(X) equals the lower 4 bits of X. + F(X) equals 2 if X equals 15 otherwise F(X) equals 3. + D(X,Y) equals the (upper 4 bits of X) * 256 + Y + 1. + + +VII. Imploding - Method 6 +------------------------- + +The Imploding algorithm is actually a combination of two distinct +algorithms. The first algorithm compresses repeated byte +sequences using a sliding dictionary. The second algorithm is +used to compress the encoding of the sliding dictionary output, +using multiple Shannon-Fano trees. + +The Imploding algorithm can use a 4K or 8K sliding dictionary +size. The dictionary size used can be determined by bit 1 in the +general purpose flag word; a 0 bit indicates a 4K dictionary +while a 1 bit indicates an 8K dictionary. + +The Shannon-Fano trees are stored at the start of the compressed +file. The number of trees stored is defined by bit 2 in the +general purpose flag word; a 0 bit indicates two trees stored, a +1 bit indicates three trees are stored. If 3 trees are stored, +the first Shannon-Fano tree represents the encoding of the +Literal characters, the second tree represents the encoding of +the Length information, the third represents the encoding of the +Distance information. When 2 Shannon-Fano trees are stored, the +Length tree is stored first, followed by the Distance tree. + +The Literal Shannon-Fano tree, if present is used to represent +the entire ASCII character set, and contains 256 values. This +tree is used to compress any data not compressed by the sliding +dictionary algorithm. When this tree is present, the Minimum +Match Length for the sliding dictionary is 3. If this tree is +not present, the Minimum Match Length is 2. + +The Length Shannon-Fano tree is used to compress the Length part +of the (length,distance) pairs from the sliding dictionary +output. The Length tree contains 64 values, ranging from the +Minimum Match Length, to 63 plus the Minimum Match Length. + +The Distance Shannon-Fano tree is used to compress the Distance +part of the (length,distance) pairs from the sliding dictionary +output. The Distance tree contains 64 values, ranging from 0 to +63, representing the upper 6 bits of the distance value. The +distance values themselves will be between 0 and the sliding +dictionary size, either 4K or 8K. + +The Shannon-Fano trees themselves are stored in a compressed +format. The first byte of the tree data represents the number of +bytes of data representing the (compressed) Shannon-Fano tree +minus 1. The remaining bytes represent the Shannon-Fano tree +data encoded as: + + High 4 bits: Number of values at this bit length + 1. (1 - 16) + Low 4 bits: Bit Length needed to represent value + 1. (1 - 16) + +The Shannon-Fano codes can be constructed from the bit lengths +using the following algorithm: + +1) Sort the Bit Lengths in ascending order, while retaining the + order of the original lengths stored in the file. + +2) Generate the Shannon-Fano trees: + + Code <- 0 + CodeIncrement <- 0 + LastBitLength <- 0 + i <- number of Shannon-Fano codes - 1 (either 255 or 63) + + loop while i >= 0 + Code = Code + CodeIncrement + if BitLength(i) <> LastBitLength then + LastBitLength=BitLength(i) + CodeIncrement = 1 shifted left (16 - LastBitLength) + ShannonCode(i) = Code + i <- i - 1 + end loop + + +3) Reverse the order of all the bits in the above ShannonCode() + vector, so that the most significant bit becomes the least + significant bit. For example, the value 0x1234 (hex) would + become 0x2C48 (hex). + +4) Restore the order of Shannon-Fano codes as originally stored + within the file. + +Example: + + This example will show the encoding of a Shannon-Fano tree + of size 8. Notice that the actual Shannon-Fano trees used + for Imploding are either 64 or 256 entries in size. + +Example: 0x02, 0x42, 0x01, 0x13 + + The first byte indicates 3 values in this table. Decoding the + bytes: + 0x42 = 5 codes of 3 bits long + 0x01 = 1 code of 2 bits long + 0x13 = 2 codes of 4 bits long + + This would generate the original bit length array of: + (3, 3, 3, 3, 3, 2, 4, 4) + + There are 8 codes in this table for the values 0 thru 7. Using + the algorithm to obtain the Shannon-Fano codes produces: + + Reversed Order Original +Val Sorted Constructed Code Value Restored Length +--- ------ ----------------- -------- -------- ------ +0: 2 1100000000000000 11 101 3 +1: 3 1010000000000000 101 001 3 +2: 3 1000000000000000 001 110 3 +3: 3 0110000000000000 110 010 3 +4: 3 0100000000000000 010 100 3 +5: 3 0010000000000000 100 11 2 +6: 4 0001000000000000 1000 1000 4 +7: 4 0000000000000000 0000 0000 4 + + +The values in the Val, Order Restored and Original Length columns +now represent the Shannon-Fano encoding tree that can be used for +decoding the Shannon-Fano encoded data. How to parse the +variable length Shannon-Fano values from the data stream is beyond +the scope of this document. (See the references listed at the end of +this document for more information.) However, traditional decoding +schemes used for Huffman variable length decoding, such as the +Greenlaw algorithm, can be successfully applied. + +The compressed data stream begins immediately after the +compressed Shannon-Fano data. The compressed data stream can be +interpreted as follows: + +loop until done + read 1 bit from input stream. + + if this bit is non-zero then (encoded data is literal data) + if Literal Shannon-Fano tree is present + read and decode character using Literal Shannon-Fano tree. + otherwise + read 8 bits from input stream. + copy character to the output stream. + otherwise (encoded data is sliding dictionary match) + if 8K dictionary size + read 7 bits for offset Distance (lower 7 bits of offset). + otherwise + read 6 bits for offset Distance (lower 6 bits of offset). + + using the Distance Shannon-Fano tree, read and decode the + upper 6 bits of the Distance value. + + using the Length Shannon-Fano tree, read and decode + the Length value. + + Length <- Length + Minimum Match Length + + if Length = 63 + Minimum Match Length + read 8 bits from the input stream, + add this value to Length. + + move backwards Distance+1 bytes in the output stream, and + copy Length characters from this position to the output + stream. (if this position is before the start of the output + stream, then assume that all the data before the start of + the output stream is filled with zeros). +end loop + +VIII. Tokenizing - Method 7 +--------------------------- + +This method is not used by PKZIP. + +IX. Deflating - Method 8 +------------------------ + +The Deflate algorithm is similar to the Implode algorithm using +a sliding dictionary of up to 32K with secondary compression +from Huffman/Shannon-Fano codes. + +The compressed data is stored in blocks with a header describing +the block and the Huffman codes used in the data block. The header +format is as follows: + + Bit 0: Last Block bit This bit is set to 1 if this is the last + compressed block in the data. + Bits 1-2: Block type + 00 (0) - Block is stored - All stored data is byte aligned. + Skip bits until next byte, then next word = block + length, followed by the ones compliment of the block + length word. Remaining data in block is the stored + data. + + 01 (1) - Use fixed Huffman codes for literal and distance codes. + Lit Code Bits Dist Code Bits + --------- ---- --------- ---- + 0 - 143 8 0 - 31 5 + 144 - 255 9 + 256 - 279 7 + 280 - 287 8 + + Literal codes 286-287 and distance codes 30-31 are + never used but participate in the huffman construction. + + 10 (2) - Dynamic Huffman codes. (See expanding Huffman codes) + + 11 (3) - Reserved - Flag a "Error in compressed data" if seen. + +Expanding Huffman Codes +----------------------- +If the data block is stored with dynamic Huffman codes, the Huffman +codes are sent in the following compressed format: + + 5 Bits: # of Literal codes sent - 257 (257 - 286) + All other codes are never sent. + 5 Bits: # of Dist codes - 1 (1 - 32) + 4 Bits: # of Bit Length codes - 4 (4 - 19) + +The Huffman codes are sent as bit lengths and the codes are built as +described in the implode algorithm. The bit lengths themselves are +compressed with Huffman codes. There are 19 bit length codes: + + 0 - 15: Represent bit lengths of 0 - 15 + 16: Copy the previous bit length 3 - 6 times. + The next 2 bits indicate repeat length (0 = 3, ... ,3 = 6) + Example: Codes 8, 16 (+2 bits 11), 16 (+2 bits 10) will + expand to 12 bit lengths of 8 (1 + 6 + 5) + 17: Repeat a bit length of 0 for 3 - 10 times. (3 bits of length) + 18: Repeat a bit length of 0 for 11 - 138 times (7 bits of length) + +The lengths of the bit length codes are sent packed 3 bits per value +(0 - 7) in the following order: + + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 + +The Huffman codes should be built as described in the Implode algorithm +except codes are assigned starting at the shortest bit length, i.e. the +shortest code should be all 0's rather than all 1's. Also, codes with +a bit length of zero do not participate in the tree construction. The +codes are then used to decode the bit lengths for the literal and +distance tables. + +The bit lengths for the literal tables are sent first with the number +of entries sent described by the 5 bits sent earlier. There are up +to 286 literal characters; the first 256 represent the respective 8 +bit character, code 256 represents the End-Of-Block code, the remaining +29 codes represent copy lengths of 3 thru 258. There are up to 30 +distance codes representing distances from 1 thru 32k as described +below. + + Length Codes + ------------ + Extra Extra Extra Extra + Code Bits Length Code Bits Lengths Code Bits Lengths Code Bits Length(s) + ---- ---- ------ ---- ---- ------- ---- ---- ------- ---- ---- --------- + 257 0 3 265 1 11,12 273 3 35-42 281 5 131-162 + 258 0 4 266 1 13,14 274 3 43-50 282 5 163-194 + 259 0 5 267 1 15,16 275 3 51-58 283 5 195-226 + 260 0 6 268 1 17,18 276 3 59-66 284 5 227-258 + 261 0 7 269 2 19-22 277 4 67-82 285 0 258 + 262 0 8 270 2 23-26 278 4 83-98 + 263 0 9 271 2 27-30 279 4 99-114 + 264 0 10 272 2 31-34 280 4 115-130 + + Distance Codes + -------------- + Extra Extra Extra Extra + Code Bits Dist Code Bits Dist Code Bits Distance Code Bits Distance + ---- ---- ---- ---- ---- ------ ---- ---- -------- ---- ---- -------- + 0 0 1 8 3 17-24 16 7 257-384 24 11 4097-6144 + 1 0 2 9 3 25-32 17 7 385-512 25 11 6145-8192 + 2 0 3 10 4 33-48 18 8 513-768 26 12 8193-12288 + 3 0 4 11 4 49-64 19 8 769-1024 27 12 12289-16384 + 4 1 5,6 12 5 65-96 20 9 1025-1536 28 13 16385-24576 + 5 1 7,8 13 5 97-128 21 9 1537-2048 29 13 24577-32768 + 6 2 9-12 14 6 129-192 22 10 2049-3072 + 7 2 13-16 15 6 193-256 23 10 3073-4096 + +The compressed data stream begins immediately after the +compressed header data. The compressed data stream can be +interpreted as follows: + +do + read header from input stream. + + if stored block + skip bits until byte aligned + read count and 1's compliment of count + copy count bytes data block + otherwise + loop until end of block code sent + decode literal character from input stream + if literal < 256 + copy character to the output stream + otherwise + if literal = end of block + break from loop + otherwise + decode distance from input stream + + move backwards distance bytes in the output stream, and + copy length characters from this position to the output + stream. + end loop +while not last block + +if data descriptor exists + skip bits until byte aligned + check data descriptor signature + read crc and sizes +endif + +X. Enhanced Deflating - Method 9 +-------------------------------- + +The Enhanced Deflating algorithm is similar to Deflate but +uses a sliding dictionary of up to 64K. Deflate64(tm) is supported +by the Deflate extractor. + +[This description is inofficial. It has been deduced by Info-ZIP from +close inspection of PKZIP 4.x Deflate64(tm) compressed output.] + +The Deflate64 algorithm is almost identical to the normal Deflate algorithm. +Differences are: + +- The sliding window size is 64k. + +- The previously unused distance codes 30 and 31 are now used to describe + match distances from 32k-48k and 48k-64k. + Extra + Code Bits Distance + ---- ---- ----------- + .. .. ... + 29 13 24577-32768 + 30 14 32769-49152 + 31 14 49153-65536 + +- The semantics of the "maximum match length" code #258 has been changed to + allow the specification of arbitrary large match lengths (up to 64k). + Extra + Code Bits Lengths + ---- ---- ------ + ... .. ... + 284 5 227-258 + 285 16 3-65538 + +Whereas the first two modifications fit into the framework of Deflate, +this last change breaks compatibility with Deflate method 8. Thus, a +Deflate64 decompressor cannot decode normal deflated data. + +XI. BZIP2 - Method 12 +--------------------- + +BZIP2 is an open-source data compression algorithm developed by +Julian Seward. Information and source code for this algorithm +can be found on the internet. + + +XII. Traditional PKWARE Encryption +---------------------------------- + +The following information discusses the decryption steps +required to support traditional PKWARE encryption. This +form of encryption is considered weak by today's standards +and its use is recommended only for situations with +low security needs or for compatibility with older .ZIP +applications. + +XIII. Decryption +---------------- + +The encryption used in PKZIP was generously supplied by Roger +Schlafly. PKWARE is grateful to Mr. Schlafly for his expert +help and advice in the field of data encryption. + +PKZIP encrypts the compressed data stream. Encrypted files must +be decrypted before they can be extracted. + +Each encrypted file has an extra 12 bytes stored at the start of +the data area defining the encryption header for that file. The +encryption header is originally set to random values, and then +itself encrypted, using three, 32-bit keys. The key values are +initialized using the supplied encryption password. After each byte +is encrypted, the keys are then updated using pseudo-random number +generation techniques in combination with the same CRC-32 algorithm +used in PKZIP and described elsewhere in this document. + +The following is the basic steps required to decrypt a file: + +1) Initialize the three 32-bit keys with the password. +2) Read and decrypt the 12-byte encryption header, further + initializing the encryption keys. +3) Read and decrypt the compressed data stream using the + encryption keys. + + +Step 1 - Initializing the encryption keys +----------------------------------------- + +Key(0) <- 305419896 +Key(1) <- 591751049 +Key(2) <- 878082192 + +loop for i <- 0 to length(password)-1 + update_keys(password(i)) +end loop + + +Where update_keys() is defined as: + + +update_keys(char): + Key(0) <- crc32(key(0),char) + Key(1) <- Key(1) + (Key(0) & 000000ffH) + Key(1) <- Key(1) * 134775813 + 1 + Key(2) <- crc32(key(2),key(1) >> 24) +end update_keys + + +Where crc32(old_crc,char) is a routine that given a CRC value and a +character, returns an updated CRC value after applying the CRC-32 +algorithm described elsewhere in this document. + + +Step 2 - Decrypting the encryption header +----------------------------------------- + +The purpose of this step is to further initialize the encryption +keys, based on random data, to render a plaintext attack on the +data ineffective. + + +Read the 12-byte encryption header into Buffer, in locations +Buffer(0) thru Buffer(11). + +loop for i <- 0 to 11 + C <- buffer(i) ^ decrypt_byte() + update_keys(C) + buffer(i) <- C +end loop + + +Where decrypt_byte() is defined as: + + +unsigned char decrypt_byte() + local unsigned short temp + temp <- Key(2) | 2 + decrypt_byte <- (temp * (temp ^ 1)) >> 8 +end decrypt_byte + + +After the header is decrypted, the last 1 or 2 bytes in Buffer +should be the high-order word/byte of the CRC for the file being +decrypted, stored in Intel low-byte/high-byte order, or the high-order +byte of the file time if bit 3 of the general purpose bit flag is set. +Versions of PKZIP prior to 2.0 used a 2 byte CRC check; a 1 byte CRC check is +used on versions after 2.0. This can be used to test if the password +supplied is correct or not. + + +Step 3 - Decrypting the compressed data stream +---------------------------------------------- + +The compressed data stream can be decrypted as follows: + + +loop until done + read a character into C + Temp <- C ^ decrypt_byte() + update_keys(temp) + output Temp +end loop + + +XIV. Strong Encryption Specification (EFS) +------------------------------------------ + +Version 5.x of this specification introduced support for strong +encryption algorithms. These algorithms can be used with either +a password or an X.509v3 digital certificate to encrypt each file. +This format specification supports either password or certificate +based encryption to meet the security needs of today, to enable +interoperability between users within both PKI and non-PKI +environments, and to ensure interoperability between different +computing platforms that are running a ZIP program. + +Password based encryption is the most common form of encryption +people are familiar with. However, inherent weaknesses with +passwords (e.g. susceptibility to dictionary/brute force attack) +as well as password management and support issues make certificate +based encryption a more secure and scalable option. Industry +efforts and support are defining and moving towards more advanced +security solutions built around X.509v3 digital certificates and +Public Key Infrastructures(PKI) because of the greater scalability, +administrative options, and more robust security over traditional +password-based encryption. + +Most standard encryption algorithms are supported with this +specification. Reference implementations for many of these +algorithms are available from either commercial or open source +distributors. Readily available cryptographic toolkits make +implementation of the encryption features straight-forward. +This document is not intended to provide a treatise on data +encryption principles or theory. Its purpose is to document the +data structures required for implementing interoperable data +encryption within the .ZIP format. It is strongly recommended that +you have a good understanding of data encryption before reading +further. + +The algorithms introduced in Version 5.0 of this specification +include: + + RC2 40 bit, 64 bit, and 128 bit + RC4 40 bit, 64 bit, and 128 bit + DES + 3DES 112 bit and 168 bit + +Version 5.1 adds support for the following: + + AES 128 bit, 192 bit, and 256 bit + +Version 6.1 introduces encryption data changes to support +interoperability with SmartCard and USB Token certificate storage +methods which do not support the OAEP strengthening standard. + +Version 6.2 introduces support for encrypting metadata by compressing +and encrypting the central directory data structure to reduce information +leakage. Information leakage can occur in legacy ZIP applications +through exposure of information about a file even though that file is +stored encrypted. The information exposed consists of file +characteristics stored within the records and fields defined by this +specification. This includes data such as a files name, its original +size, timestamp and CRC32 value. + +Central Directory Encryption provides greater protection against +information leakage by encrypting the Central Directory structure and +by masking key values that are replicated in the unencrypted Local +Header. ZIP compatible programs that cannot interpret an encrypted +Central Directory structure cannot rely on the data in the corresponding +Local Header for decompression information. + +Extra Field records that may contain information about a file that should +not be exposed should not be stored in the Local Header and should only +be written to the Central Directory where they can be encrypted. This +design currently does not support streaming. Information in the End of +Central Directory record, the ZIP64 End of Central Directory Locator, +and the ZIP64 End of Central Directory record are not encrypted. Access +to view data on files within a ZIP file with an encrypted Central Directory +requires the appropriate password or private key for decryption prior to +viewing any files, or any information about the files, in the archive. + +Older ZIP compatible programs not familiar with the Central Directory +Encryption feature will no longer be able to recognize the Central +Directory and may assume the ZIP file is corrupt. Programs that +attempt streaming access using Local Headers will see invalid +information for each file. Central Directory Encryption need not be +used for every ZIP file. Its use is recommended for greater security. +ZIP files not using Central Directory Encryption should operate as +in the past. + +The details of the strong encryption specification for certificates +remain under development as design and testing issues are worked out +for the range of algorithms, encryption methods, certificate processing +and cross-platform support necessary to meet the advanced security needs +of .ZIP file users today and in the future. + +This feature specification is intended to support basic encryption needs +of today, such as password support. However this specification is also +designed to lay the foundation for future advanced security needs. + +Encryption provides data confidentiality and privacy. It is +recommended that you combine X.509 digital signing with encryption +to add authentication and non-repudiation. + + +Single Password Symmetric Encryption Method: +------------------------------------------- + +The Single Password Symmetric Encryption Method using strong +encryption algorithms operates similarly to the traditional +PKWARE encryption defined in this format. Additional data +structures are added to support the processing needs of the +strong algorithms. + +The Strong Encryption data structures are: + +1. General Purpose Bits - Bits 0 and 6 of the General Purpose bit +flag in both local and central header records. Both bits set +indicates strong encryption. Bit 13, when set indicates the Central +Directory is encrypted and that selected fields in the Local Header +are masked to hide their actual value. + + +2. Extra Field 0x0017 in central header only. + + Fields to consider in this record are: + + Format - the data format identifier for this record. The only + value allowed at this time is the integer value 2. + + AlgId - integer identifier of the encryption algorithm from the + following range + + 0x6601 - DES + 0x6602 - RC2 (version needed to extract < 5.2) + 0x6603 - 3DES 168 + 0x6609 - 3DES 112 + 0x660E - AES 128 + 0x660F - AES 192 + 0x6610 - AES 256 + 0x6702 - RC2 (version needed to extract >= 5.2) + 0x6801 - RC4 + 0xFFFF - Unknown algorithm + + Bitlen - Explicit bit length of key + + 40 + 56 + 64 + 112 + 128 + 168 + 192 + 256 + + Flags - Processing flags needed for decryption + + 0x0001 - Password is required to decrypt + 0x0002 - Certificates only + 0x0003 - Password or certificate required to decrypt + + Values > 0x0003 reserved for certificate processing + + +3. Decryption header record preceeding compressed file data. + + -Decryption Header: + + Value Size Description + ----- ---- ----------- + IVSize 2 bytes Size of initialization vector (IV) + IVData IVSize Initialization vector for this file + Size 4 bytes Size of remaining decryption header data + Format 2 bytes Format definition for this record + AlgID 2 bytes Encryption algorithm identifier + Bitlen 2 bytes Bit length of encryption key + Flags 2 bytes Processing flags + ErdSize 2 bytes Size of Encrypted Random Data + ErdData ErdSize Encrypted Random Data + Reserved1 4 bytes Reserved certificate processing data + Reserved2 (var) Reserved for certificate processing data + VSize 2 bytes Size of password validation data + VData VSize-4 Password validation data + VCRC32 4 bytes Standard ZIP CRC32 of password validation data + + IVData - The size of the IV should match the algorithm block size. + The IVData can be completely random data. If the size of + the randomly generated data does not match the block size + it should be complemented with zero's or truncated as + necessary. If IVSize is 0, then IV = CRC32 + Uncompressed + File Size (as a 64 bit little-endian, unsigned integer value). + + Format - the data format identifier for this record. The only + value allowed at this time is the integer value 3. + + AlgId - integer identifier of the encryption algorithm from the + following range + + 0x6601 - DES + 0x6602 - RC2 (version needed to extract < 5.2) + 0x6603 - 3DES 168 + 0x6609 - 3DES 112 + 0x660E - AES 128 + 0x660F - AES 192 + 0x6610 - AES 256 + 0x6702 - RC2 (version needed to extract >= 5.2) + 0x6801 - RC4 + 0xFFFF - Unknown algorithm + + Bitlen - Explicit bit length of key + + 40 + 56 + 64 + 112 + 128 + 168 + 192 + 256 + + Flags - Processing flags needed for decryption + + 0x0001 - Password is required to decrypt + 0x0002 - Certificates only + 0x0003 - Password or certificate required to decrypt + + Values > 0x0003 reserved for certificate processing + + ErdData - Encrypted random data is used to generate a file + session key for encrypting each file. SHA1 is + used to calculate hash data used to derive keys. + File session keys are derived from a master session + key generated from the user-supplied password. + If the Flags field in the decryption header contains + the value 0x4000, then the ErdData field must be + decrypted using 3DES. + + Reserved1 - Reserved for certificate processing, if value is + zero, then Reserved2 data is absent. See the explanation + under the Certificate Processing Method for details on + this data structure. + + Reserved2 - If present, the size of the Reserved2 data structure + is located by skipping the first 4 bytes of this field + and using the next 2 bytes as the remaining size. See + the explanation under the Certificate Processing Method + for details on this data structure. + + VSize - This size value will always include the 4 bytes of the + VCRC32 data and will be greater than 4 bytes. + + VData - Random data for password validation. This data is VSize + in length and VSize must be a multiple of the encryption + block size. VCRC32 is a checksum value of VData. + VData and VCRC32 are stored encrypted and start the + stream of encrypted data for a file. + +4. Single Password Central Directory Encryption + +Central Directory Encryption is achieved within the .ZIP format by +encrypting the Central Directory structure. This encapsulates the metadata +most often used for processing .ZIP files. Additional metadata is stored for +redundancy in the Local Header for each file. The process of concealing +metadata by encrypting the Central Directory does not protect the data within +the Local Header. To avoid information leakage from the exposed metadata +in the Local Header, the fields containing information about a file are masked. + +Local Header: + +Masking replaces the true content of the fields for a file in the Local +Header with false information. When masked, the Local Header is not +suitable for streaming access and the options for data recovery of damaged +archives is reduced. Extra Data fields that may contain confidential +data should not be stored within the Local Header. The value set into +the Version needed to extract field should be the correct value needed to +extract the file without regard to Central Directory Encryption. The fields +within the Local Header targeted for masking when the Central Directory is +encrypted are: + + Field Name Mask Value + ------------------ --------------------------- + compression method 0 + last mod file time 0 + last mod file date 0 + crc-32 0 + compressed size 0 + uncompressed size 0 + file name (variable size) Base 16 value from the + range 1 - FFFFFFFFFFFFFFFF + represented as a string whose + size will be set into the + file name length field + +The Base 16 value assigned as a masked file name is simply a sequentially +incremented value for each file starting with 1 for the first file. +Modifications to a ZIP file may cause different values to be stored for +each file. For compatibility, the file name field in the Local Header +should never be left blank. As of Version 6.2 of this specification, +the Compression Method and Compressed Size fields are not yet masked. + +Encrypting the Central Directory: + +Encryption of the Central Directory does not include encryption of the +Central Directory Signature data, the ZIP64 End of Central Directory +record, the ZIP64 End of Central Directory Locator, or the End +of Central Directory record. The ZIP file comment data is never +encrypted. + +Before encrypting the Central Directory, it may optionally be compressed. +Compression is not required, but for storage efficiency it is assumed +this structure will be compressed before encrypting. Similarly, this +specification supports compressing the Central Directory without +requiring that it also be encrypted. Early implementations of this +feature will assume the encryption method applied to files matches the +encryption applied to the Central Directory. + +Encryption of the Central Directory is done in a manner similar to +that of file encryption. The encrypted data is preceded by a +decryption header. The decryption header is known as the Archive +Decryption Header. The fields of this record are identical to +the decryption header preceding each encrypted file. The location +of the Archive Decryption Header is determined by the value in the +Start of the Central Directory field in the ZIP64 End of Central +Directory record. When the Central Directory is encrypted, the +ZIP64 End of Central Directory record will always be present. + +The layout of the ZIP64 End of Central Directory record for all +versions starting with 6.2 of this specification will follow the +Version 2 format. The Version 2 format is as follows: + +The first 48 bytes will remain identical to that of Version 1. +The record signature for both Version 1 and Version 2 will be +0x06064b50. Immediately following the 48th byte, which identifies +the end of the field known as the Offset of Start of Central +Directory With Respect to the Starting Disk Number will begin the +new fields defining Version 2 of this record. + +New fields for Version 2: + +Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + Compression Method 2 bytes Method used to compress the + Central Directory + Compressed Size 8 bytes Size of the compressed data + Original Size 8 bytes Original uncompressed size + AlgId 2 bytes Encryption algorithm ID + BitLen 2 bytes Encryption key length + Flags 2 bytes Encryption flags + HashID 2 bytes Hash algorithm identifier + Hash Length 2 bytes Length of hash data + Hash Data (variable) Hash data + +The Compression Method accepts the same range of values as the +corresponding field in the Central Header. + +The Compressed Size and Original Size values will not include the +data of the Central Directory Signature which is compressed or +encrypted. + +The AlgId, BitLen, and Flags fields accept the same range of values +the corresponding fields within the 0x0017 record. + +Hash ID identifies the algorithm used to hash the Central Directory +data. This data does not have to be hashed, in which case the +values for both the HashID and Hash Length will be 0. Possible +values for HashID are: + + Value Algorithm + ------ --------- + 0x0000 none + 0x0001 CRC32 + 0x8003 MD5 + 0x8004 SHA1 + +When the Central Directory data is signed, the same hash algorithm +used to hash the Central Directory for signing should be used. +This is recommended for processing efficiency, however, it is +permissible for any of the above algorithms to be used independent +of the signing process. + +The Hash Data will contain the hash data for the Central Directory. +The length of this data will vary depending on the algorithm used. + +The Version Needed to Extract should be set to 62. + +The value for the Total Number of Entries on the Current Disk will +be 0. These records will no longer support random access when +encrypting the Central Directory. + +When the Central Directory is compressed and/or encrypted, the +End of Central Directory record will store the value 0xFFFFFFFF +as the value for the Total Number of Entries in the Central +Directory. The value stored in the Total Number of Entries in +the Central Directory on this Disk field will be 0. The actual +values will be stored in the equivalent fields of the ZIP64 +End of Central Directory record. + +Decrypting and decompressing the Central Directory is accomplished +in the same manner as decrypting and decompressing a file. + + +5. Useful Tips + +Strong Encryption is always applied to a file after compression. The +block oriented algorithms all operate in Cypher Block Chaining (CBC) +mode. The block size used for AES encryption is 16. All other block +algorithms use a block size of 8. Two ID's are defined for RC2 to +account for a discrepancy found in the implementation of the RC2 +algorithm in the cryptographic library on Windows XP SP1 and all +earlier versions of Windows. + +A pseudo-code representation of the encryption process is as follows: + +Password = GetUserPassword() +RD = Random() +ERD = Encrypt(RD,DeriveKey(SHA1(Password))) +For Each File + IV = Random() + VData = Random() + FileSessionKey = DeriveKey(SHA1(IV + RD)) + Encrypt(VData + VCRC32 + FileData,FileSessionKey) +Done + +The function names and parameter requirements will depend on +the choice of the cryptographic toolkit selected. Almost any +toolkit supporting the reference implementations for each +algorithm can be used. The RSA BSAFE(r), OpenSSL, and Microsoft +CryptoAPI libraries are all known to work well. + + +Certificate Processing Method: +----------------------------- + +The Certificate Processing Method for ZIP file encryption remains +under development. The information provided here serves as a guide +to those interested in certificate-based data decryption. This +information may be subject to change in future versions of this +specification and is subject to change without notice. + +OAEP Processing with Certificate-based Encryption: + +Versions of PKZIP available during this development phase of the +certificate processing method may set a value of 61 into the +version needed to extract field for a file. This indicates that +non-OAEP key wrapping is used. This affects certificate encryption +only, and password encryption functions should not be affected by +this value. This means values of 61 may be found on files encrypted +with certificates only, or on files encrypted with both password +encryption and certificate encryption. Files encrypted with both +methods can safely be decrypted using the password methods documented. + +OAEP stands for Optimal Asymmetric Encryption Padding. It is a +strengthening technique used for small encoded items such as decryption +keys. This is commonly applied in cryptographic key-wrapping techniques +and is supported by PKCS #1. Versions 5.0 and 6.0 of this specification +were designed to support OAEP key-wrapping for certificate-based +decryption keys for additional security. + +Support for private keys stored on Smart Cards or Tokens introduced +a conflict with this OAEP logic. Most card and token products do +not support the additional strengthening applied to OAEP key-wrapped +data. In order to resolve this conflict, versions 6.1 and above of this +specification will no longer support OAEP when encrypting using +digital certificates. + +Certificate Processing Data Fields: + +The Certificate Processing Method of this specification defines the +following additional data fields: + + +1. Certificate Flag Values + +Additional processing flags that can be present in the Flags field of both +the 0x0017 field of the central directory Extra Field and the Decryption +header record preceding compressed file data are: + + 0x0007 - reserved for future use + 0x000F - reserved for future use + 0x0100 - Indicates non-OAEP key wrapping was used. If this + this field is set, the version needed to extract must + be at least 61. This means OAEP key wrapping is not + used when generating a Master Session Key using + ErdData. + 0x4000 - ErdData must be decrypted using 3DES-168, otherwise use the + same algorithm used for encrypting the file contents. + 0x8000 - reserved for future use + + +2. CertData - Extra Field 0x0017 record certificate data structure + +The data structure used to store certificate data within the section +of the Extra Field defined by the CertData field of the 0x0017 +record are as shown: + + Value Size Description + ----- ---- ----------- + RCount 4 bytes Number of recipients. + HashAlg 2 bytes Hash algorithm identifier + HSize 2 bytes Hash size + SRList (var) Simple list of recipients hashed public keys + + + RCount This defines the number intended recipients whose + public keys were used for encryption. This identifies + the number of elements in the SRList. + + HashAlg This defines the hash algorithm used to calculate + the public key hash of each public key used + for encryption. This field currently supports + only the following value for SHA-1 + + 0x8004 - SHA1 + + HSize This defines the size of a hashed public key. + + SRList This is a variable length list of the hashed + public keys for each intended recipient. Each + element in this list is HSize. The total size of + SRList is determined using RCount * HSize. + + +3. Reserved1 - Certificate Decryption Header Reserved1 Data: + + Value Size Description + ----- ---- ----------- + RCount 4 bytes Number of recipients. + + RCount This defines the number intended recipients whose + public keys were used for encryption. This defines + the number of elements in the REList field defined below. + + +4. Reserved2 - Certificate Decryption Header Reserved2 Data Structures: + + + Value Size Description + ----- ---- ----------- + HashAlg 2 bytes Hash algorithm identifier + HSize 2 bytes Hash size + REList (var) List of recipient data elements + + + HashAlg This defines the hash algorithm used to calculate + the public key hash of each public key used + for encryption. This field currently supports + only the following value for SHA-1 + + 0x8004 - SHA1 + + HSize This defines the size of a hashed public key + defined in REHData. + + REList This is a variable length of list of recipient data. + Each element in this list consists of a Recipient + Element data structure as follows: + + + Recipient Element (REList) Data Structure: + + Value Size Description + ----- ---- ----------- + RESize 2 bytes Size of REHData + REKData + REHData HSize Hash of recipients public key + REKData (var) Simple key blob + + + RESize This defines the size of an individual REList + element. This value is the combined size of the + REHData field + REKData field. REHData is defined by + HSize. REKData is variable and can be calculated + for each REList element using RESize and HSize. + + REHData Hashed public key for this recipient. + + REKData Simple Key Blob. The format of this data structure + is identical to that defined in the Microsoft + CryptoAPI and generated using the CryptExportKey() + function. The version of the Simple Key Blob + supported at this time is 0x02 as defined by + Microsoft. + +5. Certificate Processing - Central Directory Encryption: + +Central Directory Encryption using Digital Certificates will +operate in a manner similar to that of Single Password Central +Directory Encryption. This record will only be present when there +is data to place into it. Currently, data is placed into this +record when digital certificates are used for either encrypting +or signing the files within a ZIP file. When only password +encryption is used with no certificate encryption or digital +signing, this record is not currently needed. When present, this +record will appear before the start of the actual Central Directory +data structure and will be located immediately after the Archive +Decryption Header if the Central Directory is encrypted. + +The Archive Extra Data record will be used to store the following +information. Additional data may be added in future versions. + +Extra Data Fields: + +0x0014 - PKCS#7 Store for X.509 Certificates +0x0016 - X.509 Certificate ID and Signature for central directory +0x0019 - PKCS#7 Encryption Recipient Certificate List + +The 0x0014 and 0x0016 Extra Data records that otherwise would be +located in the first record of the Central Directory for digital +certificate processing. When encrypting or compressing the Central +Directory, the 0x0014 and 0x0016 records must be located in the +Archive Extra Data record and they should not remain in the first +Central Directory record. The Archive Extra Data record will also +be used to store the 0x0019 data. + +When present, the size of the Archive Extra Data record will be +included in the size of the Central Directory. The data of the +Archive Extra Data record will also be compressed and encrypted +along with the Central Directory data structure. + +6. Certificate Processing Differences: + +The Certificate Processing Method of encryption differs from the +Single Password Symmetric Encryption Method as follows. Instead +of using a user-defined password to generate a master session key, +cryptographically random data is used. The key material is then +wrapped using standard key-wrapping techniques. This key material +is wrapped using the public key of each recipient that will need +to decrypt the file using their corresponding private key. + +This specification currently assumes digital certificates will follow +the X.509 V3 format for 1024 bit and higher RSA format digital +certificates. Implementation of this Certificate Processing Method +requires supporting logic for key access and management. This logic +is outside the scope of this specification. + + +License Agreement: +----------------- + +The features set forth in this Section XIV (the "Strong Encryption +Specification") are covered by a pending patent application. Portions of +this Strong Encryption technology are available for use at no charge +under the following terms and conditions. + +1. License Grant. + + a. NOTICE TO USER. PLEASE READ THIS ENTIRE SECTION XIV OF THE + APPNOTE (THE "AGREEMENT") CAREFULLY. BY USING ALL OR ANY PORTION OF THE + LICENSED TECHNOLOGY, YOU ACCEPT ALL THE TERMS AND CONDITIONS OF THIS + AGREEMENT AND YOU AGREE THAT THIS AGREEMENT IS ENFORCEABLE LIKE ANY + WRITTEN NEGOTIATED AGREEMENT SIGNED BY YOU. IF YOU DO NOT AGREE, DO NOT + USE THE LICENSED TECHNOLOGY. + + b. Definitions. + + i. "Licensed Technology" shall mean that proprietary technology now or + hereafter owned or controlled by PKWare, Inc. ("PKWARE") or any + subsidiary or affiliate that covers or is necessary to be used to give + software the ability to a) extract and decrypt data from zip files + encrypted using any methods of data encryption and key processing which + are published in this APPNOTE or any prior APPNOTE, as supplemented by + any Additional Compatibility Information; and b) encrypt file contents + as part of .ZIP file processing using only the Single Password Symmetric + Encryption Method as published in this APPNOTE or any prior APPNOTE, as + supplemented by any Additional Compatibility Information. For purposes + of this AGREEMENT, "Additional Compatibility Information" means, with + regard to any method of data encryption and key processing published in + this or any prior APPNOTE, any corrections, additions, or clarifications + to the information in such APPNOTE that are required in order to give + software the ability to successfully extract and decrypt zip files (or, + but solely in the case of the Single Password Symmetric Encryption Method, + to successfully encrypt zip files) in a manner interoperable with the + actual implementation of such method in any PKWARE product that is + documented or publicly described by PKWARE as being able to create, or + to extract and decrypt, zip files using that method. + + ii. "Licensed Products" shall mean any products you produce that + incorporate the Licensed Technology. + + c. License to Licensed Technology. + + PKWARE hereby grants to you a non-exclusive license to use the Licensed + Technology for the purpose of manufacturing, offering, selling and using + Licensed Products, which license shall extend to permit the practice of all + claims in any patent or patent application (collectively, "Patents") now or + hereafter owned or controlled by PKWARE in any jurisdiction in the world + that are infringed by implementation of the Licensed Technology. You have + the right to sublicense rights you receive under the terms of this AGREEMENT + for the purpose of allowing sublicensee to manufacture, offer, sell and use + products that incorporate all or a portion of any of your Licensed Products, + but if you do, you agree to i) impose the same restrictions on any such + sublicensee as these terms impose on you and ii) notify the sublicensee, + by means chosen by you in your unfettered discretion, including a notice on + your web site, of the terms of this AGREEMENT and make available to each + sublicensee the full text of this APPNOTE. Further, PKWARE hereby grants to + you a non-exclusive right to reproduce and distribute, in any form, copies of + this APPNOTE, without modification. Notwithstanding anything to the contrary + in this AGREEMENT, you have the right to sublicense the rights, without any of + the restrictions described above or elsewhere in this AGREEMENT, to use, offer + to sell and sell Licensed Technology as incorporated in executable object code + or byte code forms of your Licensed Products. Any sublicense to use the + Licensed Technology incorporated in a Licensed Product granted by you shall + survive the termination of this AGREEMENT for any reason. PKWARE warrants that + this license shall continue to encumber the Licensed Technology regardless of + changes in ownership of the Licensed Technology. + + d. Proprietary Notices. + + i. With respect to any Licensed Product that is distributed by you either + in source code form or in the form of an object code library of externally + callable functions that has been designed by you for incorporation into third + party products, you agree to include, in the source code, or in the case of + an object code library, in accompanying documentation, a notice using the + words "patent pending" until a patent is issued to PKWARE covering any + portion of the Licensed Technology or PKWARE provides notice, by means + chosen by PKWARE in its unfettered discretion, that it no longer has any + patent pending covering any portion of the Licensed Technology. With respect + to any Licensed Product, upon your becoming aware that at least one patent has + been granted covering the Licensed Technology, you agree to include in any + revisions made by you to the documentation (or any source code distributed + by you) the words "Pat. No.", or "Patent Number" and the patent number or + numbers of the applicable patent or patents. PKWARE shall, from time to time, + inform you of the patent number or numbers of the patents covering the + Licensed Technology, by means chosen by PKWARE in its unfettered discretion, + including a notice on its web site. It shall be a violation of the terms of + this AGREEMENT for you to sell Licensed Products without complying with the + foregoing marking provisions. + + ii. You acknowledge that the terms of this AGREEMENT do not grant you any + license or other right to use any PKWARE trademark in connection with the sale, + offering for sale, distribution and delivery of the Licensed Products, or in + connection with the advertising, promotion and offering of the Licensed Products. + You acknowledge PKWARE's ownership of the PKZIP trademark and all other marks + owned by PKWARE. + + e. Covenant of Compliance and Remedies. + + To the extent that you have elected to implement portions of the Licensed + Technology, you agree to use reasonable diligence to comply with those portions + of this Section XIV, as modified or supplemented by Additional Compatibility + Information available to you, describing the portions of the Licensed Technology + that you have elected to implement. Upon reasonable request by PKWARE, you will + provide written notice to PKWARE identifying which version of this APPNOTE you + have relied upon for your implementation of any specified Licensed Product. + + If any substantial non-compliance with the terms of this AGREEMENT is determined + to exist, you will make such changes as necessary to bring your Licensed Products + into substantial compliance with the terms of this AGREEMENT. If, within sixty + days of receipt of notice that a Licensed Product fails to comply with the terms + of this AGREEMENT, you fail to make such changes as necessary to bring your + Licensed Products into compliance with the terms of this AGREEMENT, PKWARE may + terminate your rights under this AGREEMENT. PKWARE does not waive and expressly + reserves the right to pursue any and all additional remedies that are or may + become available to PKWARE. + + f. Warranty and Indemnification Regarding Exportation. + + You realize and acknowledge that, as between yourself and PKWARE, you are fully + responsible for compliance with the import and export laws and regulations of + any country in or to which you import or export any Licensed Products, and you + agree to hold PKWARE harmless from any claim of violation of any such import + or export laws. + + g. Patent Infringement. + + You agree that you will not bring or threaten to bring any action against PKWARE + for infringement of the claims of any patent owned or controlled by you solely + as a result of PKWARE's own implementation of the Licensed Technology. As its + exclusive remedy for your breach of the foregoing agreement, PKWARE reserves + the right to suspend or terminate all rights granted under the terms of this + AGREEMENT if you bring or threaten to bring any such action against PKWARE, + effective immediately upon delivery of written notice of suspension or + termination to you. + + h. Governing Law. + + The license granted in this AGREEMENT shall be governed by and construed under + the laws of the State of Wisconsin and the United States. + + i. Revisions and Notice. + + The license granted in this APPNOTE is irrevocable, except as expressly set + forth above. You agree and understand that any changes which PKWARE determines + to make to this APPNOTE shall be posted at the same location as the current + APPNOTE or at a location which will be identified by means chosen by PKWARE, + including a notice on its web site, and shall be available for adoption by you + immediately upon such posting, or at such other time as PKWARE shall determine. + Any changes to the terms of the license published in a subsequent version of + this AGREEMENT shall be binding upon you only with respect to your products + that (i) incorporate any Licensed Technology (as defined in the subsequent + AGREEMENT) that is not otherwise included in the definition of Licensed + Technology under this AGREEMENT, or (ii) that you expressly identify are to + be licensed under the subsequent AGREEMENT, which identification shall be by + written notice with reference to the APPNOTE (version and release date or other + unique identifier) in which the subsequent AGREEMENT is published. PKWARE + agrees to identify each change to this APPNOTE by using a unique version and + release date identifier or other unique identifier. + + j. Warranty by PKWARE + + PKWare, Inc. warrants that it has the right to grant the license hereunder. + +XV. Change Process +------------------ + +In order for the .ZIP file format to remain a viable definition, this +specification should be considered as open for periodic review and +revision. Although this format was originally designed with a +certain level of extensibility, not all changes in technology +(present or future) were or will be necessarily considered in its +design. If your application requires new definitions to the +extensible sections in this format, or if you would like to +submit new data structures, please forward your request to +zipformat@pkware.com. All submissions will be reviewed by the +ZIP File Specification Committee for possible inclusion into +future versions of this specification. Periodic revisions +to this specification will be published to ensure interoperability. +We encourage comments and feedback that may help improve clarity +or content. + + +XVI. Acknowledgements +--------------------- + +In addition to the above mentioned contributors to PKZIP and PKUNZIP, +I would like to extend special thanks to Robert Mahoney for suggesting +the extension .ZIP for this software. + + +XVII. References +---------------- + + Fiala, Edward R., and Greene, Daniel H., "Data compression with + finite windows", Communications of the ACM, Volume 32, Number 4, + April 1989, pages 490-505. + + Held, Gilbert, "Data Compression, Techniques and Applications, + Hardware and Software Considerations", John Wiley & Sons, 1987. + + Huffman, D.A., "A method for the construction of minimum-redundancy + codes", Proceedings of the IRE, Volume 40, Number 9, September 1952, + pages 1098-1101. + + Nelson, Mark, "LZW Data Compression", Dr. Dobbs Journal, Volume 14, + Number 10, October 1989, pages 29-37. + + Nelson, Mark, "The Data Compression Book", M&T Books, 1991. + + Storer, James A., "Data Compression, Methods and Theory", + Computer Science Press, 1988 + + Welch, Terry, "A Technique for High-Performance Data Compression", + IEEE Computer, Volume 17, Number 6, June 1984, pages 8-19. + + Ziv, J. and Lempel, A., "A universal algorithm for sequential data + compression", Communications of the ACM, Volume 30, Number 6, + June 1987, pages 520-540. + + Ziv, J. and Lempel, A., "Compression of individual sequences via + variable-rate coding", IEEE Transactions on Information Theory, + Volume 24, Number 5, September 1978, pages 530-536. diff --git a/dotNetZip/AppNote.txt b/dotNetZip/AppNote.txt new file mode 100644 index 0000000..9440997 --- /dev/null +++ b/dotNetZip/AppNote.txt @@ -0,0 +1,3217 @@ +File: APPNOTE.TXT - .ZIP File Format Specification +Version: 6.3.2 +Revised: September 28, 2007 +Copyright (c) 1989 - 2007 PKWARE Inc., All Rights Reserved. + +The use of certain technological aspects disclosed in the current +APPNOTE is available pursuant to the below section entitled +"Incorporating PKWARE Proprietary Technology into Your Product". + +I. Purpose +---------- + +This specification is intended to define a cross-platform, +interoperable file storage and transfer format. Since its +first publication in 1989, PKWARE has remained committed to +ensuring the interoperability of the .ZIP file format through +publication and maintenance of this specification. We trust that +all .ZIP compatible vendors and application developers that have +adopted and benefited from this format will share and support +this commitment to interoperability. + +II. Contacting PKWARE +--------------------- + + PKWARE, Inc. + 648 N. Plankinton Avenue, Suite 220 + Milwaukee, WI 53203 + +1-414-289-9788 + +1-414-289-9789 FAX + zipformat@pkware.com + +III. Disclaimer +--------------- + +Although PKWARE will attempt to supply current and accurate +information relating to its file formats, algorithms, and the +subject programs, the possibility of error or omission cannot +be eliminated. PKWARE therefore expressly disclaims any warranty +that the information contained in the associated materials relating +to the subject programs and/or the format of the files created or +accessed by the subject programs and/or the algorithms used by +the subject programs, or any other matter, is current, correct or +accurate as delivered. Any risk of damage due to any possible +inaccurate information is assumed by the user of the information. +Furthermore, the information relating to the subject programs +and/or the file formats created or accessed by the subject +programs and/or the algorithms used by the subject programs is +subject to change without notice. + +If the version of this file is marked as a NOTIFICATION OF CHANGE, +the content defines an Early Feature Specification (EFS) change +to the .ZIP file format that may be subject to modification prior +to publication of the Final Feature Specification (FFS). This +document may also contain information on Planned Feature +Specifications (PFS) defining recognized future extensions. + +IV. Change Log +-------------- + +Version Change Description Date +------- ------------------ ---------- +5.2 -Single Password Symmetric Encryption 06/02/2003 + storage + +6.1.0 -Smartcard compatibility 01/20/2004 + -Documentation on certificate storage + +6.2.0 -Introduction of Central Directory 04/26/2004 + Encryption for encrypting metadata + -Added OS/X to Version Made By values + +6.2.1 -Added Extra Field placeholder for 04/01/2005 + POSZIP using ID 0x4690 + + -Clarified size field on + "zip64 end of central directory record" + +6.2.2 -Documented Final Feature Specification 01/06/2006 + for Strong Encryption + + -Clarifications and typographical + corrections + +6.3.0 -Added tape positioning storage 09/29/2006 + parameters + + -Expanded list of supported hash algorithms + + -Expanded list of supported compression + algorithms + + -Expanded list of supported encryption + algorithms + + -Added option for Unicode filename + storage + + -Clarifications for consistent use + of Data Descriptor records + + -Added additional "Extra Field" + definitions + +6.3.1 -Corrected standard hash values for 04/11/2007 + SHA-256/384/512 + +6.3.2 -Added compression method 97 09/28/2007 + + -Documented InfoZIP "Extra Field" + values for UTF-8 file name and + file comment storage + +V. General Format of a .ZIP file +-------------------------------- + + Files stored in arbitrary order. Large .ZIP files can span multiple + volumes or be split into user-defined segment sizes. All values + are stored in little-endian byte order unless otherwise specified. + + Overall .ZIP file format: + + [local file header 1] + [file data 1] + [data descriptor 1] + . + . + . + [local file header n] + [file data n] + [data descriptor n] + [archive decryption header] + [archive extra data record] + [central directory] + [zip64 end of central directory record] + [zip64 end of central directory locator] + [end of central directory record] + + + A. Local file header: + + local file header signature 4 bytes (0x04034b50) + version needed to extract 2 bytes + general purpose bit flag 2 bytes + compression method 2 bytes + last mod file time 2 bytes + last mod file date 2 bytes + crc-32 4 bytes + compressed size 4 bytes + uncompressed size 4 bytes + file name length 2 bytes + extra field length 2 bytes + + file name (variable size) + extra field (variable size) + + B. File data + + Immediately following the local header for a file + is the compressed or stored data for the file. + The series of [local file header][file data][data + descriptor] repeats for each file in the .ZIP archive. + + C. Data descriptor: + + crc-32 4 bytes + compressed size 4 bytes + uncompressed size 4 bytes + + This descriptor exists only if bit 3 of the general + purpose bit flag is set (see below). It is byte aligned + and immediately follows the last byte of compressed data. + This descriptor is used only when it was not possible to + seek in the output .ZIP file, e.g., when the output .ZIP file + was standard output or a non-seekable device. For ZIP64(tm) format + archives, the compressed and uncompressed sizes are 8 bytes each. + + When compressing files, compressed and uncompressed sizes + should be stored in ZIP64 format (as 8 byte values) when a + files size exceeds 0xFFFFFFFF. However ZIP64 format may be + used regardless of the size of a file. When extracting, if + the zip64 extended information extra field is present for + the file the compressed and uncompressed sizes will be 8 + byte values. + + Although not originally assigned a signature, the value + 0x08074b50 has commonly been adopted as a signature value + for the data descriptor record. Implementers should be + aware that ZIP files may be encountered with or without this + signature marking data descriptors and should account for + either case when reading ZIP files to ensure compatibility. + When writing ZIP files, it is recommended to include the + signature value marking the data descriptor record. When + the signature is used, the fields currently defined for + the data descriptor record will immediately follow the + signature. + + An extensible data descriptor will be released in a future + version of this APPNOTE. This new record is intended to + resolve conflicts with the use of this record going forward, + and to provide better support for streamed file processing. + + When the Central Directory Encryption method is used, the data + descriptor record is not required, but may be used. If present, + and bit 3 of the general purpose bit field is set to indicate + its presence, the values in fields of the data descriptor + record should be set to binary zeros. + + D. Archive decryption header: + + The Archive Decryption Header is introduced in version 6.2 + of the ZIP format specification. This record exists in support + of the Central Directory Encryption Feature implemented as part of + the Strong Encryption Specification as described in this document. + When the Central Directory Structure is encrypted, this decryption + header will precede the encrypted data segment. The encrypted + data segment will consist of the Archive extra data record (if + present) and the encrypted Central Directory Structure data. + The format of this data record is identical to the Decryption + header record preceding compressed file data. If the central + directory structure is encrypted, the location of the start of + this data record is determined using the Start of Central Directory + field in the Zip64 End of Central Directory record. Refer to the + section on the Strong Encryption Specification for information + on the fields used in the Archive Decryption Header record. + + + E. Archive extra data record: + + archive extra data signature 4 bytes (0x08064b50) + extra field length 4 bytes + extra field data (variable size) + + The Archive Extra Data Record is introduced in version 6.2 + of the ZIP format specification. This record exists in support + of the Central Directory Encryption Feature implemented as part of + the Strong Encryption Specification as described in this document. + When present, this record immediately precedes the central + directory data structure. The size of this data record will be + included in the Size of the Central Directory field in the + End of Central Directory record. If the central directory structure + is compressed, but not encrypted, the location of the start of + this data record is determined using the Start of Central Directory + field in the Zip64 End of Central Directory record. + + + F. Central directory structure: + + [file header 1] + . + . + . + [file header n] + [digital signature] + + File header: + + central file header signature 4 bytes (0x02014b50) + version made by 2 bytes + version needed to extract 2 bytes + general purpose bit flag 2 bytes + compression method 2 bytes + last mod file time 2 bytes + last mod file date 2 bytes + crc-32 4 bytes + compressed size 4 bytes + uncompressed size 4 bytes + file name length 2 bytes + extra field length 2 bytes + file comment length 2 bytes + disk number start 2 bytes + internal file attributes 2 bytes + external file attributes 4 bytes + relative offset of local header 4 bytes + + file name (variable size) + extra field (variable size) + file comment (variable size) + + Digital signature: + + header signature 4 bytes (0x05054b50) + size of data 2 bytes + signature data (variable size) + + With the introduction of the Central Directory Encryption + feature in version 6.2 of this specification, the Central + Directory Structure may be stored both compressed and encrypted. + Although not required, it is assumed when encrypting the + Central Directory Structure, that it will be compressed + for greater storage efficiency. Information on the + Central Directory Encryption feature can be found in the section + describing the Strong Encryption Specification. The Digital + Signature record will be neither compressed nor encrypted. + + G. Zip64 end of central directory record + + zip64 end of central dir + signature 4 bytes (0x06064b50) + size of zip64 end of central + directory record 8 bytes + version made by 2 bytes + version needed to extract 2 bytes + number of this disk 4 bytes + number of the disk with the + start of the central directory 4 bytes + total number of entries in the + central directory on this disk 8 bytes + total number of entries in the + central directory 8 bytes + size of the central directory 8 bytes + offset of start of central + directory with respect to + the starting disk number 8 bytes + zip64 extensible data sector (variable size) + + The value stored into the "size of zip64 end of central + directory record" should be the size of the remaining + record and should not include the leading 12 bytes. + + Size = SizeOfFixedFields + SizeOfVariableData - 12. + + The above record structure defines Version 1 of the + zip64 end of central directory record. Version 1 was + implemented in versions of this specification preceding + 6.2 in support of the ZIP64 large file feature. The + introduction of the Central Directory Encryption feature + implemented in version 6.2 as part of the Strong Encryption + Specification defines Version 2 of this record structure. + Refer to the section describing the Strong Encryption + Specification for details on the version 2 format for + this record. + + Special purpose data may reside in the zip64 extensible data + sector field following either a V1 or V2 version of this + record. To ensure identification of this special purpose data + it must include an identifying header block consisting of the + following: + + Header ID - 2 bytes + Data Size - 4 bytes + + The Header ID field indicates the type of data that is in the + data block that follows. + + Data Size identifies the number of bytes that follow for this + data block type. + + Multiple special purpose data blocks may be present, but each + must be preceded by a Header ID and Data Size field. Current + mappings of Header ID values supported in this field are as + defined in APPENDIX C. + + H. Zip64 end of central directory locator + + zip64 end of central dir locator + signature 4 bytes (0x07064b50) + number of the disk with the + start of the zip64 end of + central directory 4 bytes + relative offset of the zip64 + end of central directory record 8 bytes + total number of disks 4 bytes + + I. End of central directory record: + + end of central dir signature 4 bytes (0x06054b50) + number of this disk 2 bytes + number of the disk with the + start of the central directory 2 bytes + total number of entries in the + central directory on this disk 2 bytes + total number of entries in + the central directory 2 bytes + size of the central directory 4 bytes + offset of start of central + directory with respect to + the starting disk number 4 bytes + .ZIP file comment length 2 bytes + .ZIP file comment (variable size) + + J. Explanation of fields: + + version made by (2 bytes) + + The upper byte indicates the compatibility of the file + attribute information. If the external file attributes + are compatible with MS-DOS and can be read by PKZIP for + DOS version 2.04g then this value will be zero. If these + attributes are not compatible, then this value will + identify the host system on which the attributes are + compatible. Software can use this information to determine + the line record format for text files etc. The current + mappings are: + + 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) + 1 - Amiga 2 - OpenVMS + 3 - UNIX 4 - VM/CMS + 5 - Atari ST 6 - OS/2 H.P.F.S. + 7 - Macintosh 8 - Z-System + 9 - CP/M 10 - Windows NTFS + 11 - MVS (OS/390 - Z/OS) 12 - VSE + 13 - Acorn Risc 14 - VFAT + 15 - alternate MVS 16 - BeOS + 17 - Tandem 18 - OS/400 + 19 - OS/X (Darwin) 20 thru 255 - unused + + The lower byte indicates the ZIP specification version + (the version of this document) supported by the software + used to encode the file. The value/10 indicates the major + version number, and the value mod 10 is the minor version + number. + + version needed to extract (2 bytes) + + The minimum supported ZIP specification version needed to + extract the file, mapped as above. This value is based on + the specific format features a ZIP program must support to + be able to extract the file. If multiple features are + applied to a file, the minimum version should be set to the + feature having the highest value. New features or feature + changes affecting the published format specification will be + implemented using higher version numbers than the last + published value to avoid conflict. + + Current minimum feature versions are as defined below: + + 1.0 - Default value + 1.1 - File is a volume label + 2.0 - File is a folder (directory) + 2.0 - File is compressed using Deflate compression + 2.0 - File is encrypted using traditional PKWARE encryption + 2.1 - File is compressed using Deflate64(tm) + 2.5 - File is compressed using PKWARE DCL Implode + 2.7 - File is a patch data set + 4.5 - File uses ZIP64 format extensions + 4.6 - File is compressed using BZIP2 compression* + 5.0 - File is encrypted using DES + 5.0 - File is encrypted using 3DES + 5.0 - File is encrypted using original RC2 encryption + 5.0 - File is encrypted using RC4 encryption + 5.1 - File is encrypted using AES encryption + 5.1 - File is encrypted using corrected RC2 encryption** + 5.2 - File is encrypted using corrected RC2-64 encryption** + 6.1 - File is encrypted using non-OAEP key wrapping*** + 6.2 - Central directory encryption + 6.3 - File is compressed using LZMA + 6.3 - File is compressed using PPMd+ + 6.3 - File is encrypted using Blowfish + 6.3 - File is encrypted using Twofish + + + * Early 7.x (pre-7.2) versions of PKZIP incorrectly set the + version needed to extract for BZIP2 compression to be 50 + when it should have been 46. + + ** Refer to the section on Strong Encryption Specification + for additional information regarding RC2 corrections. + + *** Certificate encryption using non-OAEP key wrapping is the + intended mode of operation for all versions beginning with 6.1. + Support for OAEP key wrapping should only be used for + backward compatibility when sending ZIP files to be opened by + versions of PKZIP older than 6.1 (5.0 or 6.0). + + + Files compressed using PPMd should set the version + needed to extract field to 6.3, however, not all ZIP + programs enforce this and may be unable to decompress + data files compressed using PPMd if this value is set. + + When using ZIP64 extensions, the corresponding value in the + zip64 end of central directory record should also be set. + This field should be set appropriately to indicate whether + Version 1 or Version 2 format is in use. + + general purpose bit flag: (2 bytes) + + Bit 0: If set, indicates that the file is encrypted. + + (For Method 6 - Imploding) + Bit 1: If the compression method used was type 6, + Imploding, then this bit, if set, indicates + an 8K sliding dictionary was used. If clear, + then a 4K sliding dictionary was used. + Bit 2: If the compression method used was type 6, + Imploding, then this bit, if set, indicates + 3 Shannon-Fano trees were used to encode the + sliding dictionary output. If clear, then 2 + Shannon-Fano trees were used. + + (For Methods 8 and 9 - Deflating) + Bit 2 Bit 1 + 0 0 Normal (-en) compression option was used. + 0 1 Maximum (-exx/-ex) compression option was used. + 1 0 Fast (-ef) compression option was used. + 1 1 Super Fast (-es) compression option was used. + + (For Method 14 - LZMA) + Bit 1: If the compression method used was type 14, + LZMA, then this bit, if set, indicates + an end-of-stream (EOS) marker is used to + mark the end of the compressed data stream. + If clear, then an EOS marker is not present + and the compressed data size must be known + to extract. + + Note: Bits 1 and 2 are undefined if the compression + method is any other. + + Bit 3: If this bit is set, the fields crc-32, compressed + size and uncompressed size are set to zero in the + local header. The correct values are put in the + data descriptor immediately following the compressed + data. (Note: PKZIP version 2.04g for DOS only + recognizes this bit for method 8 compression, newer + versions of PKZIP recognize this bit for any + compression method.) + + Bit 4: Reserved for use with method 8, for enhanced + deflating. + + Bit 5: If this bit is set, this indicates that the file is + compressed patched data. (Note: Requires PKZIP + version 2.70 or greater) + + Bit 6: Strong encryption. If this bit is set, you should + set the version needed to extract value to at least + 50 and you must also set bit 0. If AES encryption + is used, the version needed to extract value must + be at least 51. + + Bit 7: Currently unused. + + Bit 8: Currently unused. + + Bit 9: Currently unused. + + Bit 10: Currently unused. + + Bit 11: Language encoding flag (EFS). If this bit is set, + the filename and comment fields for this file + must be encoded using UTF-8. (see APPENDIX D) + + Bit 12: Reserved by PKWARE for enhanced compression. + + Bit 13: Used when encrypting the Central Directory to indicate + selected data values in the Local Header are masked to + hide their actual values. See the section describing + the Strong Encryption Specification for details. + + Bit 14: Reserved by PKWARE. + + Bit 15: Reserved by PKWARE. + + compression method: (2 bytes) + + (see accompanying documentation for algorithm + descriptions) + + 0 - The file is stored (no compression) + 1 - The file is Shrunk + 2 - The file is Reduced with compression factor 1 + 3 - The file is Reduced with compression factor 2 + 4 - The file is Reduced with compression factor 3 + 5 - The file is Reduced with compression factor 4 + 6 - The file is Imploded + 7 - Reserved for Tokenizing compression algorithm + 8 - The file is Deflated + 9 - Enhanced Deflating using Deflate64(tm) + 10 - PKWARE Data Compression Library Imploding (old IBM TERSE) + 11 - Reserved by PKWARE + 12 - File is compressed using BZIP2 algorithm + 13 - Reserved by PKWARE + 14 - LZMA (EFS) + 15 - Reserved by PKWARE + 16 - Reserved by PKWARE + 17 - Reserved by PKWARE + 18 - File is compressed using IBM TERSE (new) + 19 - IBM LZ77 z Architecture (PFS) + 97 - WavPack compressed data + 98 - PPMd version I, Rev 1 + + date and time fields: (2 bytes each) + + The date and time are encoded in standard MS-DOS format. + If input came from standard input, the date and time are + those at which compression was started for this data. + If encrypting the central directory and general purpose bit + flag 13 is set indicating masking, the value stored in the + Local Header will be zero. + + CRC-32: (4 bytes) + + The CRC-32 algorithm was generously contributed by + David Schwaderer and can be found in his excellent + book "C Programmers Guide to NetBIOS" published by + Howard W. Sams & Co. Inc. The 'magic number' for + the CRC is 0xdebb20e3. The proper CRC pre and post + conditioning is used, meaning that the CRC register + is pre-conditioned with all ones (a starting value + of 0xffffffff) and the value is post-conditioned by + taking the one's complement of the CRC residual. + If bit 3 of the general purpose flag is set, this + field is set to zero in the local header and the correct + value is put in the data descriptor and in the central + directory. When encrypting the central directory, if the + local header is not in ZIP64 format and general purpose + bit flag 13 is set indicating masking, the value stored + in the Local Header will be zero. + + compressed size: (4 bytes) + uncompressed size: (4 bytes) + + The size of the file compressed and uncompressed, + respectively. When a decryption header is present it will + be placed in front of the file data and the value of the + compressed file size will include the bytes of the decryption + header. If bit 3 of the general purpose bit flag is set, + these fields are set to zero in the local header and the + correct values are put in the data descriptor and + in the central directory. If an archive is in ZIP64 format + and the value in this field is 0xFFFFFFFF, the size will be + in the corresponding 8 byte ZIP64 extended information + extra field. When encrypting the central directory, if the + local header is not in ZIP64 format and general purpose bit + flag 13 is set indicating masking, the value stored for the + uncompressed size in the Local Header will be zero. + + file name length: (2 bytes) + extra field length: (2 bytes) + file comment length: (2 bytes) + + The length of the file name, extra field, and comment + fields respectively. The combined length of any + directory record and these three fields should not + generally exceed 65,535 bytes. If input came from standard + input, the file name length is set to zero. + + disk number start: (2 bytes) + + The number of the disk on which this file begins. If an + archive is in ZIP64 format and the value in this field is + 0xFFFF, the size will be in the corresponding 4 byte zip64 + extended information extra field. + + internal file attributes: (2 bytes) + + Bits 1 and 2 are reserved for use by PKWARE. + + The lowest bit of this field indicates, if set, that + the file is apparently an ASCII or text file. If not + set, that the file apparently contains binary data. + The remaining bits are unused in version 1.0. + + The 0x0002 bit of this field indicates, if set, that a + 4 byte variable record length control field precedes each + logical record indicating the length of the record. The + record length control field is stored in little-endian byte + order. This flag is independent of text control characters, + and if used in conjunction with text data, includes any + control characters in the total length of the record. This + value is provided for mainframe data transfer support. + + external file attributes: (4 bytes) + + The mapping of the external attributes is + host-system dependent (see 'version made by'). For + MS-DOS, the low order byte is the MS-DOS directory + attribute byte. If input came from standard input, this + field is set to zero. + + relative offset of local header: (4 bytes) + + This is the offset from the start of the first disk on + which this file appears, to where the local header should + be found. If an archive is in ZIP64 format and the value + in this field is 0xFFFFFFFF, the size will be in the + corresponding 8 byte zip64 extended information extra field. + + file name: (Variable) + + The name of the file, with optional relative path. + The path stored should not contain a drive or + device letter, or a leading slash. All slashes + should be forward slashes '/' as opposed to + backwards slashes '\' for compatibility with Amiga + and UNIX file systems etc. If input came from standard + input, there is no file name field. If encrypting + the central directory and general purpose bit flag 13 is set + indicating masking, the file name stored in the Local Header + will not be the actual file name. A masking value consisting + of a unique hexadecimal value will be stored. This value will + be sequentially incremented for each file in the archive. See + the section on the Strong Encryption Specification for details + on retrieving the encrypted file name. + + extra field: (Variable) + + This is for expansion. If additional information + needs to be stored for special needs or for specific + platforms, it should be stored here. Earlier versions + of the software can then safely skip this file, and + find the next file or header. This field will be 0 + length in version 1.0. + + In order to allow different programs and different types + of information to be stored in the 'extra' field in .ZIP + files, the following structure should be used for all + programs storing data in this field: + + header1+data1 + header2+data2 . . . + + Each header should consist of: + + Header ID - 2 bytes + Data Size - 2 bytes + + Note: all fields stored in Intel low-byte/high-byte order. + + The Header ID field indicates the type of data that is in + the following data block. + + Header ID's of 0 thru 31 are reserved for use by PKWARE. + The remaining ID's can be used by third party vendors for + proprietary usage. + + The current Header ID mappings defined by PKWARE are: + + 0x0001 Zip64 extended information extra field + 0x0007 AV Info + 0x0008 Reserved for extended language encoding data (PFS) + (see APPENDIX D) + 0x0009 OS/2 + 0x000a NTFS + 0x000c OpenVMS + 0x000d UNIX + 0x000e Reserved for file stream and fork descriptors + 0x000f Patch Descriptor + 0x0014 PKCS#7 Store for X.509 Certificates + 0x0015 X.509 Certificate ID and Signature for + individual file + 0x0016 X.509 Certificate ID for Central Directory + 0x0017 Strong Encryption Header + 0x0018 Record Management Controls + 0x0019 PKCS#7 Encryption Recipient Certificate List + 0x0065 IBM S/390 (Z390), AS/400 (I400) attributes + - uncompressed + 0x0066 Reserved for IBM S/390 (Z390), AS/400 (I400) + attributes - compressed + 0x4690 POSZIP 4690 (reserved) + + Third party mappings commonly used are: + + + 0x07c8 Macintosh + 0x2605 ZipIt Macintosh + 0x2705 ZipIt Macintosh 1.3.5+ + 0x2805 ZipIt Macintosh 1.3.5+ + 0x334d Info-ZIP Macintosh + 0x4341 Acorn/SparkFS + 0x4453 Windows NT security descriptor (binary ACL) + 0x4704 VM/CMS + 0x470f MVS + 0x4b46 FWKCS MD5 (see below) + 0x4c41 OS/2 access control list (text ACL) + 0x4d49 Info-ZIP OpenVMS + 0x4f4c Xceed original location extra field + 0x5356 AOS/VS (ACL) + 0x5455 extended timestamp + 0x554e Xceed unicode extra field + 0x5855 Info-ZIP UNIX (original, also OS/2, NT, etc) + 0x6375 Info-ZIP Unicode Comment Extra Field + 0x6542 BeOS/BeBox + 0x7075 Info-ZIP Unicode Path Extra Field + 0x756e ASi UNIX + 0x7855 Info-ZIP UNIX (new) + 0xa220 Microsoft Open Packaging Growth Hint + 0xfd4a SMS/QDOS + + Detailed descriptions of Extra Fields defined by third + party mappings will be documented as information on + these data structures is made available to PKWARE. + PKWARE does not guarantee the accuracy of any published + third party data. + + The Data Size field indicates the size of the following + data block. Programs can use this value to skip to the + next header block, passing over any data blocks that are + not of interest. + + Note: As stated above, the size of the entire .ZIP file + header, including the file name, comment, and extra + field should not exceed 64K in size. + + In case two different programs should appropriate the same + Header ID value, it is strongly recommended that each + program place a unique signature of at least two bytes in + size (and preferably 4 bytes or bigger) at the start of + each data area. Every program should verify that its + unique signature is present, in addition to the Header ID + value being correct, before assuming that it is a block of + known type. + + -Zip64 Extended Information Extra Field (0x0001): + + The following is the layout of the zip64 extended + information "extra" block. If one of the size or + offset fields in the Local or Central directory + record is too small to hold the required data, + a Zip64 extended information record is created. + The order of the fields in the zip64 extended + information record is fixed, but the fields will + only appear if the corresponding Local or Central + directory record field is set to 0xFFFF or 0xFFFFFFFF. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (ZIP64) 0x0001 2 bytes Tag for this "extra" block type + Size 2 bytes Size of this "extra" block + Original + Size 8 bytes Original uncompressed file size + Compressed + Size 8 bytes Size of compressed data + Relative Header + Offset 8 bytes Offset of local header record + Disk Start + Number 4 bytes Number of the disk on which + this file starts + + This entry in the Local header must include BOTH original + and compressed file size fields. If encrypting the + central directory and bit 13 of the general purpose bit + flag is set indicating masking, the value stored in the + Local Header for the original file size will be zero. + + + -OS/2 Extra Field (0x0009): + + The following is the layout of the OS/2 attributes "extra" + block. (Last Revision 09/05/95) + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (OS/2) 0x0009 2 bytes Tag for this "extra" block type + TSize 2 bytes Size for the following data block + BSize 4 bytes Uncompressed Block Size + CType 2 bytes Compression type + EACRC 4 bytes CRC value for uncompress block + (var) variable Compressed block + + The OS/2 extended attribute structure (FEA2LIST) is + compressed and then stored in it's entirety within this + structure. There will only ever be one "block" of data in + VarFields[]. + + -NTFS Extra Field (0x000a): + + The following is the layout of the NTFS attributes + "extra" block. (Note: At this time the Mtime, Atime + and Ctime values may be used on any WIN32 system.) + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (NTFS) 0x000a 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the total "extra" block + Reserved 4 bytes Reserved for future use + Tag1 2 bytes NTFS attribute tag value #1 + Size1 2 bytes Size of attribute #1, in bytes + (var.) Size1 Attribute #1 data + . + . + . + TagN 2 bytes NTFS attribute tag value #N + SizeN 2 bytes Size of attribute #N, in bytes + (var.) SizeN Attribute #N data + + For NTFS, values for Tag1 through TagN are as follows: + (currently only one set of attributes is defined for NTFS) + + Tag Size Description + ----- ---- ----------- + 0x0001 2 bytes Tag for attribute #1 + Size1 2 bytes Size of attribute #1, in bytes + Mtime 8 bytes File last modification time + Atime 8 bytes File last access time + Ctime 8 bytes File creation time + + -OpenVMS Extra Field (0x000c): + + The following is the layout of the OpenVMS attributes + "extra" block. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (VMS) 0x000c 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the total "extra" block + CRC 4 bytes 32-bit CRC for remainder of the block + Tag1 2 bytes OpenVMS attribute tag value #1 + Size1 2 bytes Size of attribute #1, in bytes + (var.) Size1 Attribute #1 data + . + . + . + TagN 2 bytes OpenVMS attribute tag value #N + SizeN 2 bytes Size of attribute #N, in bytes + (var.) SizeN Attribute #N data + + Rules: + + 1. There will be one or more of attributes present, which + will each be preceded by the above TagX & SizeX values. + These values are identical to the ATR$C_XXXX and + ATR$S_XXXX constants which are defined in ATR.H under + OpenVMS C. Neither of these values will ever be zero. + + 2. No word alignment or padding is performed. + + 3. A well-behaved PKZIP/OpenVMS program should never produce + more than one sub-block with the same TagX value. Also, + there will never be more than one "extra" block of type + 0x000c in a particular directory record. + + -UNIX Extra Field (0x000d): + + The following is the layout of the UNIX "extra" block. + Note: all fields are stored in Intel low-byte/high-byte + order. + + Value Size Description + ----- ---- ----------- + (UNIX) 0x000d 2 bytes Tag for this "extra" block type + TSize 2 bytes Size for the following data block + Atime 4 bytes File last access time + Mtime 4 bytes File last modification time + Uid 2 bytes File user ID + Gid 2 bytes File group ID + (var) variable Variable length data field + + The variable length data field will contain file type + specific data. Currently the only values allowed are + the original "linked to" file names for hard or symbolic + links, and the major and minor device node numbers for + character and block device nodes. Since device nodes + cannot be either symbolic or hard links, only one set of + variable length data is stored. Link files will have the + name of the original file stored. This name is NOT NULL + terminated. Its size can be determined by checking TSize - + 12. Device entries will have eight bytes stored as two 4 + byte entries (in little endian format). The first entry + will be the major device number, and the second the minor + device number. + + -PATCH Descriptor Extra Field (0x000f): + + The following is the layout of the Patch Descriptor "extra" + block. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (Patch) 0x000f 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the total "extra" block + Version 2 bytes Version of the descriptor + Flags 4 bytes Actions and reactions (see below) + OldSize 4 bytes Size of the file about to be patched + OldCRC 4 bytes 32-bit CRC of the file to be patched + NewSize 4 bytes Size of the resulting file + NewCRC 4 bytes 32-bit CRC of the resulting file + + Actions and reactions + + Bits Description + ---- ---------------- + 0 Use for auto detection + 1 Treat as a self-patch + 2-3 RESERVED + 4-5 Action (see below) + 6-7 RESERVED + 8-9 Reaction (see below) to absent file + 10-11 Reaction (see below) to newer file + 12-13 Reaction (see below) to unknown file + 14-15 RESERVED + 16-31 RESERVED + + Actions + + Action Value + ------ ----- + none 0 + add 1 + delete 2 + patch 3 + + Reactions + + Reaction Value + -------- ----- + ask 0 + skip 1 + ignore 2 + fail 3 + + Patch support is provided by PKPatchMaker(tm) technology and is + covered under U.S. Patents and Patents Pending. The use or + implementation in a product of certain technological aspects set + forth in the current APPNOTE, including those with regard to + strong encryption, patching, or extended tape operations requires + a license from PKWARE. Please contact PKWARE with regard to + acquiring a license. + + -PKCS#7 Store for X.509 Certificates (0x0014): + + This field contains information about each of the certificates + files may be signed with. When the Central Directory Encryption + feature is enabled for a ZIP file, this record will appear in + the Archive Extra Data Record, otherwise it will appear in the + first central directory record and will be ignored in any + other record. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (Store) 0x0014 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the store data + TData TSize Data about the store + + + -X.509 Certificate ID and Signature for individual file (0x0015): + + This field contains the information about which certificate in + the PKCS#7 store was used to sign a particular file. It also + contains the signature data. This field can appear multiple + times, but can only appear once per certificate. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (CID) 0x0015 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of data that follows + TData TSize Signature Data + + -X.509 Certificate ID and Signature for central directory (0x0016): + + This field contains the information about which certificate in + the PKCS#7 store was used to sign the central directory structure. + When the Central Directory Encryption feature is enabled for a + ZIP file, this record will appear in the Archive Extra Data Record, + otherwise it will appear in the first central directory record. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (CDID) 0x0016 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of data that follows + TData TSize Data + + -Strong Encryption Header (0x0017): + + Value Size Description + ----- ---- ----------- + 0x0017 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of data that follows + Format 2 bytes Format definition for this record + AlgID 2 bytes Encryption algorithm identifier + Bitlen 2 bytes Bit length of encryption key + Flags 2 bytes Processing flags + CertData TSize-8 Certificate decryption extra field data + (refer to the explanation for CertData + in the section describing the + Certificate Processing Method under + the Strong Encryption Specification) + + + -Record Management Controls (0x0018): + + Value Size Description + ----- ---- ----------- +(Rec-CTL) 0x0018 2 bytes Tag for this "extra" block type + CSize 2 bytes Size of total extra block data + Tag1 2 bytes Record control attribute 1 + Size1 2 bytes Size of attribute 1, in bytes + Data1 Size1 Attribute 1 data + . + . + . + TagN 2 bytes Record control attribute N + SizeN 2 bytes Size of attribute N, in bytes + DataN SizeN Attribute N data + + + -PKCS#7 Encryption Recipient Certificate List (0x0019): + + This field contains information about each of the certificates + used in encryption processing and it can be used to identify who is + allowed to decrypt encrypted files. This field should only appear + in the archive extra data record. This field is not required and + serves only to aide archive modifications by preserving public + encryption key data. Individual security requirements may dictate + that this data be omitted to deter information exposure. + + Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + (CStore) 0x0019 2 bytes Tag for this "extra" block type + TSize 2 bytes Size of the store data + TData TSize Data about the store + + TData: + + Value Size Description + ----- ---- ----------- + Version 2 bytes Format version number - must 0x0001 at this time + CStore (var) PKCS#7 data blob + + + -MVS Extra Field (0x0065): + + The following is the layout of the MVS "extra" block. + Note: Some fields are stored in Big Endian format. + All text is in EBCDIC format unless otherwise specified. + + Value Size Description + ----- ---- ----------- + (MVS) 0x0065 2 bytes Tag for this "extra" block type + TSize 2 bytes Size for the following data block + ID 4 bytes EBCDIC "Z390" 0xE9F3F9F0 or + "T4MV" for TargetFour + (var) TSize-4 Attribute data (see APPENDIX B) + + + -OS/400 Extra Field (0x0065): + + The following is the layout of the OS/400 "extra" block. + Note: Some fields are stored in Big Endian format. + All text is in EBCDIC format unless otherwise specified. + + Value Size Description + ----- ---- ----------- + (OS400) 0x0065 2 bytes Tag for this "extra" block type + TSize 2 bytes Size for the following data block + ID 4 bytes EBCDIC "I400" 0xC9F4F0F0 or + "T4MV" for TargetFour + (var) TSize-4 Attribute data (see APPENDIX A) + + + Third-party Mappings: + + -ZipIt Macintosh Extra Field (long) (0x2605): + + The following is the layout of the ZipIt extra block + for Macintosh. The local-header and central-header versions + are identical. This block must be present if the file is + stored MacBinary-encoded and it should not be used if the file + is not stored MacBinary-encoded. + + Value Size Description + ----- ---- ----------- + (Mac2) 0x2605 Short tag for this extra block type + TSize Short total data size for this block + "ZPIT" beLong extra-field signature + FnLen Byte length of FileName + FileName variable full Macintosh filename + FileType Byte[4] four-byte Mac file type string + Creator Byte[4] four-byte Mac creator string + + + -ZipIt Macintosh Extra Field (short, for files) (0x2705): + + The following is the layout of a shortened variant of the + ZipIt extra block for Macintosh (without "full name" entry). + This variant is used by ZipIt 1.3.5 and newer for entries of + files (not directories) that do not have a MacBinary encoded + file. The local-header and central-header versions are identical. + + Value Size Description + ----- ---- ----------- + (Mac2b) 0x2705 Short tag for this extra block type + TSize Short total data size for this block (12) + "ZPIT" beLong extra-field signature + FileType Byte[4] four-byte Mac file type string + Creator Byte[4] four-byte Mac creator string + fdFlags beShort attributes from FInfo.frFlags, + may be omitted + 0x0000 beShort reserved, may be omitted + + + -ZipIt Macintosh Extra Field (short, for directories) (0x2805): + + The following is the layout of a shortened variant of the + ZipIt extra block for Macintosh used only for directory + entries. This variant is used by ZipIt 1.3.5 and newer to + save some optional Mac-specific information about directories. + The local-header and central-header versions are identical. + + Value Size Description + ----- ---- ----------- + (Mac2c) 0x2805 Short tag for this extra block type + TSize Short total data size for this block (12) + "ZPIT" beLong extra-field signature + frFlags beShort attributes from DInfo.frFlags, may + be omitted + View beShort ZipIt view flag, may be omitted + + + The View field specifies ZipIt-internal settings as follows: + + Bits of the Flags: + bit 0 if set, the folder is shown expanded (open) + when the archive contents are viewed in ZipIt. + bits 1-15 reserved, zero; + + + -FWKCS MD5 Extra Field (0x4b46): + + The FWKCS Contents_Signature System, used in + automatically identifying files independent of file name, + optionally adds and uses an extra field to support the + rapid creation of an enhanced contents_signature: + + Header ID = 0x4b46 + Data Size = 0x0013 + Preface = 'M','D','5' + followed by 16 bytes containing the uncompressed file's + 128_bit MD5 hash(1), low byte first. + + When FWKCS revises a .ZIP file central directory to add + this extra field for a file, it also replaces the + central directory entry for that file's uncompressed + file length with a measured value. + + FWKCS provides an option to strip this extra field, if + present, from a .ZIP file central directory. In adding + this extra field, FWKCS preserves .ZIP file Authenticity + Verification; if stripping this extra field, FWKCS + preserves all versions of AV through PKZIP version 2.04g. + + FWKCS, and FWKCS Contents_Signature System, are + trademarks of Frederick W. Kantor. + + (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer + Science and RSA Data Security, Inc., April 1992. + ll.76-77: "The MD5 algorithm is being placed in the + public domain for review and possible adoption as a + standard." + + + -Info-ZIP Unicode Comment Extra Field (0x6375): + + Stores the UTF-8 version of the file comment as stored in the + central directory header. (Last Revision 20070912) + + Value Size Description + ----- ---- ----------- + (UCom) 0x6375 Short tag for this extra block type ("uc") + TSize Short total data size for this block + Version 1 byte version of this extra field, currently 1 + ComCRC32 4 bytes Comment Field CRC32 Checksum + UnicodeCom Variable UTF-8 version of the entry comment + + Currently Version is set to the number 1. If there is a need + to change this field, the version will be incremented. Changes + may not be backward compatible so this extra field should not be + used if the version is not recognized. + + The ComCRC32 is the standard zip CRC32 checksum of the File Comment + field in the central directory header. This is used to verify that + the comment field has not changed since the Unicode Comment extra field + was created. This can happen if a utility changes the File Comment + field but does not update the UTF-8 Comment extra field. If the CRC + check fails, this Unicode Comment extra field should be ignored and + the File Comment field in the header should be used instead. + + The UnicodeCom field is the UTF-8 version of the File Comment field + in the header. As UnicodeCom is defined to be UTF-8, no UTF-8 byte + order mark (BOM) is used. The length of this field is determined by + subtracting the size of the previous fields from TSize. If both the + File Name and Comment fields are UTF-8, the new General Purpose Bit + Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate + both the header File Name and Comment fields are UTF-8 and, in this + case, the Unicode Path and Unicode Comment extra fields are not + needed and should not be created. Note that, for backward + compatibility, bit 11 should only be used if the native character set + of the paths and comments being zipped up are already in UTF-8. It is + expected that the same file comment storage method, either general + purpose bit 11 or extra fields, be used in both the Local and Central + Directory Header for a file. + + + -Info-ZIP Unicode Path Extra Field (0x7075): + + Stores the UTF-8 version of the file name field as stored in the + local header and central directory header. (Last Revision 20070912) + + Value Size Description + ----- ---- ----------- + (UPath) 0x7075 Short tag for this extra block type ("up") + TSize Short total data size for this block + Version 1 byte version of this extra field, currently 1 + NameCRC32 4 bytes File Name Field CRC32 Checksum + UnicodeName Variable UTF-8 version of the entry File Name + + Currently Version is set to the number 1. If there is a need + to change this field, the version will be incremented. Changes + may not be backward compatible so this extra field should not be + used if the version is not recognized. + + The NameCRC32 is the standard zip CRC32 checksum of the File Name + field in the header. This is used to verify that the header + File Name field has not changed since the Unicode Path extra field + was created. This can happen if a utility renames the File Name but + does not update the UTF-8 path extra field. If the CRC check fails, + this UTF-8 Path Extra Field should be ignored and the File Name field + in the header should be used instead. + + The UnicodeName is the UTF-8 version of the contents of the File Name + field in the header. As UnicodeName is defined to be UTF-8, no UTF-8 + byte order mark (BOM) is used. The length of this field is determined + by subtracting the size of the previous fields from TSize. If both + the File Name and Comment fields are UTF-8, the new General Purpose + Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to + indicate that both the header File Name and Comment fields are UTF-8 + and, in this case, the Unicode Path and Unicode Comment extra fields + are not needed and should not be created. Note that, for backward + compatibility, bit 11 should only be used if the native character set + of the paths and comments being zipped up are already in UTF-8. It is + expected that the same file name storage method, either general + purpose bit 11 or extra fields, be used in both the Local and Central + Directory Header for a file. + + + -Microsoft Open Packaging Growth Hint (0xa220): + + Value Size Description + ----- ---- ----------- + 0xa220 Short tag for this extra block type + TSize Short size of Sig + PadVal + Padding + Sig Short verification signature (A028) + PadVal Short Initial padding value + Padding variable filled with NULL characters + + + file comment: (Variable) + + The comment for this file. + + number of this disk: (2 bytes) + + The number of this disk, which contains central + directory end record. If an archive is in ZIP64 format + and the value in this field is 0xFFFF, the size will + be in the corresponding 4 byte zip64 end of central + directory field. + + + number of the disk with the start of the central + directory: (2 bytes) + + The number of the disk on which the central + directory starts. If an archive is in ZIP64 format + and the value in this field is 0xFFFF, the size will + be in the corresponding 4 byte zip64 end of central + directory field. + + total number of entries in the central dir on + this disk: (2 bytes) + + The number of central directory entries on this disk. + If an archive is in ZIP64 format and the value in + this field is 0xFFFF, the size will be in the + corresponding 8 byte zip64 end of central + directory field. + + total number of entries in the central dir: (2 bytes) + + The total number of files in the .ZIP file. If an + archive is in ZIP64 format and the value in this field + is 0xFFFF, the size will be in the corresponding 8 byte + zip64 end of central directory field. + + size of the central directory: (4 bytes) + + The size (in bytes) of the entire central directory. + If an archive is in ZIP64 format and the value in + this field is 0xFFFFFFFF, the size will be in the + corresponding 8 byte zip64 end of central + directory field. + + offset of start of central directory with respect to + the starting disk number: (4 bytes) + + Offset of the start of the central directory on the + disk on which the central directory starts. If an + archive is in ZIP64 format and the value in this + field is 0xFFFFFFFF, the size will be in the + corresponding 8 byte zip64 end of central + directory field. + + .ZIP file comment length: (2 bytes) + + The length of the comment for this .ZIP file. + + .ZIP file comment: (Variable) + + The comment for this .ZIP file. ZIP file comment data + is stored unsecured. No encryption or data authentication + is applied to this area at this time. Confidential information + should not be stored in this section. + + zip64 extensible data sector (variable size) + + (currently reserved for use by PKWARE) + + + K. Splitting and Spanning ZIP files + + Spanning is the process of segmenting a ZIP file across + multiple removable media. This support has typically only + been provided for DOS formatted floppy diskettes. + + File splitting is a newer derivative of spanning. + Splitting follows the same segmentation process as + spanning, however, it does not require writing each + segment to a unique removable medium and instead supports + placing all pieces onto local or non-removable locations + such as file systems, local drives, folders, etc... + + A key difference between spanned and split ZIP files is + that all pieces of a spanned ZIP file have the same name. + Since each piece is written to a separate volume, no name + collisions occur and each segment can reuse the original + .ZIP file name given to the archive. + + Sequence ordering for DOS spanned archives uses the DOS + volume label to determine segment numbers. Volume labels + for each segment are written using the form PKBACK#xxx, + where xxx is the segment number written as a decimal + value from 001 - nnn. + + Split ZIP files are typically written to the same location + and are subject to name collisions if the spanned name + format is used since each segment will reside on the same + drive. To avoid name collisions, split archives are named + as follows. + + Segment 1 = filename.z01 + Segment n-1 = filename.z(n-1) + Segment n = filename.zip + + The .ZIP extension is used on the last segment to support + quickly reading the central directory. The segment number + n should be a decimal value. + + Spanned ZIP files may be PKSFX Self-extracting ZIP files. + PKSFX files may also be split, however, in this case + the first segment must be named filename.exe. The first + segment of a split PKSFX archive must be large enough to + include the entire executable program. + + Capacities for split archives are as follows. + + Maximum number of segments = 4,294,967,295 - 1 + Maximum .ZIP segment size = 4,294,967,295 bytes + Minimum segment size = 64K + Maximum PKSFX segment size = 2,147,483,647 bytes + + Segment sizes may be different however by convention, all + segment sizes should be the same with the exception of the + last, which may be smaller. Local and central directory + header records must never be split across a segment boundary. + When writing a header record, if the number of bytes remaining + within a segment is less than the size of the header record, + end the current segment and write the header at the start + of the next segment. The central directory may span segment + boundaries, but no single record in the central directory + should be split across segments. + + Spanned/Split archives created using PKZIP for Windows + (V2.50 or greater), PKZIP Command Line (V2.50 or greater), + or PKZIP Explorer will include a special spanning + signature as the first 4 bytes of the first segment of + the archive. This signature (0x08074b50) will be + followed immediately by the local header signature for + the first file in the archive. + + A special spanning marker may also appear in spanned/split + archives if the spanning or splitting process starts but + only requires one segment. In this case the 0x08074b50 + signature will be replaced with the temporary spanning + marker signature of 0x30304b50. Split archives can + only be uncompressed by other versions of PKZIP that + know how to create a split archive. + + The signature value 0x08074b50 is also used by some + ZIP implementations as a marker for the Data Descriptor + record. Conflict in this alternate assignment can be + avoided by ensuring the position of the signature + within the ZIP file to determine the use for which it + is intended. + + L. General notes: + + 1) All fields unless otherwise noted are unsigned and stored + in Intel low-byte:high-byte, low-word:high-word order. + + 2) String fields are not null terminated, since the + length is given explicitly. + + 3) The entries in the central directory may not necessarily + be in the same order that files appear in the .ZIP file. + + 4) If one of the fields in the end of central directory + record is too small to hold required data, the field + should be set to -1 (0xFFFF or 0xFFFFFFFF) and the + ZIP64 format record should be created. + + 5) The end of central directory record and the + Zip64 end of central directory locator record must + reside on the same disk when splitting or spanning + an archive. + +VI. Explanation of compression methods +-------------------------------------- + +UnShrinking - Method 1 +---------------------- + +Shrinking is a Dynamic Ziv-Lempel-Welch compression algorithm +with partial clearing. The initial code size is 9 bits, and +the maximum code size is 13 bits. Shrinking differs from +conventional Dynamic Ziv-Lempel-Welch implementations in several +respects: + +1) The code size is controlled by the compressor, and is not + automatically increased when codes larger than the current + code size are created (but not necessarily used). When + the decompressor encounters the code sequence 256 + (decimal) followed by 1, it should increase the code size + read from the input stream to the next bit size. No + blocking of the codes is performed, so the next code at + the increased size should be read from the input stream + immediately after where the previous code at the smaller + bit size was read. Again, the decompressor should not + increase the code size used until the sequence 256,1 is + encountered. + +2) When the table becomes full, total clearing is not + performed. Rather, when the compressor emits the code + sequence 256,2 (decimal), the decompressor should clear + all leaf nodes from the Ziv-Lempel tree, and continue to + use the current code size. The nodes that are cleared + from the Ziv-Lempel tree are then re-used, with the lowest + code value re-used first, and the highest code value + re-used last. The compressor can emit the sequence 256,2 + at any time. + +Expanding - Methods 2-5 +----------------------- + +The Reducing algorithm is actually a combination of two +distinct algorithms. The first algorithm compresses repeated +byte sequences, and the second algorithm takes the compressed +stream from the first algorithm and applies a probabilistic +compression method. + +The probabilistic compression stores an array of 'follower +sets' S(j), for j=0 to 255, corresponding to each possible +ASCII character. Each set contains between 0 and 32 +characters, to be denoted as S(j)[0],...,S(j)[m], where m<32. +The sets are stored at the beginning of the data area for a +Reduced file, in reverse order, with S(255) first, and S(0) +last. + +The sets are encoded as { N(j), S(j)[0],...,S(j)[N(j)-1] }, +where N(j) is the size of set S(j). N(j) can be 0, in which +case the follower set for S(j) is empty. Each N(j) value is +encoded in 6 bits, followed by N(j) eight bit character values +corresponding to S(j)[0] to S(j)[N(j)-1] respectively. If +N(j) is 0, then no values for S(j) are stored, and the value +for N(j-1) immediately follows. + +Immediately after the follower sets, is the compressed data +stream. The compressed data stream can be interpreted for the +probabilistic decompression as follows: + +let Last-Character <- 0. +loop until done + if the follower set S(Last-Character) is empty then + read 8 bits from the input stream, and copy this + value to the output stream. + otherwise if the follower set S(Last-Character) is non-empty then + read 1 bit from the input stream. + if this bit is not zero then + read 8 bits from the input stream, and copy this + value to the output stream. + otherwise if this bit is zero then + read B(N(Last-Character)) bits from the input + stream, and assign this value to I. + Copy the value of S(Last-Character)[I] to the + output stream. + + assign the last value placed on the output stream to + Last-Character. +end loop + +B(N(j)) is defined as the minimal number of bits required to +encode the value N(j)-1. + +The decompressed stream from above can then be expanded to +re-create the original file as follows: + +let State <- 0. + +loop until done + read 8 bits from the input stream into C. + case State of + 0: if C is not equal to DLE (144 decimal) then + copy C to the output stream. + otherwise if C is equal to DLE then + let State <- 1. + + 1: if C is non-zero then + let V <- C. + let Len <- L(V) + let State <- F(Len). + otherwise if C is zero then + copy the value 144 (decimal) to the output stream. + let State <- 0 + + 2: let Len <- Len + C + let State <- 3. + + 3: move backwards D(V,C) bytes in the output stream + (if this position is before the start of the output + stream, then assume that all the data before the + start of the output stream is filled with zeros). + copy Len+3 bytes from this position to the output stream. + let State <- 0. + end case +end loop + +The functions F,L, and D are dependent on the 'compression +factor', 1 through 4, and are defined as follows: + +For compression factor 1: + L(X) equals the lower 7 bits of X. + F(X) equals 2 if X equals 127 otherwise F(X) equals 3. + D(X,Y) equals the (upper 1 bit of X) * 256 + Y + 1. +For compression factor 2: + L(X) equals the lower 6 bits of X. + F(X) equals 2 if X equals 63 otherwise F(X) equals 3. + D(X,Y) equals the (upper 2 bits of X) * 256 + Y + 1. +For compression factor 3: + L(X) equals the lower 5 bits of X. + F(X) equals 2 if X equals 31 otherwise F(X) equals 3. + D(X,Y) equals the (upper 3 bits of X) * 256 + Y + 1. +For compression factor 4: + L(X) equals the lower 4 bits of X. + F(X) equals 2 if X equals 15 otherwise F(X) equals 3. + D(X,Y) equals the (upper 4 bits of X) * 256 + Y + 1. + +Imploding - Method 6 +-------------------- + +The Imploding algorithm is actually a combination of two distinct +algorithms. The first algorithm compresses repeated byte +sequences using a sliding dictionary. The second algorithm is +used to compress the encoding of the sliding dictionary output, +using multiple Shannon-Fano trees. + +The Imploding algorithm can use a 4K or 8K sliding dictionary +size. The dictionary size used can be determined by bit 1 in the +general purpose flag word; a 0 bit indicates a 4K dictionary +while a 1 bit indicates an 8K dictionary. + +The Shannon-Fano trees are stored at the start of the compressed +file. The number of trees stored is defined by bit 2 in the +general purpose flag word; a 0 bit indicates two trees stored, a +1 bit indicates three trees are stored. If 3 trees are stored, +the first Shannon-Fano tree represents the encoding of the +Literal characters, the second tree represents the encoding of +the Length information, the third represents the encoding of the +Distance information. When 2 Shannon-Fano trees are stored, the +Length tree is stored first, followed by the Distance tree. + +The Literal Shannon-Fano tree, if present is used to represent +the entire ASCII character set, and contains 256 values. This +tree is used to compress any data not compressed by the sliding +dictionary algorithm. When this tree is present, the Minimum +Match Length for the sliding dictionary is 3. If this tree is +not present, the Minimum Match Length is 2. + +The Length Shannon-Fano tree is used to compress the Length part +of the (length,distance) pairs from the sliding dictionary +output. The Length tree contains 64 values, ranging from the +Minimum Match Length, to 63 plus the Minimum Match Length. + +The Distance Shannon-Fano tree is used to compress the Distance +part of the (length,distance) pairs from the sliding dictionary +output. The Distance tree contains 64 values, ranging from 0 to +63, representing the upper 6 bits of the distance value. The +distance values themselves will be between 0 and the sliding +dictionary size, either 4K or 8K. + +The Shannon-Fano trees themselves are stored in a compressed +format. The first byte of the tree data represents the number of +bytes of data representing the (compressed) Shannon-Fano tree +minus 1. The remaining bytes represent the Shannon-Fano tree +data encoded as: + + High 4 bits: Number of values at this bit length + 1. (1 - 16) + Low 4 bits: Bit Length needed to represent value + 1. (1 - 16) + +The Shannon-Fano codes can be constructed from the bit lengths +using the following algorithm: + +1) Sort the Bit Lengths in ascending order, while retaining the + order of the original lengths stored in the file. + +2) Generate the Shannon-Fano trees: + + Code <- 0 + CodeIncrement <- 0 + LastBitLength <- 0 + i <- number of Shannon-Fano codes - 1 (either 255 or 63) + + loop while i >= 0 + Code = Code + CodeIncrement + if BitLength(i) <> LastBitLength then + LastBitLength=BitLength(i) + CodeIncrement = 1 shifted left (16 - LastBitLength) + ShannonCode(i) = Code + i <- i - 1 + end loop + +3) Reverse the order of all the bits in the above ShannonCode() + vector, so that the most significant bit becomes the least + significant bit. For example, the value 0x1234 (hex) would + become 0x2C48 (hex). + +4) Restore the order of Shannon-Fano codes as originally stored + within the file. + +Example: + + This example will show the encoding of a Shannon-Fano tree + of size 8. Notice that the actual Shannon-Fano trees used + for Imploding are either 64 or 256 entries in size. + +Example: 0x02, 0x42, 0x01, 0x13 + + The first byte indicates 3 values in this table. Decoding the + bytes: + 0x42 = 5 codes of 3 bits long + 0x01 = 1 code of 2 bits long + 0x13 = 2 codes of 4 bits long + + This would generate the original bit length array of: + (3, 3, 3, 3, 3, 2, 4, 4) + + There are 8 codes in this table for the values 0 thru 7. Using + the algorithm to obtain the Shannon-Fano codes produces: + + Reversed Order Original +Val Sorted Constructed Code Value Restored Length +--- ------ ----------------- -------- -------- ------ +0: 2 1100000000000000 11 101 3 +1: 3 1010000000000000 101 001 3 +2: 3 1000000000000000 001 110 3 +3: 3 0110000000000000 110 010 3 +4: 3 0100000000000000 010 100 3 +5: 3 0010000000000000 100 11 2 +6: 4 0001000000000000 1000 1000 4 +7: 4 0000000000000000 0000 0000 4 + +The values in the Val, Order Restored and Original Length columns +now represent the Shannon-Fano encoding tree that can be used for +decoding the Shannon-Fano encoded data. How to parse the +variable length Shannon-Fano values from the data stream is beyond +the scope of this document. (See the references listed at the end of +this document for more information.) However, traditional decoding +schemes used for Huffman variable length decoding, such as the +Greenlaw algorithm, can be successfully applied. + +The compressed data stream begins immediately after the +compressed Shannon-Fano data. The compressed data stream can be +interpreted as follows: + +loop until done + read 1 bit from input stream. + + if this bit is non-zero then (encoded data is literal data) + if Literal Shannon-Fano tree is present + read and decode character using Literal Shannon-Fano tree. + otherwise + read 8 bits from input stream. + copy character to the output stream. + otherwise (encoded data is sliding dictionary match) + if 8K dictionary size + read 7 bits for offset Distance (lower 7 bits of offset). + otherwise + read 6 bits for offset Distance (lower 6 bits of offset). + + using the Distance Shannon-Fano tree, read and decode the + upper 6 bits of the Distance value. + + using the Length Shannon-Fano tree, read and decode + the Length value. + + Length <- Length + Minimum Match Length + + if Length = 63 + Minimum Match Length + read 8 bits from the input stream, + add this value to Length. + + move backwards Distance+1 bytes in the output stream, and + copy Length characters from this position to the output + stream. (if this position is before the start of the output + stream, then assume that all the data before the start of + the output stream is filled with zeros). +end loop + +Tokenizing - Method 7 +--------------------- + +This method is not used by PKZIP. + +Deflating - Method 8 +-------------------- + +The Deflate algorithm is similar to the Implode algorithm using +a sliding dictionary of up to 32K with secondary compression +from Huffman/Shannon-Fano codes. + +The compressed data is stored in blocks with a header describing +the block and the Huffman codes used in the data block. The header +format is as follows: + + Bit 0: Last Block bit This bit is set to 1 if this is the last + compressed block in the data. + Bits 1-2: Block type + 00 (0) - Block is stored - All stored data is byte aligned. + Skip bits until next byte, then next word = block + length, followed by the ones compliment of the block + length word. Remaining data in block is the stored + data. + + 01 (1) - Use fixed Huffman codes for literal and distance codes. + Lit Code Bits Dist Code Bits + --------- ---- --------- ---- + 0 - 143 8 0 - 31 5 + 144 - 255 9 + 256 - 279 7 + 280 - 287 8 + + Literal codes 286-287 and distance codes 30-31 are + never used but participate in the huffman construction. + + 10 (2) - Dynamic Huffman codes. (See expanding Huffman codes) + + 11 (3) - Reserved - Flag a "Error in compressed data" if seen. + +Expanding Huffman Codes +----------------------- +If the data block is stored with dynamic Huffman codes, the Huffman +codes are sent in the following compressed format: + + 5 Bits: # of Literal codes sent - 256 (256 - 286) + All other codes are never sent. + 5 Bits: # of Dist codes - 1 (1 - 32) + 4 Bits: # of Bit Length codes - 3 (3 - 19) + +The Huffman codes are sent as bit lengths and the codes are built as +described in the implode algorithm. The bit lengths themselves are +compressed with Huffman codes. There are 19 bit length codes: + + 0 - 15: Represent bit lengths of 0 - 15 + 16: Copy the previous bit length 3 - 6 times. + The next 2 bits indicate repeat length (0 = 3, ... ,3 = 6) + Example: Codes 8, 16 (+2 bits 11), 16 (+2 bits 10) will + expand to 12 bit lengths of 8 (1 + 6 + 5) + 17: Repeat a bit length of 0 for 3 - 10 times. (3 bits of length) + 18: Repeat a bit length of 0 for 11 - 138 times (7 bits of length) + +The lengths of the bit length codes are sent packed 3 bits per value +(0 - 7) in the following order: + + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 + +The Huffman codes should be built as described in the Implode algorithm +except codes are assigned starting at the shortest bit length, i.e. the +shortest code should be all 0's rather than all 1's. Also, codes with +a bit length of zero do not participate in the tree construction. The +codes are then used to decode the bit lengths for the literal and +distance tables. + +The bit lengths for the literal tables are sent first with the number +of entries sent described by the 5 bits sent earlier. There are up +to 286 literal characters; the first 256 represent the respective 8 +bit character, code 256 represents the End-Of-Block code, the remaining +29 codes represent copy lengths of 3 thru 258. There are up to 30 +distance codes representing distances from 1 thru 32k as described +below. + + Length Codes + ------------ + Extra Extra Extra Extra + Code Bits Length Code Bits Lengths Code Bits Lengths Code Bits Length(s) + ---- ---- ------ ---- ---- ------- ---- ---- ------- ---- ---- --------- + 257 0 3 265 1 11,12 273 3 35-42 281 5 131-162 + 258 0 4 266 1 13,14 274 3 43-50 282 5 163-194 + 259 0 5 267 1 15,16 275 3 51-58 283 5 195-226 + 260 0 6 268 1 17,18 276 3 59-66 284 5 227-257 + 261 0 7 269 2 19-22 277 4 67-82 285 0 258 + 262 0 8 270 2 23-26 278 4 83-98 + 263 0 9 271 2 27-30 279 4 99-114 + 264 0 10 272 2 31-34 280 4 115-130 + + Distance Codes + -------------- + Extra Extra Extra Extra + Code Bits Dist Code Bits Dist Code Bits Distance Code Bits Distance + ---- ---- ---- ---- ---- ------ ---- ---- -------- ---- ---- -------- + 0 0 1 8 3 17-24 16 7 257-384 24 11 4097-6144 + 1 0 2 9 3 25-32 17 7 385-512 25 11 6145-8192 + 2 0 3 10 4 33-48 18 8 513-768 26 12 8193-12288 + 3 0 4 11 4 49-64 19 8 769-1024 27 12 12289-16384 + 4 1 5,6 12 5 65-96 20 9 1025-1536 28 13 16385-24576 + 5 1 7,8 13 5 97-128 21 9 1537-2048 29 13 24577-32768 + 6 2 9-12 14 6 129-192 22 10 2049-3072 + 7 2 13-16 15 6 193-256 23 10 3073-4096 + +The compressed data stream begins immediately after the +compressed header data. The compressed data stream can be +interpreted as follows: + +do + read header from input stream. + + if stored block + skip bits until byte aligned + read count and 1's compliment of count + copy count bytes data block + otherwise + loop until end of block code sent + decode literal character from input stream + if literal < 256 + copy character to the output stream + otherwise + if literal = end of block + break from loop + otherwise + decode distance from input stream + + move backwards distance bytes in the output stream, and + copy length characters from this position to the output + stream. + end loop +while not last block + +if data descriptor exists + skip bits until byte aligned + read crc and sizes +endif + +Enhanced Deflating - Method 9 +----------------------------- + +The Enhanced Deflating algorithm is similar to Deflate but +uses a sliding dictionary of up to 64K. Deflate64(tm) is supported +by the Deflate extractor. + +BZIP2 - Method 12 +----------------- + +BZIP2 is an open-source data compression algorithm developed by +Julian Seward. Information and source code for this algorithm +can be found on the internet. + +LZMA - Method 14 (EFS) +---------------------- + +LZMA is a block-oriented, general purpose data compression algorithm +developed and maintained by Igor Pavlov. It is a derivative of LZ77 +that utilizes Markov chains and a range coder. Information and +source code for this algorithm can be found on the internet. Consult +with the author of this algorithm for information on terms or +restrictions on use. + +Support for LZMA within the ZIP format is defined as follows: + +The Compression method field within the ZIP Local and Central +Header records will be set to the value 14 to indicate data was +compressed using LZMA. + +The Version needed to extract field within the ZIP Local and +Central Header records will be set to 6.3 to indicate the +minimum ZIP format version supporting this feature. + +File data compressed using the LZMA algorithm must be placed +immediately following the Local Header for the file. If a +standard ZIP encryption header is required, it will follow +the Local Header and will precede the LZMA compressed file +data segment. The location of LZMA compressed data segment +within the ZIP format will be as shown: + + [local header file 1] + [encryption header file 1] + [LZMA compressed data segment for file 1] + [data descriptor 1] + [local header file 2] + +The encryption header and data descriptor records may +be conditionally present. The LZMA Compressed Data Segment +will consist of an LZMA Properties Header followed by the +LZMA Compressed Data as shown: + + [LZMA properties header for file 1] + [LZMA compressed data for file 1] + +The LZMA Compressed Data will be stored as provided by the +LZMA compression library. Compressed size, uncompressed +size and other file characteristics about the file being +compressed must be stored in standard ZIP storage format. + +The LZMA Properties Header will store specific data required to +decompress the LZMA compressed Data. This data is set by the +LZMA compression engine using the function WriteCoderProperties() +as documented within the LZMA SDK. + +Storage fields for the property information within the LZMA +Properties Header are as follows: + + LZMA Version Information 2 bytes + LZMA Properties Size 2 bytes + LZMA Properties Data variable, defined by "LZMA Properties Size" + +LZMA Version Information - this field identifies which version of + the LZMA SDK was used to compress a file. The first byte will + store the major version number of the LZMA SDK and the second + byte will store the minor number. + +LZMA Properties Size - this field defines the size of the remaining + property data. Typically this size should be determined by the + version of the SDK. This size field is included as a convenience + and to help avoid any ambiguity should it arise in the future due + to changes in this compression algorithm. + +LZMA Property Data - this variable sized field records the required + values for the decompressor as defined by the LZMA SDK. The + data stored in this field should be obtained using the + WriteCoderProperties() in the version of the SDK defined by + the "LZMA Version Information" field. + +The layout of the "LZMA Properties Data" field is a function of the +LZMA compression algorithm. It is possible that this layout may be +changed by the author over time. The data layout in version 4.32 +of the LZMA SDK defines a 5 byte array that uses 4 bytes to store +the dictionary size in little-endian order. This is preceded by a +single packed byte as the first element of the array that contains +the following fields: + + PosStateBits + LiteralPosStateBits + LiteralContextBits + +Refer to the LZMA documentation for a more detailed explanation of +these fields. + +Data compressed with method 14, LZMA, may include an end-of-stream +(EOS) marker ending the compressed data stream. This marker is not +required, but its use is highly recommended to facilitate processing +and implementers should include the EOS marker whenever possible. +When the EOS marker is used, general purpose bit 1 must be set. If +general purpose bit 1 is not set, the EOS marker is not present. + +WavPack - Method 97 +------------------- + +Information describing the use of compression method 97 is +provided by WinZIP International, LLC. This method relies on the +open source WavPack audio compression utility developed by David Bryant. +Information on WavPack is available at www.wavpack.com. Please consult +with the author of this algorithm for information on terms and +restrictions on use. + +WavPack data for a file begins immediately after the end of the +local header data. This data is the output from WavPack compression +routines. Within the ZIP file, the use of WavPack compression is +indicated by setting the compression method field to a value of 97 +in both the local header and the central directory header. The Version +needed to extract and version made by fields use the same values as are +used for data compressed using the Deflate algorithm. + +An implementation note for storing digital sample data when using +WavPack compression within ZIP files is that all of the bytes of +the sample data should be compressed. This includes any unused +bits up to the byte boundary. An example is a 2 byte sample that +uses only 12 bits for the sample data with 4 unused bits. If only +12 bits are passed as the sample size to the WavPack routines, the 4 +unused bits will be set to 0 on extraction regardless of their original +state. To avoid this, the full 16 bits of the sample data size +should be provided. + +PPMd - Method 98 +---------------- + +PPMd is a data compression algorithm developed by Dmitry Shkarin +which includes a carryless rangecoder developed by Dmitry Subbotin. +This algorithm is based on predictive phrase matching on multiple +order contexts. Information and source code for this algorithm +can be found on the internet. Consult with the author of this +algorithm for information on terms or restrictions on use. + +Support for PPMd within the ZIP format currently is provided only +for version I, revision 1 of the algorithm. Storage requirements +for using this algorithm are as follows: + +Parameters needed to control the algorithm are stored in the two +bytes immediately preceding the compressed data. These bytes are +used to store the following fields: + +Model order - sets the maximum model order, default is 8, possible + values are from 2 to 16 inclusive + +Sub-allocator size - sets the size of sub-allocator in MB, default is 50, + possible values are from 1MB to 256MB inclusive + +Model restoration method - sets the method used to restart context + model at memory insufficiency, values are: + + 0 - restarts model from scratch - default + 1 - cut off model - decreases performance by as much as 2x + 2 - freeze context tree - not recommended + +An example for packing these fields into the 2 byte storage field is +illustrated below. These values are stored in Intel low-byte/high-byte +order. + +wPPMd = (Model order - 1) + + ((Sub-allocator size - 1) << 4) + + (Model restoration method << 12) + + +VII. Traditional PKWARE Encryption +---------------------------------- + +The following information discusses the decryption steps +required to support traditional PKWARE encryption. This +form of encryption is considered weak by today's standards +and its use is recommended only for situations with +low security needs or for compatibility with older .ZIP +applications. + +Decryption +---------- + +PKWARE is grateful to Mr. Roger Schlafly for his expert contribution +towards the development of PKWARE's traditional encryption. + +PKZIP encrypts the compressed data stream. Encrypted files must +be decrypted before they can be extracted. + +Each encrypted file has an extra 12 bytes stored at the start of +the data area defining the encryption header for that file. The +encryption header is originally set to random values, and then +itself encrypted, using three, 32-bit keys. The key values are +initialized using the supplied encryption password. After each byte +is encrypted, the keys are then updated using pseudo-random number +generation techniques in combination with the same CRC-32 algorithm +used in PKZIP and described elsewhere in this document. + +The following is the basic steps required to decrypt a file: + +1) Initialize the three 32-bit keys with the password. +2) Read and decrypt the 12-byte encryption header, further + initializing the encryption keys. +3) Read and decrypt the compressed data stream using the + encryption keys. + +Step 1 - Initializing the encryption keys +----------------------------------------- + +Key(0) <- 305419896 +Key(1) <- 591751049 +Key(2) <- 878082192 + +loop for i <- 0 to length(password)-1 + update_keys(password(i)) +end loop + +Where update_keys() is defined as: + +update_keys(char): + Key(0) <- crc32(key(0),char) + Key(1) <- Key(1) + (Key(0) & 000000ffH) + Key(1) <- Key(1) * 134775813 + 1 + Key(2) <- crc32(key(2),key(1) >> 24) +end update_keys + +Where crc32(old_crc,char) is a routine that given a CRC value and a +character, returns an updated CRC value after applying the CRC-32 +algorithm described elsewhere in this document. + +Step 2 - Decrypting the encryption header +----------------------------------------- + +The purpose of this step is to further initialize the encryption +keys, based on random data, to render a plaintext attack on the +data ineffective. + +Read the 12-byte encryption header into Buffer, in locations +Buffer(0) thru Buffer(11). + +loop for i <- 0 to 11 + C <- buffer(i) ^ decrypt_byte() + update_keys(C) + buffer(i) <- C +end loop + +Where decrypt_byte() is defined as: + +unsigned char decrypt_byte() + local unsigned short temp + temp <- Key(2) | 2 + decrypt_byte <- (temp * (temp ^ 1)) >> 8 +end decrypt_byte + +After the header is decrypted, the last 1 or 2 bytes in Buffer +should be the high-order word/byte of the CRC for the file being +decrypted, stored in Intel low-byte/high-byte order. Versions of +PKZIP prior to 2.0 used a 2 byte CRC check; a 1 byte CRC check is +used on versions after 2.0. This can be used to test if the password +supplied is correct or not. + +Step 3 - Decrypting the compressed data stream +---------------------------------------------- + +The compressed data stream can be decrypted as follows: + +loop until done + read a character into C + Temp <- C ^ decrypt_byte() + update_keys(temp) + output Temp +end loop + + +VIII. Strong Encryption Specification +------------------------------------- + +The Strong Encryption technology defined in this specification is +covered under a pending patent application. The use or implementation +in a product of certain technological aspects set forth in the current +APPNOTE, including those with regard to strong encryption, patching, +or extended tape operations requires a license from PKWARE. Portions +of this Strong Encryption technology are available for use at no charge. +Contact PKWARE for licensing terms and conditions. Refer to section II +of this APPNOTE (Contacting PKWARE) for information on how to +contact PKWARE. + +Version 5.x of this specification introduced support for strong +encryption algorithms. These algorithms can be used with either +a password or an X.509v3 digital certificate to encrypt each file. +This format specification supports either password or certificate +based encryption to meet the security needs of today, to enable +interoperability between users within both PKI and non-PKI +environments, and to ensure interoperability between different +computing platforms that are running a ZIP program. + +Password based encryption is the most common form of encryption +people are familiar with. However, inherent weaknesses with +passwords (e.g. susceptibility to dictionary/brute force attack) +as well as password management and support issues make certificate +based encryption a more secure and scalable option. Industry +efforts and support are defining and moving towards more advanced +security solutions built around X.509v3 digital certificates and +Public Key Infrastructures(PKI) because of the greater scalability, +administrative options, and more robust security over traditional +password based encryption. + +Most standard encryption algorithms are supported with this +specification. Reference implementations for many of these +algorithms are available from either commercial or open source +distributors. Readily available cryptographic toolkits make +implementation of the encryption features straight-forward. +This document is not intended to provide a treatise on data +encryption principles or theory. Its purpose is to document the +data structures required for implementing interoperable data +encryption within the .ZIP format. It is strongly recommended that +you have a good understanding of data encryption before reading +further. + +The algorithms introduced in Version 5.0 of this specification +include: + + RC2 40 bit, 64 bit, and 128 bit + RC4 40 bit, 64 bit, and 128 bit + DES + 3DES 112 bit and 168 bit + +Version 5.1 adds support for the following: + + AES 128 bit, 192 bit, and 256 bit + + +Version 6.1 introduces encryption data changes to support +interoperability with Smartcard and USB Token certificate storage +methods which do not support the OAEP strengthening standard. + +Version 6.2 introduces support for encrypting metadata by compressing +and encrypting the central directory data structure to reduce information +leakage. Information leakage can occur in legacy ZIP applications +through exposure of information about a file even though that file is +stored encrypted. The information exposed consists of file +characteristics stored within the records and fields defined by this +specification. This includes data such as a files name, its original +size, timestamp and CRC32 value. + +Version 6.3 introduces support for encrypting data using the Blowfish +and Twofish algorithms. These are symmetric block ciphers developed +by Bruce Schneier. Blowfish supports using a variable length key from +32 to 448 bits. Block size is 64 bits. Implementations should use 16 +rounds and the only mode supported within ZIP files is CBC. Twofish +supports key sizes 128, 192 and 256 bits. Block size is 128 bits. +Implementations should use 16 rounds and the only mode supported within +ZIP files is CBC. Information and source code for both Blowfish and +Twofish algorithms can be found on the internet. Consult with the author +of these algorithms for information on terms or restrictions on use. + +Central Directory Encryption provides greater protection against +information leakage by encrypting the Central Directory structure and +by masking key values that are replicated in the unencrypted Local +Header. ZIP compatible programs that cannot interpret an encrypted +Central Directory structure cannot rely on the data in the corresponding +Local Header for decompression information. + +Extra Field records that may contain information about a file that should +not be exposed should not be stored in the Local Header and should only +be written to the Central Directory where they can be encrypted. This +design currently does not support streaming. Information in the End of +Central Directory record, the Zip64 End of Central Directory Locator, +and the Zip64 End of Central Directory records are not encrypted. Access +to view data on files within a ZIP file with an encrypted Central Directory +requires the appropriate password or private key for decryption prior to +viewing any files, or any information about the files, in the archive. + +Older ZIP compatible programs not familiar with the Central Directory +Encryption feature will no longer be able to recognize the Central +Directory and may assume the ZIP file is corrupt. Programs that +attempt streaming access using Local Headers will see invalid +information for each file. Central Directory Encryption need not be +used for every ZIP file. Its use is recommended for greater security. +ZIP files not using Central Directory Encryption should operate as +in the past. + +This strong encryption feature specification is intended to provide for +scalable, cross-platform encryption needs ranging from simple password +encryption to authenticated public/private key encryption. + +Encryption provides data confidentiality and privacy. It is +recommended that you combine X.509 digital signing with encryption +to add authentication and non-repudiation. + + +Single Password Symmetric Encryption Method: +------------------------------------------- + +The Single Password Symmetric Encryption Method using strong +encryption algorithms operates similarly to the traditional +PKWARE encryption defined in this format. Additional data +structures are added to support the processing needs of the +strong algorithms. + +The Strong Encryption data structures are: + +1. General Purpose Bits - Bits 0 and 6 of the General Purpose bit +flag in both local and central header records. Both bits set +indicates strong encryption. Bit 13, when set indicates the Central +Directory is encrypted and that selected fields in the Local Header +are masked to hide their actual value. + + +2. Extra Field 0x0017 in central header only. + + Fields to consider in this record are: + + Format - the data format identifier for this record. The only + value allowed at this time is the integer value 2. + + AlgId - integer identifier of the encryption algorithm from the + following range + + 0x6601 - DES + 0x6602 - RC2 (version needed to extract < 5.2) + 0x6603 - 3DES 168 + 0x6609 - 3DES 112 + 0x660E - AES 128 + 0x660F - AES 192 + 0x6610 - AES 256 + 0x6702 - RC2 (version needed to extract >= 5.2) + 0x6720 - Blowfish + 0x6721 - Twofish + 0x6801 - RC4 + 0xFFFF - Unknown algorithm + + Bitlen - Explicit bit length of key + + 32 - 448 bits + + Flags - Processing flags needed for decryption + + 0x0001 - Password is required to decrypt + 0x0002 - Certificates only + 0x0003 - Password or certificate required to decrypt + + Values > 0x0003 reserved for certificate processing + + +3. Decryption header record preceding compressed file data. + + -Decryption Header: + + Value Size Description + ----- ---- ----------- + IVSize 2 bytes Size of initialization vector (IV) + IVData IVSize Initialization vector for this file + Size 4 bytes Size of remaining decryption header data + Format 2 bytes Format definition for this record + AlgID 2 bytes Encryption algorithm identifier + Bitlen 2 bytes Bit length of encryption key + Flags 2 bytes Processing flags + ErdSize 2 bytes Size of Encrypted Random Data + ErdData ErdSize Encrypted Random Data + Reserved1 4 bytes Reserved certificate processing data + Reserved2 (var) Reserved for certificate processing data + VSize 2 bytes Size of password validation data + VData VSize-4 Password validation data + VCRC32 4 bytes Standard ZIP CRC32 of password validation data + + IVData - The size of the IV should match the algorithm block size. + The IVData can be completely random data. If the size of + the randomly generated data does not match the block size + it should be complemented with zero's or truncated as + necessary. If IVSize is 0,then IV = CRC32 + Uncompressed + File Size (as a 64 bit little-endian, unsigned integer value). + + Format - the data format identifier for this record. The only + value allowed at this time is the integer value 3. + + AlgId - integer identifier of the encryption algorithm from the + following range + + 0x6601 - DES + 0x6602 - RC2 (version needed to extract < 5.2) + 0x6603 - 3DES 168 + 0x6609 - 3DES 112 + 0x660E - AES 128 + 0x660F - AES 192 + 0x6610 - AES 256 + 0x6702 - RC2 (version needed to extract >= 5.2) + 0x6720 - Blowfish + 0x6721 - Twofish + 0x6801 - RC4 + 0xFFFF - Unknown algorithm + + Bitlen - Explicit bit length of key + + 32 - 448 bits + + Flags - Processing flags needed for decryption + + 0x0001 - Password is required to decrypt + 0x0002 - Certificates only + 0x0003 - Password or certificate required to decrypt + + Values > 0x0003 reserved for certificate processing + + ErdData - Encrypted random data is used to store random data that + is used to generate a file session key for encrypting + each file. SHA1 is used to calculate hash data used to + derive keys. File session keys are derived from a master + session key generated from the user-supplied password. + If the Flags field in the decryption header contains + the value 0x4000, then the ErdData field must be + decrypted using 3DES. If the value 0x4000 is not set, + then the ErdData field must be decrypted using AlgId. + + + Reserved1 - Reserved for certificate processing, if value is + zero, then Reserved2 data is absent. See the explanation + under the Certificate Processing Method for details on + this data structure. + + Reserved2 - If present, the size of the Reserved2 data structure + is located by skipping the first 4 bytes of this field + and using the next 2 bytes as the remaining size. See + the explanation under the Certificate Processing Method + for details on this data structure. + + VSize - This size value will always include the 4 bytes of the + VCRC32 data and will be greater than 4 bytes. + + VData - Random data for password validation. This data is VSize + in length and VSize must be a multiple of the encryption + block size. VCRC32 is a checksum value of VData. + VData and VCRC32 are stored encrypted and start the + stream of encrypted data for a file. + + +4. Useful Tips + +Strong Encryption is always applied to a file after compression. The +block oriented algorithms all operate in Cypher Block Chaining (CBC) +mode. The block size used for AES encryption is 16. All other block +algorithms use a block size of 8. Two ID's are defined for RC2 to +account for a discrepancy found in the implementation of the RC2 +algorithm in the cryptographic library on Windows XP SP1 and all +earlier versions of Windows. It is recommended that zero length files +not be encrypted, however programs should be prepared to extract them +if they are found within a ZIP file. + +A pseudo-code representation of the encryption process is as follows: + +Password = GetUserPassword() +MasterSessionKey = DeriveKey(SHA1(Password)) +RD = CryptographicStrengthRandomData() +For Each File + IV = CryptographicStrengthRandomData() + VData = CryptographicStrengthRandomData() + VCRC32 = CRC32(VData) + FileSessionKey = DeriveKey(SHA1(IV + RD) + ErdData = Encrypt(RD,MasterSessionKey,IV) + Encrypt(VData + VCRC32 + FileData, FileSessionKey,IV) +Done + +The function names and parameter requirements will depend on +the choice of the cryptographic toolkit selected. Almost any +toolkit supporting the reference implementations for each +algorithm can be used. The RSA BSAFE(r), OpenSSL, and Microsoft +CryptoAPI libraries are all known to work well. + + +Single Password - Central Directory Encryption: +----------------------------------------------- + +Central Directory Encryption is achieved within the .ZIP format by +encrypting the Central Directory structure. This encapsulates the metadata +most often used for processing .ZIP files. Additional metadata is stored for +redundancy in the Local Header for each file. The process of concealing +metadata by encrypting the Central Directory does not protect the data within +the Local Header. To avoid information leakage from the exposed metadata +in the Local Header, the fields containing information about a file are masked. + +Local Header: + +Masking replaces the true content of the fields for a file in the Local +Header with false information. When masked, the Local Header is not +suitable for streaming access and the options for data recovery of damaged +archives is reduced. Extra Data fields that may contain confidential +data should not be stored within the Local Header. The value set into +the Version needed to extract field should be the correct value needed to +extract the file without regard to Central Directory Encryption. The fields +within the Local Header targeted for masking when the Central Directory is +encrypted are: + + Field Name Mask Value + ------------------ --------------------------- + compression method 0 + last mod file time 0 + last mod file date 0 + crc-32 0 + compressed size 0 + uncompressed size 0 + file name (variable size) Base 16 value from the + range 1 - 0xFFFFFFFFFFFFFFFF + represented as a string whose + size will be set into the + file name length field + +The Base 16 value assigned as a masked file name is simply a sequentially +incremented value for each file starting with 1 for the first file. +Modifications to a ZIP file may cause different values to be stored for +each file. For compatibility, the file name field in the Local Header +should never be left blank. As of Version 6.2 of this specification, +the Compression Method and Compressed Size fields are not yet masked. +Fields having a value of 0xFFFF or 0xFFFFFFFF for the ZIP64 format +should not be masked. + +Encrypting the Central Directory: + +Encryption of the Central Directory does not include encryption of the +Central Directory Signature data, the Zip64 End of Central Directory +record, the Zip64 End of Central Directory Locator, or the End +of Central Directory record. The ZIP file comment data is never +encrypted. + +Before encrypting the Central Directory, it may optionally be compressed. +Compression is not required, but for storage efficiency it is assumed +this structure will be compressed before encrypting. Similarly, this +specification supports compressing the Central Directory without +requiring that it also be encrypted. Early implementations of this +feature will assume the encryption method applied to files matches the +encryption applied to the Central Directory. + +Encryption of the Central Directory is done in a manner similar to +that of file encryption. The encrypted data is preceded by a +decryption header. The decryption header is known as the Archive +Decryption Header. The fields of this record are identical to +the decryption header preceding each encrypted file. The location +of the Archive Decryption Header is determined by the value in the +Start of the Central Directory field in the Zip64 End of Central +Directory record. When the Central Directory is encrypted, the +Zip64 End of Central Directory record will always be present. + +The layout of the Zip64 End of Central Directory record for all +versions starting with 6.2 of this specification will follow the +Version 2 format. The Version 2 format is as follows: + +The leading fixed size fields within the Version 1 format for this +record remain unchanged. The record signature for both Version 1 +and Version 2 will be 0x06064b50. Immediately following the last +byte of the field known as the Offset of Start of Central +Directory With Respect to the Starting Disk Number will begin the +new fields defining Version 2 of this record. + +New fields for Version 2: + +Note: all fields stored in Intel low-byte/high-byte order. + + Value Size Description + ----- ---- ----------- + Compression Method 2 bytes Method used to compress the + Central Directory + Compressed Size 8 bytes Size of the compressed data + Original Size 8 bytes Original uncompressed size + AlgId 2 bytes Encryption algorithm ID + BitLen 2 bytes Encryption key length + Flags 2 bytes Encryption flags + HashID 2 bytes Hash algorithm identifier + Hash Length 2 bytes Length of hash data + Hash Data (variable) Hash data + +The Compression Method accepts the same range of values as the +corresponding field in the Central Header. + +The Compressed Size and Original Size values will not include the +data of the Central Directory Signature which is compressed or +encrypted. + +The AlgId, BitLen, and Flags fields accept the same range of values +the corresponding fields within the 0x0017 record. + +Hash ID identifies the algorithm used to hash the Central Directory +data. This data does not have to be hashed, in which case the +values for both the HashID and Hash Length will be 0. Possible +values for HashID are: + + Value Algorithm + ------ --------- + 0x0000 none + 0x0001 CRC32 + 0x8003 MD5 + 0x8004 SHA1 + 0x8007 RIPEMD160 + 0x800C SHA256 + 0x800D SHA384 + 0x800E SHA512 + +When the Central Directory data is signed, the same hash algorithm +used to hash the Central Directory for signing should be used. +This is recommended for processing efficiency, however, it is +permissible for any of the above algorithms to be used independent +of the signing process. + +The Hash Data will contain the hash data for the Central Directory. +The length of this data will vary depending on the algorithm used. + +The Version Needed to Extract should be set to 62. + +The value for the Total Number of Entries on the Current Disk will +be 0. These records will no longer support random access when +encrypting the Central Directory. + +When the Central Directory is compressed and/or encrypted, the +End of Central Directory record will store the value 0xFFFFFFFF +as the value for the Total Number of Entries in the Central +Directory. The value stored in the Total Number of Entries in +the Central Directory on this Disk field will be 0. The actual +values will be stored in the equivalent fields of the Zip64 +End of Central Directory record. + +Decrypting and decompressing the Central Directory is accomplished +in the same manner as decrypting and decompressing a file. + +Certificate Processing Method: +----------------------------- + +The Certificate Processing Method of for ZIP file encryption +defines the following additional data fields: + +1. Certificate Flag Values + +Additional processing flags that can be present in the Flags field of both +the 0x0017 field of the central directory Extra Field and the Decryption +header record preceding compressed file data are: + + 0x0007 - reserved for future use + 0x000F - reserved for future use + 0x0100 - Indicates non-OAEP key wrapping was used. If this + this field is set, the version needed to extract must + be at least 61. This means OAEP key wrapping is not + used when generating a Master Session Key using + ErdData. + 0x4000 - ErdData must be decrypted using 3DES-168, otherwise use the + same algorithm used for encrypting the file contents. + 0x8000 - reserved for future use + + +2. CertData - Extra Field 0x0017 record certificate data structure + +The data structure used to store certificate data within the section +of the Extra Field defined by the CertData field of the 0x0017 +record are as shown: + + Value Size Description + ----- ---- ----------- + RCount 4 bytes Number of recipients. + HashAlg 2 bytes Hash algorithm identifier + HSize 2 bytes Hash size + SRList (var) Simple list of recipients hashed public keys + + + RCount This defines the number intended recipients whose + public keys were used for encryption. This identifies + the number of elements in the SRList. + + HashAlg This defines the hash algorithm used to calculate + the public key hash of each public key used + for encryption. This field currently supports + only the following value for SHA-1 + + 0x8004 - SHA1 + + HSize This defines the size of a hashed public key. + + SRList This is a variable length list of the hashed + public keys for each intended recipient. Each + element in this list is HSize. The total size of + SRList is determined using RCount * HSize. + + +3. Reserved1 - Certificate Decryption Header Reserved1 Data: + + Value Size Description + ----- ---- ----------- + RCount 4 bytes Number of recipients. + + RCount This defines the number intended recipients whose + public keys were used for encryption. This defines + the number of elements in the REList field defined below. + + +4. Reserved2 - Certificate Decryption Header Reserved2 Data Structures: + + + Value Size Description + ----- ---- ----------- + HashAlg 2 bytes Hash algorithm identifier + HSize 2 bytes Hash size + REList (var) List of recipient data elements + + + HashAlg This defines the hash algorithm used to calculate + the public key hash of each public key used + for encryption. This field currently supports + only the following value for SHA-1 + + 0x8004 - SHA1 + + HSize This defines the size of a hashed public key + defined in REHData. + + REList This is a variable length of list of recipient data. + Each element in this list consists of a Recipient + Element data structure as follows: + + + Recipient Element (REList) Data Structure: + + Value Size Description + ----- ---- ----------- + RESize 2 bytes Size of REHData + REKData + REHData HSize Hash of recipients public key + REKData (var) Simple key blob + + + RESize This defines the size of an individual REList + element. This value is the combined size of the + REHData field + REKData field. REHData is defined by + HSize. REKData is variable and can be calculated + for each REList element using RESize and HSize. + + REHData Hashed public key for this recipient. + + REKData Simple Key Blob. The format of this data structure + is identical to that defined in the Microsoft + CryptoAPI and generated using the CryptExportKey() + function. The version of the Simple Key Blob + supported at this time is 0x02 as defined by + Microsoft. + +Certificate Processing - Central Directory Encryption: +------------------------------------------------------ + +Central Directory Encryption using Digital Certificates will +operate in a manner similar to that of Single Password Central +Directory Encryption. This record will only be present when there +is data to place into it. Currently, data is placed into this +record when digital certificates are used for either encrypting +or signing the files within a ZIP file. When only password +encryption is used with no certificate encryption or digital +signing, this record is not currently needed. When present, this +record will appear before the start of the actual Central Directory +data structure and will be located immediately after the Archive +Decryption Header if the Central Directory is encrypted. + +The Archive Extra Data record will be used to store the following +information. Additional data may be added in future versions. + +Extra Data Fields: + +0x0014 - PKCS#7 Store for X.509 Certificates +0x0016 - X.509 Certificate ID and Signature for central directory +0x0019 - PKCS#7 Encryption Recipient Certificate List + +The 0x0014 and 0x0016 Extra Data records that otherwise would be +located in the first record of the Central Directory for digital +certificate processing. When encrypting or compressing the Central +Directory, the 0x0014 and 0x0016 records must be located in the +Archive Extra Data record and they should not remain in the first +Central Directory record. The Archive Extra Data record will also +be used to store the 0x0019 data. + +When present, the size of the Archive Extra Data record will be +included in the size of the Central Directory. The data of the +Archive Extra Data record will also be compressed and encrypted +along with the Central Directory data structure. + +Certificate Processing Differences: + +The Certificate Processing Method of encryption differs from the +Single Password Symmetric Encryption Method as follows. Instead +of using a user-defined password to generate a master session key, +cryptographically random data is used. The key material is then +wrapped using standard key-wrapping techniques. This key material +is wrapped using the public key of each recipient that will need +to decrypt the file using their corresponding private key. + +This specification currently assumes digital certificates will follow +the X.509 V3 format for 1024 bit and higher RSA format digital +certificates. Implementation of this Certificate Processing Method +requires supporting logic for key access and management. This logic +is outside the scope of this specification. + +OAEP Processing with Certificate-based Encryption: + +OAEP stands for Optimal Asymmetric Encryption Padding. It is a +strengthening technique used for small encoded items such as decryption +keys. This is commonly applied in cryptographic key-wrapping techniques +and is supported by PKCS #1. Versions 5.0 and 6.0 of this specification +were designed to support OAEP key-wrapping for certificate-based +decryption keys for additional security. + +Support for private keys stored on Smartcards or Tokens introduced +a conflict with this OAEP logic. Most card and token products do +not support the additional strengthening applied to OAEP key-wrapped +data. In order to resolve this conflict, versions 6.1 and above of this +specification will no longer support OAEP when encrypting using +digital certificates. + +Versions of PKZIP available during initial development of the +certificate processing method set a value of 61 into the +version needed to extract field for a file. This indicates that +non-OAEP key wrapping is used. This affects certificate encryption +only, and password encryption functions should not be affected by +this value. This means values of 61 may be found on files encrypted +with certificates only, or on files encrypted with both password +encryption and certificate encryption. Files encrypted with both +methods can safely be decrypted using the password methods documented. + +IX. Change Process +------------------ + +In order for the .ZIP file format to remain a viable definition, this +specification should be considered as open for periodic review and +revision. Although this format was originally designed with a +certain level of extensibility, not all changes in technology +(present or future) were or will be necessarily considered in its +design. If your application requires new definitions to the +extensible sections in this format, or if you would like to +submit new data structures, please forward your request to +zipformat@pkware.com. All submissions will be reviewed by the +ZIP File Specification Committee for possible inclusion into +future versions of this specification. Periodic revisions +to this specification will be published to ensure interoperability. +We encourage comments and feedback that may help improve clarity +or content. + +X. Incorporating PKWARE Proprietary Technology into Your Product +---------------------------------------------------------------- + +PKWARE is committed to the interoperability and advancement of the +.ZIP format. PKWARE offers a free license for certain technological +aspects described above under certain restrictions and conditions. +However, the use or implementation in a product of certain technological +aspects set forth in the current APPNOTE, including those with regard to +strong encryption, patching, or extended tape operations requires a +license from PKWARE. Please contact PKWARE with regard to acquiring +a license. + +XI. Acknowledgements +--------------------- + +In addition to the above mentioned contributors to PKZIP and PKUNZIP, +I would like to extend special thanks to Robert Mahoney for suggesting +the extension .ZIP for this software. + +XII. References +--------------- + + Fiala, Edward R., and Greene, Daniel H., "Data compression with + finite windows", Communications of the ACM, Volume 32, Number 4, + April 1989, pages 490-505. + + Held, Gilbert, "Data Compression, Techniques and Applications, + Hardware and Software Considerations", John Wiley & Sons, 1987. + + Huffman, D.A., "A method for the construction of minimum-redundancy + codes", Proceedings of the IRE, Volume 40, Number 9, September 1952, + pages 1098-1101. + + Nelson, Mark, "LZW Data Compression", Dr. Dobbs Journal, Volume 14, + Number 10, October 1989, pages 29-37. + + Nelson, Mark, "The Data Compression Book", M&T Books, 1991. + + Storer, James A., "Data Compression, Methods and Theory", + Computer Science Press, 1988 + + Welch, Terry, "A Technique for High-Performance Data Compression", + IEEE Computer, Volume 17, Number 6, June 1984, pages 8-19. + + Ziv, J. and Lempel, A., "A universal algorithm for sequential data + compression", Communications of the ACM, Volume 30, Number 6, + June 1987, pages 520-540. + + Ziv, J. and Lempel, A., "Compression of individual sequences via + variable-rate coding", IEEE Transactions on Information Theory, + Volume 24, Number 5, September 1978, pages 530-536. + + +APPENDIX A - AS/400 Extra Field (0x0065) Attribute Definitions +-------------------------------------------------------------- + +Field Definition Structure: + + a. field length including length 2 bytes + b. field code 2 bytes + c. data x bytes + +Field Code Description + 4001 Source type i.e. CLP etc + 4002 The text description of the library + 4003 The text description of the file + 4004 The text description of the member + 4005 x'F0' or 0 is PF-DTA, x'F1' or 1 is PF_SRC + 4007 Database Type Code 1 byte + 4008 Database file and fields definition + 4009 GZIP file type 2 bytes + 400B IFS code page 2 bytes + 400C IFS Creation Time 4 bytes + 400D IFS Access Time 4 bytes + 400E IFS Modification time 4 bytes + 005C Length of the records in the file 2 bytes + 0068 GZIP two words 8 bytes + +APPENDIX B - z/OS Extra Field (0x0065) Attribute Definitions +------------------------------------------------------------ + +Field Definition Structure: + + a. field length including length 2 bytes + b. field code 2 bytes + c. data x bytes + +Field Code Description + 0001 File Type 2 bytes + 0002 NonVSAM Record Format 1 byte + 0003 Reserved + 0004 NonVSAM Block Size 2 bytes Big Endian + 0005 Primary Space Allocation 3 bytes Big Endian + 0006 Secondary Space Allocation 3 bytes Big Endian + 0007 Space Allocation Type1 byte flag + 0008 Modification Date Retired with PKZIP 5.0 + + 0009 Expiration Date Retired with PKZIP 5.0 + + 000A PDS Directory Block Allocation 3 bytes Big Endian binary value + 000B NonVSAM Volume List variable + 000C UNIT Reference Retired with PKZIP 5.0 + + 000D DF/SMS Management Class 8 bytes EBCDIC Text Value + 000E DF/SMS Storage Class 8 bytes EBCDIC Text Value + 000F DF/SMS Data Class 8 bytes EBCDIC Text Value + 0010 PDS/PDSE Member Info. 30 bytes + 0011 VSAM sub-filetype 2 bytes + 0012 VSAM LRECL 13 bytes EBCDIC "(num_avg num_max)" + 0013 VSAM Cluster Name Retired with PKZIP 5.0 + + 0014 VSAM KSDS Key Information 13 bytes EBCDIC "(num_length num_position)" + 0015 VSAM Average LRECL 5 bytes EBCDIC num_value padded with blanks + 0016 VSAM Maximum LRECL 5 bytes EBCDIC num_value padded with blanks + 0017 VSAM KSDS Key Length 5 bytes EBCDIC num_value padded with blanks + 0018 VSAM KSDS Key Position 5 bytes EBCDIC num_value padded with blanks + 0019 VSAM Data Name 1-44 bytes EBCDIC text string + 001A VSAM KSDS Index Name 1-44 bytes EBCDIC text string + 001B VSAM Catalog Name 1-44 bytes EBCDIC text string + 001C VSAM Data Space Type 9 bytes EBCDIC text string + 001D VSAM Data Space Primary 9 bytes EBCDIC num_value left-justified + 001E VSAM Data Space Secondary 9 bytes EBCDIC num_value left-justified + 001F VSAM Data Volume List variable EBCDIC text list of 6-character Volume IDs + 0020 VSAM Data Buffer Space 8 bytes EBCDIC num_value left-justified + 0021 VSAM Data CISIZE 5 bytes EBCDIC num_value left-justified + 0022 VSAM Erase Flag 1 byte flag + 0023 VSAM Free CI % 3 bytes EBCDIC num_value left-justified + 0024 VSAM Free CA % 3 bytes EBCDIC num_value left-justified + 0025 VSAM Index Volume List variable EBCDIC text list of 6-character Volume IDs + 0026 VSAM Ordered Flag 1 byte flag + 0027 VSAM REUSE Flag 1 byte flag + 0028 VSAM SPANNED Flag 1 byte flag + 0029 VSAM Recovery Flag 1 byte flag + 002A VSAM WRITECHK Flag 1 byte flag + 002B VSAM Cluster/Data SHROPTS 3 bytes EBCDIC "n,y" + 002C VSAM Index SHROPTS 3 bytes EBCDIC "n,y" + 002D VSAM Index Space Type 9 bytes EBCDIC text string + 002E VSAM Index Space Primary 9 bytes EBCDIC num_value left-justified + 002F VSAM Index Space Secondary 9 bytes EBCDIC num_value left-justified + 0030 VSAM Index CISIZE 5 bytes EBCDIC num_value left-justified + 0031 VSAM Index IMBED 1 byte flag + 0032 VSAM Index Ordered Flag 1 byte flag + 0033 VSAM REPLICATE Flag 1 byte flag + 0034 VSAM Index REUSE Flag 1 byte flag + 0035 VSAM Index WRITECHK Flag 1 byte flag Retired with PKZIP 5.0 + + 0036 VSAM Owner 8 bytes EBCDIC text string + 0037 VSAM Index Owner 8 bytes EBCDIC text string + 0038 Reserved + 0039 Reserved + 003A Reserved + 003B Reserved + 003C Reserved + 003D Reserved + 003E Reserved + 003F Reserved + 0040 Reserved + 0041 Reserved + 0042 Reserved + 0043 Reserved + 0044 Reserved + 0045 Reserved + 0046 Reserved + 0047 Reserved + 0048 Reserved + 0049 Reserved + 004A Reserved + 004B Reserved + 004C Reserved + 004D Reserved + 004E Reserved + 004F Reserved + 0050 Reserved + 0051 Reserved + 0052 Reserved + 0053 Reserved + 0054 Reserved + 0055 Reserved + 0056 Reserved + 0057 Reserved + 0058 PDS/PDSE Member TTR Info. 6 bytes Big Endian + 0059 PDS 1st LMOD Text TTR 3 bytes Big Endian + 005A PDS LMOD EP Rec # 4 bytes Big Endian + 005B Reserved + 005C Max Length of records 2 bytes Big Endian + 005D PDSE Flag 1 byte flag + 005E Reserved + 005F Reserved + 0060 Reserved + 0061 Reserved + 0062 Reserved + 0063 Reserved + 0064 Reserved + 0065 Last Date Referenced 4 bytes Packed Hex "yyyymmdd" + 0066 Date Created 4 bytes Packed Hex "yyyymmdd" + 0068 GZIP two words 8 bytes + 0071 Extended NOTE Location 12 bytes Big Endian + 0072 Archive device UNIT 6 bytes EBCDIC + 0073 Archive 1st Volume 6 bytes EBCDIC + 0074 Archive 1st VOL File Seq# 2 bytes Binary + +APPENDIX C - Zip64 Extensible Data Sector Mappings (EFS) +-------------------------------------------------------- + + -Z390 Extra Field: + + The following is the general layout of the attributes for the + ZIP 64 "extra" block for extended tape operations. Portions of + this extended tape processing technology is covered under a + pending patent application. The use or implementation in a + product of certain technological aspects set forth in the + current APPNOTE, including those with regard to strong encryption, + patching or extended tape operations, requires a license from + PKWARE. Please contact PKWARE with regard to acquiring a license. + + + Note: some fields stored in Big Endian format. All text is + in EBCDIC format unless otherwise specified. + + Value Size Description + ----- ---- ----------- + (Z390) 0x0065 2 bytes Tag for this "extra" block type + Size 4 bytes Size for the following data block + Tag 4 bytes EBCDIC "Z390" + Length71 2 bytes Big Endian + Subcode71 2 bytes Enote type code + FMEPos 1 byte + Length72 2 bytes Big Endian + Subcode72 2 bytes Unit type code + Unit 1 byte Unit + Length73 2 bytes Big Endian + Subcode73 2 bytes Volume1 type code + FirstVol 1 byte Volume + Length74 2 bytes Big Endian + Subcode74 2 bytes FirstVol file sequence + FileSeq 2 bytes Sequence + +APPENDIX D - Language Encoding (EFS) +------------------------------------ + +The ZIP format has historically supported only the original IBM PC character +encoding set, commonly referred to as IBM Code Page 437. This limits storing +file name characters to only those within the original MS-DOS range of values +and does not properly support file names in other character encodings, or +languages. To address this limitation, this specification will support the +following change. + +If general purpose bit 11 is unset, the file name and comment should conform +to the original ZIP character encoding. If general purpose bit 11 is set, the +filename and comment must support The Unicode Standard, Version 4.1.0 or +greater using the character encoding form defined by the UTF-8 storage +specification. The Unicode Standard is published by the The Unicode +Consortium (www.unicode.org). UTF-8 encoded data stored within ZIP files +is expected to not include a byte order mark (BOM). + +Applications may choose to supplement this file name storage through the use +of the 0x0008 Extra Field. Storage for this optional field is currently +undefined, however it will be used to allow storing extended information +on source or target encoding that may further assist applications with file +name, or file content encoding tasks. Please contact PKWARE with any +requirements on how this field should be used. + +The 0x0008 Extra Field storage may be used with either setting for general +purpose bit 11. Examples of the intended usage for this field is to store +whether "modified-UTF-8" (JAVA) is used, or UTF-8-MAC. Similarly, other +commonly used character encoding (code page) designations can be indicated +through this field. Formalized values for use of the 0x0008 record remain +undefined at this time. The definition for the layout of the 0x0008 field +will be published when available. Use of the 0x0008 Extra Field provides +for storing data within a ZIP file in an encoding other than IBM Code +Page 437 or UTF-8. + +General purpose bit 11 will not imply any encoding of file content or +password. Values defining character encoding for file content or +password must be stored within the 0x0008 Extended Language Encoding +Extra Field. + +Ed Gordon of the Info-ZIP group has defined a pair of "extra field" records +that can be used to store UTF-8 file name and file comment fields. These +records can be used for cases when the general purpose bit 11 method +for storing UTF-8 data in the standard file name and comment fields is +not desirable. A common case for this alternate method is if backward +compatibility with older programs is required. + +Definitions for the record structure of these fields are included above +in the section on 3rd party mappings for "extra field" records. These +records are identified by Header ID's 0x6375 (Info-ZIP Unicode Comment +Extra Field) and 0x7075 (Info-ZIP Unicode Path Extra Field). + +The choice of which storage method to use when writing a ZIP file is left +to the implementation. Developers should expect that a ZIP file may +contain either method and should provide support for reading data in +either format. Use of general purpose bit 11 reduces storage requirements +for file name data by not requiring additional "extra field" data for +each file, but can result in older ZIP programs not being able to extract +files. Use of the 0x6375 and 0x7075 records will result in a ZIP file +that should always be readable by older ZIP programs, but requires more +storage per file to write file name and/or file comment fields. + + + + diff --git a/dotNetZip/BZip2 CF/AssemblyInfo.cs b/dotNetZip/BZip2 CF/AssemblyInfo.cs new file mode 100644 index 0000000..060aa40 Binary files /dev/null and b/dotNetZip/BZip2 CF/AssemblyInfo.cs differ diff --git a/dotNetZip/BZip2 CF/BZip2 CF DLL.csproj b/dotNetZip/BZip2 CF/BZip2 CF DLL.csproj new file mode 100644 index 0000000..83754ab --- /dev/null +++ b/dotNetZip/BZip2 CF/BZip2 CF DLL.csproj @@ -0,0 +1,132 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {18a4aed9-d477-4c57-9c7a-c0cbbd5599de} + Library + Properties + Ionic.BZip2 + Ionic.BZip2.CF + Smartphone + f27da329-3269-4191-98e0-c87d3d7f1db9 + 5.2 + Ionic.BZip2.CF + v2.0 + Windows Mobile 6 Standard SDK + true + ..\Ionic.snk + + + SAK + SAK + SAK + SAK + + + 4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;Smartphone; NETCF; NETCF20;BZIP + true + true + prompt + 512 + 4 + Off + bin\Debug\Ionic.BZip2.CF.XML + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE;Smartphone; NETCF; NETCF20;BZIP + true + true + prompt + 512 + 4 + Off + AllRules.ruleset + + + + + + + + CRC32.cs + + + + + SolutionInfo.cs + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/BZip2 SL DLL/BZip2 SL DLL.csproj b/dotNetZip/BZip2 SL DLL/BZip2 SL DLL.csproj new file mode 100644 index 0000000..3901935 --- /dev/null +++ b/dotNetZip/BZip2 SL DLL/BZip2 SL DLL.csproj @@ -0,0 +1,134 @@ + + + + v3.5 + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {50e11f2c-9d49-45f5-a52d-560be456cc04} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Ionic.BZip2 + Ionic.BZip2 + v3.0 + false + true + true + SAK + SAK + SAK + SAK + true + ..\Ionic.snk + Silverlight + $(TargetFrameworkVersion) + + + 4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + Bin\Debug\Ionic.BZip2.XML + AllRules.ruleset + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + + + CRC32.cs + + + + Properties\SolutionInfo.cs + + + + + Ionic.snk + + + + + NOTICE.txt + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/BZip2 SL DLL/Properties/AssemblyInfo.cs b/dotNetZip/BZip2 SL DLL/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..00a3c3f --- /dev/null +++ b/dotNetZip/BZip2 SL DLL/Properties/AssemblyInfo.cs @@ -0,0 +1,21 @@ +using System.Reflection; +using System.Security; +using System.Runtime.CompilerServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("Ionic's Managed BZip2 for Silverlight")] + +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +[assembly: AssemblyDescription("library for BZip2 compression. http://DotNetZip.codeplex.com/ (Flavor=Debug)")] +#else +[assembly: AssemblyConfiguration("Retail")] +[assembly: AssemblyDescription("library for BZip2 compression. http://DotNetZip.codeplex.com/ (Flavor=Retail)")] +#endif + + +[assembly: System.CLSCompliant(true)] + diff --git a/dotNetZip/BZip2 Tests/BZip2UnitTest1.cs b/dotNetZip/BZip2 Tests/BZip2UnitTest1.cs new file mode 100644 index 0000000..23d99bc --- /dev/null +++ b/dotNetZip/BZip2 Tests/BZip2UnitTest1.cs @@ -0,0 +1,680 @@ +using System; +using System.Linq; +using System.Text; +using System.Collections.Generic; +using Ionic.BZip2; + +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.IO; + +namespace Ionic.BZip2.Tests +{ + /// + /// Summary description for UnitTest1 + /// + [TestClass] + public class UnitTest1 + { + private System.Random rnd; + + public UnitTest1() + { + this.rnd = new System.Random(); + FilesToRemove = new System.Collections.Generic.List(); + } + + static UnitTest1() + { + string lorem = TestStrings["LoremIpsum"]; + LoremIpsumWords = lorem.Split(" ".ToCharArray(), + System.StringSplitOptions.RemoveEmptyEntries); + } + + + private TestContext testContextInstance; + + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + public TestContext TestContext + { + get + { + return testContextInstance; + } + set + { + testContextInstance = value; + } + } + + #region Additional test attributes + // + // You can use the following additional attributes as you write your tests: + // + // Use ClassInitialize to run code before running the first test in the class + // [ClassInitialize()] + // public static void MyClassInitialize(TestContext testContext) { } + // + // Use ClassCleanup to run code after all tests in a class have run + // [ClassCleanup()] + // public static void MyClassCleanup() { } + // + // Use TestInitialize to run code before running each test + // [TestInitialize()] + // public void MyTestInitialize() { } + // + // Use TestCleanup to run code after each test has run + // [TestCleanup()] + // public void MyTestCleanup() { } + // + + private string CurrentDir = null; + private string TopLevelDir = null; + protected System.Collections.Generic.List FilesToRemove; + + // Use TestInitialize to run code before running each test + [TestInitialize()] + public void MyTestInitialize() + { + CurrentDir = System.IO.Directory.GetCurrentDirectory(); + Assert.AreNotEqual(System.IO.Path.GetFileName(CurrentDir), "Temp", "at start"); + + string parentDir = System.Environment.GetEnvironmentVariable("TEMP"); + + TopLevelDir = System.IO.Path.Combine(parentDir, String.Format("Ionic.ZlibTest-{0}.tmp", System.DateTime.Now.ToString("yyyyMMMdd-HHmmss"))); + System.IO.Directory.CreateDirectory(TopLevelDir); + System.IO.Directory.SetCurrentDirectory(TopLevelDir); + + FilesToRemove.Add(TopLevelDir); + } + + + // Use TestCleanup to run code after each test has run + [TestCleanup()] + public void MyTestCleanup() + { + Assert.AreNotEqual(Path.GetFileName(CurrentDir), "Temp", "at finish"); + Directory.SetCurrentDirectory(CurrentDir); + IOException GotException = null; + int Tries = 0; + do + { + try + { + GotException = null; + foreach (string filename in FilesToRemove) + { + if (Directory.Exists(filename)) + { + // turn off any ReadOnly attributes + ClearReadOnly(filename); + Directory.Delete(filename, true); + } + if (File.Exists(filename)) + { + File.Delete(filename); + } + } + Tries++; + } + catch (IOException ioexc) + { + GotException = ioexc; + // use an backoff interval before retry + System.Threading.Thread.Sleep(200 * Tries); + } + } while ((GotException != null) && (Tries < 4)); + if (GotException != null) throw GotException; + FilesToRemove.Clear(); + } + + + public static void ClearReadOnly(string dirname) + { + // don't traverse reparse points + if ((File.GetAttributes(dirname) & FileAttributes.ReparsePoint) != 0) + return; + + foreach (var d in Directory.GetDirectories(dirname)) + { + ClearReadOnly(d); // recurse + } + + foreach (var f in Directory.GetFiles(dirname)) + { + // clear ReadOnly and System attributes + var a = File.GetAttributes(f); + if ((a & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) + { + a ^= FileAttributes.ReadOnly; + File.SetAttributes(f, a); + } + if ((a & FileAttributes.System) == FileAttributes.System) + { + a ^= FileAttributes.System; + File.SetAttributes(f, a); + } + } + } + + + #endregion + + #region Helpers + private static void CopyStream(System.IO.Stream src, System.IO.Stream dest) + { + byte[] buffer = new byte[4096]; + int n; + while ((n = src.Read(buffer, 0, buffer.Length)) > 0) + { + dest.Write(buffer, 0, n); + } + } + + private static string GetTestDependentDir(string startingPoint, string subdir) + { + var location = startingPoint; + for (int i = 0; i < 3; i++) + location = Path.GetDirectoryName(location); + + location = Path.Combine(location, subdir); + return location; + } + + private static string GetTestBinDir(string startingPoint) + { + return GetTestDependentDir(startingPoint, "BZip2 Tests\\bin\\Debug"); + } + + private string GetContentFile(string fileName) + { + string testBin = GetTestBinDir(CurrentDir); + string path = Path.Combine(testBin, String.Format("Resources\\{0}", fileName)); + Assert.IsTrue(File.Exists(path), "file ({0}) does not exist", path); + return path; + } + + private static Int32 GetCrc(string fname) + { + using (var fs1 = File.OpenRead(fname)) + { + var checker = new Ionic.Crc.CRC32(true); + return checker.GetCrc32(fs1); + } + } + + internal string Exec(string program, string args) + { + return Exec(program, args, true); + } + + internal string Exec(string program, string args, bool waitForExit) + { + return Exec(program, args, waitForExit, true); + } + + internal string Exec(string program, string args, bool waitForExit, bool emitOutput) + { + if (program == null) + throw new ArgumentException("program"); + + if (args == null) + throw new ArgumentException("args"); + + // Microsoft.VisualStudio.TestTools.UnitTesting + this.TestContext.WriteLine("running command: {0} {1}", program, args); + + string output; + int rc = Exec_NoContext(program, args, waitForExit, out output); + + if (rc != 0) + throw new Exception(String.Format("Non-zero RC {0}: {1}", program, output)); + + if (emitOutput) + this.TestContext.WriteLine("output: {0}", output); + else + this.TestContext.WriteLine("A-OK. (output suppressed)"); + + return output; + } + + internal static int Exec_NoContext(string program, string args, bool waitForExit, out string output) + { + System.Diagnostics.Process p = new System.Diagnostics.Process + { + StartInfo = + { + FileName = program, + CreateNoWindow = true, + Arguments = args, + WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, + UseShellExecute = false, + } + + }; + + if (waitForExit) + { + StringBuilder sb = new StringBuilder(); + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardError = true; + // must read at least one of the stderr or stdout asynchronously, + // to avoid deadlock + Action stdErrorRead = (o, e) => + { + if (!String.IsNullOrEmpty(e.Data)) + sb.Append(e.Data); + }; + + p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(stdErrorRead); + p.Start(); + p.BeginErrorReadLine(); + output = p.StandardOutput.ReadToEnd(); + p.WaitForExit(); + if (sb.Length > 0) + output += sb.ToString(); + //output = CleanWzzipOut(output); // just in case + return p.ExitCode; + } + else + { + p.Start(); + } + output = ""; + return 0; + } + + + void CreateAndFillTextFile(string filename, Int64 minimumSize) + { + // fill the file with text data, selecting one word at a time + int L = LoremIpsumWords.Length - 2; + Int64 bytesRemaining = minimumSize; + using (StreamWriter sw = File.CreateText(filename)) + { + do + { + // pick a word at random + int n = this.rnd.Next(L); + int batchLength = LoremIpsumWords[n].Length + + LoremIpsumWords[n+1].Length + + LoremIpsumWords[n+2].Length + 3; + sw.Write(LoremIpsumWords[n]); + sw.Write(" "); + sw.Write(LoremIpsumWords[n+1]); + sw.Write(" "); + sw.Write(LoremIpsumWords[n+2]); + sw.Write(" "); + bytesRemaining -= batchLength; + } while (bytesRemaining > 0); + } + } + + #endregion + + + [TestMethod] + [Timeout(15 * 60*1000)] // 60*1000 = 1min + public void BZ_LargeParallel() + { + string filename = "LargeFile.txt"; + int minSize = 0x6000000 + this.rnd.Next(0x6000000); + TestContext.WriteLine("Creating large file, minimum {0} bytes", minSize); + + CreateAndFillTextFile(filename, minSize); + + Func[] getBzStream = { + new Func( s0 => { + return new Ionic.BZip2.BZip2OutputStream(s0); + }), + new Func( s1 => { + return new Ionic.BZip2.ParallelBZip2OutputStream(s1); + }) + }; + + var ts = new TimeSpan[2]; + for (int k=0; k < 2; k++) + { + var stopwatch = new System.Diagnostics.Stopwatch(); + TestContext.WriteLine("Trial {0}", k); + stopwatch.Start(); + string bzFname = Path.GetFileNameWithoutExtension(filename) + + "." + k + Path.GetExtension(filename) + ".bz2"; + using (Stream input = File.OpenRead(filename), + output = File.Create(bzFname), + compressor = getBzStream[k](output)) + { + CopyStream(input, compressor); + } + stopwatch.Stop(); + ts[k] = stopwatch.Elapsed; + TestContext.WriteLine("Trial complete {0} : {1}", k, ts[k]); + } + + Assert.IsTrue(ts[1][] getBzStream = { + new Func( s0 => { + var decorator = new Ionic.BZip2.BZip2OutputStream(s0, blockSize); + return decorator; + }), + new Func( s1 => { + var decorator = new Ionic.BZip2.ParallelBZip2OutputStream(s1, blockSize); + return decorator; + }) + }; + + int[] blockSizes = { 1,2,3,4,5,6,7,8,9 }; + + for (int k=0; k < getBzStream.Length; k++) + { + for (int m=0; m < blockSizes.Length; m++) + { + blockSize = blockSizes[m]; + var getStream = getBzStream[k]; + var root = Path.GetFileNameWithoutExtension(fname); + var ext = Path.GetExtension(fname); + // compress into bz2 + var bzFname = String.Format("{0}.{1}.blocksize{2}{3}.bz2", + root, + (k==0)?"SingleThread":"MultiThread", + blockSize, ext); + + TestContext.WriteLine("Compress cycle ({0},{1})", k,m); + TestContext.WriteLine("file {0}", bzFname); + using (var fs = File.OpenRead(fname)) + { + using (var output = File.Create(bzFname)) + { + using (var compressor = getStream(output)) + { + CopyStream(fs, compressor); + } + } + } + + TestContext.WriteLine("Decompress"); + var decompressedFname = Path.GetFileNameWithoutExtension(bzFname); + using (Stream fs = File.OpenRead(bzFname), + output = File.Create(decompressedFname), + decompressor = new Ionic.BZip2.BZip2InputStream(fs)) + { + CopyStream(decompressor, output); + } + + TestContext.WriteLine("Check CRC"); + int crcDecompressed = GetCrc(decompressedFname); + Assert.AreEqual(crcOriginal, crcDecompressed, + "CRC mismatch {0:X8} != {1:X8}", + crcOriginal, crcDecompressed); + TestContext.WriteLine(""); + + // just for the sake of disk space economy: + File.Delete(decompressedFname); + File.Delete(bzFname); + } + } + } + + + [TestMethod] + [ExpectedException(typeof(IOException))] + public void BZ_Error_1() + { + var bzbin = GetTestDependentDir(CurrentDir, "Tools\\BZip2\\bin\\Debug"); + var dnzBzip2exe = Path.Combine(bzbin, "bzip2.exe"); + string decompressedFname = "ThisWillNotWork.txt"; + using (Stream input = File.OpenRead(dnzBzip2exe), + decompressor = new Ionic.BZip2.BZip2InputStream(input), + output = File.Create(decompressedFname)) + CopyStream(decompressor, output); + } + + [TestMethod] + [ExpectedException(typeof(IOException))] + public void BZ_Error_2() + { + string decompressedFname = "ThisWillNotWork.txt"; + using (Stream input = new MemoryStream(), // empty stream + decompressor = new Ionic.BZip2.BZip2InputStream(input), + output = File.Create(decompressedFname)) + CopyStream(decompressor, output); + } + + + [TestMethod] + public void BZ_Utility() + { + var bzbin = GetTestDependentDir(CurrentDir, "Tools\\BZip2\\bin\\Debug"); + var dnzBzip2exe = Path.Combine(bzbin, "bzip2.exe"); + Assert.IsTrue(File.Exists(dnzBzip2exe), "Bzip2.exe is missing {0}", + dnzBzip2exe); + var unxBzip2exe = "\\bin\\bzip2.exe"; + Assert.IsTrue(File.Exists(unxBzip2exe), "Bzip2.exe is missing {0}", + unxBzip2exe); + + foreach (var key in TestStrings.Keys) + { + int count = this.rnd.Next(18) + 4; + TestContext.WriteLine("Doing string {0}", key); + var s = TestStrings[key]; + var fname = String.Format("Pippo-{0}.txt", key); + using (var sw = new StreamWriter(File.Create(fname))) + { + for (int k=0; k < count; k++) + { + sw.WriteLine(s); + } + } + + int crcOriginal = GetCrc(fname); + + string args = fname + " -keep -v"; + TestContext.WriteLine("Exec: bzip2 {0}", args); + string bzout = this.Exec(dnzBzip2exe, args); + + var bzfile = fname + ".bz2"; + Assert.IsTrue(File.Exists(bzfile), "File is missing. {0}", + bzfile); + + File.Delete(fname); + Assert.IsTrue(!File.Exists(fname), "The delete failed. {0}", + fname); + + System.Threading.Thread.Sleep(1200); + + args = "-dfk "+ bzfile; + TestContext.WriteLine("Exec: bzip2 {0}", args); + bzout = this.Exec(unxBzip2exe, args); + Assert.IsTrue(File.Exists(fname), "File is missing. {0}", + fname); + + int crcDecompressed = GetCrc(fname); + Assert.AreEqual(crcOriginal, crcDecompressed, + "CRC mismatch {0:X8}!={1:X8}", + crcOriginal, crcDecompressed); + } + } + + + [TestMethod] + public void BZ_Samples() + { + string testBin = GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + var filesToDecompress = Directory.GetFiles(resourceDir, "*.bz2"); + + Assert.IsTrue(filesToDecompress.Length > 2, + "There are not enough sample files"); + + foreach (var filename in filesToDecompress) + { + TestContext.WriteLine("Decompressing {0}", filename); + var outFname = filename + ".decompressed"; + TestContext.WriteLine("Decompressing to {0}", outFname); + + using (var fs = File.OpenRead(filename)) + { + using (var output = File.Create(outFname)) + { + using (var decompressor = new Ionic.BZip2.BZip2InputStream(fs)) + { + CopyStream(decompressor, output); + } + } + } + TestContext.WriteLine(""); + } + } + + + + + internal static Dictionary TestStrings = new Dictionary() { + {"LetMeDoItNow", "I expect to pass through the world but once. Any good therefore that I can do, or any kindness I can show to any creature, let me do it now. Let me not defer it, for I shall not pass this way again. -- Anonymous, although some have attributed it to Stephen Grellet" }, + + {"UntilHeExtends", "Until he extends the circle of his compassion to all living things, man will not himself find peace. - Albert Schweitzer, early 20th-century German Nobel Peace Prize-winning mission doctor and theologian." }, + + {"WhatWouldThingsHaveBeenLike","'What would things have been like [in Russia] if during periods of mass arrests people had not simply sat there, paling with terror at every bang on the downstairs door and at every step on the staircase, but understood they had nothing to lose and had boldly set up in the downstairs hall an ambush of half a dozen people?' -- Alexander Solzhenitsyn" + }, + + {"GoPlacidly", + @"Go placidly amid the noise and haste, and remember what peace there may be in silence. + +As far as possible, without surrender, be on good terms with all persons. Speak your truth quietly and clearly; and listen to others, even to the dull and the ignorant, they too have their story. Avoid loud and aggressive persons, they are vexations to the spirit. + +If you compare yourself with others, you may become vain and bitter; for always there will be greater and lesser persons than yourself. Enjoy your achievements as well as your plans. Keep interested in your own career, however humble; it is a real possession in the changing fortunes of time. + +Exercise caution in your business affairs, for the world is full of trickery. But let this not blind you to what virtue there is; many persons strive for high ideals, and everywhere life is full of heroism. Be yourself. Especially, do not feign affection. Neither be cynical about love, for in the face of all aridity and disenchantment it is perennial as the grass. + +Take kindly to the counsel of the years, gracefully surrendering the things of youth. Nurture strength of spirit to shield you in sudden misfortune. But do not distress yourself with imaginings. Many fears are born of fatigue and loneliness. + +Beyond a wholesome discipline, be gentle with yourself. You are a child of the universe, no less than the trees and the stars; you have a right to be here. And whether or not it is clear to you, no doubt the universe is unfolding as it should. + +Therefore be at peace with God, whatever you conceive Him to be, and whatever your labors and aspirations, in the noisy confusion of life, keep peace in your soul. + +With all its sham, drudgery and broken dreams, it is still a beautiful world. + +Be cheerful. Strive to be happy. + +Max Ehrmann c.1920 +"}, + + {"IhaveaDream", @"Let us not wallow in the valley of despair, I say to you today, my friends. + +And so even though we face the difficulties of today and tomorrow, I still have a dream. It is a dream deeply rooted in the American dream. + +I have a dream that one day this nation will rise up and live out the true meaning of its creed: 'We hold these truths to be self-evident, that all men are created equal.' + +I have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood. + +I have a dream that one day even the state of Mississippi, a state sweltering with the heat of injustice, sweltering with the heat of oppression, will be transformed into an oasis of freedom and justice. + +I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character. + +I have a dream today! + +I have a dream that one day, down in Alabama, with its vicious racists, with its governor having his lips dripping with the words of 'interposition' and 'nullification' -- one day right there in Alabama little black boys and black girls will be able to join hands with little white boys and white girls as sisters and brothers. + +I have a dream today! + +I have a dream that one day every valley shall be exalted, and every hill and mountain shall be made low, the rough places will be made plain, and the crooked places will be made straight; 'and the glory of the Lord shall be revealed and all flesh shall see it together.'2 +"}, + + { "LoremIpsum", +"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer " + +"vulputate, nibh non rhoncus euismod, erat odio pellentesque lacus, sit " + +"amet convallis mi augue et odio. Phasellus cursus urna facilisis " + +"quam. Suspendisse nec metus et sapien scelerisque euismod. Nullam " + +"molestie sem quis nisl. Fusce pellentesque, ante sed semper egestas, sem " + +"nulla vestibulum nulla, quis sollicitudin leo lorem elementum " + +"wisi. Aliquam vestibulum nonummy orci. Sed in dolor sed enim ullamcorper " + +"accumsan. Duis vel nibh. Class aptent taciti sociosqu ad litora torquent " + +"per conubia nostra, per inceptos hymenaeos. Sed faucibus, enim sit amet " + +"venenatis laoreet, nisl elit posuere est, ut sollicitudin tortor velit " + +"ut ipsum. Aliquam erat volutpat. Phasellus tincidunt vehicula " + +"eros. Curabitur vitae erat. " + +"\n " + +"Quisque pharetra lacus quis sapien. Duis id est non wisi sagittis " + +"adipiscing. Nulla facilisi. Etiam quam erat, lobortis eu, facilisis nec, " + +"blandit hendrerit, metus. Fusce hendrerit. Nunc magna libero, " + +"sollicitudin non, vulputate non, ornare id, nulla. Suspendisse " + +"potenti. Nullam in mauris. Curabitur et nisl vel purus vehicula " + +"sodales. Class aptent taciti sociosqu ad litora torquent per conubia " + +"nostra, per inceptos hymenaeos. Cum sociis natoque penatibus et magnis " + +"dis parturient montes, nascetur ridiculus mus. Donec semper, arcu nec " + +"dignissim porta, eros odio tempus pede, et laoreet nibh arcu et " + +"nisl. Morbi pellentesque eleifend ante. Morbi dictum lorem non " + +"ante. Nullam et augue sit amet sapien varius mollis. " + +"\n " + +"Nulla erat lorem, fringilla eget, ultrices nec, dictum sed, " + +"sapien. Aliquam libero ligula, porttitor scelerisque, lobortis nec, " + +"dignissim eu, elit. Etiam feugiat, dui vitae laoreet faucibus, tellus " + +"urna molestie purus, sit amet pretium lorem pede in erat. Ut non libero " + +"et sapien porttitor eleifend. Vestibulum ante ipsum primis in faucibus " + +"orci luctus et ultrices posuere cubilia Curae; In at lorem et lacus " + +"feugiat iaculis. Nunc tempus eros nec arcu tristique egestas. Quisque " + +"metus arcu, pretium in, suscipit dictum, bibendum sit amet, " + +"mauris. Aliquam non urna. Suspendisse eget diam. Aliquam erat " + +"volutpat. In euismod aliquam lorem. Mauris dolor nisl, consectetuer sit " + +"amet, suscipit sodales, rutrum in, lorem. Nunc nec nisl. Nulla ante " + +"libero, aliquam porttitor, aliquet at, imperdiet sed, diam. Pellentesque " + +"tincidunt nisl et ipsum. Suspendisse purus urna, semper quis, laoreet " + +"in, vestibulum vel, arcu. Nunc elementum eros nec mauris. " + +"\n " + +"Vivamus congue pede at quam. Aliquam aliquam leo vel turpis. Ut " + +"commodo. Integer tincidunt sem a risus. Cras aliquam libero quis " + +"arcu. Integer posuere. Nulla malesuada, wisi ac elementum sollicitudin, " + +"libero libero molestie velit, eu faucibus est ante eu libero. Sed " + +"vestibulum, dolor ac ultricies consectetuer, tellus risus interdum diam, " + +"a imperdiet nibh eros eget mauris. Donec faucibus volutpat " + +"augue. Phasellus vitae arcu quis ipsum ultrices fermentum. Vivamus " + +"ultricies porta ligula. Nullam malesuada. Ut feugiat urna non " + +"turpis. Vivamus ipsum. Vivamus eleifend condimentum risus. Curabitur " + +"pede. Maecenas suscipit pretium tortor. Integer pellentesque. " + +"\n " + +"Mauris est. Aenean accumsan purus vitae ligula. Lorem ipsum dolor sit " + +"amet, consectetuer adipiscing elit. Nullam at mauris id turpis placerat " + +"accumsan. Sed pharetra metus ut ante. Aenean vel urna sit amet ante " + +"pretium dapibus. Sed nulla. Sed nonummy, lacus a suscipit semper, erat " + +"wisi convallis mi, et accumsan magna elit laoreet sem. Nam leo est, " + +"cursus ut, molestie ac, laoreet id, mauris. Suspendisse auctor nibh. " + + "\n"} + }; + + static string[] LoremIpsumWords; + + private const int WORKING_BUFFER_SIZE = 0x4000; + + } + + + +} diff --git a/dotNetZip/BZip2 Tests/Bzip2 Tests.csproj b/dotNetZip/BZip2 Tests/Bzip2 Tests.csproj new file mode 100644 index 0000000..17f53bf --- /dev/null +++ b/dotNetZip/BZip2 Tests/Bzip2 Tests.csproj @@ -0,0 +1,121 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF} + Library + Properties + BZip2Test + BZip2Test + v4.0 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + Properties\SolutionInfo.cs + + + + + Always + + + Always + + + Always + + + + + {e2ce0d56-7af8-4404-bd0c-bc562cbd74d4} + BZip2 DLL + + + {c2241050-f23c-420b-aa67-60e94b34c2b2} + BZip2 + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/BZip2 Tests/Properties/AssemblyInfo.cs b/dotNetZip/BZip2 Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bbc2cba Binary files /dev/null and b/dotNetZip/BZip2 Tests/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/BZip2 Tests/Resources/dancing-color.ps.bz2 b/dotNetZip/BZip2 Tests/Resources/dancing-color.ps.bz2 new file mode 100644 index 0000000..15c6061 Binary files /dev/null and b/dotNetZip/BZip2 Tests/Resources/dancing-color.ps.bz2 differ diff --git a/dotNetZip/BZip2 Tests/Resources/sample1.bz2 b/dotNetZip/BZip2 Tests/Resources/sample1.bz2 new file mode 100644 index 0000000..18dea60 Binary files /dev/null and b/dotNetZip/BZip2 Tests/Resources/sample1.bz2 differ diff --git a/dotNetZip/BZip2 Tests/Resources/sample2.bz2 b/dotNetZip/BZip2 Tests/Resources/sample2.bz2 new file mode 100644 index 0000000..d5a6160 Binary files /dev/null and b/dotNetZip/BZip2 Tests/Resources/sample2.bz2 differ diff --git a/dotNetZip/BZip2/BZip2 DLL.csproj b/dotNetZip/BZip2/BZip2 DLL.csproj new file mode 100644 index 0000000..79372c8 --- /dev/null +++ b/dotNetZip/BZip2/BZip2 DLL.csproj @@ -0,0 +1,161 @@ + + + + Local + 2.0 + Debug + AnyCPU + + + + + Ionic.BZip2 + ..\Ionic.snk + JScript + Grid + IE50 + false + Library + Ionic.BZip2 + false + OnBuildSuccess + + + + + 3.5 + + + {e2ce0d56-7af8-4404-bd0c-bc562cbd74d4} + false + true + SAK + SAK + SAK + SAK + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + bin\Debug\ + false + 285212672 + false + + + + + bin\Debug\Ionic.BZip2.XML + true + 4096 + false + + + false + false + false + 4 + full + prompt + AllRules.ruleset + + + bin\Release\ + false + 285212672 + false + + + + + + + true + 4096 + false + + + false + false + false + 4 + full + prompt + AllRules.ruleset + + + + mscorlib + + + System + + + + + + + + + + + + CRC32.cs + + + SolutionInfo.cs + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/BZip2/BZip2Compressor.cs b/dotNetZip/BZip2/BZip2Compressor.cs new file mode 100644 index 0000000..b09b16b --- /dev/null +++ b/dotNetZip/BZip2/BZip2Compressor.cs @@ -0,0 +1,1920 @@ +// BZip2Compressor.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-28 06:17:22> +// +// ------------------------------------------------------------------ +// +// This module defines the BZip2Compressor class, which is a +// BZIP2-compressing encoder. It is used internally in the BZIP2 +// library, by the BZip2OutputStream class and its parallel variant, +// ParallelBZip2OutputStream. This code was originally based on Apache +// commons source code, and significantly modified. The license below +// applies to the original Apache code and to this modified variant. +// +// ------------------------------------------------------------------ + + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * This package is based on the work done by Keiron Liddle, Aftex Software + * to whom the Ant project is very grateful for his + * great code. + */ + + +// +// Design notes: +// +// This class performs BZip2 compression. It is derived from the +// BZip2OutputStream from the Apache commons source code, but is +// significantly modified from that code. While the Apache class is a +// stream that compresses, this particular class simply performs +// compression. It follows a Manager pattern. It manages an internal +// buffer for uncompressed data; callers place data into the buffer +// using the Fill() method. This class then compresses the data and +// writes the compressed form out, via the CompressAndWrite() method. +// Because BZip2 uses byte-shredding, this class relies on a BitWriter, +// and not a .NET Stream, to emit its output. (*Think of the BitWriter +// class as an Adapter that enables Bit-oriented output to a standard +// byte-oriented .NET stream.) +// +// This class exists to support the two distinct output streams that +// perform BZip2 compression: BZip2OutputStream and +// ParallelBZip2OutputStream. These streams rely on BZip2Compressor to +// provide the encoder/compression logic. This code has been derived +// from the bzip2 output stream in the Apache commons library; it has +// been significantly modified from that form, in order to provide a +// single compressor that could support both types of streams. +// +// In a bz2 file or stream, there is never any bit padding except for 0..7 +// bits in the final byte in the file. Successive compressed blocks in a +// .bz2 file are not byte-aligned. +// +// + +using System; +using System.IO; + +// flymake: csc.exe /t:module BZip2InputStream.cs BZip2OutputStream.cs Rand.cs BCRC32.cs @@FILE@@ + +namespace Ionic.BZip2 +{ + internal class BZip2Compressor + { + private int blockSize100k; // 0...9 + private int currentByte = -1; + private int runLength = 0; + private int last; // index into the block of the last char processed + private int outBlockFillThreshold; + private CompressionState cstate; + private readonly Ionic.Crc.CRC32 crc = new Ionic.Crc.CRC32(true); + BitWriter bw; + int runs; + + /* + * The following three vars are used when sorting. If too many long + * comparisons happen, we stop sorting, randomise the block slightly, and + * try again. I think this wrinkle in the implementation was removed from + * a later rev of the C-language bzip, not sure. -DPC 24 Jul 2011 + * + */ + private int workDone; + private int workLimit; + private bool firstAttempt; + private bool blockRandomised; + private int origPtr; + + private int nInUse; + private int nMTF; + + private static readonly int SETMASK = (1 << 21); + private static readonly int CLEARMASK = (~SETMASK); + private static readonly byte GREATER_ICOST = 15; + private static readonly byte LESSER_ICOST = 0; + private static readonly int SMALL_THRESH = 20; + private static readonly int DEPTH_THRESH = 10; + private static readonly int WORK_FACTOR = 30; + + /** + * Knuth's increments seem to work better than Incerpi-Sedgewick here. + * Possibly because the number of elems to sort is usually small, typically + * <= 20. + */ + private static readonly int[] increments = { 1, 4, 13, 40, 121, 364, 1093, 3280, + 9841, 29524, 88573, 265720, 797161, + 2391484 }; + + /// + /// BZip2Compressor writes its compressed data out via a BitWriter. This + /// is necessary because BZip2 does byte shredding. + /// + public BZip2Compressor(BitWriter writer) + : this(writer, BZip2.MaxBlockSize) + { + } + + public BZip2Compressor(BitWriter writer, int blockSize) + { + this.blockSize100k = blockSize; + this.bw = writer; + + // 20 provides a margin of slop (not to say "Safety"). The maximum + // size of an encoded run in the output block is 5 bytes, so really, 5 + // bytes ought to do, but this is a margin of slop found in the + // original bzip code. Not sure if important for decoding + // (decompressing). So we'll leave the slop. + this.outBlockFillThreshold = (blockSize * BZip2.BlockSizeMultiple) - 20; + this.cstate = new CompressionState(blockSize); + Reset(); + } + + + void Reset() + { + // initBlock(); + this.crc.Reset(); + this.currentByte = -1; + this.runLength = 0; + this.last = -1; + for (int i = 256; --i >= 0;) + this.cstate.inUse[i] = false; + //bw.Reset(); xxx? want this? no no no + } + + + public int BlockSize + { + get { return this.blockSize100k; } + } + + public uint Crc32 + { + get; private set; + } + + public int AvailableBytesOut + { + get; private set; + } + + /// + /// The number of uncompressed bytes being held in the buffer. + /// + /// + /// + /// I am thinking this may be useful in a Stream that uses this + /// compressor class. In the Close() method on the stream it could + /// check this value to see if anything has been written at all. You + /// may think the stream could easily track the number of bytes it + /// wrote, which would eliminate the need for this. But, there is the + /// case where the stream writes a complete block, and it is full, and + /// then writes no more. In that case the stream may want to check. + /// + /// + public int UncompressedBytes + { + get { return this.last + 1; } + } + + + /// + /// Accept new bytes into the compressor data buffer + /// + /// + /// + /// This method does the first-level (cheap) run-length encoding, and + /// stores the encoded data into the rle block. + /// + /// + public int Fill(byte[] buffer, int offset, int count) + { + if (this.last >= this.outBlockFillThreshold) + return 0; // We're full, I tell you! + + int bytesWritten = 0; + int limit = offset + count; + int rc; + + // do run-length-encoding until block is full + do + { + rc = write0(buffer[offset++]); + if (rc > 0) bytesWritten++; + } while (offset < limit && rc == 1); + + return bytesWritten; + } + + + + /// + /// Process one input byte into the block. + /// + /// + /// + /// + /// To "process" the byte means to do the run-length encoding. + /// There are 3 possible return values: + /// + /// 0 - the byte was not written, in other words, not + /// encoded into the block. This happens when the + /// byte b would require the start of a new run, and + /// the block has no more room for new runs. + /// + /// 1 - the byte was written, and the block is not full. + /// + /// 2 - the byte was written, and the block is full. + /// + /// + /// + /// 0 if the byte was not written, non-zero if written. + private int write0(byte b) + { + bool rc; + // there is no current run in progress + if (this.currentByte == -1) + { + this.currentByte = b; + this.runLength++; + return 1; + } + + // this byte is the same as the current run in progress + if (this.currentByte == b) + { + if (++this.runLength > 254) + { + rc = AddRunToOutputBlock(false); + this.currentByte = -1; + this.runLength = 0; + return (rc) ? 2 : 1; + } + return 1; // not full + } + + // This byte requires a new run. + // Put the prior run into the Run-length-encoded block, + // and try to start a new run. + rc = AddRunToOutputBlock(false); + + if (rc) + { + this.currentByte = -1; + this.runLength = 0; + // returning 0 implies the block is full, and the byte was not written. + return 0; + } + + // start a new run + this.runLength = 1; + this.currentByte = b; + return 1; + } + + /// + /// Append one run to the output block. + /// + /// + /// + /// + /// This compressor does run-length-encoding before BWT and etc. This + /// method simply appends a run to the output block. The append always + /// succeeds. The return value indicates whether the block is full: + /// false (not full) implies that at least one additional run could be + /// processed. + /// + /// + /// true if the block is now full; otherwise false. + private bool AddRunToOutputBlock(bool final) + { + runs++; + /* add_pair_to_block ( EState* s ) */ + int previousLast = this.last; + + // sanity check only - because of the check done at the + // bottom of this method, and the logic in write0(), this + // should never ever happen. + if (previousLast >= this.outBlockFillThreshold && !final) + { + var msg = String.Format("block overrun(final={2}): {0} >= threshold ({1})", + previousLast, this.outBlockFillThreshold, final); + throw new Exception(msg); + } + + // NB: the index used here into block is always (last+2). This is + // because last is -1 based - the initial value is -1, a flag value + // used to indicate that nothing has yet been written into the + // block. The endBlock() fn tests for -1 to detect empty blocks. Also, + // the first byte of block is used, during sorting, to hold block[last + // +1], which is the final byte value that had been written into the + // rle block. For those two reasons, the base offset from last is + // always +2. + + byte b = (byte) this.currentByte; + byte[] block = this.cstate.block; + this.cstate.inUse[b] = true; + int rl = this.runLength; + this.crc.UpdateCRC(b, rl); + + switch (rl) + { + case 1: + block[previousLast + 2] = b; + this.last = previousLast + 1; + break; + + case 2: + block[previousLast + 2] = b; + block[previousLast + 3] = b; + this.last = previousLast + 2; + break; + + case 3: + block[previousLast + 2] = b; + block[previousLast + 3] = b; + block[previousLast + 4] = b; + this.last = previousLast + 3; + break; + + default: + rl -= 4; + this.cstate.inUse[rl] = true; + block[previousLast + 2] = b; + block[previousLast + 3] = b; + block[previousLast + 4] = b; + block[previousLast + 5] = b; + block[previousLast + 6] = (byte) rl; + this.last = previousLast + 5; + break; + } + + // is full? + return (this.last >= this.outBlockFillThreshold); + } + + + /// + /// Compress the data that has been placed (Run-length-encoded) into the + /// block. The compressed data goes into the CompressedBytes array. + /// + /// + /// + /// Side effects: 1. fills the CompressedBytes array. 2. sets the + /// AvailableBytesOut property. + /// + /// + public void CompressAndWrite() // endBlock + { + if (this.runLength > 0) + AddRunToOutputBlock(true); + + this.currentByte = -1; + + // Console.WriteLine(" BZip2Compressor:CompressAndWrite (r={0} bcrc={1:X8})", + // runs, this.crc.Crc32Result); + + // has any data been written? + if (this.last == -1) + return; // no data; nothing to compress + + /* sort the block and establish posn of original string */ + blockSort(); + + /* + * A 6-byte block header, the value chosen arbitrarily as 0x314159265359 + * :-). A 32 bit value does not really give a strong enough guarantee + * that the value will not appear by chance in the compressed + * datastream. Worst-case probability of this event, for a 900k block, + * is about 2.0e-3 for 32 bits, 1.0e-5 for 40 bits and 4.0e-8 for 48 + * bits. For a compressed file of size 100Gb -- about 100000 blocks -- + * only a 48-bit marker will do. NB: normal compression/ decompression + * donot rely on these statistical properties. They are only important + * when trying to recover blocks from damaged files. + */ + this.bw.WriteByte(0x31); + this.bw.WriteByte(0x41); + this.bw.WriteByte(0x59); + this.bw.WriteByte(0x26); + this.bw.WriteByte(0x53); + this.bw.WriteByte(0x59); + + this.Crc32 = (uint) this.crc.Crc32Result; + this.bw.WriteInt(this.Crc32); + + /* Now a single bit indicating randomisation. */ + this.bw.WriteBits(1, (this.blockRandomised)?1U:0U); + + /* Finally, block's contents proper. */ + moveToFrontCodeAndSend(); + + Reset(); + } + + + private void randomiseBlock() + { + bool[] inUse = this.cstate.inUse; + byte[] block = this.cstate.block; + int lastShadow = this.last; + + for (int i = 256; --i >= 0;) + inUse[i] = false; + + int rNToGo = 0; + int rTPos = 0; + for (int i = 0, j = 1; i <= lastShadow; i = j, j++) + { + if (rNToGo == 0) + { + rNToGo = (char) Rand.Rnums(rTPos); + if (++rTPos == 512) + { + rTPos = 0; + } + } + + rNToGo--; + block[j] ^= (byte) ((rNToGo == 1) ? 1 : 0); + + // handle 16 bit signed numbers + inUse[block[j] & 0xff] = true; + } + + this.blockRandomised = true; + } + + private void mainSort() + { + CompressionState dataShadow = this.cstate; + int[] runningOrder = dataShadow.mainSort_runningOrder; + int[] copy = dataShadow.mainSort_copy; + bool[] bigDone = dataShadow.mainSort_bigDone; + int[] ftab = dataShadow.ftab; + byte[] block = dataShadow.block; + int[] fmap = dataShadow.fmap; + char[] quadrant = dataShadow.quadrant; + int lastShadow = this.last; + int workLimitShadow = this.workLimit; + bool firstAttemptShadow = this.firstAttempt; + + // Set up the 2-byte frequency table + for (int i = 65537; --i >= 0;) + { + ftab[i] = 0; + } + + /* + * In the various block-sized structures, live data runs from 0 to + * last+NUM_OVERSHOOT_BYTES inclusive. First, set up the overshoot area + * for block. + */ + for (int i = 0; i < BZip2.NUM_OVERSHOOT_BYTES; i++) + { + block[lastShadow + i + 2] = block[(i % (lastShadow + 1)) + 1]; + } + for (int i = lastShadow + BZip2.NUM_OVERSHOOT_BYTES +1; --i >= 0;) + { + quadrant[i] = '\0'; + } + block[0] = block[lastShadow + 1]; + + // Complete the initial radix sort: + + int c1 = block[0] & 0xff; + for (int i = 0; i <= lastShadow; i++) + { + int c2 = block[i + 1] & 0xff; + ftab[(c1 << 8) + c2]++; + c1 = c2; + } + + for (int i = 1; i <= 65536; i++) + ftab[i] += ftab[i - 1]; + + c1 = block[1] & 0xff; + for (int i = 0; i < lastShadow; i++) + { + int c2 = block[i + 2] & 0xff; + fmap[--ftab[(c1 << 8) + c2]] = i; + c1 = c2; + } + + fmap[--ftab[((block[lastShadow + 1] & 0xff) << 8) + (block[1] & 0xff)]] = lastShadow; + + /* + * Now ftab contains the first loc of every small bucket. Calculate the + * running order, from smallest to largest big bucket. + */ + for (int i = 256; --i >= 0;) + { + bigDone[i] = false; + runningOrder[i] = i; + } + + for (int h = 364; h != 1;) + { + h /= 3; + for (int i = h; i <= 255; i++) + { + int vv = runningOrder[i]; + int a = ftab[(vv + 1) << 8] - ftab[vv << 8]; + int b = h - 1; + int j = i; + for (int ro = runningOrder[j - h]; (ftab[(ro + 1) << 8] - ftab[ro << 8]) > a; ro = runningOrder[j + - h]) + { + runningOrder[j] = ro; + j -= h; + if (j <= b) + { + break; + } + } + runningOrder[j] = vv; + } + } + + /* + * The main sorting loop. + */ + for (int i = 0; i <= 255; i++) + { + /* + * Process big buckets, starting with the least full. + */ + int ss = runningOrder[i]; + + // Step 1: + /* + * Complete the big bucket [ss] by quicksorting any unsorted small + * buckets [ss, j]. Hopefully previous pointer-scanning phases have + * already completed many of the small buckets [ss, j], so we don't + * have to sort them at all. + */ + for (int j = 0; j <= 255; j++) + { + int sb = (ss << 8) + j; + int ftab_sb = ftab[sb]; + if ((ftab_sb & SETMASK) != SETMASK) + { + int lo = ftab_sb & CLEARMASK; + int hi = (ftab[sb + 1] & CLEARMASK) - 1; + if (hi > lo) + { + mainQSort3(dataShadow, lo, hi, 2); + if (firstAttemptShadow + && (this.workDone > workLimitShadow)) + { + return; + } + } + ftab[sb] = ftab_sb | SETMASK; + } + } + + // Step 2: + // Now scan this big bucket so as to synthesise the + // sorted order for small buckets [t, ss] for all t != ss. + + for (int j = 0; j <= 255; j++) + { + copy[j] = ftab[(j << 8) + ss] & CLEARMASK; + } + + for (int j = ftab[ss << 8] & CLEARMASK, hj = (ftab[(ss + 1) << 8] & CLEARMASK); j < hj; j++) + { + int fmap_j = fmap[j]; + c1 = block[fmap_j] & 0xff; + if (!bigDone[c1]) + { + fmap[copy[c1]] = (fmap_j == 0) ? lastShadow : (fmap_j - 1); + copy[c1]++; + } + } + + for (int j = 256; --j >= 0;) + ftab[(j << 8) + ss] |= SETMASK; + + // Step 3: + /* + * The ss big bucket is now done. Record this fact, and update the + * quadrant descriptors. Remember to update quadrants in the + * overshoot area too, if necessary. The "if (i < 255)" test merely + * skips this updating for the last bucket processed, since updating + * for the last bucket is pointless. + */ + bigDone[ss] = true; + + if (i < 255) + { + int bbStart = ftab[ss << 8] & CLEARMASK; + int bbSize = (ftab[(ss + 1) << 8] & CLEARMASK) - bbStart; + int shifts = 0; + + while ((bbSize >> shifts) > 65534) + { + shifts++; + } + + for (int j = 0; j < bbSize; j++) + { + int a2update = fmap[bbStart + j]; + char qVal = (char) (j >> shifts); + quadrant[a2update] = qVal; + if (a2update < BZip2.NUM_OVERSHOOT_BYTES) + { + quadrant[a2update + lastShadow + 1] = qVal; + } + } + } + + } + } + + + private void blockSort() + { + this.workLimit = WORK_FACTOR * this.last; + this.workDone = 0; + this.blockRandomised = false; + this.firstAttempt = true; + mainSort(); + + if (this.firstAttempt && (this.workDone > this.workLimit)) + { + randomiseBlock(); + this.workLimit = this.workDone = 0; + this.firstAttempt = false; + mainSort(); + } + + int[] fmap = this.cstate.fmap; + this.origPtr = -1; + for (int i = 0, lastShadow = this.last; i <= lastShadow; i++) + { + if (fmap[i] == 0) + { + this.origPtr = i; + break; + } + } + + // assert (this.origPtr != -1) : this.origPtr; + } + + + /** + * This is the most hammered method of this class. + * + *

+ * This is the version using unrolled loops. + *

+ */ + private bool mainSimpleSort(CompressionState dataShadow, int lo, + int hi, int d) + { + int bigN = hi - lo + 1; + if (bigN < 2) + { + return this.firstAttempt && (this.workDone > this.workLimit); + } + + int hp = 0; + while (increments[hp] < bigN) + hp++; + + int[] fmap = dataShadow.fmap; + char[] quadrant = dataShadow.quadrant; + byte[] block = dataShadow.block; + int lastShadow = this.last; + int lastPlus1 = lastShadow + 1; + bool firstAttemptShadow = this.firstAttempt; + int workLimitShadow = this.workLimit; + int workDoneShadow = this.workDone; + + // Following block contains unrolled code which could be shortened by + // coding it in additional loops. + + // HP: + while (--hp >= 0) + { + int h = increments[hp]; + int mj = lo + h - 1; + + for (int i = lo + h; i <= hi;) + { + // copy + for (int k = 3; (i <= hi) && (--k >= 0); i++) + { + int v = fmap[i]; + int vd = v + d; + int j = i; + + // for (int a; + // (j > mj) && mainGtU((a = fmap[j - h]) + d, vd, + // block, quadrant, lastShadow); + // j -= h) { + // fmap[j] = a; + // } + // + // unrolled version: + + // start inline mainGTU + bool onceRunned = false; + int a = 0; + + HAMMER: while (true) + { + if (onceRunned) + { + fmap[j] = a; + if ((j -= h) <= mj) + { + goto END_HAMMER; + } + } + else { + onceRunned = true; + } + + a = fmap[j - h]; + int i1 = a + d; + int i2 = vd; + + // following could be done in a loop, but + // unrolled it for performance: + if (block[i1 + 1] == block[i2 + 1]) + { + if (block[i1 + 2] == block[i2 + 2]) + { + if (block[i1 + 3] == block[i2 + 3]) + { + if (block[i1 + 4] == block[i2 + 4]) + { + if (block[i1 + 5] == block[i2 + 5]) + { + if (block[(i1 += 6)] == block[(i2 += 6)]) + { + int x = lastShadow; + X: while (x > 0) + { + x -= 4; + + if (block[i1 + 1] == block[i2 + 1]) + { + if (quadrant[i1] == quadrant[i2]) + { + if (block[i1 + 2] == block[i2 + 2]) + { + if (quadrant[i1 + 1] == quadrant[i2 + 1]) + { + if (block[i1 + 3] == block[i2 + 3]) + { + if (quadrant[i1 + 2] == quadrant[i2 + 2]) + { + if (block[i1 + 4] == block[i2 + 4]) + { + if (quadrant[i1 + 3] == quadrant[i2 + 3]) + { + if ((i1 += 4) >= lastPlus1) + { + i1 -= lastPlus1; + } + if ((i2 += 4) >= lastPlus1) + { + i2 -= lastPlus1; + } + workDoneShadow++; + goto X; + } + else if ((quadrant[i1 + 3] > quadrant[i2 + 3])) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 4] & 0xff) > (block[i2 + 4] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((quadrant[i1 + 2] > quadrant[i2 + 2])) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 3] & 0xff) > (block[i2 + 3] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((quadrant[i1 + 1] > quadrant[i2 + 1])) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 2] & 0xff) > (block[i2 + 2] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((quadrant[i1] > quadrant[i2])) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 1] & 0xff) > (block[i2 + 1] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + + } + goto END_HAMMER; + } // while x > 0 + else { + if ((block[i1] & 0xff) > (block[i2] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + } + else if ((block[i1 + 5] & 0xff) > (block[i2 + 5] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 4] & 0xff) > (block[i2 + 4] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 3] & 0xff) > (block[i2 + 3] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 2] & 0xff) > (block[i2 + 2] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + } + else if ((block[i1 + 1] & 0xff) > (block[i2 + 1] & 0xff)) + { + goto HAMMER; + } + else { + goto END_HAMMER; + } + + } // HAMMER + + END_HAMMER: + // end inline mainGTU + + fmap[j] = v; + } + + if (firstAttemptShadow && (i <= hi) + && (workDoneShadow > workLimitShadow)) + { + goto END_HP; + } + } + } + END_HP: + + this.workDone = workDoneShadow; + return firstAttemptShadow && (workDoneShadow > workLimitShadow); + } + + + + private static void vswap(int[] fmap, int p1, int p2, int n) + { + n += p1; + while (p1 < n) + { + int t = fmap[p1]; + fmap[p1++] = fmap[p2]; + fmap[p2++] = t; + } + } + + private static byte med3(byte a, byte b, byte c) + { + return (a < b) ? (b < c ? b : a < c ? c : a) : (b > c ? b : a > c ? c + : a); + } + + + /** + * Method "mainQSort3", file "blocksort.c", BZip2 1.0.2 + */ + private void mainQSort3(CompressionState dataShadow, int loSt, + int hiSt, int dSt) + { + int[] stack_ll = dataShadow.stack_ll; + int[] stack_hh = dataShadow.stack_hh; + int[] stack_dd = dataShadow.stack_dd; + int[] fmap = dataShadow.fmap; + byte[] block = dataShadow.block; + + stack_ll[0] = loSt; + stack_hh[0] = hiSt; + stack_dd[0] = dSt; + + for (int sp = 1; --sp >= 0;) + { + int lo = stack_ll[sp]; + int hi = stack_hh[sp]; + int d = stack_dd[sp]; + + if ((hi - lo < SMALL_THRESH) || (d > DEPTH_THRESH)) + { + if (mainSimpleSort(dataShadow, lo, hi, d)) + { + return; + } + } + else { + int d1 = d + 1; + int med = med3(block[fmap[lo] + d1], + block[fmap[hi] + d1], block[fmap[(lo + hi) >> 1] + d1]) & 0xff; + + int unLo = lo; + int unHi = hi; + int ltLo = lo; + int gtHi = hi; + + while (true) + { + while (unLo <= unHi) + { + int n = (block[fmap[unLo] + d1] & 0xff) + - med; + if (n == 0) + { + int temp = fmap[unLo]; + fmap[unLo++] = fmap[ltLo]; + fmap[ltLo++] = temp; + } + else if (n < 0) + { + unLo++; + } + else { + break; + } + } + + while (unLo <= unHi) + { + int n = (block[fmap[unHi] + d1] & 0xff) + - med; + if (n == 0) + { + int temp = fmap[unHi]; + fmap[unHi--] = fmap[gtHi]; + fmap[gtHi--] = temp; + } + else if (n > 0) + { + unHi--; + } + else { + break; + } + } + + if (unLo <= unHi) + { + int temp = fmap[unLo]; + fmap[unLo++] = fmap[unHi]; + fmap[unHi--] = temp; + } + else { + break; + } + } + + if (gtHi < ltLo) + { + stack_ll[sp] = lo; + stack_hh[sp] = hi; + stack_dd[sp] = d1; + sp++; + } + else { + int n = ((ltLo - lo) < (unLo - ltLo)) ? (ltLo - lo) + : (unLo - ltLo); + vswap(fmap, lo, unLo - n, n); + int m = ((hi - gtHi) < (gtHi - unHi)) ? (hi - gtHi) + : (gtHi - unHi); + vswap(fmap, unLo, hi - m + 1, m); + + n = lo + unLo - ltLo - 1; + m = hi - (gtHi - unHi) + 1; + + stack_ll[sp] = lo; + stack_hh[sp] = n; + stack_dd[sp] = d; + sp++; + + stack_ll[sp] = n + 1; + stack_hh[sp] = m - 1; + stack_dd[sp] = d1; + sp++; + + stack_ll[sp] = m; + stack_hh[sp] = hi; + stack_dd[sp] = d; + sp++; + } + } + } + } + + + + private void generateMTFValues() + { + int lastShadow = this.last; + CompressionState dataShadow = this.cstate; + bool[] inUse = dataShadow.inUse; + byte[] block = dataShadow.block; + int[] fmap = dataShadow.fmap; + char[] sfmap = dataShadow.sfmap; + int[] mtfFreq = dataShadow.mtfFreq; + byte[] unseqToSeq = dataShadow.unseqToSeq; + byte[] yy = dataShadow.generateMTFValues_yy; + + // make maps + int nInUseShadow = 0; + for (int i = 0; i < 256; i++) + { + if (inUse[i]) + { + unseqToSeq[i] = (byte) nInUseShadow; + nInUseShadow++; + } + } + this.nInUse = nInUseShadow; + + int eob = nInUseShadow + 1; + + for (int i = eob; i >= 0; i--) + { + mtfFreq[i] = 0; + } + + for (int i = nInUseShadow; --i >= 0;) + { + yy[i] = (byte) i; + } + + int wr = 0; + int zPend = 0; + + for (int i = 0; i <= lastShadow; i++) + { + byte ll_i = unseqToSeq[block[fmap[i]] & 0xff]; + byte tmp = yy[0]; + int j = 0; + + while (ll_i != tmp) + { + j++; + byte tmp2 = tmp; + tmp = yy[j]; + yy[j] = tmp2; + } + yy[0] = tmp; + + if (j == 0) + { + zPend++; + } + else + { + if (zPend > 0) + { + zPend--; + while (true) + { + if ((zPend & 1) == 0) + { + sfmap[wr] = BZip2.RUNA; + wr++; + mtfFreq[BZip2.RUNA]++; + } + else + { + sfmap[wr] = BZip2.RUNB; + wr++; + mtfFreq[BZip2.RUNB]++; + } + + if (zPend >= 2) + { + zPend = (zPend - 2) >> 1; + } + else + { + break; + } + } + zPend = 0; + } + sfmap[wr] = (char) (j + 1); + wr++; + mtfFreq[j + 1]++; + } + } + + if (zPend > 0) + { + zPend--; + while (true) + { + if ((zPend & 1) == 0) + { + sfmap[wr] = BZip2.RUNA; + wr++; + mtfFreq[BZip2.RUNA]++; + } + else + { + sfmap[wr] = BZip2.RUNB; + wr++; + mtfFreq[BZip2.RUNB]++; + } + + if (zPend >= 2) + { + zPend = (zPend - 2) >> 1; + } + else + { + break; + } + } + } + + sfmap[wr] = (char) eob; + mtfFreq[eob]++; + this.nMTF = wr + 1; + } + + + private static void hbAssignCodes(int[] code, byte[] length, + int minLen, int maxLen, + int alphaSize) + { + int vec = 0; + for (int n = minLen; n <= maxLen; n++) + { + for (int i = 0; i < alphaSize; i++) + { + if ((length[i] & 0xff) == n) + { + code[i] = vec; + vec++; + } + } + vec <<= 1; + } + } + + + + + private void sendMTFValues() + { + byte[][] len = this.cstate.sendMTFValues_len; + int alphaSize = this.nInUse + 2; + + for (int t = BZip2.NGroups; --t >= 0;) + { + byte[] len_t = len[t]; + for (int v = alphaSize; --v >= 0;) + { + len_t[v] = GREATER_ICOST; + } + } + + /* Decide how many coding tables to use */ + // assert (this.nMTF > 0) : this.nMTF; + int nGroups = (this.nMTF < 200) ? 2 : (this.nMTF < 600) ? 3 + : (this.nMTF < 1200) ? 4 : (this.nMTF < 2400) ? 5 : 6; + + /* Generate an initial set of coding tables */ + sendMTFValues0(nGroups, alphaSize); + + /* + * Iterate up to N_ITERS times to improve the tables. + */ + int nSelectors = sendMTFValues1(nGroups, alphaSize); + + /* Compute MTF values for the selectors. */ + sendMTFValues2(nGroups, nSelectors); + + /* Assign actual codes for the tables. */ + sendMTFValues3(nGroups, alphaSize); + + /* Transmit the mapping table. */ + sendMTFValues4(); + + /* Now the selectors. */ + sendMTFValues5(nGroups, nSelectors); + + /* Now the coding tables. */ + sendMTFValues6(nGroups, alphaSize); + + /* And finally, the block data proper */ + sendMTFValues7(nSelectors); + } + + private void sendMTFValues0(int nGroups, int alphaSize) + { + byte[][] len = this.cstate.sendMTFValues_len; + int[] mtfFreq = this.cstate.mtfFreq; + + int remF = this.nMTF; + int gs = 0; + + for (int nPart = nGroups; nPart > 0; nPart--) + { + int tFreq = remF / nPart; + int ge = gs - 1; + int aFreq = 0; + + for (int a = alphaSize - 1; (aFreq < tFreq) && (ge < a);) + { + aFreq += mtfFreq[++ge]; + } + + if ((ge > gs) && (nPart != nGroups) && (nPart != 1) + && (((nGroups - nPart) & 1) != 0)) + { + aFreq -= mtfFreq[ge--]; + } + + byte[] len_np = len[nPart - 1]; + for (int v = alphaSize; --v >= 0;) + { + if ((v >= gs) && (v <= ge)) + { + len_np[v] = LESSER_ICOST; + } + else { + len_np[v] = GREATER_ICOST; + } + } + + gs = ge + 1; + remF -= aFreq; + } + } + + + private static void hbMakeCodeLengths(byte[] len, int[] freq, + CompressionState state1, int alphaSize, + int maxLen) + { + /* + * Nodes and heap entries run from 1. Entry 0 for both the heap and + * nodes is a sentinel. + */ + int[] heap = state1.heap; + int[] weight = state1.weight; + int[] parent = state1.parent; + + for (int i = alphaSize; --i >= 0;) + { + weight[i + 1] = (freq[i] == 0 ? 1 : freq[i]) << 8; + } + + for (bool tooLong = true; tooLong;) + { + tooLong = false; + + int nNodes = alphaSize; + int nHeap = 0; + heap[0] = 0; + weight[0] = 0; + parent[0] = -2; + + for (int i = 1; i <= alphaSize; i++) + { + parent[i] = -1; + nHeap++; + heap[nHeap] = i; + + int zz = nHeap; + int tmp = heap[zz]; + while (weight[tmp] < weight[heap[zz >> 1]]) + { + heap[zz] = heap[zz >> 1]; + zz >>= 1; + } + heap[zz] = tmp; + } + + while (nHeap > 1) + { + int n1 = heap[1]; + heap[1] = heap[nHeap]; + nHeap--; + + int yy = 0; + int zz = 1; + int tmp = heap[1]; + + while (true) + { + yy = zz << 1; + + if (yy > nHeap) + { + break; + } + + if ((yy < nHeap) + && (weight[heap[yy + 1]] < weight[heap[yy]])) + { + yy++; + } + + if (weight[tmp] < weight[heap[yy]]) + { + break; + } + + heap[zz] = heap[yy]; + zz = yy; + } + + heap[zz] = tmp; + + int n2 = heap[1]; + heap[1] = heap[nHeap]; + nHeap--; + + yy = 0; + zz = 1; + tmp = heap[1]; + + while (true) + { + yy = zz << 1; + + if (yy > nHeap) + { + break; + } + + if ((yy < nHeap) + && (weight[heap[yy + 1]] < weight[heap[yy]])) + { + yy++; + } + + if (weight[tmp] < weight[heap[yy]]) + { + break; + } + + heap[zz] = heap[yy]; + zz = yy; + } + + heap[zz] = tmp; + nNodes++; + parent[n1] = parent[n2] = nNodes; + + int weight_n1 = weight[n1]; + int weight_n2 = weight[n2]; + weight[nNodes] = (int) (((uint)weight_n1 & 0xffffff00U) + + ((uint)weight_n2 & 0xffffff00U)) + | (1 + (((weight_n1 & 0x000000ff) + > (weight_n2 & 0x000000ff)) + ? (weight_n1 & 0x000000ff) + : (weight_n2 & 0x000000ff))); + + parent[nNodes] = -1; + nHeap++; + heap[nHeap] = nNodes; + + tmp = 0; + zz = nHeap; + tmp = heap[zz]; + int weight_tmp = weight[tmp]; + while (weight_tmp < weight[heap[zz >> 1]]) + { + heap[zz] = heap[zz >> 1]; + zz >>= 1; + } + heap[zz] = tmp; + + } + + for (int i = 1; i <= alphaSize; i++) + { + int j = 0; + int k = i; + + for (int parent_k; (parent_k = parent[k]) >= 0;) + { + k = parent_k; + j++; + } + + len[i - 1] = (byte) j; + if (j > maxLen) + { + tooLong = true; + } + } + + if (tooLong) + { + for (int i = 1; i < alphaSize; i++) + { + int j = weight[i] >> 8; + j = 1 + (j >> 1); + weight[i] = j << 8; + } + } + } + } + + + private int sendMTFValues1(int nGroups, int alphaSize) + { + CompressionState dataShadow = this.cstate; + int[][] rfreq = dataShadow.sendMTFValues_rfreq; + int[] fave = dataShadow.sendMTFValues_fave; + short[] cost = dataShadow.sendMTFValues_cost; + char[] sfmap = dataShadow.sfmap; + byte[] selector = dataShadow.selector; + byte[][] len = dataShadow.sendMTFValues_len; + byte[] len_0 = len[0]; + byte[] len_1 = len[1]; + byte[] len_2 = len[2]; + byte[] len_3 = len[3]; + byte[] len_4 = len[4]; + byte[] len_5 = len[5]; + int nMTFShadow = this.nMTF; + + int nSelectors = 0; + + for (int iter = 0; iter < BZip2.N_ITERS; iter++) + { + for (int t = nGroups; --t >= 0;) + { + fave[t] = 0; + int[] rfreqt = rfreq[t]; + for (int i = alphaSize; --i >= 0;) + { + rfreqt[i] = 0; + } + } + + nSelectors = 0; + + for (int gs = 0; gs < this.nMTF;) + { + /* Set group start & end marks. */ + + /* + * Calculate the cost of this group as coded by each of the + * coding tables. + */ + + int ge = Math.Min(gs + BZip2.G_SIZE - 1, nMTFShadow - 1); + + if (nGroups == BZip2.NGroups) + { + // unrolled version of the else-block + + int[] c = new int[6]; + + for (int i = gs; i <= ge; i++) + { + int icv = sfmap[i]; + c[0] += len_0[icv] & 0xff; + c[1] += len_1[icv] & 0xff; + c[2] += len_2[icv] & 0xff; + c[3] += len_3[icv] & 0xff; + c[4] += len_4[icv] & 0xff; + c[5] += len_5[icv] & 0xff; + } + + cost[0] = (short) c[0]; + cost[1] = (short) c[1]; + cost[2] = (short) c[2]; + cost[3] = (short) c[3]; + cost[4] = (short) c[4]; + cost[5] = (short) c[5]; + } + else + { + for (int t = nGroups; --t >= 0;) + { + cost[t] = 0; + } + + for (int i = gs; i <= ge; i++) + { + int icv = sfmap[i]; + for (int t = nGroups; --t >= 0;) + { + cost[t] += (short) (len[t][icv] & 0xff); + } + } + } + + /* + * Find the coding table which is best for this group, and + * record its identity in the selector table. + */ + int bt = -1; + for (int t = nGroups, bc = 999999999; --t >= 0;) + { + int cost_t = cost[t]; + if (cost_t < bc) + { + bc = cost_t; + bt = t; + } + } + + fave[bt]++; + selector[nSelectors] = (byte) bt; + nSelectors++; + + /* + * Increment the symbol frequencies for the selected table. + */ + int[] rfreq_bt = rfreq[bt]; + for (int i = gs; i <= ge; i++) + { + rfreq_bt[sfmap[i]]++; + } + + gs = ge + 1; + } + + /* + * Recompute the tables based on the accumulated frequencies. + */ + for (int t = 0; t < nGroups; t++) + { + hbMakeCodeLengths(len[t], rfreq[t], this.cstate, alphaSize, 20); + } + } + + return nSelectors; + } + + private void sendMTFValues2(int nGroups, int nSelectors) + { + // assert (nGroups < 8) : nGroups; + + CompressionState dataShadow = this.cstate; + byte[] pos = dataShadow.sendMTFValues2_pos; + + for (int i = nGroups; --i >= 0;) + { + pos[i] = (byte) i; + } + + for (int i = 0; i < nSelectors; i++) + { + byte ll_i = dataShadow.selector[i]; + byte tmp = pos[0]; + int j = 0; + + while (ll_i != tmp) + { + j++; + byte tmp2 = tmp; + tmp = pos[j]; + pos[j] = tmp2; + } + + pos[0] = tmp; + dataShadow.selectorMtf[i] = (byte) j; + } + } + + private void sendMTFValues3(int nGroups, int alphaSize) + { + int[][] code = this.cstate.sendMTFValues_code; + byte[][] len = this.cstate.sendMTFValues_len; + + for (int t = 0; t < nGroups; t++) + { + int minLen = 32; + int maxLen = 0; + byte[] len_t = len[t]; + for (int i = alphaSize; --i >= 0;) + { + int l = len_t[i] & 0xff; + if (l > maxLen) + { + maxLen = l; + } + if (l < minLen) + { + minLen = l; + } + } + + // assert (maxLen <= 20) : maxLen; + // assert (minLen >= 1) : minLen; + + hbAssignCodes(code[t], len[t], minLen, maxLen, alphaSize); + } + } + + private void sendMTFValues4() + { + bool[] inUse = this.cstate.inUse; + bool[] inUse16 = this.cstate.sentMTFValues4_inUse16; + + for (int i = 16; --i >= 0;) + { + inUse16[i] = false; + int i16 = i * 16; + for (int j = 16; --j >= 0;) + { + if (inUse[i16 + j]) + { + inUse16[i] = true; + } + } + } + + uint u = 0; + for (int i = 0; i < 16; i++) + { + if (inUse16[i]) + u |= 1U << (16 - i - 1); + } + this.bw.WriteBits(16, u); + + + for (int i = 0; i < 16; i++) + { + if (inUse16[i]) + { + int i16 = i * 16; + u = 0; + for (int j = 0; j < 16; j++) + { + if (inUse[i16 + j]) + { + u |= 1U << (16 - j - 1); + } + } + this.bw.WriteBits(16, u); + } + } + } + + + private void sendMTFValues5(int nGroups, int nSelectors) + { + this.bw.WriteBits(3, (uint) nGroups); + this.bw.WriteBits(15, (uint) nSelectors); + + byte[] selectorMtf = this.cstate.selectorMtf; + + for (int i = 0; i < nSelectors; i++) + { + for (int j = 0, hj = selectorMtf[i] & 0xff; j < hj; j++) + { + this.bw.WriteBits(1, 1); + } + + this.bw.WriteBits(1, 0); + } + } + + private void sendMTFValues6(int nGroups, int alphaSize) + { + byte[][] len = this.cstate.sendMTFValues_len; + + for (int t = 0; t < nGroups; t++) + { + byte[] len_t = len[t]; + uint curr = (uint) (len_t[0] & 0xff); + this.bw.WriteBits(5, curr); + + for (int i = 0; i < alphaSize; i++) + { + int lti = len_t[i] & 0xff; + while (curr < lti) + { + this.bw.WriteBits(2, 2U); + curr++; /* 10 */ + } + + while (curr > lti) + { + this.bw.WriteBits(2, 3U); + curr--; /* 11 */ + } + + this.bw.WriteBits(1, 0U); + } + } + } + + + private void sendMTFValues7(int nSelectors) + { + byte[][] len = this.cstate.sendMTFValues_len; + int[][] code = this.cstate.sendMTFValues_code; + byte[] selector = this.cstate.selector; + char[] sfmap = this.cstate.sfmap; + int nMTFShadow = this.nMTF; + + int selCtr = 0; + + for (int gs = 0; gs < nMTFShadow;) + { + int ge = Math.Min(gs + BZip2.G_SIZE - 1, nMTFShadow - 1); + int ix = selector[selCtr] & 0xff; + int[] code_selCtr = code[ix]; + byte[] len_selCtr = len[ix]; + + while (gs <= ge) + { + int sfmap_i = sfmap[gs]; + int n = len_selCtr[sfmap_i] & 0xFF; + this.bw.WriteBits(n, (uint) code_selCtr[sfmap_i]); + gs++; + } + + gs = ge + 1; + selCtr++; + } + } + + private void moveToFrontCodeAndSend() + { + this.bw.WriteBits(24, (uint) this.origPtr); + generateMTFValues(); + sendMTFValues(); + } + + + + + + + private class CompressionState + { + // with blockSize 900k + public readonly bool[] inUse = new bool[256]; // 256 byte + public readonly byte[] unseqToSeq = new byte[256]; // 256 byte + public readonly int[] mtfFreq = new int[BZip2.MaxAlphaSize]; // 1032 byte + public readonly byte[] selector = new byte[BZip2.MaxSelectors]; // 18002 byte + public readonly byte[] selectorMtf = new byte[BZip2.MaxSelectors]; // 18002 byte + + public readonly byte[] generateMTFValues_yy = new byte[256]; // 256 byte + public byte[][] sendMTFValues_len; + + // byte + public int[][] sendMTFValues_rfreq; + + // byte + public readonly int[] sendMTFValues_fave = new int[BZip2.NGroups]; // 24 byte + public readonly short[] sendMTFValues_cost = new short[BZip2.NGroups]; // 12 byte + public int[][] sendMTFValues_code; + + // byte + public readonly byte[] sendMTFValues2_pos = new byte[BZip2.NGroups]; // 6 byte + public readonly bool[] sentMTFValues4_inUse16 = new bool[16]; // 16 byte + + public readonly int[] stack_ll = new int[BZip2.QSORT_STACK_SIZE]; // 4000 byte + public readonly int[] stack_hh = new int[BZip2.QSORT_STACK_SIZE]; // 4000 byte + public readonly int[] stack_dd = new int[BZip2.QSORT_STACK_SIZE]; // 4000 byte + + public readonly int[] mainSort_runningOrder = new int[256]; // 1024 byte + public readonly int[] mainSort_copy = new int[256]; // 1024 byte + public readonly bool[] mainSort_bigDone = new bool[256]; // 256 byte + + public int[] heap = new int[BZip2.MaxAlphaSize + 2]; // 1040 byte + public int[] weight = new int[BZip2.MaxAlphaSize * 2]; // 2064 byte + public int[] parent = new int[BZip2.MaxAlphaSize * 2]; // 2064 byte + + public readonly int[] ftab = new int[65537]; // 262148 byte + // ------------ + // 333408 byte + + public byte[] block; // 900021 byte + public int[] fmap; // 3600000 byte + public char[] sfmap; // 3600000 byte + + // ------------ + // 8433529 byte + // ============ + + /** + * Array instance identical to sfmap, both are used only + * temporarily and independently, so we do not need to allocate + * additional memory. + */ + public char[] quadrant; + + public CompressionState(int blockSize100k) + { + int n = blockSize100k * BZip2.BlockSizeMultiple; + this.block = new byte[(n + 1 + BZip2.NUM_OVERSHOOT_BYTES)]; + this.fmap = new int[n]; + this.sfmap = new char[2 * n]; + this.quadrant = this.sfmap; + this.sendMTFValues_len = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + this.sendMTFValues_rfreq = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + this.sendMTFValues_code = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + } + + } + + + + } +} \ No newline at end of file diff --git a/dotNetZip/BZip2/BZip2InputStream.cs b/dotNetZip/BZip2/BZip2InputStream.cs new file mode 100644 index 0000000..1c152d5 --- /dev/null +++ b/dotNetZip/BZip2/BZip2InputStream.cs @@ -0,0 +1,1447 @@ +// BZip2InputStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-31 11:57:32> +// +// ------------------------------------------------------------------ +// +// This module defines the BZip2InputStream class, which is a decompressing +// stream that handles BZIP2. This code is derived from Apache commons source code. +// The license below applies to the original Apache code. +// +// ------------------------------------------------------------------ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * This package is based on the work done by Keiron Liddle, Aftex Software + * to whom the Ant project is very grateful for his + * great code. + */ + +// compile: msbuild +// not: csc.exe /t:library /debug+ /out:Ionic.BZip2.dll BZip2InputStream.cs BCRC32.cs Rand.cs + + + +using System; +using System.IO; + +namespace Ionic.BZip2 +{ + + /// + /// A read-only decorator stream that performs BZip2 decompression on Read. + /// + public class BZip2InputStream : System.IO.Stream + { + bool _disposed; + bool _leaveOpen; + Int64 totalBytesRead; + private int last; + + /* for undoing the Burrows-Wheeler transform */ + private int origPtr; + + // blockSize100k: 0 .. 9. + // + // This var name is a misnomer. The actual block size is 100000 + // * blockSize100k. (not 100k * blocksize100k) + private int blockSize100k; + private bool blockRandomised; + private int bsBuff; + private int bsLive; + private readonly Ionic.Crc.CRC32 crc = new Ionic.Crc.CRC32(true); + private int nInUse; + private Stream input; + private int currentChar = -1; + + /// + /// Compressor State + /// + enum CState + { + EOF = 0, + START_BLOCK = 1, + RAND_PART_A = 2, + RAND_PART_B = 3, + RAND_PART_C = 4, + NO_RAND_PART_A = 5, + NO_RAND_PART_B = 6, + NO_RAND_PART_C = 7, + } + + private CState currentState = CState.START_BLOCK; + + private uint storedBlockCRC, storedCombinedCRC; + private uint computedBlockCRC, computedCombinedCRC; + + // Variables used by setup* methods exclusively + private int su_count; + private int su_ch2; + private int su_chPrev; + private int su_i2; + private int su_j2; + private int su_rNToGo; + private int su_rTPos; + private int su_tPos; + private char su_z; + private BZip2InputStream.DecompressionState data; + + + /// + /// Create a BZip2InputStream, wrapping it around the given input Stream. + /// + /// + /// + /// The input stream will be closed when the BZip2InputStream is closed. + /// + /// + /// The stream from which to read compressed data + public BZip2InputStream(Stream input) + : this(input, false) + {} + + + /// + /// Create a BZip2InputStream with the given stream, and + /// specifying whether to leave the wrapped stream open when + /// the BZip2InputStream is closed. + /// + /// The stream from which to read compressed data + /// + /// Whether to leave the input stream open, when the BZip2InputStream closes. + /// + /// + /// + /// + /// This example reads a bzip2-compressed file, decompresses it, + /// and writes the decompressed data into a newly created file. + /// + /// + /// var fname = "logfile.log.bz2"; + /// using (var fs = File.OpenRead(fname)) + /// { + /// using (var decompressor = new Ionic.BZip2.BZip2InputStream(fs)) + /// { + /// var outFname = fname + ".decompressed"; + /// using (var output = File.Create(outFname)) + /// { + /// byte[] buffer = new byte[2048]; + /// int n; + /// while ((n = decompressor.Read(buffer, 0, buffer.Length)) > 0) + /// { + /// output.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + public BZip2InputStream(Stream input, bool leaveOpen) + : base() + { + + this.input = input; + this._leaveOpen = leaveOpen; + init(); + } + + /// + /// Read data from the stream. + /// + /// + /// + /// + /// To decompress a BZip2 data stream, create a BZip2InputStream, + /// providing a stream that reads compressed data. Then call Read() on + /// that BZip2InputStream, and the data read will be decompressed + /// as you read. + /// + /// + /// + /// A BZip2InputStream can be used only for Read(), not for Write(). + /// + /// + /// + /// The buffer into which the read data should be placed. + /// the offset within that data array to put the first byte read. + /// the number of bytes to read. + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + if (offset < 0) + throw new IndexOutOfRangeException(String.Format("offset ({0}) must be > 0", offset)); + + if (count < 0) + throw new IndexOutOfRangeException(String.Format("count ({0}) must be > 0", count)); + + if (offset + count > buffer.Length) + throw new IndexOutOfRangeException(String.Format("offset({0}) count({1}) bLength({2})", + offset, count, buffer.Length)); + + if (this.input == null) + throw new IOException("the stream is not open"); + + + int hi = offset + count; + int destOffset = offset; + for (int b; (destOffset < hi) && ((b = ReadByte()) >= 0);) + { + buffer[destOffset++] = (byte) b; + } + + return (destOffset == offset) ? -1 : (destOffset - offset); + } + + private void MakeMaps() + { + bool[] inUse = this.data.inUse; + byte[] seqToUnseq = this.data.seqToUnseq; + + int n = 0; + + for (int i = 0; i < 256; i++) + { + if (inUse[i]) + seqToUnseq[n++] = (byte) i; + } + + this.nInUse = n; + } + + /// + /// Read a single byte from the stream. + /// + /// the byte read from the stream, or -1 if EOF + public override int ReadByte() + { + int retChar = this.currentChar; + totalBytesRead++; + switch (this.currentState) + { + case CState.EOF: + return -1; + + case CState.START_BLOCK: + throw new IOException("bad state"); + + case CState.RAND_PART_A: + throw new IOException("bad state"); + + case CState.RAND_PART_B: + SetupRandPartB(); + break; + + case CState.RAND_PART_C: + SetupRandPartC(); + break; + + case CState.NO_RAND_PART_A: + throw new IOException("bad state"); + + case CState.NO_RAND_PART_B: + SetupNoRandPartB(); + break; + + case CState.NO_RAND_PART_C: + SetupNoRandPartC(); + break; + + default: + throw new IOException("bad state"); + } + + return retChar; + } + + + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value depends on whether the captive stream supports reading. + /// + public override bool CanRead + { + get + { + if (_disposed) throw new ObjectDisposedException("BZip2Stream"); + return this.input.CanRead; + } + } + + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (_disposed) throw new ObjectDisposedException("BZip2Stream"); + return input.CanWrite; + } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_disposed) throw new ObjectDisposedException("BZip2Stream"); + input.Flush(); + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the + /// total number of uncompressed bytes read in. + /// + public override long Position + { + get + { + return this.totalBytesRead; + } + set { throw new NotImplementedException(); } + } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + /// this is irrelevant, since it will always throw! + /// irrelevant! + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this parameter is never used + /// this parameter is never used + /// this parameter is never used + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + + + /// + /// Dispose the stream. + /// + /// + /// indicates whether the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this.input != null)) + this.input.Close(); + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + + void init() + { + if (null == this.input) + throw new IOException("No input Stream"); + + if (!this.input.CanRead) + throw new IOException("Unreadable input Stream"); + + CheckMagicChar('B', 0); + CheckMagicChar('Z', 1); + CheckMagicChar('h', 2); + + int blockSize = this.input.ReadByte(); + + if ((blockSize < '1') || (blockSize > '9')) + throw new IOException("Stream is not BZip2 formatted: illegal " + + "blocksize " + (char) blockSize); + + this.blockSize100k = blockSize - '0'; + + InitBlock(); + SetupBlock(); + } + + + void CheckMagicChar(char expected, int position) + { + int magic = this.input.ReadByte(); + if (magic != (int)expected) + { + var msg = String.Format("Not a valid BZip2 stream. byte {0}, expected '{1}', got '{2}'", + position, (int)expected, magic); + throw new IOException(msg); + } + } + + + void InitBlock() + { + char magic0 = bsGetUByte(); + char magic1 = bsGetUByte(); + char magic2 = bsGetUByte(); + char magic3 = bsGetUByte(); + char magic4 = bsGetUByte(); + char magic5 = bsGetUByte(); + + if (magic0 == 0x17 && magic1 == 0x72 && magic2 == 0x45 + && magic3 == 0x38 && magic4 == 0x50 && magic5 == 0x90) + { + complete(); // end of file + } + else if (magic0 != 0x31 || + magic1 != 0x41 || + magic2 != 0x59 || + magic3 != 0x26 || + magic4 != 0x53 || + magic5 != 0x59) + { + this.currentState = CState.EOF; + var msg = String.Format("bad block header at offset 0x{0:X}", + this.input.Position); + throw new IOException(msg); + } + else + { + this.storedBlockCRC = bsGetInt(); + // Console.WriteLine(" stored block CRC : {0:X8}", this.storedBlockCRC); + + this.blockRandomised = (GetBits(1) == 1); + + // Lazily allocate data + if (this.data == null) + this.data = new DecompressionState(this.blockSize100k); + + // currBlockNo++; + getAndMoveToFrontDecode(); + + this.crc.Reset(); + this.currentState = CState.START_BLOCK; + } + } + + + private void EndBlock() + { + this.computedBlockCRC = (uint)this.crc.Crc32Result; + + // A bad CRC is considered a fatal error. + if (this.storedBlockCRC != this.computedBlockCRC) + { + // make next blocks readable without error + // (repair feature, not yet documented, not tested) + // this.computedCombinedCRC = (this.storedCombinedCRC << 1) + // | (this.storedCombinedCRC >> 31); + // this.computedCombinedCRC ^= this.storedBlockCRC; + + var msg = String.Format("BZip2 CRC error (expected {0:X8}, computed {1:X8})", + this.storedBlockCRC, this.computedBlockCRC); + throw new IOException(msg); + } + + // Console.WriteLine(" combined CRC (before): {0:X8}", this.computedCombinedCRC); + this.computedCombinedCRC = (this.computedCombinedCRC << 1) + | (this.computedCombinedCRC >> 31); + this.computedCombinedCRC ^= this.computedBlockCRC; + // Console.WriteLine(" computed block CRC : {0:X8}", this.computedBlockCRC); + // Console.WriteLine(" combined CRC (after) : {0:X8}", this.computedCombinedCRC); + // Console.WriteLine(); + } + + + private void complete() + { + this.storedCombinedCRC = bsGetInt(); + this.currentState = CState.EOF; + this.data = null; + + if (this.storedCombinedCRC != this.computedCombinedCRC) + { + var msg = String.Format("BZip2 CRC error (expected {0:X8}, computed {1:X8})", + this.storedCombinedCRC, this.computedCombinedCRC); + + throw new IOException(msg); + } + } + + /// + /// Close the stream. + /// + public override void Close() + { + Stream inShadow = this.input; + if (inShadow != null) + { + try + { + if (!this._leaveOpen) + inShadow.Close(); + } + finally + { + this.data = null; + this.input = null; + } + } + } + + + /// + /// Read n bits from input, right justifying the result. + /// + /// + /// + /// For example, if you read 1 bit, the result is either 0 + /// or 1. + /// + /// + /// + /// The number of bits to read, always between 1 and 32. + /// + private int GetBits(int n) + { + int bsLiveShadow = this.bsLive; + int bsBuffShadow = this.bsBuff; + + if (bsLiveShadow < n) + { + do + { + int thech = this.input.ReadByte(); + + if (thech < 0) + throw new IOException("unexpected end of stream"); + + // Console.WriteLine("R {0:X2}", thech); + + bsBuffShadow = (bsBuffShadow << 8) | thech; + bsLiveShadow += 8; + } while (bsLiveShadow < n); + + this.bsBuff = bsBuffShadow; + } + + this.bsLive = bsLiveShadow - n; + return (bsBuffShadow >> (bsLiveShadow - n)) & ((1 << n) - 1); + } + + + // private bool bsGetBit() + // { + // int bsLiveShadow = this.bsLive; + // int bsBuffShadow = this.bsBuff; + // + // if (bsLiveShadow < 1) + // { + // int thech = this.input.ReadByte(); + // + // if (thech < 0) + // { + // throw new IOException("unexpected end of stream"); + // } + // + // bsBuffShadow = (bsBuffShadow << 8) | thech; + // bsLiveShadow += 8; + // this.bsBuff = bsBuffShadow; + // } + // + // this.bsLive = bsLiveShadow - 1; + // return ((bsBuffShadow >> (bsLiveShadow - 1)) & 1) != 0; + // } + + private bool bsGetBit() + { + int bit = GetBits(1); + return bit != 0; + } + + private char bsGetUByte() + { + return (char) GetBits(8); + } + + private uint bsGetInt() + { + return (uint)((((((GetBits(8) << 8) | GetBits(8)) << 8) | GetBits(8)) << 8) | GetBits(8)); + } + + + /** + * Called by createHuffmanDecodingTables() exclusively. + */ + private static void hbCreateDecodeTables(int[] limit, + int[] bbase, int[] perm, char[] length, + int minLen, int maxLen, int alphaSize) + { + for (int i = minLen, pp = 0; i <= maxLen; i++) + { + for (int j = 0; j < alphaSize; j++) + { + if (length[j] == i) + { + perm[pp++] = j; + } + } + } + + for (int i = BZip2.MaxCodeLength; --i > 0;) + { + bbase[i] = 0; + limit[i] = 0; + } + + for (int i = 0; i < alphaSize; i++) + { + bbase[length[i] + 1]++; + } + + for (int i = 1, b = bbase[0]; i < BZip2.MaxCodeLength; i++) + { + b += bbase[i]; + bbase[i] = b; + } + + for (int i = minLen, vec = 0, b = bbase[i]; i <= maxLen; i++) + { + int nb = bbase[i + 1]; + vec += nb - b; + b = nb; + limit[i] = vec - 1; + vec <<= 1; + } + + for (int i = minLen + 1; i <= maxLen; i++) + { + bbase[i] = ((limit[i - 1] + 1) << 1) - bbase[i]; + } + } + + + + private void recvDecodingTables() + { + var s = this.data; + bool[] inUse = s.inUse; + byte[] pos = s.recvDecodingTables_pos; + //byte[] selector = s.selector; + + int inUse16 = 0; + + /* Receive the mapping table */ + for (int i = 0; i < 16; i++) + { + if (bsGetBit()) + { + inUse16 |= 1 << i; + } + } + + for (int i = 256; --i >= 0;) + { + inUse[i] = false; + } + + for (int i = 0; i < 16; i++) + { + if ((inUse16 & (1 << i)) != 0) + { + int i16 = i << 4; + for (int j = 0; j < 16; j++) + { + if (bsGetBit()) + { + inUse[i16 + j] = true; + } + } + } + } + + MakeMaps(); + int alphaSize = this.nInUse + 2; + + /* Now the selectors */ + int nGroups = GetBits(3); + int nSelectors = GetBits(15); + + for (int i = 0; i < nSelectors; i++) + { + int j = 0; + while (bsGetBit()) + { + j++; + } + s.selectorMtf[i] = (byte) j; + } + + /* Undo the MTF values for the selectors. */ + for (int v = nGroups; --v >= 0;) + { + pos[v] = (byte) v; + } + + for (int i = 0; i < nSelectors; i++) + { + int v = s.selectorMtf[i]; + byte tmp = pos[v]; + while (v > 0) + { + // nearly all times v is zero, 4 in most other cases + pos[v] = pos[v - 1]; + v--; + } + pos[0] = tmp; + s.selector[i] = tmp; + } + + char[][] len = s.temp_charArray2d; + + /* Now the coding tables */ + for (int t = 0; t < nGroups; t++) + { + int curr = GetBits(5); + char[] len_t = len[t]; + for (int i = 0; i < alphaSize; i++) + { + while (bsGetBit()) + { + curr += bsGetBit() ? -1 : 1; + } + len_t[i] = (char) curr; + } + } + + // finally create the Huffman tables + createHuffmanDecodingTables(alphaSize, nGroups); + } + + + /** + * Called by recvDecodingTables() exclusively. + */ + private void createHuffmanDecodingTables(int alphaSize, + int nGroups) + { + var s = this.data; + char[][] len = s.temp_charArray2d; + + for (int t = 0; t < nGroups; t++) + { + int minLen = 32; + int maxLen = 0; + char[] len_t = len[t]; + for (int i = alphaSize; --i >= 0;) + { + char lent = len_t[i]; + if (lent > maxLen) + maxLen = lent; + + if (lent < minLen) + minLen = lent; + } + hbCreateDecodeTables(s.gLimit[t], s.gBase[t], s.gPerm[t], len[t], minLen, + maxLen, alphaSize); + s.gMinlen[t] = minLen; + } + } + + + + private void getAndMoveToFrontDecode() + { + var s = this.data; + this.origPtr = GetBits(24); + + if (this.origPtr < 0) + throw new IOException("BZ_DATA_ERROR"); + if (this.origPtr > 10 + BZip2.BlockSizeMultiple * this.blockSize100k) + throw new IOException("BZ_DATA_ERROR"); + + recvDecodingTables(); + + byte[] yy = s.getAndMoveToFrontDecode_yy; + int limitLast = this.blockSize100k * BZip2.BlockSizeMultiple; + + /* + * Setting up the unzftab entries here is not strictly necessary, but it + * does save having to do it later in a separate pass, and so saves a + * block's worth of cache misses. + */ + for (int i = 256; --i >= 0;) + { + yy[i] = (byte) i; + s.unzftab[i] = 0; + } + + int groupNo = 0; + int groupPos = BZip2.G_SIZE - 1; + int eob = this.nInUse + 1; + int nextSym = getAndMoveToFrontDecode0(0); + int bsBuffShadow = this.bsBuff; + int bsLiveShadow = this.bsLive; + int lastShadow = -1; + int zt = s.selector[groupNo] & 0xff; + int[] base_zt = s.gBase[zt]; + int[] limit_zt = s.gLimit[zt]; + int[] perm_zt = s.gPerm[zt]; + int minLens_zt = s.gMinlen[zt]; + + while (nextSym != eob) + { + if ((nextSym == BZip2.RUNA) || (nextSym == BZip2.RUNB)) + { + int es = -1; + + for (int n = 1; true; n <<= 1) + { + if (nextSym == BZip2.RUNA) + { + es += n; + } + else if (nextSym == BZip2.RUNB) + { + es += n << 1; + } + else + { + break; + } + + if (groupPos == 0) + { + groupPos = BZip2.G_SIZE - 1; + zt = s.selector[++groupNo] & 0xff; + base_zt = s.gBase[zt]; + limit_zt = s.gLimit[zt]; + perm_zt = s.gPerm[zt]; + minLens_zt = s.gMinlen[zt]; + } + else + { + groupPos--; + } + + int zn = minLens_zt; + + // Inlined: + // int zvec = GetBits(zn); + while (bsLiveShadow < zn) + { + int thech = this.input.ReadByte(); + if (thech >= 0) + { + bsBuffShadow = (bsBuffShadow << 8) | thech; + bsLiveShadow += 8; + continue; + } + else + { + throw new IOException("unexpected end of stream"); + } + } + int zvec = (bsBuffShadow >> (bsLiveShadow - zn)) + & ((1 << zn) - 1); + bsLiveShadow -= zn; + + while (zvec > limit_zt[zn]) + { + zn++; + while (bsLiveShadow < 1) + { + int thech = this.input.ReadByte(); + if (thech >= 0) + { + bsBuffShadow = (bsBuffShadow << 8) | thech; + bsLiveShadow += 8; + continue; + } + else + { + throw new IOException("unexpected end of stream"); + } + } + bsLiveShadow--; + zvec = (zvec << 1) + | ((bsBuffShadow >> bsLiveShadow) & 1); + } + nextSym = perm_zt[zvec - base_zt[zn]]; + } + + byte ch = s.seqToUnseq[yy[0]]; + s.unzftab[ch & 0xff] += es + 1; + + while (es-- >= 0) + { + s.ll8[++lastShadow] = ch; + } + + if (lastShadow >= limitLast) + throw new IOException("block overrun"); + } + else + { + if (++lastShadow >= limitLast) + throw new IOException("block overrun"); + + byte tmp = yy[nextSym - 1]; + s.unzftab[s.seqToUnseq[tmp] & 0xff]++; + s.ll8[lastShadow] = s.seqToUnseq[tmp]; + + /* + * This loop is hammered during decompression, hence avoid + * native method call overhead of System.Buffer.BlockCopy for very + * small ranges to copy. + */ + if (nextSym <= 16) + { + for (int j = nextSym - 1; j > 0;) + { + yy[j] = yy[--j]; + } + } + else + { + System.Buffer.BlockCopy(yy, 0, yy, 1, nextSym - 1); + } + + yy[0] = tmp; + + if (groupPos == 0) + { + groupPos = BZip2.G_SIZE - 1; + zt = s.selector[++groupNo] & 0xff; + base_zt = s.gBase[zt]; + limit_zt = s.gLimit[zt]; + perm_zt = s.gPerm[zt]; + minLens_zt = s.gMinlen[zt]; + } + else + { + groupPos--; + } + + int zn = minLens_zt; + + // Inlined: + // int zvec = GetBits(zn); + while (bsLiveShadow < zn) + { + int thech = this.input.ReadByte(); + if (thech >= 0) + { + bsBuffShadow = (bsBuffShadow << 8) | thech; + bsLiveShadow += 8; + continue; + } + else + { + throw new IOException("unexpected end of stream"); + } + } + int zvec = (bsBuffShadow >> (bsLiveShadow - zn)) + & ((1 << zn) - 1); + bsLiveShadow -= zn; + + while (zvec > limit_zt[zn]) + { + zn++; + while (bsLiveShadow < 1) + { + int thech = this.input.ReadByte(); + if (thech >= 0) + { + bsBuffShadow = (bsBuffShadow << 8) | thech; + bsLiveShadow += 8; + continue; + } + else + { + throw new IOException("unexpected end of stream"); + } + } + bsLiveShadow--; + zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); + } + nextSym = perm_zt[zvec - base_zt[zn]]; + } + } + + this.last = lastShadow; + this.bsLive = bsLiveShadow; + this.bsBuff = bsBuffShadow; + } + + + private int getAndMoveToFrontDecode0(int groupNo) + { + var s = this.data; + int zt = s.selector[groupNo] & 0xff; + int[] limit_zt = s.gLimit[zt]; + int zn = s.gMinlen[zt]; + int zvec = GetBits(zn); + int bsLiveShadow = this.bsLive; + int bsBuffShadow = this.bsBuff; + + while (zvec > limit_zt[zn]) + { + zn++; + while (bsLiveShadow < 1) + { + int thech = this.input.ReadByte(); + + if (thech >= 0) + { + bsBuffShadow = (bsBuffShadow << 8) | thech; + bsLiveShadow += 8; + continue; + } + else + { + throw new IOException("unexpected end of stream"); + } + } + bsLiveShadow--; + zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); + } + + this.bsLive = bsLiveShadow; + this.bsBuff = bsBuffShadow; + + return s.gPerm[zt][zvec - s.gBase[zt][zn]]; + } + + + private void SetupBlock() + { + if (this.data == null) + return; + + int i; + var s = this.data; + int[] tt = s.initTT(this.last + 1); + + // xxxx + + /* Check: unzftab entries in range. */ + for (i = 0; i <= 255; i++) + { + if (s.unzftab[i] < 0 || s.unzftab[i] > this.last) + throw new Exception("BZ_DATA_ERROR"); + } + + /* Actually generate cftab. */ + s.cftab[0] = 0; + for (i = 1; i <= 256; i++) s.cftab[i] = s.unzftab[i-1]; + for (i = 1; i <= 256; i++) s.cftab[i] += s.cftab[i-1]; + /* Check: cftab entries in range. */ + for (i = 0; i <= 256; i++) + { + if (s.cftab[i] < 0 || s.cftab[i] > this.last+1) + { + var msg = String.Format("BZ_DATA_ERROR: cftab[{0}]={1} last={2}", + i, s.cftab[i], this.last); + throw new Exception(msg); + } + } + /* Check: cftab entries non-descending. */ + for (i = 1; i <= 256; i++) + { + if (s.cftab[i-1] > s.cftab[i]) + throw new Exception("BZ_DATA_ERROR"); + } + + int lastShadow; + for (i = 0, lastShadow = this.last; i <= lastShadow; i++) + { + tt[s.cftab[s.ll8[i] & 0xff]++] = i; + } + + if ((this.origPtr < 0) || (this.origPtr >= tt.Length)) + throw new IOException("stream corrupted"); + + this.su_tPos = tt[this.origPtr]; + this.su_count = 0; + this.su_i2 = 0; + this.su_ch2 = 256; /* not a valid 8-bit byte value?, and not EOF */ + + if (this.blockRandomised) + { + this.su_rNToGo = 0; + this.su_rTPos = 0; + SetupRandPartA(); + } + else + { + SetupNoRandPartA(); + } + } + + + + private void SetupRandPartA() + { + if (this.su_i2 <= this.last) + { + this.su_chPrev = this.su_ch2; + int su_ch2Shadow = this.data.ll8[this.su_tPos] & 0xff; + this.su_tPos = this.data.tt[this.su_tPos]; + if (this.su_rNToGo == 0) + { + this.su_rNToGo = Rand.Rnums(this.su_rTPos) - 1; + if (++this.su_rTPos == 512) + { + this.su_rTPos = 0; + } + } + else + { + this.su_rNToGo--; + } + this.su_ch2 = su_ch2Shadow ^= (this.su_rNToGo == 1) ? 1 : 0; + this.su_i2++; + this.currentChar = su_ch2Shadow; + this.currentState = CState.RAND_PART_B; + this.crc.UpdateCRC((byte)su_ch2Shadow); + } + else + { + EndBlock(); + InitBlock(); + SetupBlock(); + } + } + + private void SetupNoRandPartA() + { + if (this.su_i2 <= this.last) + { + this.su_chPrev = this.su_ch2; + int su_ch2Shadow = this.data.ll8[this.su_tPos] & 0xff; + this.su_ch2 = su_ch2Shadow; + this.su_tPos = this.data.tt[this.su_tPos]; + this.su_i2++; + this.currentChar = su_ch2Shadow; + this.currentState = CState.NO_RAND_PART_B; + this.crc.UpdateCRC((byte)su_ch2Shadow); + } + else + { + this.currentState = CState.NO_RAND_PART_A; + EndBlock(); + InitBlock(); + SetupBlock(); + } + } + + private void SetupRandPartB() + { + if (this.su_ch2 != this.su_chPrev) + { + this.currentState = CState.RAND_PART_A; + this.su_count = 1; + SetupRandPartA(); + } + else if (++this.su_count >= 4) + { + this.su_z = (char) (this.data.ll8[this.su_tPos] & 0xff); + this.su_tPos = this.data.tt[this.su_tPos]; + if (this.su_rNToGo == 0) + { + this.su_rNToGo = Rand.Rnums(this.su_rTPos) - 1; + if (++this.su_rTPos == 512) + { + this.su_rTPos = 0; + } + } + else + { + this.su_rNToGo--; + } + this.su_j2 = 0; + this.currentState = CState.RAND_PART_C; + if (this.su_rNToGo == 1) + { + this.su_z ^= (char)1; + } + SetupRandPartC(); + } + else + { + this.currentState = CState.RAND_PART_A; + SetupRandPartA(); + } + } + + private void SetupRandPartC() + { + if (this.su_j2 < this.su_z) + { + this.currentChar = this.su_ch2; + this.crc.UpdateCRC((byte)this.su_ch2); + this.su_j2++; + } + else + { + this.currentState = CState.RAND_PART_A; + this.su_i2++; + this.su_count = 0; + SetupRandPartA(); + } + } + + private void SetupNoRandPartB() + { + if (this.su_ch2 != this.su_chPrev) + { + this.su_count = 1; + SetupNoRandPartA(); + } + else if (++this.su_count >= 4) + { + this.su_z = (char) (this.data.ll8[this.su_tPos] & 0xff); + this.su_tPos = this.data.tt[this.su_tPos]; + this.su_j2 = 0; + SetupNoRandPartC(); + } + else + { + SetupNoRandPartA(); + } + } + + private void SetupNoRandPartC() + { + if (this.su_j2 < this.su_z) + { + int su_ch2Shadow = this.su_ch2; + this.currentChar = su_ch2Shadow; + this.crc.UpdateCRC((byte)su_ch2Shadow); + this.su_j2++; + this.currentState = CState.NO_RAND_PART_C; + } + else + { + this.su_i2++; + this.su_count = 0; + SetupNoRandPartA(); + } + } + + private sealed class DecompressionState + { + // (with blockSize 900k) + readonly public bool[] inUse = new bool[256]; + readonly public byte[] seqToUnseq = new byte[256]; // 256 byte + readonly public byte[] selector = new byte[BZip2.MaxSelectors]; // 18002 byte + readonly public byte[] selectorMtf = new byte[BZip2.MaxSelectors]; // 18002 byte + + /** + * Freq table collected to save a pass over the data during + * decompression. + */ + public readonly int[] unzftab; + public readonly int[][] gLimit; + public readonly int[][] gBase; + public readonly int[][] gPerm; + public readonly int[] gMinlen; + + public readonly int[] cftab; + public readonly byte[] getAndMoveToFrontDecode_yy; + public readonly char[][] temp_charArray2d; + public readonly byte[] recvDecodingTables_pos; + // --------------- + // 60798 byte + + public int[] tt; // 3600000 byte + public byte[] ll8; // 900000 byte + + // --------------- + // 4560782 byte + // =============== + + public DecompressionState(int blockSize100k) + { + this.unzftab = new int[256]; // 1024 byte + + this.gLimit = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + this.gBase = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + this.gPerm = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + this.gMinlen = new int[BZip2.NGroups]; // 24 byte + + this.cftab = new int[257]; // 1028 byte + this.getAndMoveToFrontDecode_yy = new byte[256]; // 512 byte + this.temp_charArray2d = BZip2.InitRectangularArray(BZip2.NGroups,BZip2.MaxAlphaSize); + this.recvDecodingTables_pos = new byte[BZip2.NGroups]; // 6 byte + + this.ll8 = new byte[blockSize100k * BZip2.BlockSizeMultiple]; + } + + /** + * Initializes the tt array. + * + * This method is called when the required length of the array is known. + * I don't initialize it at construction time to avoid unneccessary + * memory allocation when compressing small files. + */ + public int[] initTT(int length) + { + int[] ttShadow = this.tt; + + // tt.length should always be >= length, but theoretically + // it can happen, if the compressor mixed small and large + // blocks. Normally only the last block will be smaller + // than others. + if ((ttShadow == null) || (ttShadow.Length < length)) + { + this.tt = ttShadow = new int[length]; + } + + return ttShadow; + } + } + + + } + + // /** + // * Checks if the signature matches what is expected for a bzip2 file. + // * + // * @param signature + // * the bytes to check + // * @param length + // * the number of bytes to check + // * @return true, if this stream is a bzip2 compressed stream, false otherwise + // * + // * @since Apache Commons Compress 1.1 + // */ + // public static boolean MatchesSig(byte[] signature) + // { + // if ((signature.Length < 3) || + // (signature[0] != 'B') || + // (signature[1] != 'Z') || + // (signature[2] != 'h')) + // return false; + // + // return true; + // } + + + internal static class BZip2 + { + internal static T[][] InitRectangularArray(int d1, int d2) + { + var x = new T[d1][]; + for (int i=0; i < d1; i++) + { + x[i] = new T[d2]; + } + return x; + } + + public static readonly int BlockSizeMultiple = 100000; + public static readonly int MinBlockSize = 1; + public static readonly int MaxBlockSize = 9; + public static readonly int MaxAlphaSize = 258; + public static readonly int MaxCodeLength = 23; + public static readonly char RUNA = (char) 0; + public static readonly char RUNB = (char) 1; + public static readonly int NGroups = 6; + public static readonly int G_SIZE = 50; + public static readonly int N_ITERS = 4; + public static readonly int MaxSelectors = (2 + (900000 / G_SIZE)); + public static readonly int NUM_OVERSHOOT_BYTES = 20; + /* + *

If you are ever unlucky/improbable enough to get a stack + * overflow whilst sorting, increase the following constant and + * try again. In practice I have never seen the stack go above 27 + * elems, so the following limit seems very generous.

+ */ + internal static readonly int QSORT_STACK_SIZE = 1000; + + + } + +} \ No newline at end of file diff --git a/dotNetZip/BZip2/BZip2OutputStream.cs b/dotNetZip/BZip2/BZip2OutputStream.cs new file mode 100644 index 0000000..74dce3c --- /dev/null +++ b/dotNetZip/BZip2/BZip2OutputStream.cs @@ -0,0 +1,530 @@ +//#define Trace + +// BZip2OutputStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-02 16:44:11> +// +// ------------------------------------------------------------------ +// +// This module defines the BZip2OutputStream class, which is a +// compressing stream that handles BZIP2. This code may have been +// derived in part from Apache commons source code. The license below +// applies to the original Apache code. +// +// ------------------------------------------------------------------ +// flymake: csc.exe /t:module BZip2InputStream.cs BZip2Compressor.cs Rand.cs BCRC32.cs @@FILE@@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +// Design Notes: +// +// This class follows the classic Decorator pattern: it is a Stream that +// wraps itself around a Stream, and in doing so provides bzip2 +// compression as callers Write into it. +// +// BZip2 is a straightforward data format: there are 4 magic bytes at +// the top of the file, followed by 1 or more compressed blocks. There +// is a small "magic byte" trailer after all compressed blocks. This +// class emits the magic bytes for the header and trailer, and relies on +// a BZip2Compressor to generate each of the compressed data blocks. +// +// BZip2 does byte-shredding - it uses partial fractions of bytes to +// represent independent pieces of information. This class relies on the +// BitWriter to adapt the bit-oriented BZip2 output to the byte-oriented +// model of the .NET Stream class. +// +// ---- +// +// Regarding the Apache code base: Most of the code in this particular +// class is related to stream operations, and is my own code. It largely +// does not rely on any code obtained from Apache commons. If you +// compare this code with the Apache commons BZip2OutputStream, you will +// see very little code that is common, except for the +// nearly-boilerplate structure that is common to all subtypes of +// System.IO.Stream. There may be some small remnants of code in this +// module derived from the Apache stuff, which is why I left the license +// in here. Most of the Apache commons compressor magic has been ported +// into the BZip2Compressor class. +// + +using System; +using System.IO; + + +namespace Ionic.BZip2 +{ + /// + /// A write-only decorator stream that compresses data as it is + /// written using the BZip2 algorithm. + /// + public class BZip2OutputStream : System.IO.Stream + { + int totalBytesWrittenIn; + bool leaveOpen; + BZip2Compressor compressor; + uint combinedCRC; + Stream output; + BitWriter bw; + int blockSize100k; // 0...9 + + private TraceBits desiredTrace = TraceBits.Crc | TraceBits.Write; + + /// + /// Constructs a new BZip2OutputStream, that sends its + /// compressed output to the given output stream. + /// + /// + /// + /// The destination stream, to which compressed output will be sent. + /// + /// + /// + /// + /// This example reads a file, then compresses it with bzip2 file, + /// and writes the compressed data into a newly created file. + /// + /// + /// var fname = "logfile.log"; + /// using (var fs = File.OpenRead(fname)) + /// { + /// var outFname = fname + ".bz2"; + /// using (var output = File.Create(outFname)) + /// { + /// using (var compressor = new Ionic.BZip2.BZip2OutputStream(output)) + /// { + /// byte[] buffer = new byte[2048]; + /// int n; + /// while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + public BZip2OutputStream(Stream output) + : this(output, BZip2.MaxBlockSize, false) + { + } + + + /// + /// Constructs a new BZip2OutputStream with specified blocksize. + /// + /// the destination stream. + /// + /// The blockSize in units of 100000 bytes. + /// The valid range is 1..9. + /// + public BZip2OutputStream(Stream output, int blockSize) + : this(output, blockSize, false) + { + } + + + /// + /// Constructs a new BZip2OutputStream. + /// + /// the destination stream. + /// + /// whether to leave the captive stream open upon closing this stream. + /// + public BZip2OutputStream(Stream output, bool leaveOpen) + : this(output, BZip2.MaxBlockSize, leaveOpen) + { + } + + + /// + /// Constructs a new BZip2OutputStream with specified blocksize, + /// and explicitly specifies whether to leave the wrapped stream open. + /// + /// + /// the destination stream. + /// + /// The blockSize in units of 100000 bytes. + /// The valid range is 1..9. + /// + /// + /// whether to leave the captive stream open upon closing this stream. + /// + public BZip2OutputStream(Stream output, int blockSize, bool leaveOpen) + { + if (blockSize < BZip2.MinBlockSize || + blockSize > BZip2.MaxBlockSize) + { + var msg = String.Format("blockSize={0} is out of range; must be between {1} and {2}", + blockSize, + BZip2.MinBlockSize, BZip2.MaxBlockSize); + throw new ArgumentException(msg, "blockSize"); + } + + this.output = output; + if (!this.output.CanWrite) + throw new ArgumentException("The stream is not writable.", "output"); + + this.bw = new BitWriter(this.output); + this.blockSize100k = blockSize; + this.compressor = new BZip2Compressor(this.bw, blockSize); + this.leaveOpen = leaveOpen; + this.combinedCRC = 0; + EmitHeader(); + } + + + + + /// + /// Close the stream. + /// + /// + /// + /// This may or may not close the underlying stream. Check the + /// constructors that accept a bool value. + /// + /// + public override void Close() + { + if (output != null) + { + Stream o = this.output; + Finish(); + if (!leaveOpen) + o.Close(); + } + } + + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (this.output != null) + { + this.bw.Flush(); + this.output.Flush(); + } + } + + private void EmitHeader() + { + var magic = new byte[] { + (byte) 'B', + (byte) 'Z', + (byte) 'h', + (byte) ('0' + this.blockSize100k) + }; + + // not necessary to shred the initial magic bytes + this.output.Write(magic, 0, magic.Length); + } + + private void EmitTrailer() + { + // A magic 48-bit number, 0x177245385090, to indicate the end + // of the last block. (sqrt(pi), if you want to know) + + TraceOutput(TraceBits.Write, "total written out: {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut); + + // must shred + this.bw.WriteByte(0x17); + this.bw.WriteByte(0x72); + this.bw.WriteByte(0x45); + this.bw.WriteByte(0x38); + this.bw.WriteByte(0x50); + this.bw.WriteByte(0x90); + + this.bw.WriteInt(this.combinedCRC); + + this.bw.FinishAndPad(); + + TraceOutput(TraceBits.Write, "final total: {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut); + } + + void Finish() + { + // Console.WriteLine("BZip2:Finish"); + + try + { + var totalBefore = this.bw.TotalBytesWrittenOut; + this.compressor.CompressAndWrite(); + TraceOutput(TraceBits.Write,"out block length (bytes): {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut - totalBefore); + + TraceOutput(TraceBits.Crc, " combined CRC (before): {0:X8}", + this.combinedCRC); + this.combinedCRC = (this.combinedCRC << 1) | (this.combinedCRC >> 31); + this.combinedCRC ^= (uint) compressor.Crc32; + TraceOutput(TraceBits.Crc, " block CRC : {0:X8}", + this.compressor.Crc32); + TraceOutput(TraceBits.Crc, " combined CRC (final) : {0:X8}", + this.combinedCRC); + + EmitTrailer(); + } + finally + { + this.output = null; + this.compressor = null; + this.bw = null; + } + } + + + /// + /// The blocksize parameter specified at construction time. + /// + public int BlockSize + { + get { return this.blockSize100k; } + } + + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// Use the BZip2OutputStream to compress data while writing: + /// create a BZip2OutputStream with a writable output stream. + /// Then call Write() on that BZip2OutputStream, providing + /// uncompressed data as input. The data sent to the output stream will + /// be the compressed form of the input data. + /// + /// + /// + /// A BZip2OutputStream can be used only for Write() not for Read(). + /// + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (offset < 0) + throw new IndexOutOfRangeException(String.Format("offset ({0}) must be > 0", offset)); + if (count < 0) + throw new IndexOutOfRangeException(String.Format("count ({0}) must be > 0", count)); + if (offset + count > buffer.Length) + throw new IndexOutOfRangeException(String.Format("offset({0}) count({1}) bLength({2})", + offset, count, buffer.Length)); + if (this.output == null) + throw new IOException("the stream is not open"); + + if (count == 0) return; // nothing to do + + int bytesWritten = 0; + int bytesRemaining = count; + + do + { + int n = compressor.Fill(buffer, offset, bytesRemaining); + if (n != bytesRemaining) + { + // The compressor data block is full. Compress and + // write out the compressed data, then reset the + // compressor and continue. + + var totalBefore = this.bw.TotalBytesWrittenOut; + this.compressor.CompressAndWrite(); + TraceOutput(TraceBits.Write,"out block length (bytes): {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut - totalBefore); + + // and now any remaining bits + TraceOutput(TraceBits.Write, + " remaining: {0} 0x{1:X}", + this.bw.NumRemainingBits, + this.bw.RemainingBits); + + TraceOutput(TraceBits.Crc, " combined CRC (before): {0:X8}", + this.combinedCRC); + this.combinedCRC = (this.combinedCRC << 1) | (this.combinedCRC >> 31); + this.combinedCRC ^= (uint) compressor.Crc32; + TraceOutput(TraceBits.Crc, " block CRC : {0:X8}", + compressor.Crc32); + TraceOutput(TraceBits.Crc, " combined CRC (after) : {0:X8}", + this.combinedCRC); + offset += n; + } + bytesRemaining -= n; + bytesWritten += n; + } while (bytesRemaining > 0); + + totalBytesWrittenIn += bytesWritten; + } + + + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value is always false. + /// + public override bool CanRead + { + get { return false; } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value should always be true, unless and until the + /// object is disposed and closed. + /// + public override bool CanWrite + { + get + { + if (this.output == null) throw new ObjectDisposedException("BZip2Stream"); + return this.output.CanWrite; + } + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the + /// total number of uncompressed bytes written through. + /// + public override long Position + { + get + { + return this.totalBytesWrittenIn; + } + set { throw new NotImplementedException(); } + } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + /// this is irrelevant, since it will always throw! + /// irrelevant! + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this parameter is never used + /// this parameter is never used + /// this parameter is never used + /// never returns anything; always throws + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + + + // used only when Trace is defined + [Flags] + enum TraceBits : uint + { + None = 0, + Crc = 1, + Write = 2, + All = 0xffffffff, + } + + + [System.Diagnostics.ConditionalAttribute("Trace")] + private void TraceOutput(TraceBits bits, string format, params object[] varParams) + { + if ((bits & this.desiredTrace) != 0) + { + //lock(outputLock) + { + int tid = System.Threading.Thread.CurrentThread.GetHashCode(); +#if !SILVERLIGHT && !NETCF + Console.ForegroundColor = (ConsoleColor) (tid % 8 + 10); +#endif + Console.Write("{0:000} PBOS ", tid); + Console.WriteLine(format, varParams); +#if !SILVERLIGHT && !NETCF + Console.ResetColor(); +#endif + } + } + } + + + } + +} diff --git a/dotNetZip/BZip2/BitWriter.cs b/dotNetZip/BZip2/BitWriter.cs new file mode 100644 index 0000000..b739f02 --- /dev/null +++ b/dotNetZip/BZip2/BitWriter.cs @@ -0,0 +1,248 @@ +// BitWriter.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-25 18:57:31> +// +// ------------------------------------------------------------------ +// +// This module defines the BitWriter class, which writes bits at a time +// to an output stream. It's used by the BZip2Compressor class, and by +// the BZip2OutputStream class and its parallel variant, +// ParallelBZip2OutputStream. +// +// ------------------------------------------------------------------ + +// +// Design notes: +// +// BZip2 employs byte-shredding in its data format - rather than +// aligning all data items in a compressed .bz2 file on byte barriers, +// the BZip2 format uses portions of bytes to represent independent +// pieces of information. This "shredding" starts with the first +// "randomised" bit - just 12 bytes or so into a bz2 file or stream. But +// the approach is used extensively in bzip2 files - sometimes 5 bits +// are used, sometimes 24 or 3 bits, sometimes just 1 bit, and so on. +// It's not possible to send this information directly to a stream in +// this form; Streams in .NET accept byte-oriented input. Therefore, +// when actually writing a bz2 file, the output data must be organized +// into a byte-aligned format before being written to the output stream. +// +// This BitWriter class provides the byte-shredding necessary for BZip2 +// output. Think of this class as an Adapter that enables Bit-oriented +// output to a standard byte-oriented .NET stream. This class writes +// data out to the captive output stream only after the data bits have +// been accumulated and aligned. For example, suppose that during +// operation, the BZip2 compressor emits 5 bits, then 24 bits, then 32 +// bits. When the first 5 bits are sent to the BitWriter, nothing is +// written to the output stream; instead these 5 bits are simply stored +// in the internal accumulator. When the next 24 bits are written, the +// first 3 bits are gathered with the accumulated bits. The resulting +// 5+3 constitutes an entire byte; the BitWriter then actually writes +// that byte to the output stream. This leaves 21 bits. BitWriter writes +// 2 more whole bytes (16 more bits), in 8-bit chunks, leaving 5 in the +// accumulator. BitWriter then follows the same procedure with the 32 +// new bits. And so on. +// +// A quick tour of the implementation: +// +// The accumulator is a uint - so it can accumulate at most 4 bytes of +// information. In practice because of the design of this class, it +// never accumulates more than 3 bytes. +// +// The Flush() method emits all whole bytes available. After calling +// Flush(), there may be between 0-7 bits yet to be emitted into the +// output stream. +// +// FinishAndPad() emits all data, including the last partial byte and +// any necessary padding. In effect, it establishes a byte-alignment +// barrier. To support bzip2, FinishAndPad() should be called only once +// for a bz2 file, after the last bit of data has been written through +// this adapter. Other binary file formats may use byte-alignment at +// various points within the file, and FinishAndPad() would support that +// scenario. +// +// The internal fn Reset() is used to reset the state of the adapter; +// this class is used by BZip2Compressor, instances of which get re-used +// by multiple distinct threads, for different blocks of data. +// + + +using System; +using System.IO; + +namespace Ionic.BZip2 +{ + + internal class BitWriter + { + uint accumulator; + int nAccumulatedBits; + Stream output; + int totalBytesWrittenOut; + + public BitWriter(Stream s) + { + this.output = s; + } + + /// + /// Delivers the remaining bits, left-aligned, in a byte. + /// + /// + /// + /// This is valid only if NumRemainingBits is less than 8; + /// in other words it is valid only after a call to Flush(). + /// + /// + public byte RemainingBits + { + get + { + return (byte) (this.accumulator >> (32 - this.nAccumulatedBits) & 0xff); + } + } + + public int NumRemainingBits + { + get + { + return this.nAccumulatedBits; + } + } + + public int TotalBytesWrittenOut + { + get + { + return this.totalBytesWrittenOut; + } + } + + /// + /// Reset the BitWriter. + /// + /// + /// + /// This is useful when the BitWriter writes into a MemoryStream, and + /// is used by a BZip2Compressor, which itself is re-used for multiple + /// distinct data blocks. + /// + /// + public void Reset() + { + this.accumulator = 0; + this.nAccumulatedBits = 0; + this.totalBytesWrittenOut = 0; + this.output.Seek(0, SeekOrigin.Begin); + this.output.SetLength(0); + } + + /// + /// Write some number of bits from the given value, into the output. + /// + /// + /// + /// The nbits value should be a max of 25, for safety. For performance + /// reasons, this method does not check! + /// + /// + public void WriteBits(int nbits, uint value) + { + int nAccumulated = this.nAccumulatedBits; + uint u = this.accumulator; + + while (nAccumulated >= 8) + { + this.output.WriteByte ((byte)(u >> 24 & 0xff)); + this.totalBytesWrittenOut++; + u <<= 8; + nAccumulated -= 8; + } + + this.accumulator = u | (value << (32 - nAccumulated - nbits)); + this.nAccumulatedBits = nAccumulated + nbits; + + // Console.WriteLine("WriteBits({0}, 0x{1:X2}) => {2:X8} n({3})", + // nbits, value, accumulator, nAccumulatedBits); + // Console.ReadLine(); + + // At this point the accumulator may contain up to 31 bits waiting for + // output. + } + + + /// + /// Write a full 8-bit byte into the output. + /// + public void WriteByte(byte b) + { + WriteBits(8, b); + } + + /// + /// Write four 8-bit bytes into the output. + /// + public void WriteInt(uint u) + { + WriteBits(8, (u >> 24) & 0xff); + WriteBits(8, (u >> 16) & 0xff); + WriteBits(8, (u >> 8) & 0xff); + WriteBits(8, u & 0xff); + } + + /// + /// Write all available byte-aligned bytes. + /// + /// + /// + /// This method writes no new output, but flushes any accumulated + /// bits. At completion, the accumulator may contain up to 7 + /// bits. + /// + /// + /// This is necessary when re-assembling output from N independent + /// compressors, one for each of N blocks. The output of any + /// particular compressor will in general have some fragment of a byte + /// remaining. This fragment needs to be accumulated into the + /// parent BZip2OutputStream. + /// + /// + public void Flush() + { + WriteBits(0,0); + } + + + /// + /// Writes all available bytes, and emits padding for the final byte as + /// necessary. This must be the last method invoked on an instance of + /// BitWriter. + /// + public void FinishAndPad() + { + Flush(); + + if (this.NumRemainingBits > 0) + { + byte b = (byte)((this.accumulator >> 24) & 0xff); + this.output.WriteByte(b); + this.totalBytesWrittenOut++; + } + } + + } + +} \ No newline at end of file diff --git a/dotNetZip/BZip2/NOTICE.txt b/dotNetZip/BZip2/NOTICE.txt new file mode 100644 index 0000000..a5331f0 --- /dev/null +++ b/dotNetZip/BZip2/NOTICE.txt @@ -0,0 +1,5 @@ +Apache Commons Compress +Copyright 2002-2010 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). diff --git a/dotNetZip/BZip2/ParallelBZip2OutputStream.cs b/dotNetZip/BZip2/ParallelBZip2OutputStream.cs new file mode 100644 index 0000000..b6f241f --- /dev/null +++ b/dotNetZip/BZip2/ParallelBZip2OutputStream.cs @@ -0,0 +1,999 @@ +//#define Trace + +// ParallelBZip2OutputStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-02 16:44:24> +// +// ------------------------------------------------------------------ +// +// This module defines the ParallelBZip2OutputStream class, which is a +// BZip2 compressing stream. This code was derived in part from Apache +// commons source code. The license below applies to the original Apache +// code. +// +// ------------------------------------------------------------------ +// flymake: csc.exe /t:module BZip2InputStream.cs BZip2Compressor.cs Rand.cs BCRC32.cs @@FILE@@ + + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +// Design Notes: +// +// This class follows the classic Decorator pattern: it is a Stream that +// wraps itself around a Stream, and in doing so provides bzip2 +// compression as callers Write into it. It is exactly the same in +// outward function as the BZip2OutputStream, except that this class can +// perform compression using multiple independent threads. Because of +// that, and because of the CPU-intensive nature of BZip2 compression, +// this class can perform significantly better (in terms of wall-click +// time) than the single-threaded variant, at the expense of memory and +// CPU utilization. +// +// BZip2 is a straightforward data format: there are 4 magic bytes at +// the top of the file, followed by 1 or more compressed blocks. There +// is a small "magic byte" trailer after all compressed blocks. +// +// In concept parallelizing BZip2 is simple: do the CPU-intensive +// compression for each block in a separate thread, then emit the +// compressed output, in order, to the output stream. Each block can be +// compressed independently, so a block is the natural candidate for the +// parcel of work that can be passed to an independent worker thread. +// +// The design approach used here is simple: within the Write() method of +// the stream, fill a block. When the block is full, pass it to a +// background worker thread for compression. When the compressor thread +// completes its work, the main thread (the application thread that +// calls Write()) can send the compressed data to the output stream, +// being careful to respect the order of the compressed blocks. +// +// The challenge of ordering the compressed data is a solved and +// well-understood problem - it is the same approach here as DotNetZip +// uses in the ParallelDeflateOutputStream. It is a map/reduce approach +// in design intent. +// +// One new twist for BZip2 is that the compressor output is not +// byte-aligned. In other words the final output of a compressed block +// will in general be a number of bits that is not a multiple of +// 8. Therefore, combining the ordered results of the N compressor +// threads requires additional byte-shredding by the parent +// stream. Hence this stream uses a BitWriter to adapt bit-oriented +// BZip2 output to the byte-oriented .NET Stream. +// +// The approach used here creates N instances of the BZip2Compressor +// type, where N is governed by the number of cores (cpus) and limited +// by the MaxWorkers property exposed by this class. Each +// BZip2Compressor instance gets its own MemoryStream, to which it +// writes its data, via a BitWriter. +// +// along with the bit accumulator described above. The MemoryStream +// would gather the byte-aligned compressed output of the compressor. + +// When reducing the output of the various workers, this class must +// again do the byte-shredding thing. The data from the compressors is +// therefore shredded twice: once when being placed into the +// MemoryStream, and again when emitted into the final output stream +// that this class decorates. This is an unfortunate and seemingly +// unavoidable inefficiency. Two rounds of byte-shredding will use more +// CPU than we'd like, but I haven't imagined a way to avoid it. +// +// The BZip2Compressor is designed to write directly into the parent +// stream's accumulator (BitWriter) when possible, and write into a +// distinct BitWriter when necessary. The former can be used in a +// single-thread scenario, while the latter is required in a +// multi-thread scenario. +// +// ---- +// +// Regarding the Apache code base: Most of the code in this particular +// class is related to stream operations and thread synchronization, and +// is my own code. It largely does not rely on any code obtained from +// Apache commons. If you compare this code with the Apache commons +// BZip2OutputStream, you will see very little code that is common, +// except for the nearly-boilerplate structure that is common to all +// subtypes of System.IO.Stream. There may be some small remnants of +// code in this module derived from the Apache stuff, which is why I +// left the license in here. Most of the Apache commons compressor magic +// has been ported into the BZip2Compressor class. +// + +using System; +using System.IO; +using System.Collections.Generic; +using System.Threading; + +namespace Ionic.BZip2 +{ + internal class WorkItem + { + public int index; + public BZip2Compressor Compressor { get; private set; } + public MemoryStream ms; + public int ordinal; + public BitWriter bw; + + public WorkItem(int ix, int blockSize) + { + // compressed data gets written to a MemoryStream + this.ms = new MemoryStream(); + this.bw = new BitWriter(ms); + this.Compressor = new BZip2Compressor(bw, blockSize); + this.index = ix; + } + } + + + /// + /// A write-only decorator stream that compresses data as it is + /// written using the BZip2 algorithm. This stream compresses by + /// block using multiple threads. + /// + /// + /// This class performs BZIP2 compression through writing. For + /// more information on the BZIP2 algorithm, see + /// . + /// + /// + /// + /// This class is similar to , + /// except that this implementation uses an approach that employs multiple + /// worker threads to perform the compression. On a multi-cpu or multi-core + /// computer, the performance of this class can be significantly higher than + /// the single-threaded BZip2OutputStream, particularly for larger streams. + /// How large? Anything over 10mb is a good candidate for parallel + /// compression. + /// + /// + /// + /// The tradeoff is that this class uses more memory and more CPU than the + /// vanilla BZip2OutputStream. Also, for small files, the + /// ParallelBZip2OutputStream can be much slower than the vanilla + /// BZip2OutputStream, because of the overhead associated to using the + /// thread pool. + /// + /// + /// + public class ParallelBZip2OutputStream : System.IO.Stream + { + private static readonly int BufferPairsPerCore = 4; + private int _maxWorkers; + private bool firstWriteDone; + private int lastFilled; + private int lastWritten; + private int latestCompressed; + private int currentlyFilling; + private volatile Exception pendingException; + private bool handlingException; + private bool emitting; + private System.Collections.Generic.Queue toWrite; + private System.Collections.Generic.Queue toFill; + private System.Collections.Generic.List pool; + private object latestLock = new object(); + private object eLock = new object(); // for exceptions + private object outputLock = new object(); // for multi-thread output + private AutoResetEvent newlyCompressedBlob; + + long totalBytesWrittenIn; + long totalBytesWrittenOut; + bool leaveOpen; + uint combinedCRC; + Stream output; + BitWriter bw; + int blockSize100k; // 0...9 + + private TraceBits desiredTrace = TraceBits.Crc | TraceBits.Write; + + /// + /// Constructs a new ParallelBZip2OutputStream, that sends its + /// compressed output to the given output stream. + /// + /// + /// + /// The destination stream, to which compressed output will be sent. + /// + /// + /// + /// + /// This example reads a file, then compresses it with bzip2 file, + /// and writes the compressed data into a newly created file. + /// + /// + /// var fname = "logfile.log"; + /// using (var fs = File.OpenRead(fname)) + /// { + /// var outFname = fname + ".bz2"; + /// using (var output = File.Create(outFname)) + /// { + /// using (var compressor = new Ionic.BZip2.ParallelBZip2OutputStream(output)) + /// { + /// byte[] buffer = new byte[2048]; + /// int n; + /// while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + public ParallelBZip2OutputStream(Stream output) + : this(output, BZip2.MaxBlockSize, false) + { + } + + /// + /// Constructs a new ParallelBZip2OutputStream with specified blocksize. + /// + /// the destination stream. + /// + /// The blockSize in units of 100000 bytes. + /// The valid range is 1..9. + /// + public ParallelBZip2OutputStream(Stream output, int blockSize) + : this(output, blockSize, false) + { + } + + /// + /// Constructs a new ParallelBZip2OutputStream. + /// + /// the destination stream. + /// + /// whether to leave the captive stream open upon closing this stream. + /// + public ParallelBZip2OutputStream(Stream output, bool leaveOpen) + : this(output, BZip2.MaxBlockSize, leaveOpen) + { + } + + /// + /// Constructs a new ParallelBZip2OutputStream with specified blocksize, + /// and explicitly specifies whether to leave the wrapped stream open. + /// + /// + /// the destination stream. + /// + /// The blockSize in units of 100000 bytes. + /// The valid range is 1..9. + /// + /// + /// whether to leave the captive stream open upon closing this stream. + /// + public ParallelBZip2OutputStream(Stream output, int blockSize, bool leaveOpen) + { + if (blockSize < BZip2.MinBlockSize || blockSize > BZip2.MaxBlockSize) + { + var msg = String.Format("blockSize={0} is out of range; must be between {1} and {2}", + blockSize, + BZip2.MinBlockSize, BZip2.MaxBlockSize); + throw new ArgumentException(msg, "blockSize"); + } + + this.output = output; + if (!this.output.CanWrite) + throw new ArgumentException("The stream is not writable.", "output"); + + this.bw = new BitWriter(this.output); + this.blockSize100k = blockSize; + this.leaveOpen = leaveOpen; + this.combinedCRC = 0; + this.MaxWorkers = 16; // default + EmitHeader(); + } + + + private void InitializePoolOfWorkItems() + { + this.toWrite = new Queue(); + this.toFill = new Queue(); + this.pool = new System.Collections.Generic.List(); + int nWorkers = BufferPairsPerCore * Environment.ProcessorCount; + nWorkers = Math.Min(nWorkers, this.MaxWorkers); + for(int i=0; i < nWorkers; i++) + { + this.pool.Add(new WorkItem(i, this.blockSize100k)); + this.toFill.Enqueue(i); + } + + this.newlyCompressedBlob = new AutoResetEvent(false); + this.currentlyFilling = -1; + this.lastFilled = -1; + this.lastWritten = -1; + this.latestCompressed = -1; + } + + + /// + /// The maximum number of concurrent compression worker threads to use. + /// + /// + /// + /// + /// This property sets an upper limit on the number of concurrent worker + /// threads to employ for compression. The implementation of this stream + /// employs multiple threads from the .NET thread pool, via + /// ThreadPool.QueueUserWorkItem(), to compress the incoming data by + /// block. As each block of data is compressed, this stream re-orders the + /// compressed blocks and writes them to the output stream. + /// + /// + /// + /// A higher number of workers enables a higher degree of + /// parallelism, which tends to increase the speed of compression on + /// multi-cpu computers. On the other hand, a higher number of buffer + /// pairs also implies a larger memory consumption, more active worker + /// threads, and a higher cpu utilization for any compression. This + /// property enables the application to limit its memory consumption and + /// CPU utilization behavior depending on requirements. + /// + /// + /// + /// By default, DotNetZip allocates 4 workers per CPU core, subject to the + /// upper limit specified in this property. For example, suppose the + /// application sets this property to 16. Then, on a machine with 2 + /// cores, DotNetZip will use 8 workers; that number does not exceed the + /// upper limit specified by this property, so the actual number of + /// workers used will be 4 * 2 = 8. On a machine with 4 cores, DotNetZip + /// will use 16 workers; again, the limit does not apply. On a machine + /// with 8 cores, DotNetZip will use 16 workers, because of the limit. + /// + /// + /// + /// For each compression "worker thread" that occurs in parallel, there is + /// up to 2mb of memory allocated, for buffering and processing. The + /// actual number depends on the property. + /// + /// + /// + /// CPU utilization will also go up with additional workers, because a + /// larger number of buffer pairs allows a larger number of background + /// threads to compress in parallel. If you find that parallel + /// compression is consuming too much memory or CPU, you can adjust this + /// value downward. + /// + /// + /// + /// The default value is 16. Different values may deliver better or + /// worse results, depending on your priorities and the dynamic + /// performance characteristics of your storage and compute resources. + /// + /// + /// + /// The application can set this value at any time, but it is effective + /// only before the first call to Write(), which is when the buffers are + /// allocated. + /// + /// + public int MaxWorkers + { + get + { + return _maxWorkers; + } + set + { + if (value < 4) + throw new ArgumentException("MaxWorkers", + "Value must be 4 or greater."); + _maxWorkers = value; + } + } + + /// + /// Close the stream. + /// + /// + /// + /// This may or may not close the underlying stream. Check the + /// constructors that accept a bool value. + /// + /// + public override void Close() + { + if (this.pendingException != null) + { + this.handlingException = true; + var pe = this.pendingException; + this.pendingException = null; + throw pe; + } + + if (this.handlingException) + return; + + if (output == null) + return; + + Stream o = this.output; + + try + { + FlushOutput(true); + } + finally + { + this.output = null; + this.bw = null; + } + + if (!leaveOpen) + o.Close(); + } + + + private void FlushOutput(bool lastInput) + { + if (this.emitting) return; + + // compress and write whatever is ready + if (this.currentlyFilling >= 0) + { + WorkItem workitem = this.pool[this.currentlyFilling]; + CompressOne(workitem); + this.currentlyFilling = -1; // get a new buffer next Write() + } + + if (lastInput) + { + EmitPendingBuffers(true, false); + EmitTrailer(); + } + else + { + EmitPendingBuffers(false, false); + } + } + + + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (this.output != null) + { + FlushOutput(false); + this.bw.Flush(); + this.output.Flush(); + } + } + + private void EmitHeader() + { + var magic = new byte[] { + (byte) 'B', + (byte) 'Z', + (byte) 'h', + (byte) ('0' + this.blockSize100k) + }; + + // not necessary to shred the initial magic bytes + this.output.Write(magic, 0, magic.Length); + } + + private void EmitTrailer() + { + // A magic 48-bit number, 0x177245385090, to indicate the end + // of the last block. (sqrt(pi), if you want to know) + + TraceOutput(TraceBits.Write, "total written out: {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut); + + // must shred + this.bw.WriteByte(0x17); + this.bw.WriteByte(0x72); + this.bw.WriteByte(0x45); + this.bw.WriteByte(0x38); + this.bw.WriteByte(0x50); + this.bw.WriteByte(0x90); + + this.bw.WriteInt(this.combinedCRC); + + this.bw.FinishAndPad(); + + TraceOutput(TraceBits.Write, "final total : {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut); + } + + + /// + /// The blocksize parameter specified at construction time. + /// + public int BlockSize + { + get { return this.blockSize100k; } + } + + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// Use the ParallelBZip2OutputStream to compress data while + /// writing: create a ParallelBZip2OutputStream with a writable + /// output stream. Then call Write() on that + /// ParallelBZip2OutputStream, providing uncompressed data as + /// input. The data sent to the output stream will be the compressed + /// form of the input data. + /// + /// + /// + /// A ParallelBZip2OutputStream can be used only for + /// Write() not for Read(). + /// + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + bool mustWait = false; + + // This method does this: + // 0. handles any pending exceptions + // 1. write any buffers that are ready to be written + // 2. fills a compressor buffer; when full, flip state to 'Filled', + // 3. if more data to be written, goto step 1 + + if (this.output == null) + throw new IOException("the stream is not open"); + + // dispense any exceptions that occurred on the BG threads + if (this.pendingException != null) + { + this.handlingException = true; + var pe = this.pendingException; + this.pendingException = null; + throw pe; + } + + if (offset < 0) + throw new IndexOutOfRangeException(String.Format("offset ({0}) must be > 0", offset)); + if (count < 0) + throw new IndexOutOfRangeException(String.Format("count ({0}) must be > 0", count)); + if (offset + count > buffer.Length) + throw new IndexOutOfRangeException(String.Format("offset({0}) count({1}) bLength({2})", + offset, count, buffer.Length)); + + + if (count == 0) return; // nothing to do + + + if (!this.firstWriteDone) + { + // Want to do this on first Write, first session, and not in the + // constructor. Must allow the MaxWorkers to change after + // construction, but before first Write(). + InitializePoolOfWorkItems(); + this.firstWriteDone = true; + } + + int bytesWritten = 0; + int bytesRemaining = count; + + do + { + // may need to make buffers available + EmitPendingBuffers(false, mustWait); + + mustWait = false; + + // get a compressor to fill + int ix = -1; + if (this.currentlyFilling >= 0) + { + ix = this.currentlyFilling; + } + else + { + if (this.toFill.Count == 0) + { + // No compressors available to fill, so... need to emit + // compressed buffers. + mustWait = true; + continue; + } + + ix = this.toFill.Dequeue(); + ++this.lastFilled; + } + + WorkItem workitem = this.pool[ix]; + workitem.ordinal = this.lastFilled; + + int n = workitem.Compressor.Fill(buffer, offset, bytesRemaining); + if (n != bytesRemaining) + { + if (!ThreadPool.QueueUserWorkItem( CompressOne, workitem )) + throw new Exception("Cannot enqueue workitem"); + + this.currentlyFilling = -1; // will get a new buffer next time + offset += n; + } + else + this.currentlyFilling = ix; + + bytesRemaining -= n; + bytesWritten += n; + } + while (bytesRemaining > 0); + + totalBytesWrittenIn += bytesWritten; + return; + } + + + + private void EmitPendingBuffers(bool doAll, bool mustWait) + { + // When combining parallel compression with a ZipSegmentedStream, it's + // possible for the ZSS to throw from within this method. In that + // case, Close/Dispose will be called on this stream, if this stream + // is employed within a using or try/finally pair as required. But + // this stream is unaware of the pending exception, so the Close() + // method invokes this method AGAIN. This can lead to a deadlock. + // Therefore, failfast if re-entering. + + if (emitting) return; + emitting = true; + + if (doAll || mustWait) + this.newlyCompressedBlob.WaitOne(); + + do + { + int firstSkip = -1; + int millisecondsToWait = doAll ? 200 : (mustWait ? -1 : 0); + int nextToWrite = -1; + + do + { + if (Monitor.TryEnter(this.toWrite, millisecondsToWait)) + { + nextToWrite = -1; + try + { + if (this.toWrite.Count > 0) + nextToWrite = this.toWrite.Dequeue(); + } + finally + { + Monitor.Exit(this.toWrite); + } + + if (nextToWrite >= 0) + { + WorkItem workitem = this.pool[nextToWrite]; + if (workitem.ordinal != this.lastWritten + 1) + { + // out of order. requeue and try again. + lock(this.toWrite) + { + this.toWrite.Enqueue(nextToWrite); + } + + if (firstSkip == nextToWrite) + { + // We went around the list once. + // None of the items in the list is the one we want. + // Now wait for a compressor to signal again. + this.newlyCompressedBlob.WaitOne(); + firstSkip = -1; + } + else if (firstSkip == -1) + firstSkip = nextToWrite; + + continue; + } + + firstSkip = -1; + + TraceOutput(TraceBits.Write, + "Writing block {0}", workitem.ordinal); + + // write the data to the output + var bw2 = workitem.bw; + bw2.Flush(); // not bw2.FinishAndPad()! + var ms = workitem.ms; + ms.Seek(0,SeekOrigin.Begin); + + // cannot dump bytes!! + // ms.WriteTo(this.output); + // + // must do byte shredding: + int n; + int y = -1; + long totOut = 0; + var buffer = new byte[1024]; + while ((n = ms.Read(buffer,0,buffer.Length)) > 0) + { +#if Trace + if (y == -1) // diagnostics only + { + var sb1 = new System.Text.StringBuilder(); + sb1.Append("first 16 whole bytes in block: "); + for (int z=0; z < 16; z++) + sb1.Append(String.Format(" {0:X2}", buffer[z])); + TraceOutput(TraceBits.Write, sb1.ToString()); + } +#endif + y = n; + for (int k=0; k < n; k++) + { + this.bw.WriteByte(buffer[k]); + } + totOut += n; + } +#if Trace + TraceOutput(TraceBits.Write,"out block length (bytes): {0} (0x{0:X})", totOut); + var sb = new System.Text.StringBuilder(); + sb.Append("final 16 whole bytes in block: "); + for (int z=0; z < 16; z++) + sb.Append(String.Format(" {0:X2}", buffer[y-1-12+z])); + TraceOutput(TraceBits.Write, sb.ToString()); +#endif + + // and now any remaining bits + TraceOutput(TraceBits.Write, + " remaining bits: {0} 0x{1:X}", + bw2.NumRemainingBits, + bw2.RemainingBits); + if (bw2.NumRemainingBits > 0) + { + this.bw.WriteBits(bw2.NumRemainingBits, bw2.RemainingBits); + } + + TraceOutput(TraceBits.Crc," combined CRC (before): {0:X8}", + this.combinedCRC); + this.combinedCRC = (this.combinedCRC << 1) | (this.combinedCRC >> 31); + this.combinedCRC ^= (uint) workitem.Compressor.Crc32; + + TraceOutput(TraceBits.Crc, + " block CRC : {0:X8}", + workitem.Compressor.Crc32); + TraceOutput(TraceBits.Crc, + " combined CRC (after) : {0:X8}", + this.combinedCRC); + TraceOutput(TraceBits.Write, + "total written out: {0} (0x{0:X})", + this.bw.TotalBytesWrittenOut); + TraceOutput(TraceBits.Write | TraceBits.Crc, ""); + + this.totalBytesWrittenOut += totOut; + + bw2.Reset(); + this.lastWritten = workitem.ordinal; + workitem.ordinal = -1; + this.toFill.Enqueue(workitem.index); + + // don't wait next time through + if (millisecondsToWait == -1) millisecondsToWait = 0; + } + } + else + nextToWrite = -1; + + } while (nextToWrite >= 0); + + } while (doAll && (this.lastWritten != this.latestCompressed)); + + if (doAll) + { + TraceOutput(TraceBits.Crc, + " combined CRC (final) : {0:X8}", this.combinedCRC); + } + + emitting = false; + } + + + private void CompressOne(Object wi) + { + // compress and one buffer + WorkItem workitem = (WorkItem) wi; + try + { + // compress and write to the compressor's MemoryStream + workitem.Compressor.CompressAndWrite(); + + lock(this.latestLock) + { + if (workitem.ordinal > this.latestCompressed) + this.latestCompressed = workitem.ordinal; + } + lock (this.toWrite) + { + this.toWrite.Enqueue(workitem.index); + } + this.newlyCompressedBlob.Set(); + } + catch (System.Exception exc1) + { + lock(this.eLock) + { + // expose the exception to the main thread + if (this.pendingException!=null) + this.pendingException = exc1; + } + } + } + + + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value is always false. + /// + public override bool CanRead + { + get { return false; } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (this.output == null) throw new ObjectDisposedException("BZip2Stream"); + return this.output.CanWrite; + } + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the + /// total number of uncompressed bytes written through. + /// + public override long Position + { + get + { + return this.totalBytesWrittenIn; + } + set { throw new NotImplementedException(); } + } + + /// + /// The total number of bytes written out by the stream. + /// + /// + /// This value is meaningful only after a call to Close(). + /// + public Int64 BytesWrittenOut { get { return totalBytesWrittenOut; } } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + /// this is irrelevant, since it will always throw! + /// irrelevant! + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this parameter is never used + /// this parameter is never used + /// this parameter is never used + /// never returns anything; always throws + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + + + // used only when Trace is defined + [Flags] + enum TraceBits : uint + { + None = 0, + Crc = 1, + Write = 2, + All = 0xffffffff, + } + + + [System.Diagnostics.ConditionalAttribute("Trace")] + private void TraceOutput(TraceBits bits, string format, params object[] varParams) + { + if ((bits & this.desiredTrace) != 0) + { + lock(outputLock) + { + int tid = Thread.CurrentThread.GetHashCode(); +#if !SILVERLIGHT + Console.ForegroundColor = (ConsoleColor) (tid % 8 + 10); +#endif + Console.Write("{0:000} PBOS ", tid); + Console.WriteLine(format, varParams); +#if !SILVERLIGHT + Console.ResetColor(); +#endif + } + } + } + + } + +} diff --git a/dotNetZip/BZip2/Properties/AssemblyInfo.cs b/dotNetZip/BZip2/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9473f11 Binary files /dev/null and b/dotNetZip/BZip2/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/BZip2/Rand.cs b/dotNetZip/BZip2/Rand.cs new file mode 100644 index 0000000..ac00dec --- /dev/null +++ b/dotNetZip/BZip2/Rand.cs @@ -0,0 +1,99 @@ +// Rand.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-31 15:09:16> +// +// ------------------------------------------------------------------ +// +// This module defines a helper class for the BZip2 classes. This code +// is derived from the original BZip2 source code. +// +// ------------------------------------------------------------------ + + +namespace Ionic.BZip2 +{ + internal static class Rand + { + private static int[] RNUMS = + { + 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, + 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, + 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, + 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, + 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, + 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, + 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, + 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, + 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, + 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, + 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, + 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, + 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, + 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, + 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, + 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, + 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, + 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, + 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, + 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, + 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, + 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, + 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, + 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, + 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, + 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, + 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, + 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, + 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, + 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, + 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, + 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, + 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, + 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, + 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, + 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, + 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, + 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, + 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, + 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, + 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, + 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, + 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, + 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, + 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, + 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, + 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, + 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, + 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, + 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, + 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, + 936, 638 + }; + + + /// + /// Returns the "random" number at a specific index. + /// + /// the index + /// the random number + internal static int Rnums(int i) + { + return RNUMS[i]; + } + } + +} \ No newline at end of file diff --git a/dotNetZip/BuildHelp.bat b/dotNetZip/BuildHelp.bat new file mode 100644 index 0000000..ab236f0 --- /dev/null +++ b/dotNetZip/BuildHelp.bat @@ -0,0 +1,3 @@ +@REM "C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilderConsole.exe" DotNetZip.shfb +c:\.net3.5\msbuild.exe /p:Configuration=Release Help\Dotnetzip.shfbproj +if exist c:\dinoch\dev\dotnet\pronounceword.exe (c:\dinoch\dev\dotnet\pronounceword.exe Build Complete > nul) diff --git a/dotNetZip/BuildProcessTemplates/DefaultTemplate.11.1.xaml b/dotNetZip/BuildProcessTemplates/DefaultTemplate.11.1.xaml new file mode 100644 index 0000000..bf54edf --- /dev/null +++ b/dotNetZip/BuildProcessTemplates/DefaultTemplate.11.1.xaml @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings()] + [False] + [New Microsoft.TeamFoundation.Build.Workflow.Activities.TestSpecList(New Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec("**\*test*.dll"))] + ["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"] + [False] + [True] + [True] + [Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All] + + + + [Microsoft.TeamFoundation.Build.Workflow.Activities.CodeAnalysisOption.AsConfigured] + [True] + [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] + [True] + [New Microsoft.TeamFoundation.Build.Workflow.Activities.SourceAndSymbolServerSettings(True, Nothing)] + [True] + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] + [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] + + + + + + + All + 11.0 + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotNetZip/BuildProcessTemplates/DefaultTemplate.xaml b/dotNetZip/BuildProcessTemplates/DefaultTemplate.xaml new file mode 100644 index 0000000..12cc624 --- /dev/null +++ b/dotNetZip/BuildProcessTemplates/DefaultTemplate.xaml @@ -0,0 +1,602 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Assembly references and imported namespaces serialized as XML namespaces + + + True + + + + + + + + + True + + + + + + + True + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + True + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + True + + + + + + + + + + + + + + + True + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + False + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/BuildProcessTemplates/LabDefaultTemplate.11.xaml b/dotNetZip/BuildProcessTemplates/LabDefaultTemplate.11.xaml new file mode 100644 index 0000000..9e1fb0b --- /dev/null +++ b/dotNetZip/BuildProcessTemplates/LabDefaultTemplate.11.xaml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + 11.0 + + + + + + 920,3702 + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + True + + + + + + + [LabWorkflowParameters.BuildDetails.BuildUri] + + + [ChildBuildDetail.Uri] + + + + + + + + + + + + [BuildLocation] + + + [If(LabWorkflowParameters.BuildDetails.Configuration Is Nothing, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsEmpty Or (SelectedBuildDetail.Information.GetNodesByType(Microsoft.TeamFoundation.Build.Common.InformationTypes.ConfigurationSummary, True)).Count = 1, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsPlatformEmptyOrAnyCpu, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Platform + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration)))] + + + + + + + + + + + + [LabEnvironmentUri] + + + [LabWorkflowParameters.EnvironmentDetails.LabEnvironmentUri.ToString()] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [PostDeploymentSnapshotName] + + + [If(LabWorkflowParameters.BuildDetails.IsTeamSystemBuild = True,String.Format("{0}_{1}_{2}", LabWorkflowParameters.DeploymentDetails.PostDeploymentSnapshotName, BuildNumber,BuildDetail.BuildNumber),String.Format("{0}_{1}", LabWorkflowParameters.DeploymentDetails.PostDeploymentSnapshotName, BuildDetail.BuildNumber))] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [BuildStatus] + + + [Microsoft.TeamFoundation.Build.Client.BuildStatus.PartiallySucceeded] + + + + + + + [BuildStatus] + + + [Microsoft.TeamFoundation.Build.Client.BuildStatus.Failed] + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/BuildProcessTemplates/UpgradeTemplate.xaml b/dotNetZip/BuildProcessTemplates/UpgradeTemplate.xaml new file mode 100644 index 0000000..166acb2 --- /dev/null +++ b/dotNetZip/BuildProcessTemplates/UpgradeTemplate.xaml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] + + + + [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] + [False] + [False] + + + + + + + + + + [Microsoft.TeamFoundation.VersionControl.Client.RecursionType.OneLevel] + [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] + + + + All + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/CommonSrc/CRC32.cs b/dotNetZip/CommonSrc/CRC32.cs new file mode 100644 index 0000000..97593b9 --- /dev/null +++ b/dotNetZip/CommonSrc/CRC32.cs @@ -0,0 +1,814 @@ +// CRC32.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-02 18:25:54> +// +// ------------------------------------------------------------------ +// +// This module defines the CRC32 class, which can do the CRC32 algorithm, using +// arbitrary starting polynomials, and bit reversal. The bit reversal is what +// distinguishes this CRC-32 used in BZip2 from the CRC-32 that is used in PKZIP +// files, or GZIP files. This class does both. +// +// ------------------------------------------------------------------ + + +using System; +using Interop = System.Runtime.InteropServices; + +namespace Ionic.Crc +{ + /// + /// Computes a CRC-32. The CRC-32 algorithm is parameterized - you + /// can set the polynomial and enable or disable bit + /// reversal. This can be used for GZIP, BZip2, or ZIP. + /// + /// + /// This type is used internally by DotNetZip; it is generally not used + /// directly by applications wishing to create, read, or manipulate zip + /// archive files. + /// + + [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000C")] + [Interop.ComVisible(true)] +#if !NETCF + [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)] +#endif + public class CRC32 + { + /// + /// Indicates the total number of bytes applied to the CRC. + /// + public Int64 TotalBytesRead + { + get + { + return _TotalBytesRead; + } + } + + /// + /// Indicates the current CRC for all blocks slurped in. + /// + public Int32 Crc32Result + { + get + { + return unchecked((Int32)(~_register)); + } + } + + /// + /// Returns the CRC32 for the specified stream. + /// + /// The stream over which to calculate the CRC32 + /// the CRC32 calculation + public Int32 GetCrc32(System.IO.Stream input) + { + return GetCrc32AndCopy(input, null); + } + + /// + /// Returns the CRC32 for the specified stream, and writes the input into the + /// output stream. + /// + /// The stream over which to calculate the CRC32 + /// The stream into which to deflate the input + /// the CRC32 calculation + public Int32 GetCrc32AndCopy(System.IO.Stream input, System.IO.Stream output) + { + if (input == null) + throw new Exception("The input stream must not be null."); + + unchecked + { + byte[] buffer = new byte[BUFFER_SIZE]; + int readSize = BUFFER_SIZE; + + _TotalBytesRead = 0; + int count = input.Read(buffer, 0, readSize); + if (output != null) output.Write(buffer, 0, count); + _TotalBytesRead += count; + while (count > 0) + { + SlurpBlock(buffer, 0, count); + count = input.Read(buffer, 0, readSize); + if (output != null) output.Write(buffer, 0, count); + _TotalBytesRead += count; + } + + return (Int32)(~_register); + } + } + + + /// + /// Get the CRC32 for the given (word,byte) combo. This is a + /// computation defined by PKzip for PKZIP 2.0 (weak) encryption. + /// + /// The word to start with. + /// The byte to combine it with. + /// The CRC-ized result. + public Int32 ComputeCrc32(Int32 W, byte B) + { + return _InternalComputeCrc32((UInt32)W, B); + } + + internal Int32 _InternalComputeCrc32(UInt32 W, byte B) + { + return (Int32)(crc32Table[(W ^ B) & 0xFF] ^ (W >> 8)); + } + + + /// + /// Update the value for the running CRC32 using the given block of bytes. + /// This is useful when using the CRC32() class in a Stream. + /// + /// block of bytes to slurp + /// starting point in the block + /// how many bytes within the block to slurp + public void SlurpBlock(byte[] block, int offset, int count) + { + if (block == null) + throw new Exception("The data buffer must not be null."); + + // bzip algorithm + for (int i = 0; i < count; i++) + { + int x = offset + i; + byte b = block[x]; + if (this.reverseBits) + { + UInt32 temp = (_register >> 24) ^ b; + _register = (_register << 8) ^ crc32Table[temp]; + } + else + { + UInt32 temp = (_register & 0x000000FF) ^ b; + _register = (_register >> 8) ^ crc32Table[temp]; + } + } + _TotalBytesRead += count; + } + + + /// + /// Process one byte in the CRC. + /// + /// the byte to include into the CRC . + public void UpdateCRC(byte b) + { + if (this.reverseBits) + { + UInt32 temp = (_register >> 24) ^ b; + _register = (_register << 8) ^ crc32Table[temp]; + } + else + { + UInt32 temp = (_register & 0x000000FF) ^ b; + _register = (_register >> 8) ^ crc32Table[temp]; + } + } + + /// + /// Process a run of N identical bytes into the CRC. + /// + /// + /// + /// This method serves as an optimization for updating the CRC when a + /// run of identical bytes is found. Rather than passing in a buffer of + /// length n, containing all identical bytes b, this method accepts the + /// byte value and the length of the (virtual) buffer - the length of + /// the run. + /// + /// + /// the byte to include into the CRC. + /// the number of times that byte should be repeated. + public void UpdateCRC(byte b, int n) + { + while (n-- > 0) + { + if (this.reverseBits) + { + uint temp = (_register >> 24) ^ b; + _register = (_register << 8) ^ crc32Table[(temp >= 0) + ? temp + : (temp + 256)]; + } + else + { + UInt32 temp = (_register & 0x000000FF) ^ b; + _register = (_register >> 8) ^ crc32Table[(temp >= 0) + ? temp + : (temp + 256)]; + + } + } + } + + + + private static uint ReverseBits(uint data) + { + unchecked + { + uint ret = data; + ret = (ret & 0x55555555) << 1 | (ret >> 1) & 0x55555555; + ret = (ret & 0x33333333) << 2 | (ret >> 2) & 0x33333333; + ret = (ret & 0x0F0F0F0F) << 4 | (ret >> 4) & 0x0F0F0F0F; + ret = (ret << 24) | ((ret & 0xFF00) << 8) | ((ret >> 8) & 0xFF00) | (ret >> 24); + return ret; + } + } + + private static byte ReverseBits(byte data) + { + unchecked + { + uint u = (uint)data * 0x00020202; + uint m = 0x01044010; + uint s = u & m; + uint t = (u << 2) & (m << 1); + return (byte)((0x01001001 * (s + t)) >> 24); + } + } + + + + private void GenerateLookupTable() + { + crc32Table = new UInt32[256]; + unchecked + { + UInt32 dwCrc; + byte i = 0; + do + { + dwCrc = i; + for (byte j = 8; j > 0; j--) + { + if ((dwCrc & 1) == 1) + { + dwCrc = (dwCrc >> 1) ^ dwPolynomial; + } + else + { + dwCrc >>= 1; + } + } + if (reverseBits) + { + crc32Table[ReverseBits(i)] = ReverseBits(dwCrc); + } + else + { + crc32Table[i] = dwCrc; + } + i++; + } while (i!=0); + } + +#if VERBOSE + Console.WriteLine(); + Console.WriteLine("private static readonly UInt32[] crc32Table = {"); + for (int i = 0; i < crc32Table.Length; i+=4) + { + Console.Write(" "); + for (int j=0; j < 4; j++) + { + Console.Write(" 0x{0:X8}U,", crc32Table[i+j]); + } + Console.WriteLine(); + } + Console.WriteLine("};"); + Console.WriteLine(); +#endif + } + + + private uint gf2_matrix_times(uint[] matrix, uint vec) + { + uint sum = 0; + int i=0; + while (vec != 0) + { + if ((vec & 0x01)== 0x01) + sum ^= matrix[i]; + vec >>= 1; + i++; + } + return sum; + } + + private void gf2_matrix_square(uint[] square, uint[] mat) + { + for (int i = 0; i < 32; i++) + square[i] = gf2_matrix_times(mat, mat[i]); + } + + + + /// + /// Combines the given CRC32 value with the current running total. + /// + /// + /// This is useful when using a divide-and-conquer approach to + /// calculating a CRC. Multiple threads can each calculate a + /// CRC32 on a segment of the data, and then combine the + /// individual CRC32 values at the end. + /// + /// the crc value to be combined with this one + /// the length of data the CRC value was calculated on + public void Combine(int crc, int length) + { + uint[] even = new uint[32]; // even-power-of-two zeros operator + uint[] odd = new uint[32]; // odd-power-of-two zeros operator + + if (length == 0) + return; + + uint crc1= ~_register; + uint crc2= (uint) crc; + + // put operator for one zero bit in odd + odd[0] = this.dwPolynomial; // the CRC-32 polynomial + uint row = 1; + for (int i = 1; i < 32; i++) + { + odd[i] = row; + row <<= 1; + } + + // put operator for two zero bits in even + gf2_matrix_square(even, odd); + + // put operator for four zero bits in odd + gf2_matrix_square(odd, even); + + uint len2 = (uint) length; + + // apply len2 zeros to crc1 (first square will put the operator for one + // zero byte, eight zero bits, in even) + do { + // apply zeros operator for this bit of len2 + gf2_matrix_square(even, odd); + + if ((len2 & 1)== 1) + crc1 = gf2_matrix_times(even, crc1); + len2 >>= 1; + + if (len2 == 0) + break; + + // another iteration of the loop with odd and even swapped + gf2_matrix_square(odd, even); + if ((len2 & 1)==1) + crc1 = gf2_matrix_times(odd, crc1); + len2 >>= 1; + + + } while (len2 != 0); + + crc1 ^= crc2; + + _register= ~crc1; + + //return (int) crc1; + return; + } + + + /// + /// Create an instance of the CRC32 class using the default settings: no + /// bit reversal, and a polynomial of 0xEDB88320. + /// + public CRC32() : this(false) + { + } + + /// + /// Create an instance of the CRC32 class, specifying whether to reverse + /// data bits or not. + /// + /// + /// specify true if the instance should reverse data bits. + /// + /// + /// + /// In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + /// want a CRC32 with compatibility with BZip2, you should pass true + /// here. In the CRC-32 used by GZIP and PKZIP, the bits are not + /// reversed; Therefore if you want a CRC32 with compatibility with + /// those, you should pass false. + /// + /// + public CRC32(bool reverseBits) : + this( unchecked((int)0xEDB88320), reverseBits) + { + } + + + /// + /// Create an instance of the CRC32 class, specifying the polynomial and + /// whether to reverse data bits or not. + /// + /// + /// The polynomial to use for the CRC, expressed in the reversed (LSB) + /// format: the highest ordered bit in the polynomial value is the + /// coefficient of the 0th power; the second-highest order bit is the + /// coefficient of the 1 power, and so on. Expressed this way, the + /// polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. + /// + /// + /// specify true if the instance should reverse data bits. + /// + /// + /// + /// + /// In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + /// want a CRC32 with compatibility with BZip2, you should pass true + /// here for the reverseBits parameter. In the CRC-32 used by + /// GZIP and PKZIP, the bits are not reversed; Therefore if you want a + /// CRC32 with compatibility with those, you should pass false for the + /// reverseBits parameter. + /// + /// + public CRC32(int polynomial, bool reverseBits) + { + this.reverseBits = reverseBits; + this.dwPolynomial = (uint) polynomial; + this.GenerateLookupTable(); + } + + /// + /// Reset the CRC-32 class - clear the CRC "remainder register." + /// + /// + /// + /// Use this when employing a single instance of this class to compute + /// multiple, distinct CRCs on multiple, distinct data blocks. + /// + /// + public void Reset() + { + _register = 0xFFFFFFFFU; + } + + // private member vars + private UInt32 dwPolynomial; + private Int64 _TotalBytesRead; + private bool reverseBits; + private UInt32[] crc32Table; + private const int BUFFER_SIZE = 8192; + private UInt32 _register = 0xFFFFFFFFU; + } + + + /// + /// A Stream that calculates a CRC32 (a checksum) on all bytes read, + /// or on all bytes written. + /// + /// + /// + /// + /// This class can be used to verify the CRC of a ZipEntry when + /// reading from a stream, or to calculate a CRC when writing to a + /// stream. The stream should be used to either read, or write, but + /// not both. If you intermix reads and writes, the results are not + /// defined. + /// + /// + /// + /// This class is intended primarily for use internally by the + /// DotNetZip library. + /// + /// + public class CrcCalculatorStream : System.IO.Stream, System.IDisposable + { + private static readonly Int64 UnsetLengthLimit = -99; + + internal System.IO.Stream _innerStream; + private CRC32 _Crc32; + private Int64 _lengthLimit = -99; + private bool _leaveOpen; + + /// + /// The default constructor. + /// + /// + /// + /// Instances returned from this constructor will leave the underlying + /// stream open upon Close(). The stream uses the default CRC32 + /// algorithm, which implies a polynomial of 0xEDB88320. + /// + /// + /// The underlying stream + public CrcCalculatorStream(System.IO.Stream stream) + : this(true, CrcCalculatorStream.UnsetLengthLimit, stream, null) + { + } + + /// + /// The constructor allows the caller to specify how to handle the + /// underlying stream at close. + /// + /// + /// + /// The stream uses the default CRC32 algorithm, which implies a + /// polynomial of 0xEDB88320. + /// + /// + /// The underlying stream + /// true to leave the underlying stream + /// open upon close of the CrcCalculatorStream; false otherwise. + public CrcCalculatorStream(System.IO.Stream stream, bool leaveOpen) + : this(leaveOpen, CrcCalculatorStream.UnsetLengthLimit, stream, null) + { + } + + /// + /// A constructor allowing the specification of the length of the stream + /// to read. + /// + /// + /// + /// The stream uses the default CRC32 algorithm, which implies a + /// polynomial of 0xEDB88320. + /// + /// + /// Instances returned from this constructor will leave the underlying + /// stream open upon Close(). + /// + /// + /// The underlying stream + /// The length of the stream to slurp + public CrcCalculatorStream(System.IO.Stream stream, Int64 length) + : this(true, length, stream, null) + { + if (length < 0) + throw new ArgumentException("length"); + } + + /// + /// A constructor allowing the specification of the length of the stream + /// to read, as well as whether to keep the underlying stream open upon + /// Close(). + /// + /// + /// + /// The stream uses the default CRC32 algorithm, which implies a + /// polynomial of 0xEDB88320. + /// + /// + /// The underlying stream + /// The length of the stream to slurp + /// true to leave the underlying stream + /// open upon close of the CrcCalculatorStream; false otherwise. + public CrcCalculatorStream(System.IO.Stream stream, Int64 length, bool leaveOpen) + : this(leaveOpen, length, stream, null) + { + if (length < 0) + throw new ArgumentException("length"); + } + + /// + /// A constructor allowing the specification of the length of the stream + /// to read, as well as whether to keep the underlying stream open upon + /// Close(), and the CRC32 instance to use. + /// + /// + /// + /// The stream uses the specified CRC32 instance, which allows the + /// application to specify how the CRC gets calculated. + /// + /// + /// The underlying stream + /// The length of the stream to slurp + /// true to leave the underlying stream + /// open upon close of the CrcCalculatorStream; false otherwise. + /// the CRC32 instance to use to calculate the CRC32 + public CrcCalculatorStream(System.IO.Stream stream, Int64 length, bool leaveOpen, + CRC32 crc32) + : this(leaveOpen, length, stream, crc32) + { + if (length < 0) + throw new ArgumentException("length"); + } + + + // This ctor is private - no validation is done here. This is to allow the use + // of a (specific) negative value for the _lengthLimit, to indicate that there + // is no length set. So we validate the length limit in those ctors that use an + // explicit param, otherwise we don't validate, because it could be our special + // value. + private CrcCalculatorStream + (bool leaveOpen, Int64 length, System.IO.Stream stream, CRC32 crc32) + : base() + { + _innerStream = stream; + _Crc32 = crc32 ?? new CRC32(); + _lengthLimit = length; + _leaveOpen = leaveOpen; + } + + + /// + /// Gets the total number of bytes run through the CRC32 calculator. + /// + /// + /// + /// This is either the total number of bytes read, or the total number of + /// bytes written, depending on the direction of this stream. + /// + public Int64 TotalBytesSlurped + { + get { return _Crc32.TotalBytesRead; } + } + + /// + /// Provides the current CRC for all blocks slurped in. + /// + /// + /// + /// The running total of the CRC is kept as data is written or read + /// through the stream. read this property after all reads or writes to + /// get an accurate CRC for the entire stream. + /// + /// + public Int32 Crc + { + get { return _Crc32.Crc32Result; } + } + + /// + /// Indicates whether the underlying stream will be left open when the + /// CrcCalculatorStream is Closed. + /// + /// + /// + /// Set this at any point before calling . + /// + /// + public bool LeaveOpen + { + get { return _leaveOpen; } + set { _leaveOpen = value; } + } + + /// + /// Read from the stream + /// + /// the buffer to read + /// the offset at which to start + /// the number of bytes to read + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + int bytesToRead = count; + + // Need to limit the # of bytes returned, if the stream is intended to have + // a definite length. This is especially useful when returning a stream for + // the uncompressed data directly to the application. The app won't + // necessarily read only the UncompressedSize number of bytes. For example + // wrapping the stream returned from OpenReader() into a StreadReader() and + // calling ReadToEnd() on it, We can "over-read" the zip data and get a + // corrupt string. The length limits that, prevents that problem. + + if (_lengthLimit != CrcCalculatorStream.UnsetLengthLimit) + { + if (_Crc32.TotalBytesRead >= _lengthLimit) return 0; // EOF + Int64 bytesRemaining = _lengthLimit - _Crc32.TotalBytesRead; + if (bytesRemaining < count) bytesToRead = (int)bytesRemaining; + } + int n = _innerStream.Read(buffer, offset, bytesToRead); + if (n > 0) _Crc32.SlurpBlock(buffer, offset, n); + return n; + } + + /// + /// Write to the stream. + /// + /// the buffer from which to write + /// the offset at which to start writing + /// the number of bytes to write + public override void Write(byte[] buffer, int offset, int count) + { + if (count > 0) _Crc32.SlurpBlock(buffer, offset, count); + _innerStream.Write(buffer, offset, count); + } + + /// + /// Indicates whether the stream supports reading. + /// + public override bool CanRead + { + get { return _innerStream.CanRead; } + } + + /// + /// Indicates whether the stream supports seeking. + /// + /// + /// + /// Always returns false. + /// + /// + public override bool CanSeek + { + get { return false; } + } + + /// + /// Indicates whether the stream supports writing. + /// + public override bool CanWrite + { + get { return _innerStream.CanWrite; } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + _innerStream.Flush(); + } + + /// + /// Returns the length of the underlying stream. + /// + public override long Length + { + get + { + if (_lengthLimit == CrcCalculatorStream.UnsetLengthLimit) + return _innerStream.Length; + else return _lengthLimit; + } + } + + /// + /// The getter for this property returns the total bytes read. + /// If you use the setter, it will throw + /// . + /// + public override long Position + { + get { return _Crc32.TotalBytesRead; } + set { throw new NotSupportedException(); } + } + + /// + /// Seeking is not supported on this stream. This method always throws + /// + /// + /// N/A + /// N/A + /// N/A + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + /// + /// This method always throws + /// + /// + /// N/A + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + + void IDisposable.Dispose() + { + Close(); + } + + /// + /// Closes the stream. + /// + public override void Close() + { + base.Close(); + if (!_leaveOpen) + _innerStream.Close(); + } + + } + +} \ No newline at end of file diff --git a/dotNetZip/CommonSrc/Iso8859Dash1Encoding.cs b/dotNetZip/CommonSrc/Iso8859Dash1Encoding.cs new file mode 100644 index 0000000..b182de8 --- /dev/null +++ b/dotNetZip/CommonSrc/Iso8859Dash1Encoding.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ionic.Encoding +{ + /// + /// Provides a text encoder for the iso-8859-1 encoding, aka Latin1 encoding, + /// for platforms that do not support it, for example on Silverlight or some + /// Compact Framework platforms. + /// + public class Iso8859Dash1Encoding : System.Text.Encoding + { + /// + /// Gets the name registered with the + /// Internet Assigned Numbers Authority (IANA) for the current encoding. + /// + /// + /// Always returns "iso-8859-1". + /// + public override string WebName + { + get { return "iso-8859-1"; } + } + + /// + /// Encodes a set of characters from a character array into + /// a byte array. + /// + /// + /// The actual number of bytes written into . + /// + /// The character array containing the set of characters to encode. + /// The index of the first character to encode. + /// The number of characters to encode. + /// The byte array to contain the resulting sequence of bytes. + /// The index at which to start writing the resulting sequence of bytes. + /// + public override int GetBytes(char[] chars, int start, int count, byte[] bytes, int byteIndex) + { + if (chars == null) + throw new ArgumentNullException("chars", "null array"); + + if (bytes == null) + throw new ArgumentNullException("bytes", "null array"); + + if (start < 0) + throw new ArgumentOutOfRangeException("start"); + if (count < 0) + throw new ArgumentOutOfRangeException("charCount"); + + if ((chars.Length - start) < count) + throw new ArgumentOutOfRangeException("chars"); + + if ((byteIndex < 0) || (byteIndex > bytes.Length)) + throw new ArgumentOutOfRangeException("byteIndex"); + + // iso-8859-1 is special in that it was adopted as the first page of + // UCS - ISO's Universal Coding Standard, described in ISO 10646, + // which is the same as Unicode. This means that a a Unicode + // character in the range of 0 to FF maps to the iso-8859-1 character + // with the same value. Because of that the encoding and decoding is + // trivial. + for (int i=0; i < count; i++) + { + char c = chars[start+i]; // get the unicode char + + if (c >= '\x00FF') // out of range? + bytes[byteIndex+i] = (byte) '?'; + else + bytes[byteIndex+i] = (byte) c; + } + return count; + } + + + /// + /// Decodes a sequence of bytes from the specified byte array into the specified character array. + /// + /// + /// The actual number of characters written into . + /// + /// The byte array containing the sequence of bytes to decode. + /// The index of the first byte to decode. + /// The number of bytes to decode. + /// The character array to contain the resulting set of characters. + /// The index at which to start writing the resulting set of characters. + /// + public override int GetChars(byte[] bytes, int start, int count, char[] chars, int charIndex) + { + if (chars == null) + throw new ArgumentNullException("chars", "null array"); + + if (bytes == null) + throw new ArgumentNullException("bytes", "null array"); + + if (start < 0) + throw new ArgumentOutOfRangeException("start"); + if (count < 0) + throw new ArgumentOutOfRangeException("charCount"); + + if ((bytes.Length - start) < count) + throw new ArgumentOutOfRangeException("bytes"); + + if ((charIndex < 0) || (charIndex > chars.Length)) + throw new ArgumentOutOfRangeException("charIndex"); + + // In the range 00 to FF, the Unicode characters are the same as the + // iso-8859-1 characters; because of that, decoding is trivial. + for (int i = 0; i < count; i++) + chars[charIndex + i] = (char) bytes[i + start]; + + return count; + } + + + /// + /// Calculates the number of bytes produced by encoding a set of characters + /// from the specified character array. + /// + /// + /// The number of bytes produced by encoding the specified characters. This class + /// alwas returns the value of . + /// + public override int GetByteCount(char[] chars, int index, int count) + { + return count; + } + + + /// + /// Calculates the number of characters produced by decoding a sequence + /// of bytes from the specified byte array. + /// + /// + /// The number of characters produced by decoding the specified sequence of bytes. This class + /// alwas returns the value of . + /// + public override int GetCharCount(byte[] bytes, int index, int count) + { + return count; + } + + + /// + /// Calculates the maximum number of bytes produced by encoding the specified number of characters. + /// + /// + /// The maximum number of bytes produced by encoding the specified number of characters. This + /// class alwas returns the value of . + /// + /// The number of characters to encode. + /// + public override int GetMaxByteCount(int charCount) + { + return charCount; + } + + /// + /// Calculates the maximum number of characters produced by decoding the specified number of bytes. + /// + /// + /// The maximum number of characters produced by decoding the specified number of bytes. This class + /// alwas returns the value of . + /// + /// The number of bytes to decode. + public override int GetMaxCharCount(int byteCount) + { + return byteCount; + } + + /// + /// Gets the number of characters that are supported by this encoding. + /// This property returns a maximum value of 256, as the encoding class + /// only supports single byte encodings (1 byte == 256 possible values). + /// + public static int CharacterCount + { + get { return 256; } + } + + } +} diff --git a/dotNetZip/DotNetZip.sln b/dotNetZip/DotNetZip.sln new file mode 100644 index 0000000..6b26b59 --- /dev/null +++ b/dotNetZip/DotNetZip.sln @@ -0,0 +1,413 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E1C14695-E75F-4317-919A-5341EA1F9C01}" + ProjectSection(SolutionItems) = preProject + DotNetZip.vsmdi = DotNetZip.vsmdi + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zip DLL", "Zip\Zip DLL.csproj", "{D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zip Tests", "Zip Tests\Zip Tests.csproj", "{549466CE-5CA6-4904-BA44-58141544BE70}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zip CF DLL", "Zip CF\Zip CF DLL.csproj", "{051C2B3B-8CDF-42CB-9EA2-027232BFC395}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zip SL", "Zip SL\Zip SL.csproj", "{1F27CA58-54BD-485A-BC24-3B9176F62AC3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zlib DLL", "Zlib\Zlib DLL.csproj", "{9816BA86-9250-4C00-A912-25F07F8677D1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zlib Tests", "Zlib Tests\Zlib Tests.csproj", "{047A98B2-BC96-41B4-ADD8-2167FB1B6502}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zlib CF DLL", "Zlib CF\Zlib CF DLL.csproj", "{E082D395-52BE-41EE-812B-8B09C51025B4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zlib SL DLL", "Zlib SL DLL\Zlib SL DLL.csproj", "{8E580B45-AECD-46BF-9D63-CD8BECE24D29}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BZip2 DLL", "BZip2\BZip2 DLL.csproj", "{E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BZip2 Tests", "BZip2 Tests\BZip2 Tests.csproj", "{11DC3AE9-D19F-4426-A7C8-15F17DE815BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BZip2 CF DLL", "BZip2 CF\BZip2 CF DLL.csproj", "{18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BZip2 SL DLL", "BZip2 SL DLL\BZip2 SL DLL.csproj", "{50E11F2C-9D49-45F5-A52D-560BE456CC04}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zip Reduced", "Zip Reduced\Zip Reduced.csproj", "{49A128D3-C3F2-46B1-8F7A-EECD209EA860}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CF-Unzipper", "Examples\CompactFramework\CF-Unzipper\CF-Unzipper.csproj", "{D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "QuickUnzip", "Examples\VB\Quick-Unzip\QuickUnzip.vbproj", "{95D9690B-3B37-4800-A511-6FB21436638B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZipDir", "Examples\C#\ZipDir\ZipDir.csproj", "{E04C2A53-3981-44D4-94AF-6AC07D97CDE8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateZip", "Examples\C#\CreateZip\CreateZip.csproj", "{FB9FC8D7-7897-4802-9694-F379F25C00CB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReadZip", "Examples\C#\ReadZip\ReadZip.csproj", "{F4024C01-1133-4A5A-B421-22EA8CA89EA5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BZip2", "Tools\BZip2\BZip2.csproj", "{C2241050-F23C-420B-AA67-60E94B34C2B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GZip", "Tools\GZip\GZip.csproj", "{52542D59-25EC-4EE4-8AF2-85DE50C70EA6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnZip", "Tools\UnZip\UnZip.csproj", "{A22C89E0-B5D4-4881-A61F-4B1FD82F2453}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZipIt", "Tools\ZipIt\ZipIt.csproj", "{98008721-C4DD-4F34-B3AE-A3453E29BB65}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConvertZipToSfx", "Tools\ConvertZipToSfx\ConvertZipToSfx.csproj", "{276B8174-A24E-4257-9969-42D692F8CAC2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win Forms App", "Tools\WinFormsApp\Win Forms App.csproj", "{6BCCF138-2EFB-464C-B872-E3079F0A4708}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZipTreeView", "Examples\C#\ZipTreeView\ZipTreeView.csproj", "{1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinForms-TreeViewZip", "Examples\VB\WinForms-TreeViewZip\WinForms-TreeViewZip\WinForms-TreeViewZip.vbproj", "{2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinForms-Unzip", "Examples\VB\WinForms-DotNetZip\WinForms-Unzip\WinForms-Unzip.vbproj", "{9E4C484D-656E-4E19-8741-5701D027AA51}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "DotNetZipUtils", "Setup Utils\DotNetZipUtils.wixproj", "{18B1CDB1-709D-46D4-A894-9FE0BF929686}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "DotNetZip Runtime", "Setup Runtime\DotNetZip Runtime.wixproj", "{CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{1BB61851-D01A-4788-8033-C1821FC3738B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compact Framework", "Compact Framework", "{7CFA8083-4960-4BFE-8DF0-16034C828CDE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E29C6340-FD50-4857-8C45-7BA227646B00}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setups", "Setups", "{70D5B6AD-813F-4CBC-AB08-60045171C377}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Silverlight", "Silverlight", "{E4B9972A-F80D-4D85-BF52-109D37856AC2}" +EndProject +Global + GlobalSection(TestCaseManagementSettings) = postSolution + CategoryFile = DotNetZip.vsmdi + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Release|Any CPU.Build.0 = Release|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A}.Release|x86.ActiveCfg = Release|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Debug|x86.ActiveCfg = Debug|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Release|Any CPU.Build.0 = Release|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {549466CE-5CA6-4904-BA44-58141544BE70}.Release|x86.ActiveCfg = Release|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Debug|Any CPU.Build.0 = Debug|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Debug|x86.ActiveCfg = Debug|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Release|Any CPU.ActiveCfg = Release|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Release|Any CPU.Build.0 = Release|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {051C2B3B-8CDF-42CB-9EA2-027232BFC395}.Release|x86.ActiveCfg = Release|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Debug|x86.ActiveCfg = Debug|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Release|Any CPU.Build.0 = Release|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {1F27CA58-54BD-485A-BC24-3B9176F62AC3}.Release|x86.ActiveCfg = Release|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Debug|x86.ActiveCfg = Debug|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Release|Any CPU.Build.0 = Release|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9816BA86-9250-4C00-A912-25F07F8677D1}.Release|x86.ActiveCfg = Release|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Debug|Any CPU.Build.0 = Debug|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Debug|x86.ActiveCfg = Debug|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Release|Any CPU.ActiveCfg = Release|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Release|Any CPU.Build.0 = Release|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {047A98B2-BC96-41B4-ADD8-2167FB1B6502}.Release|x86.ActiveCfg = Release|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Debug|x86.ActiveCfg = Debug|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Release|Any CPU.Build.0 = Release|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E082D395-52BE-41EE-812B-8B09C51025B4}.Release|x86.ActiveCfg = Release|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Debug|x86.ActiveCfg = Debug|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Release|Any CPU.Build.0 = Release|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8E580B45-AECD-46BF-9D63-CD8BECE24D29}.Release|x86.ActiveCfg = Release|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Debug|x86.ActiveCfg = Debug|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Release|Any CPU.Build.0 = Release|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E2CE0D56-7AF8-4404-BD0C-BC562CBD74D4}.Release|x86.ActiveCfg = Release|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Debug|x86.ActiveCfg = Debug|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Release|Any CPU.Build.0 = Release|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF}.Release|x86.ActiveCfg = Release|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Debug|x86.ActiveCfg = Debug|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Release|Any CPU.Build.0 = Release|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE}.Release|x86.ActiveCfg = Release|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Debug|x86.ActiveCfg = Debug|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Release|Any CPU.Build.0 = Release|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {50E11F2C-9D49-45F5-A52D-560BE456CC04}.Release|x86.ActiveCfg = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Debug|x86.ActiveCfg = Debug|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|Any CPU.Build.0 = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {49A128D3-C3F2-46B1-8F7A-EECD209EA860}.Release|x86.ActiveCfg = Release|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Debug|x86.ActiveCfg = Debug|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Release|Any CPU.Build.0 = Release|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B}.Release|x86.ActiveCfg = Release|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Debug|x86.ActiveCfg = Debug|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Release|Any CPU.Build.0 = Release|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {95D9690B-3B37-4800-A511-6FB21436638B}.Release|x86.ActiveCfg = Release|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Debug|x86.ActiveCfg = Debug|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Release|Any CPU.Build.0 = Release|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8}.Release|x86.ActiveCfg = Release|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Debug|x86.ActiveCfg = Debug|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Release|Any CPU.Build.0 = Release|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {FB9FC8D7-7897-4802-9694-F379F25C00CB}.Release|x86.ActiveCfg = Release|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Debug|x86.ActiveCfg = Debug|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Release|Any CPU.Build.0 = Release|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F4024C01-1133-4A5A-B421-22EA8CA89EA5}.Release|x86.ActiveCfg = Release|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Debug|x86.ActiveCfg = Debug|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Release|Any CPU.Build.0 = Release|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C2241050-F23C-420B-AA67-60E94B34C2B2}.Release|x86.ActiveCfg = Release|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Debug|x86.ActiveCfg = Debug|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Release|Any CPU.Build.0 = Release|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6}.Release|x86.ActiveCfg = Release|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Debug|x86.ActiveCfg = Debug|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Release|Any CPU.Build.0 = Release|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453}.Release|x86.ActiveCfg = Release|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Debug|x86.ActiveCfg = Debug|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Release|Any CPU.Build.0 = Release|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {98008721-C4DD-4F34-B3AE-A3453E29BB65}.Release|x86.ActiveCfg = Release|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Debug|x86.ActiveCfg = Debug|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Release|Any CPU.Build.0 = Release|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {276B8174-A24E-4257-9969-42D692F8CAC2}.Release|x86.ActiveCfg = Release|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Debug|x86.ActiveCfg = Debug|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Release|Any CPU.Build.0 = Release|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6BCCF138-2EFB-464C-B872-E3079F0A4708}.Release|x86.ActiveCfg = Release|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Debug|x86.ActiveCfg = Debug|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Release|Any CPU.Build.0 = Release|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF}.Release|x86.ActiveCfg = Release|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|x86.ActiveCfg = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|Any CPU.Build.0 = Release|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|x86.ActiveCfg = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|x86.ActiveCfg = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|Any CPU.Build.0 = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|x86.ActiveCfg = Release|Any CPU + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Debug|Any CPU.ActiveCfg = Debug|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Debug|x86.ActiveCfg = Debug|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Debug|x86.Build.0 = Debug|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Release|Any CPU.ActiveCfg = Release|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Release|Mixed Platforms.Build.0 = Release|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Release|x86.ActiveCfg = Release|x86 + {18B1CDB1-709D-46D4-A894-9FE0BF929686}.Release|x86.Build.0 = Release|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Debug|Any CPU.ActiveCfg = Debug|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Debug|x86.ActiveCfg = Debug|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Debug|x86.Build.0 = Debug|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Release|Any CPU.ActiveCfg = Release|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Release|Mixed Platforms.Build.0 = Release|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Release|x86.ActiveCfg = Release|x86 + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {047A98B2-BC96-41B4-ADD8-2167FB1B6502} = {E29C6340-FD50-4857-8C45-7BA227646B00} + {11DC3AE9-D19F-4426-A7C8-15F17DE815BF} = {E29C6340-FD50-4857-8C45-7BA227646B00} + {549466CE-5CA6-4904-BA44-58141544BE70} = {E29C6340-FD50-4857-8C45-7BA227646B00} + {E082D395-52BE-41EE-812B-8B09C51025B4} = {7CFA8083-4960-4BFE-8DF0-16034C828CDE} + {18A4AED9-D477-4C57-9C7A-C0CBBD5599DE} = {7CFA8083-4960-4BFE-8DF0-16034C828CDE} + {051C2B3B-8CDF-42CB-9EA2-027232BFC395} = {7CFA8083-4960-4BFE-8DF0-16034C828CDE} + {8E580B45-AECD-46BF-9D63-CD8BECE24D29} = {E4B9972A-F80D-4D85-BF52-109D37856AC2} + {50E11F2C-9D49-45F5-A52D-560BE456CC04} = {E4B9972A-F80D-4D85-BF52-109D37856AC2} + {1F27CA58-54BD-485A-BC24-3B9176F62AC3} = {E4B9972A-F80D-4D85-BF52-109D37856AC2} + {95D9690B-3B37-4800-A511-6FB21436638B} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {FB9FC8D7-7897-4802-9694-F379F25C00CB} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {F4024C01-1133-4A5A-B421-22EA8CA89EA5} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {9E4C484D-656E-4E19-8741-5701D027AA51} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B} = {F0743B6A-25EB-4D79-B5ED-AFB4F25C91B5} + {52542D59-25EC-4EE4-8AF2-85DE50C70EA6} = {1BB61851-D01A-4788-8033-C1821FC3738B} + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453} = {1BB61851-D01A-4788-8033-C1821FC3738B} + {98008721-C4DD-4F34-B3AE-A3453E29BB65} = {1BB61851-D01A-4788-8033-C1821FC3738B} + {276B8174-A24E-4257-9969-42D692F8CAC2} = {1BB61851-D01A-4788-8033-C1821FC3738B} + {6BCCF138-2EFB-464C-B872-E3079F0A4708} = {1BB61851-D01A-4788-8033-C1821FC3738B} + {C2241050-F23C-420B-AA67-60E94B34C2B2} = {1BB61851-D01A-4788-8033-C1821FC3738B} + {CC0B949C-4F52-4DC1-9925-64DAA1CDD79F} = {70D5B6AD-813F-4CBC-AB08-60045171C377} + {18B1CDB1-709D-46D4-A894-9FE0BF929686} = {70D5B6AD-813F-4CBC-AB08-60045171C377} + EndGlobalSection +EndGlobal diff --git a/dotNetZip/DotNetZip.vsmdi b/dotNetZip/DotNetZip.vsmdi new file mode 100644 index 0000000..d307431 --- /dev/null +++ b/dotNetZip/DotNetZip.vsmdi @@ -0,0 +1,404 @@ + + + + Basic smoke test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests for WinZip AES Encryption + + + + + + + + + + + + + + + + + + + + + + + + + + various tests for Streams, ZipOutputStream, etc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tests for compatibility with COM and other zip tools. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The standard list of tests. This is every test, except the "large number of small files" test, which takes a long time, and the winforms self extractor test, which requires user intervention. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/DotNetZip1.vsmdi b/dotNetZip/DotNetZip1.vsmdi new file mode 100644 index 0000000..568b317 --- /dev/null +++ b/dotNetZip/DotNetZip1.vsmdi @@ -0,0 +1,444 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + testing spanned or split steams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/EditCsproj.exe b/dotNetZip/EditCsproj.exe new file mode 100644 index 0000000..a6853a6 Binary files /dev/null and b/dotNetZip/EditCsproj.exe differ diff --git a/dotNetZip/Examples/ASP/AspClassic-ReadZip.asp b/dotNetZip/Examples/ASP/AspClassic-ReadZip.asp new file mode 100644 index 0000000..da84ce0 --- /dev/null +++ b/dotNetZip/Examples/ASP/AspClassic-ReadZip.asp @@ -0,0 +1,184 @@ +<%@ LANGUAGE = VBScript %> +<% Option Explicit %> +<% + +' ------------------------------------------------------- +' ASP DotNetZip Example +' ------------------------------------------------------- +' This example ASP page uses DotNetZip (Ionic.Zip.dll) via COM +' interop. The page opens a zip file, then allows the user +' to download any individual file within the zip file. +' +'' To get this to work, you must be sure to register DotNetZip for COM +'' interop (regasm). Also you need to be sure that IIS/ASP has the correct +'' permissions to instantiate the ZipFile object. In my experience I Was +'' able to do this by copying Ionic.Zip.dll to the +'' c:\windows\system32\inetsrv directory, then calling "regasm /codebbase +'' Ionic.Zip.dll" from within that directory. + +'' This example assumes that the ASP page is deployed into a directory, +'' that contains a subdirectory called "fodder". Fodder must be readable, +'' and should contain one or more zip files. This page allows the user to +'' select a zip file, then select a file within the zip file, and download +'' that file. +'' +'' + + + +If Request.Form("Submit") = "Download" Then + dim pathForZipFile, fileToDownload + pathForZipFile= Request.Form("zipFile") + if pathForZipFile <> "" Then + fileToDownload = Request.Form("fileToDownload") + Response.Clear + Response.AddHeader "Content-Disposition", "attachment; filename=" & fileToDownload + Response.ContentType = "application/octet-stream" + + pathForZipFile = Server.MapPath("fodder\" & pathForZipFile) + + dim zip, ms + set zip = Server.CreateObject("Ionic.Zip.ZipFile") + zip.Initialize(pathForZipFile) + + set ms = Server.CreateObject("System.IO.MemoryStream") + + dim selectedEntry, entry + For Each entry in zip + If entry.FileName = fileToDownload Then + set selectedEntry = entry + End If + Next + + selectedEntry.Extract_3(ms) + zip.Dispose + + dim fred + fred = ms.ToArray + + Response.BinaryWrite(fred) + ms.Dispose + End If + +Else + +%> + + + + Simple DotNetZip Example + + + + + + + + + + + + +

ASP DotNetZip

+ +

This page shows how to use DotNetZip from an ASP (Classic) +page. This page reads zip files and allows the browser to download +items from the zip files.

+ +
+ + + + + + +
Select a Zip file: +
+ + + + +<% + DisplayContentsOfZip +%> + +
+ + + + +<% +End If +%> \ No newline at end of file diff --git a/dotNetZip/Examples/ASPNET/GenerateZip-Csharp-FileStream.aspx b/dotNetZip/Examples/ASPNET/GenerateZip-Csharp-FileStream.aspx new file mode 100644 index 0000000..6461e58 --- /dev/null +++ b/dotNetZip/Examples/ASPNET/GenerateZip-Csharp-FileStream.aspx @@ -0,0 +1,249 @@ +<%@ Page + Language="C#" + Debug="true" +%> + + +<%@ Import Namespace="System.Text" %> +<%@ Import Namespace="System.IO" %> +<%@ Import Namespace="Ionic.Zip" %> +<%@ Import Namespace="System.Collections.Generic" %> + + + + + + + + + + + + +
+ +

Zip Files from ASP.NET

+ +

This page uses the .NET Zip library (see http://DotNetZip.codeplex.com) + to dynamically create a zip archive, and then download it to the + browser through Response.OutputStream, via a FileStream. This page is implemented in C#.

+ +

In some cases, saving a zip directly to Response.OutputStream can + present problems for the unzipper, especially on Macintosh. + To workaround that, you can save to a file, then copy the contents of the file, via a FileStream, to + the Response.OutputStream. +

+ + Check the boxes to select the files, set a password if you like, + then click the button to zip them up. +
+
+ Password: + (Optional) +
+
+ Use AES?: +
+
+ + +
+
+ +
+ + + + + + +
+
+ + + + + + + + + +
Nothing to see here...
+
+ +
+ + + + + + + + diff --git a/dotNetZip/Examples/ASPNET/GenerateZip-Csharp-MemoryStream.aspx b/dotNetZip/Examples/ASPNET/GenerateZip-Csharp-MemoryStream.aspx new file mode 100644 index 0000000..fd5afc3 --- /dev/null +++ b/dotNetZip/Examples/ASPNET/GenerateZip-Csharp-MemoryStream.aspx @@ -0,0 +1,243 @@ +<%@ Page + Language="C#" + Debug="true" +%> + + +<%@ Import Namespace="System.Text" %> +<%@ Import Namespace="System.IO" %> +<%@ Import Namespace="Ionic.Zip" %> +<%@ Import Namespace="System.Collections.Generic" %> + + + + + + + + + + + + +
+ +

Zip Files from ASP.NET

+ +

This page uses the .NET Zip library (see http://DotNetZip.codeplex.com) + to dynamically create a zip archive, and then download it to the + browser through Response.OutputStream, via a MemoryStream. This page is implemented in C#.

+ + Check the boxes to select the files, set a password if you like, + then click the button to zip them up. +
+
+ Password: + (Optional) +
+
+ Use AES?: +
+
+ + +
+
+ +
+ + + + + + +
+
+ + + + + + + + + +
Nothing to see here...
+
+ +
+ + + + + + + + diff --git a/dotNetZip/Examples/ASPNET/GenerateZip-Csharp.aspx b/dotNetZip/Examples/ASPNET/GenerateZip-Csharp.aspx new file mode 100644 index 0000000..734851b --- /dev/null +++ b/dotNetZip/Examples/ASPNET/GenerateZip-Csharp.aspx @@ -0,0 +1,230 @@ +<%@ Page + Language="C#" + Debug="true" +%> + + +<%@ Import Namespace="System.Text" %> +<%@ Import Namespace="System.IO" %> +<%@ Import Namespace="Ionic.Zip" %> +<%@ Import Namespace="System.Collections.Generic" %> + + + + + + + + + + + + +
+ +

Zip Files from ASP.NET

+ +

This page uses the .NET Zip library (see http://DotNetZip.codeplex.com) + to dynamically create a zip archive, and then download it to the + browser through Response.OutputStream. This page is implemented in C#.

+ + Check the boxes to select the files, set a password if you like, + then click the button to zip them up. +
+
+ Password: + (Optional) +
+
+ Use AES?: +
+
+ + +
+
+ +
+ + + + + + +
+
+ + + + + + + + + +
Nothing to see here...
+
+ +
+ + + + + + + + diff --git a/dotNetZip/Examples/ASPNET/GenerateZip-VB-FileStream.aspx b/dotNetZip/Examples/ASPNET/GenerateZip-VB-FileStream.aspx new file mode 100644 index 0000000..6df7510 --- /dev/null +++ b/dotNetZip/Examples/ASPNET/GenerateZip-VB-FileStream.aspx @@ -0,0 +1,255 @@ +<%@ Page + Language="VB" + Debug="true" +%> + +<%@ Import Namespace="System.Text" %> +<%@ Import Namespace="System.IO" %> +<%@ Import Namespace="Ionic.Zip" %> +<%@ Import Namespace="System.Collections.Generic" %> + + + + + + + + + + + + +
+ +

Zip Files from ASP.NET

+ +

This page uses the .NET Zip library (see http://DotNetZip.codeplex.com/) + to dynamically create a zip archive, and then download it to the + browser through Response.OutputStream, via a FileStream. This page is implemented + in VB.NET.

+ +

In some cases, saving a zip directly to Response.OutputStream can + present problems for the unzipper, especially on Macintosh. + To workaround that, you can save to a file, then copy the contents of + the file, via a FileStream, to the Response.OutputStream. +

+ + Check the boxes to select the files, set a password if you like, + then click the button to zip them up. +
+
+ Password: + (Optional) +
+
+ Use AES?: +
+
+ + +
+
+ +
+ + + + + + +
+
+ + + + + + + + + +
Nothing to see here...
+
+ +
+ + + + + + + + diff --git a/dotNetZip/Examples/ASPNET/GenerateZip-VB.aspx b/dotNetZip/Examples/ASPNET/GenerateZip-VB.aspx new file mode 100644 index 0000000..174310e --- /dev/null +++ b/dotNetZip/Examples/ASPNET/GenerateZip-VB.aspx @@ -0,0 +1,229 @@ +<%@ Page + Language="VB" + Debug="true" +%> + +<%@ Import Namespace="System.Text" %> +<%@ Import Namespace="System.IO" %> +<%@ Import Namespace="Ionic.Zip" %> +<%@ Import Namespace="System.Collections.Generic" %> + + + + + + + + + + + + +
+ +

Zip Files from ASP.NET

+ +

This page uses the .NET Zip library (see http://DotNetZip.codeplex.com/) + to dynamically create a zip archive, and then download it to the + browser through Response.OutputStream. This page is implemented + in VB.NET.

+ + Check the boxes to select the files, set a password if you like, + then click the button to zip them up. +
+
+ Password: + (Optional) +
+
+ Use AES?: +
+
+ + +
+
+ +
+ + + + + + +
+
+ + + + + + + + + +
Nothing to see here...
+
+ +
+ + + + + + + + diff --git a/dotNetZip/Examples/C#/CreateZip/CreateZip.cs b/dotNetZip/Examples/C#/CreateZip/CreateZip.cs new file mode 100644 index 0000000..5895198 --- /dev/null +++ b/dotNetZip/Examples/C#/CreateZip/CreateZip.cs @@ -0,0 +1,89 @@ +// CreateZip.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2006, 2007, 2008 Microsoft Corporation. All rights reserved. +// +// This example is released under the Microsoft Permissive License of +// October 2006. See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This simplistic utility gets a list of all the files in the specified directory, +// and zips them into a single archive. This utility does not recurse through +// the directory tree. +// +// compile with: +// csc /debug+ /target:exe /R:Ionic.Utils.Zip.dll /out:CreateZip.exe CreateZip.cs +// +// +// Wed, 29 Mar 2006 14:36 +// + +using System; +using Ionic.Zip; + +namespace Ionic.Zip.Examples +{ + public class CreateZip + { + private static void Usage() + { + Console.WriteLine("usage:\n CreateZip "); + Environment.Exit(1); + } + + public static void Main(String[] args) + { + if (args.Length != 2) Usage(); + if (!System.IO.Directory.Exists(args[1])) + { + Console.WriteLine("The directory does not exist!\n"); + Usage(); + } + if (System.IO.File.Exists(args[0])) + { + Console.WriteLine("That zipfile already exists!\n"); + Usage(); + } + if (!args[0].EndsWith(".zip")) + { + Console.WriteLine("The filename must end with .zip!\n"); + Usage(); + } + + string ZipFileToCreate = args[0]; + string DirectoryToZip = args[1]; + try + { + using (ZipFile zip = new ZipFile()) + { + // note: this does not recurse directories! + String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + + // This is just a sample, provided to illustrate the DotNetZip interface. + // This logic does not recurse through sub-directories. + // If you are zipping up a directory, you may want to see the AddDirectory() method, + // which operates recursively. + foreach (String filename in filenames) + { + Console.WriteLine("Adding {0}...", filename); + ZipEntry e= zip.AddFile(filename); + e.Comment = "Added by Cheeso's CreateZip utility."; + } + + zip.Comment= String.Format("This zip archive was created by the CreateZip example application on machine '{0}'", + System.Net.Dns.GetHostName()); + + zip.Save(ZipFileToCreate); + } + + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: " + ex1); + } + + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/CreateZip/CreateZip.csproj b/dotNetZip/Examples/C#/CreateZip/CreateZip.csproj new file mode 100644 index 0000000..c1b476d --- /dev/null +++ b/dotNetZip/Examples/C#/CreateZip/CreateZip.csproj @@ -0,0 +1,101 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {FB9FC8D7-7897-4802-9694-F379F25C00CB} + Exe + Properties + CreateZip + CreateZip + + + + + 3.5 + SAK + SAK + SAK + SAK + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/C#/CreateZip/Properties/AssemblyInfo.cs b/dotNetZip/Examples/C#/CreateZip/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..46a93e4 Binary files /dev/null and b/dotNetZip/Examples/C#/CreateZip/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Examples/C#/ReadZip/Properties/AssemblyInfo.cs b/dotNetZip/Examples/C#/ReadZip/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..84b052c Binary files /dev/null and b/dotNetZip/Examples/C#/ReadZip/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Examples/C#/ReadZip/ReadZip.cs b/dotNetZip/Examples/C#/ReadZip/ReadZip.cs new file mode 100644 index 0000000..485eac6 --- /dev/null +++ b/dotNetZip/Examples/C#/ReadZip/ReadZip.cs @@ -0,0 +1,70 @@ +// ReadZip.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2006-2009 Microsoft Corporation. All rights reserved. +// +// This example is released under the Microsoft Public License . +// See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This simple example utility simply reads a zip archive and extracts +// all elements in it, to the specified target directory. +// +// compile with: +// csc /target:exe /r:Ionic.Zip.dll /out:ReadZip.exe ReadZip.cs +// +// Wed, 29 Mar 2006 14:36 +// + + +using System; +using Ionic.Zip; + +namespace Ionic.Zip.Examples +{ + public class ReadZip + { + private static void Usage() + { + Console.WriteLine("usage:\n ReadZip2 "); + Environment.Exit(1); + } + + + public static void Main(String[] args) + { + + if (args.Length != 2) Usage(); + if (!System.IO.File.Exists(args[0])) + { + Console.WriteLine("That zip file does not exist!\n"); + Usage(); + } + + try + { + // Specifying Console.Out here causes diagnostic msgs to be sent to the Console + // In a WinForms or WPF or Web app, you could specify nothing, or an alternate + // TextWriter to capture diagnostic messages. + + var options = new ReadOptions { StatusMessageWriter = System.Console.Out }; + using (ZipFile zip = ZipFile.Read(args[0], options)) + { + // This call to ExtractAll() assumes: + // - none of the entries are password-protected. + // - want to extract all entries to current working directory + // - none of the files in the zip already exist in the directory; + // if they do, the method will throw. + zip.ExtractAll(args[1]); + } + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: " + ex1); + } + + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ReadZip/ReadZip.csproj b/dotNetZip/Examples/C#/ReadZip/ReadZip.csproj new file mode 100644 index 0000000..447e230 --- /dev/null +++ b/dotNetZip/Examples/C#/ReadZip/ReadZip.csproj @@ -0,0 +1,101 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F4024C01-1133-4A5A-B421-22EA8CA89EA5} + Exe + Properties + ReadZip + ReadZip + + + + + 3.5 + SAK + SAK + SAK + SAK + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/C#/WinForms-QuickZip/AssemblyInfo.cs b/dotNetZip/Examples/C#/WinForms-QuickZip/AssemblyInfo.cs new file mode 100644 index 0000000..c4d81b0 Binary files /dev/null and b/dotNetZip/Examples/C#/WinForms-QuickZip/AssemblyInfo.cs differ diff --git a/dotNetZip/Examples/C#/WinForms-QuickZip/QuickZip.cs b/dotNetZip/Examples/C#/WinForms-QuickZip/QuickZip.cs new file mode 100644 index 0000000..b187ef0 --- /dev/null +++ b/dotNetZip/Examples/C#/WinForms-QuickZip/QuickZip.cs @@ -0,0 +1,226 @@ +// QuickZip.cs +// ------------------------------------------------------------------ +// +// A simple app that creates a zip file, zipping up a files and +// directories specified on the command line. This application needs to +// be run from the console, in order to specify arguments, but it is +// also a winforms app. +// +// It correctly does the multi-threading to allow smooth UI update. +// +// compile it with: +// c:\.net3.5\csc.exe /t:exe /debug:full /optimize- /R:System.dll /R:Ionic.Zip.dll +// /out:QuickZip.exe QuickZip.cs +// +// last saved: +// Time-stamp: <2010-March-16 14:11:42> +// ------------------------------------------------------------------ +// +// Copyright (c) 2010 by Dino Chiesa +// All rights reserved! +// +// Licensed under the Microsoft Public License. +// see http://www.opensource.org/licenses/ms-pl.html +// +// ------------------------------------------------------------------ + +using System; +//using System.Reflection; +using System.Windows.Forms; // Form, Label, ProgressBar +using Ionic.Zip; // ZipFile, ZipEntry +using System.ComponentModel; // BackgroundWorker +using Interop=System.Runtime.InteropServices; // DllImport + +namespace Ionic.Zip.Examples.CS +{ + public class QuickZip + { + [Interop.DllImport("kernel32.dll")] + private static extern bool AllocConsole(); + + [Interop.DllImport("kernel32.dll")] + private static extern bool AttachConsole(int pid); + + [STAThread] + public static void Main(string[] args) + { + if (args.Length != 2) + { + // open a new window so we can write to it. + QuickZip.AllocConsole(); + QuickZip.Usage(args); + return; + } + else + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + var f = new QuickZipForm(args[0], args[1]); + Application.Run(f); + } + return; + } + + private static int Usage(string[] args) + { + Console.WriteLine("QuickUnzip. Usage: QuickZip "); + Console.WriteLine("\n to continue..."); + Console.ReadLine(); + return 1; + } + + } + + + + public class QuickZipForm : Form + { + + private QuickZipForm() + { + this.components = null; + this.InitializeComponent(); + } + + public QuickZipForm(string zipfile, string selectionCriteria) : this() + { + this.zipfileName = zipfile; + this.selectionCriteria = selectionCriteria; + } + + protected override void Dispose(Boolean disposing) + { + if (disposing && (this.components != null)) + this.components.Dispose(); + + base.Dispose(disposing); + } + + private void FixTitle() + { + this.Text = String.Format("Quick Zip {0}", this.zipfileName); + } + + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.label1 = new Label(); + this.progressBar1 = new ProgressBar(); + base.SuspendLayout(); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(50, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Zipping..."; + this.progressBar1.Anchor = (AnchorStyles.Right | (AnchorStyles.Left | AnchorStyles.Top)); + this.progressBar1.Location = new System.Drawing.Point(12, 36); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(436, 18); + this.progressBar1.Step = 1; + this.progressBar1.TabIndex = 7; + base.AutoScaleDimensions = new System.Drawing.SizeF(6, 13); + base.AutoScaleMode = AutoScaleMode.Font; + base.ClientSize = new System.Drawing.Size(460, 80); + base.Controls.Add(this.label1); + base.Controls.Add(this.progressBar1); + base.Name = "QuickUnzipForm"; + this.Text = "QuickUnzip"; + this.Load += this.QuickZipForm_Load; + this.Shown += this.QuickZipForm_Shown; + base.ResumeLayout(false); + base.PerformLayout(); + } + + public void OnTimerEvent(Object source, EventArgs e) + { + base.Close(); + } + + private void QuickZipForm_Load(Object sender, EventArgs e) + { + this.FixTitle(); + } + + private void QuickZipForm_Shown(Object sender, EventArgs e) + { + // For info on running long-running tasks in response to button clicks, + // in VB.NET WinForms, see + // http://msdn.microsoft.com/en-us/library/ms951089.aspx + + var backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); + backgroundWorker1.WorkerSupportsCancellation = false; + backgroundWorker1.WorkerReportsProgress = true; + backgroundWorker1.DoWork += this.Zipit; + backgroundWorker1.RunWorkerAsync(); + } + + + public void SaveProgress(object sender, SaveProgressEventArgs e) + { + if (this.InvokeRequired) + { + this.Invoke(new Action(SaveProgress), new Object[] { sender, e }); + } + else + { + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + //Console.WriteLine("pb max {0}", e.EntriesTotal); + this.progressBar1.Maximum = e.EntriesTotal; + this.progressBar1.Value = 0; + this.progressBar1.Minimum = 0; + this.progressBar1.Step = 1; + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + //Console.WriteLine("entry {0}", e.CurrentEntry.FileName); + this.label1.Text = e.CurrentEntry.FileName; + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + this.progressBar1.PerformStep(); + break; + } + this.Update(); + Application.DoEvents(); + } + } + + + private void Zipit(object sender, DoWorkEventArgs e) + { + int delay = 1200; // ms to keep form open after completion + try + { + using (var zip = new ZipFile()) + { + zip.AddSelectedFiles(selectionCriteria, ".", "", true); + zip.SaveProgress += this.SaveProgress; + zip.Save(zipfileName); + } + } + catch (Exception ex1) + { + this.label1.Text = "Exception: " + ex1.ToString(); + delay = 4000; + } + + var timer1 = new System.Timers.Timer(delay); + timer1.Enabled = true; + timer1.AutoReset = false; + timer1.Elapsed += this.OnTimerEvent; + } + + + // Fields + private String selectionCriteria; + private String zipfileName; + private System.ComponentModel.IContainer components ; + private Label label1; + private ProgressBar progressBar1; + } + +} + diff --git a/dotNetZip/Examples/C#/WinForms-QuickZip/QuickZip.csproj b/dotNetZip/Examples/C#/WinForms-QuickZip/QuickZip.csproj new file mode 100644 index 0000000..325f564 --- /dev/null +++ b/dotNetZip/Examples/C#/WinForms-QuickZip/QuickZip.csproj @@ -0,0 +1,66 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4bc34fff-1fa8-4f1d-86ff-4842045785de} + Exe + Properties + QuickZip + QuickZip + + + + + 2.0 + SAK + SAK + SAK + SAK + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + {4F7A9BBE-5221-46C5-9E47-1E8B547CF258} + Zip Full DLL + + + + + diff --git a/dotNetZip/Examples/C#/ZLIB/ParallelGZipOutputStream.cs b/dotNetZip/Examples/C#/ZLIB/ParallelGZipOutputStream.cs new file mode 100644 index 0000000..ed54655 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/ParallelGZipOutputStream.cs @@ -0,0 +1,1221 @@ +//#define Trace + +// ParallelGZipOutputStream.cs +// ------------------------------------------------------------------ +// +// A GzipStream that does compression only, and only in output. It uses a +// divide-and-conquer approach with multiple threads to exploit multiple +// CPUs for the DEFLATE computation. +// +// Last Saved: <2011-July-11 14:36:48> +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 by Dino Chiesa +// All rights reserved! +// +// ------------------------------------------------------------------ +// +// compile: c:\.net4.0\csc.exe /t:module /R:Ionic.Zip.dll @@ORIG@@ +// flymake: c:\.net4.0\csc.exe /t:module /R:Ionic.Zip.dll @@FILE@@ +// + +using System; +using System.Collections.Concurrent; +using System.Threading.Tasks; +using System.Threading; +using Ionic.Zlib; +using System.IO; + + +namespace Ionic.Exploration +{ + internal class WorkItem + { + public byte[] buffer; + public byte[] compressed; + public int crc; + public int index; + public int ordinal; + public int inputBytesAvailable; + public int compressedBytesAvailable; + + public ZlibCodec compressor; + + public WorkItem(int size, + Ionic.Zlib.CompressionLevel compressLevel, + CompressionStrategy strategy) + { + buffer= new byte[size]; + // alloc 5 bytes overhead for every block (margin of safety= 2) + int n = size + ((size / 32768)+1) * 5 * 2; + compressed = new byte[n]; + + compressor = new ZlibCodec(); + compressor.InitializeDeflate(compressLevel, false); + compressor.OutputBuffer = compressed; + compressor.InputBuffer = buffer; + } + } + + /// + /// A class for compressing and decompressing streams using the + /// Deflate algorithm with multiple threads. + /// + /// + /// + /// + /// This class is for compression only, and that can be only + /// through writing. + /// + /// + /// + /// For more information on the Deflate algorithm, see IETF RFC 1952, + /// "GZIP file format specification version 4.3" http://tools.ietf.org/html/rfc1952 + /// + /// + /// + /// This class is similar to , except that this + /// implementation uses an approach that employs multiple worker threads + /// to perform the compression. On a multi-cpu or multi-core computer, + /// the performance of this class can be significantly higher than the + /// single-threaded DeflateStream, particularly for larger streams. How + /// large? In my experience, Anything over 10mb is a good candidate for parallel + /// compression. + /// + /// + /// + /// The tradeoff is that this class uses more memory and more CPU than the + /// vanilla DeflateStream, and also is slightly less efficient as a compressor. For + /// large files the size of the compressed data stream can be less than 1% + /// larger than the size of a compressed data stream from the vanialla + /// DeflateStream. For smaller files the difference can be larger. The + /// difference will also be larger if you set the BufferSize to be lower + /// than the default value. Your mileage may vary. Finally, for small + /// files, the ParallelGZipOutputStream can be much slower than the vanilla + /// DeflateStream, because of the overhead of using the thread pool. + /// + /// + /// + /// + public class ParallelGZipOutputStream : System.IO.Stream + { + private static readonly int IO_BUFFER_SIZE_DEFAULT = 64 * 1024; + + private System.Collections.Generic.List _pool; + private bool _leaveOpen; + private bool emitting; + private System.IO.Stream _outStream; + private Ionic.Zlib.CRC32 _runningCrc; + private int _currentlyFilling; + private AutoResetEvent _newlyCompressedBlob; + private int _lastWritten; + private int _latestCompressed; + private string _comment; + private string _FileName; + private int _lastFilled; + private int _bufferSize; + private int _nBuckets; + private object _latestLock = new object(); + private object _outputLock = new object(); + private bool _isClosed; + private bool _firstWriteDone; + private int _Crc32; + private Int64 _totalBytesProcessed; + private Ionic.Zlib.CompressionLevel _compressLevel; + private volatile Exception _pendingException; + private object _eLock = new Object(); // protects _pendingException + private BlockingCollection _toWrite; + private BlockingCollection _toCompress; + private BlockingCollection _toFill; + + // This bitfield is used only when Trace is defined. + + //private TraceBits _DesiredTrace = TraceBits.All; + private TraceBits _DesiredTrace = TraceBits.Compress | + TraceBits.Session | + TraceBits.WriteTake | + TraceBits.WriteEnter | + TraceBits.EmitEnter | + TraceBits.EmitDone | + TraceBits.EmitLock | + TraceBits.EmitSkip | + TraceBits.EmitBegin; + + /// + /// Create a ParallelGZipOutputStream. + /// + /// + /// + /// + /// This stream compresses data written into it via the DEFLATE + /// algorithm (see RFC 1951), and writes out the compressed byte stream. + /// + /// + /// + /// The instance will use the default compression level, the default + /// buffer sizes and the default number of threads and buffers per + /// thread. + /// + /// + /// + /// This class is similar to , + /// except that this implementation uses an approach that employs + /// multiple worker threads to perform the DEFLATE. On a multi-cpu or + /// multi-core computer, the performance of this class can be + /// significantly higher than the single-threaded DeflateStream, + /// particularly for larger streams. How large? Anything over 10mb is + /// a good candidate for parallel compression. + /// + /// + /// + /// + /// + /// + /// This example shows how to use a ParallelGZipOutputStream to compress + /// data. It reads a file, compresses it, and writes the compressed data to + /// a second, output file. + /// + /// + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// String outputFile = fileToCompress + ".compressed"; + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(outputFile)) + /// { + /// using (Stream compressor = new ParallelGZipOutputStream(raw)) + /// { + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Dim outputFile As String = (fileToCompress & ".compressed") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(outputFile) + /// Using compressor As Stream = New ParallelGZipOutputStream(raw) + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream to which compressed data will be written. + public ParallelGZipOutputStream(System.IO.Stream stream) + : this(stream, CompressionLevel.Default, CompressionStrategy.Default, false) + { + } + + /// + /// Create a ParallelDeflateOutputStream using the specified CompressionLevel. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// A tuning knob to trade speed for effectiveness. + public ParallelGZipOutputStream(System.IO.Stream stream, CompressionLevel level) + : this(stream, level, CompressionStrategy.Default, false) + { + } + + /// + /// Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + /// when the ParallelDeflateOutputStream is closed. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// + /// true if the application would like the stream to remain open after inflation/deflation. + /// + public ParallelGZipOutputStream(System.IO.Stream stream, bool leaveOpen) + : this(stream, CompressionLevel.Default, CompressionStrategy.Default, leaveOpen) + { + } + + /// + /// Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + /// when the ParallelDeflateOutputStream is closed. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// A tuning knob to trade speed for effectiveness. + /// + /// true if the application would like the stream to remain open after inflation/deflation. + /// + public ParallelGZipOutputStream(System.IO.Stream stream, CompressionLevel level, bool leaveOpen) + : this(stream, CompressionLevel.Default, CompressionStrategy.Default, leaveOpen) + { + } + + /// + /// Create a ParallelDeflateOutputStream using the specified + /// CompressionLevel and CompressionStrategy, and specifying whether to + /// leave the captive stream open when the ParallelDeflateOutputStream is + /// closed. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// A tuning knob to trade speed for effectiveness. + /// + /// By tweaking this parameter, you may be able to optimize the compression for + /// data with particular characteristics. + /// + /// + /// true if the application would like the stream to remain open after inflation/deflation. + /// + public ParallelGZipOutputStream(System.IO.Stream stream, + CompressionLevel level, + CompressionStrategy strategy, + bool leaveOpen) + { + TraceOutput(TraceBits.Lifecycle | TraceBits.Session, "-------------------------------------------------------"); + TraceOutput(TraceBits.Lifecycle | TraceBits.Session, "Create {0:X8}", this.GetHashCode()); + _outStream = stream; + _compressLevel= level; + Strategy = strategy; + _leaveOpen = leaveOpen; + + _nBuckets = 4; // default + _bufferSize = IO_BUFFER_SIZE_DEFAULT; + } + + + /// + /// The ZLIB strategy to be used during compression. + /// + /// + public CompressionStrategy Strategy + { + get; + private set; + } + + /// + /// The number of buffers to use. + /// + /// + /// + /// + /// This property sets the number of memory buffers to create. This + /// sets an upper limit on the amount of memory the stream can use, + /// and also the degree of parallelism the stream can employ. + /// + /// + /// + /// The divide-and-conquer approach taken by this class assumes a + /// single thread from the application will call Write(). There + /// will be multiple Tasks that then compress (DEFLATE) the data + /// written into the stream. The application's thread aggregates + /// those results and emits the compressed output. + /// + /// + /// + /// The default value is 4. Different values may deliver better or + /// worse results, depending on the dynamic performance + /// characteristics of your storage and compute resources. If you + /// have more than 2 CPUs, or more than 3gb memory, you probably + /// want to increase this value. + /// + /// + /// + /// The total amount of storage space allocated for buffering will + /// be (M*S*2), where M is the multiple (this property), S is the + /// size of each buffer (). There are 2 + /// buffers used by the compressor, one for input and one for + /// output. If you retain the default values for Buckets (4), and + /// BufferSize (64k), then the ParallelDeflateOutputStream will use + /// 512kb of buffer memory in total. + /// + /// + /// + /// The application can set this value at any time, but it is effective + /// only before the first call to Write(), which is when the buffers are + /// allocated. + /// + /// + public int Buckets + { + get + { + return _nBuckets; + } + set + { + if (value < 1 || value > 10240) + throw new ArgumentOutOfRangeException("Buckets", + "Buckets must be between 1 and 10240"); + _nBuckets = value; + TraceOutput(TraceBits.Instance, "Buckets {0}", _nBuckets); + } + } + + /// + /// The size of the buffers used by the compressor threads. + /// + /// + /// + /// + /// The default buffer size is 128k. The application can set + /// this value at any time, but it is effective only before + /// the first Write(). + /// + /// + /// + /// Larger buffer sizes implies larger memory consumption but allows + /// more efficient compression. Using smaller buffer sizes consumes less + /// memory but result in less effective compression. For example, using + /// the default buffer size of 128k, the compression delivered is within + /// 1% of the compression delivered by the single-threaded . On the other hand, using a + /// BufferSize of 8k can result in a compressed data stream that is 5% + /// larger than that delivered by the single-threaded + /// DeflateStream. Excessively small buffer sizes can also cause + /// the speed of the ParallelDeflateOutputStream to drop, because of + /// larger thread scheduling overhead dealing with many many small + /// buffers. + /// + /// + /// + /// The total amount of storage space allocated for buffering will be + /// (n*M*S*2), where n is the number of CPUs, M is the multiple (), S is the size of each buffer (this + /// property), and there are 2 buffers used by the compressor, one for + /// input and one for output. For example, if your machine has a total + /// of 4 cores, and if you set to 3, and + /// you keep the default buffer size of 128k, then the + /// ParallelDeflateOutputStream will use 3mb of buffer memory in + /// total. + /// + /// + /// + public int BufferSize + { + get { return _bufferSize;} + set + { + if (value < 1024) + throw new ArgumentOutOfRangeException("BufferSize", + "BufferSize must be greater than 1024 bytes"); + _bufferSize = value; + TraceOutput(TraceBits.Instance, "BufferSize {0}", _bufferSize); + } + } + + /// + /// The CRC32 for the pre-compressed data that was written through the stream. + /// + /// + /// This value is meaningful only after a call to Close(). + /// + public int Crc32 { get { return _Crc32; } } + + + /// + /// The total number of uncompressed bytes processed by the ParallelGZipOutputStream. + /// + /// + /// This value is meaningful only after a call to Close(). + /// + public Int64 BytesProcessed { get { return _totalBytesProcessed; } } + + + /// + /// The comment on the GZIP stream. + /// + /// + /// + /// + /// The GZIP format allows for each file to optionally have an associated + /// comment stored with the file. The comment is encoded with the ISO-8859-1 + /// code page. To include a comment in a GZIP stream you create, set this + /// property before calling Write() for the first time on the + /// ParallelGZipOutputStream. + /// + /// + /// + public String Comment + { + get + { + return _comment; + } + set + { + if (_firstWriteDone) + throw new InvalidOperationException(); + + _comment = value; + } + } + + + /// + /// The FileName for the GZIP stream. + /// + /// + /// + /// + /// + /// The GZIP format optionally allows each compressed file to embed an + /// associated filename. This property holds that value. Set this + /// property before calling Write() the first time on the + /// ParallelGZipOutputStream. The actual filename is encoded + /// into the GZIP bytestream with the ISO-8859-1 code page, according + /// to RFC 1952. It is the application's responsibility to insure that + /// the FileName can be encoded and decoded correctly with this code + /// page. + /// + /// + /// + /// The value of this property is merely written into the GZIP output. + /// There is nothing in this class that verifies that the value you + /// set here is consistent with any filesystem file the compressed + /// data eventually written to, if any. + /// + /// + public String FileName + { + get { return _FileName; } + set + { + if (_firstWriteDone) + throw new InvalidOperationException(); + + _FileName = value; + if (_FileName == null) return; + if (_FileName.IndexOf("/") != -1) + _FileName = _FileName.Replace("/", "\\"); + + if (_FileName.EndsWith("\\")) + throw new ArgumentException("FileName", "The FileName property may not end in slash."); + + if (_FileName.IndexOf("\\") != -1) + _FileName = Path.GetFileName(_FileName); + } + } + + + /// + /// The last modified time for the GZIP stream. + /// + /// + /// + /// GZIP allows the storage of a last modified time with each GZIP entry. + /// When compressing data, you must set this before the first call to + /// Write(), in order for it to be written to the output stream. + /// + public DateTime? LastModified; + + + private void _TakeAndCompress() + { + var rnd = new System.Random(); + + while (!_toCompress.IsCompleted) + { + WorkItem workitem = null; + int ix = -1; + try + { + ix = _toCompress.Take(); + workitem = _pool[ix]; + } + catch (InvalidOperationException) + { + // The collection has been completed. + // Some other thread has called CompleteAdding() + // after this thread passed the + // IsCompleted check. + } + if (workitem == null) continue; + + try + { + TraceOutput(TraceBits.Compress, + "Compress lock wi({0}) ord({1})", + workitem.index, + workitem.ordinal); + + // compress one buffer + Ionic.Zlib.CRC32 crc = new CRC32(); + int ib = workitem.inputBytesAvailable; + crc.SlurpBlock(workitem.buffer, 0, workitem.inputBytesAvailable); + DeflateOneSegment(workitem); + workitem.crc = crc.Crc32Result; + TraceOutput(TraceBits.Compress, + "Compress done wi({0}) ord({1}) ib-({2}) cba({3})", + workitem.index, + workitem.ordinal, + ib, + workitem.compressedBytesAvailable + ); + + lock(_latestLock) + { + if (workitem.ordinal > _latestCompressed) + _latestCompressed = workitem.ordinal; + } + + _toWrite.Add(workitem.index); + _newlyCompressedBlob.Set(); + } + catch (System.Exception exc1) + { + lock(_eLock) + { + // expose the exception to the main thread + if (_pendingException!=null) + _pendingException = exc1; + } + } + } + } + + + + private void _InitializeBuffers() + { + _toCompress = new BlockingCollection(Buckets); + _toFill = new BlockingCollection(Buckets); + _toWrite = new BlockingCollection(new ConcurrentQueue()); + _pool = new System.Collections.Generic.List(); + for(int i=0; i < Buckets; i++) + { + _pool.Add(new WorkItem(_bufferSize, _compressLevel, Strategy)); + _toFill.Add(i); + + // Start one perpetual compressor task per bucket. + Task.Factory.StartNew( _TakeAndCompress ); + } + + // for diagnostic purposes only + for(int i=0; i < _pool.Count; i++) + _pool[i].index= i; + + _newlyCompressedBlob = new AutoResetEvent(false); + _runningCrc = new Ionic.Zlib.CRC32(); + _currentlyFilling = -1; + _lastFilled = -1; + _lastWritten = -1; + _latestCompressed = -1; + } + + + internal static readonly System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding("iso-8859-1"); + + + private int EmitHeader() + { + byte[] commentBytes = (Comment == null) ? null : iso8859dash1.GetBytes(Comment); + byte[] filenameBytes = (FileName == null) ? null : iso8859dash1.GetBytes(FileName); + + int cbLength = (Comment == null) ? 0 : commentBytes.Length + 1; + int fnLength = (FileName == null) ? 0 : filenameBytes.Length + 1; + + int bufferLength = 10 + cbLength + fnLength; + byte[] header = new byte[bufferLength]; + int i = 0; + // ID + header[i++] = 0x1F; + header[i++] = 0x8B; + + // compression method + header[i++] = 8; + byte flag = 0; + if (Comment != null) + flag ^= 0x10; + if (FileName != null) + flag ^= 0x8; + + // flag + header[i++] = flag; + + // mtime + if (!LastModified.HasValue) LastModified = DateTime.Now; + System.TimeSpan delta = LastModified.Value - _unixEpoch; + Int32 timet = (Int32)delta.TotalSeconds; + Array.Copy(BitConverter.GetBytes(timet), 0, header, i, 4); + i += 4; + + // xflg + header[i++] = 0; // this field is totally useless + // OS + header[i++] = 0xFF; // 0xFF == unspecified + + // extra field length - only if FEXTRA is set, which it is not. + //header[i++]= 0; + //header[i++]= 0; + + // filename + if (fnLength != 0) + { + Array.Copy(filenameBytes, 0, header, i, fnLength - 1); + i += fnLength - 1; + header[i++] = 0; // terminate + } + + // comment + if (cbLength != 0) + { + Array.Copy(commentBytes, 0, header, i, cbLength - 1); + i += cbLength - 1; + header[i++] = 0; // terminate + } + + _outStream.Write(header, 0, header.Length); + + return header.Length; // bytes written + } + + + + private void _EmitPendingBuffers(bool doAll, bool mustWait) + { + // When combining parallel deflation with a ZipSegmentedStream, it's + // possible for the ZSS to throw from within this method. In that + // case, Close/Dispose will be called on this stream, if this stream + // is employed within a using or try/finally pair as required. But + // this stream is unaware of the pending exception, so the Close() + // method invokes this method AGAIN. This can lead to a deadlock. + // Therefore, failfast if re-entering. + + if (emitting) return; + emitting = true; + + if (doAll || mustWait) + _newlyCompressedBlob.WaitOne(); + + do + { + int firstSkip = -1; + int millisecondsToWait = doAll ? 200 : (mustWait ? -1 : 0); + int nextToWrite; + + while (_toWrite.TryTake(out nextToWrite, millisecondsToWait)) + { + WorkItem workitem = _pool[nextToWrite]; + if (workitem.ordinal != _lastWritten + 1) + { + // not the needed ordinal, so requeue and try again. + TraceOutput(TraceBits.EmitSkip, + "Emit skip wi({0}) ord({1}) lw({2}) fs({3})", + workitem.index, + workitem.ordinal, + _lastWritten, + firstSkip); + + _toWrite.Add(nextToWrite); + + if (firstSkip == nextToWrite) + { + // We went around the list once. + // None of the items in the list is the one we want. + // Now wait for a compressor to signal. + _newlyCompressedBlob.WaitOne(); + firstSkip = -1; + } + else if (firstSkip == -1) + firstSkip = nextToWrite; + + continue; + } + + firstSkip = -1; + + TraceOutput(TraceBits.EmitBegin, + "Emit begin wi({0}) ord({1}) cba({2})", + workitem.index, + workitem.ordinal, + workitem.compressedBytesAvailable); + + _outStream.Write(workitem.compressed, 0, workitem.compressedBytesAvailable); + _runningCrc.Combine(workitem.crc, workitem.inputBytesAvailable); + _totalBytesProcessed += workitem.inputBytesAvailable; + workitem.inputBytesAvailable= 0; + + TraceOutput(TraceBits.EmitDone, + "Emit done wi({0}) ord({1}) cba({2}) mtw({3})", + workitem.index, + workitem.ordinal, + workitem.compressedBytesAvailable, + millisecondsToWait); + + _lastWritten = workitem.ordinal; + _toFill.Add(workitem.index); + + // don't wait next time through + if (millisecondsToWait == -1) millisecondsToWait = 0; + } + + } while (doAll && + !_toCompress.IsCompleted && + (_lastWritten != _latestCompressed)); + + emitting = false; + } + + + + + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// + /// To use the ParallelGZipOutputStream to compress data, create a + /// ParallelGZipOutputStream, passing a writable output stream. + /// Then call Write() on that ParallelGZipOutputStream, providing + /// uncompressed data as input. The data sent to the output stream + /// will be the compressed form of the data written into the stream. + /// + /// + /// + /// To decompress data, use the class. + /// Any RFC-1951 + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + bool wantWaitEmit = false; + if (_isClosed) + throw new InvalidOperationException(); + + // dispense any exception that occurred on the BG threads + if (_pendingException != null) + throw _pendingException; + + if (count == 0) return; // NOP + + TraceOutput(TraceBits.WriteEnter, "Write enter"); + + if (!_firstWriteDone) + { + _InitializeBuffers(); + _firstWriteDone = true; + EmitHeader(); + } + + do + { + // may need to make buffers available + _EmitPendingBuffers(false, wantWaitEmit); + + wantWaitEmit = false; + // use current, or get a buffer to fill + int ix = -1; + if (_currentlyFilling >= 0) + { + ix = _currentlyFilling; + TraceOutput(TraceBits.WriteTake, + "Write notake wi({0}) lf({1})", + ix, + _lastFilled); + } + else + { + TraceOutput(TraceBits.WriteTake, "Write take?"); + if (!_toFill.TryTake(out ix, 0)) + { + // no available buffers, so... need to emit + // compressed buffers. + wantWaitEmit = true; + continue; + } + + TraceOutput(TraceBits.WriteTake, + "Write take wi({0}) lf({1})", + ix, + _lastFilled); + ++_lastFilled; // TODO: consider rollover? + } + + WorkItem workitem = _pool[ix]; + + int limit = ((workitem.buffer.Length - workitem.inputBytesAvailable) > count) + ? count + : (workitem.buffer.Length - workitem.inputBytesAvailable); + + workitem.ordinal = _lastFilled; + + TraceOutput(TraceBits.Write, + "Write lock wi({0}) ord({1}) iba({2})", + workitem.index, + workitem.ordinal, + workitem.inputBytesAvailable ); + + // copy from the provided buffer to our workitem, starting at + // the tail end of whatever data we might have in there currently. + Array.Copy(buffer, + offset, + workitem.buffer, + workitem.inputBytesAvailable, + limit); + + count -= limit; + offset += limit; + workitem.inputBytesAvailable += limit; + + if (workitem.inputBytesAvailable==workitem.buffer.Length) + { + TraceOutput(TraceBits.Write, + "Write full wi({0}) ord({1}) iba({2})", + workitem.index, + workitem.ordinal, + workitem.inputBytesAvailable ); + _toCompress.Add(ix); + _currentlyFilling = -1; // will get a new buffer next time + } + else + { + _currentlyFilling = ix; + } + + if (count > 0) + TraceOutput(TraceBits.WriteEnter, "Write more"); + } + while (count > 0); // until no more to write + + TraceOutput(TraceBits.WriteEnter, "Write exit"); + return; + } + + + + private void _FlushFinish() + { + // After writing a series of compressed buffers, each one closed + // with Flush.Sync, we now write the final one as Flush.Finish, + // and then stop. + byte[] buffer = new byte[128]; + var compressor = new ZlibCodec(); + int rc = compressor.InitializeDeflate(_compressLevel, false); + compressor.InputBuffer = null; + compressor.NextIn = 0; + compressor.AvailableBytesIn = 0; + compressor.OutputBuffer = buffer; + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + { + TraceOutput(TraceBits.EmitBegin, + "Emit begin flush bytes({0})", + buffer.Length - compressor.AvailableBytesOut); + + _outStream.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + + TraceOutput(TraceBits.EmitDone, + "Emit done flush"); + } + + compressor.EndDeflate(); + + _Crc32 = _runningCrc.Crc32Result; + } + + + private void _EmitTrailer() + { + // Emit the GZIP trailer: CRC32 and size mod 2^32 + _outStream.Write(BitConverter.GetBytes(_runningCrc.Crc32Result), 0, 4); + + int c2 = (Int32)(_totalBytesProcessed & 0x00000000FFFFFFFF); + _outStream.Write(BitConverter.GetBytes(c2), 0, 4); + } + + + private void _Flush(bool lastInput) + { + if (_isClosed) + throw new InvalidOperationException(); + + // post the current partial buffer to the _toCompress queue + if (_currentlyFilling>=0) + { + _toCompress.Add(_currentlyFilling); + TraceOutput(TraceBits.Flush, + "Flush filled wi({0})", + _currentlyFilling); + + _currentlyFilling = -1; // get a new buffer next Write() + } + + if (lastInput) + { + //_toWrite.CompleteAdding(); // cannot do because of sifting + _toCompress.CompleteAdding(); + _EmitPendingBuffers(true, false); + _FlushFinish(); + _EmitTrailer(); + } + else + { + _EmitPendingBuffers(false, false); + } + } + + + + /// + /// Flush the stream. + /// + public override void Flush() + { + _Flush(false); + } + + + + /// + /// Close the stream. + /// + /// + /// + /// The application must call Close() on this stream to guarantee + /// that all of the data written in has been compressed, and the + /// compressed data has been written out. + /// + /// + /// Close() is called implicitly when this stream is used within + /// a using clause. + /// + /// + public override void Close() + { + TraceOutput(TraceBits.Session, "Close {0:X8}", this.GetHashCode()); + + if (_isClosed) return; + + _Flush(true); + + if (!_leaveOpen) + _outStream.Close(); + + _isClosed= true; + } + + + + /// Dispose the object + /// + /// + /// Because ParallelDeflateOutputStream is IDisposable, the + /// application must call this method when finished using the instance. + /// + /// + /// This method is generally called implicitly upon exit from + /// a using scope in C# (Using in VB). + /// + /// + new public void Dispose() + { + TraceOutput(TraceBits.Lifecycle, "Dispose {0:X8}", this.GetHashCode()); + _pool = null; + Close(); + Dispose(true); + } + + + + /// The Dispose method + protected override void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + // dispose managed resources + } + } + + + + private bool DeflateOneSegment(WorkItem workitem) + { + ZlibCodec compressor = workitem.compressor; + int rc= 0; + compressor.ResetDeflate(); + compressor.NextIn = 0; + + compressor.AvailableBytesIn = workitem.inputBytesAvailable; + + // step 1: deflate the buffer + compressor.NextOut = 0; + compressor.AvailableBytesOut = workitem.compressed.Length; + do + { + compressor.Deflate(FlushType.None); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + // step 2: flush (sync) + rc = compressor.Deflate(FlushType.Sync); + + workitem.compressedBytesAvailable = (int) compressor.TotalBytesOut; + return true; + } + + + + [System.Diagnostics.ConditionalAttribute("Trace")] + private void TraceOutput(TraceBits bits, string format, params object[] varParams) + { + if ((bits & _DesiredTrace) != 0) + { + lock(_outputLock) + { + int tid = Thread.CurrentThread.GetHashCode(); +#if !SILVERLIGHT + Console.ForegroundColor = (ConsoleColor) (tid % 8 + 8); +#endif + Console.Write("{0:000} PGOS ", tid); + Console.WriteLine(format, varParams); +#if !SILVERLIGHT + Console.ResetColor(); +#endif + } + } + } + + + + // used only when Trace is defined + [Flags] + enum TraceBits : uint + { + None = 0, + NotUsed1 = 1, + EmitLock = 2, + EmitEnter = 4, // enter _EmitPending + EmitBegin = 8, // begin to write out + EmitDone = 16, // done writing out + EmitSkip = 32, // writer skipping a workitem + EmitAll = 58, // All Emit flags + Flush = 64, + Lifecycle = 128, // constructor/disposer + Session = 256, // Close/Reset + Synch = 512, // thread synchronization + Instance = 1024, // instance settings + Compress = 2048, // compress task + Write = 4096, // filling buffers, when caller invokes Write() + WriteEnter = 8192, // upon entry to Write() + WriteTake = 16384, // on _toFill.Take() + All = 0xffffffff, + } + + + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream supports Read operations. + /// + /// + /// Always returns false. + /// + public override bool CanRead + { + get {return false;} + } + + /// + /// Indicates whether the stream supports Write operations. + /// + /// + /// Returns true if the provided stream is writable. + /// + public override bool CanWrite + { + get { return _outStream.CanWrite; } + } + + /// + /// Reading this property always throws a NotSupportedException. + /// + public override long Length + { + get { throw new NotSupportedException(); } + } + + /// + /// Writing this property always throws a NotSupportedException. + /// On Read, the value is the number of bytes written so far to the + /// output. + /// + /// + public override long Position + { + get { return _outStream.Position; } + set { throw new NotSupportedException(); } + } + + /// + /// This method always throws a NotSupportedException. + /// + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException(); + } + + /// + /// This method always throws a NotSupportedException. + /// + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + /// + /// This method always throws a NotSupportedException. + /// + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + } +} + + diff --git a/dotNetZip/Examples/C#/ZLIB/QuickCompress.cs b/dotNetZip/Examples/C#/ZLIB/QuickCompress.cs new file mode 100644 index 0000000..9a5b0c7 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/QuickCompress.cs @@ -0,0 +1,234 @@ +// QuickCompress.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 by Dino Chiesa +// All rights reserved! +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Purpose: Demonstrate compression and decompression with the easy +// helper methods in the Ionic.Zlib namespace. +// +// ------------------------------------------------------------------ +// + +using System; +using System.Text; +using System.Reflection; +using Ionic.Zlib; +using System.Security.Cryptography; +using System.Diagnostics; + + +// to allow fast ngen +[assembly: AssemblyTitle("QuickCompress.cs")] +[assembly: AssemblyDescription("Demonstrate compression and decompression using the helper methods in the IOnic.Zlib namespace")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Dino Chiesa")] +[assembly: AssemblyProduct("DotNetZip Examples")] +[assembly: AssemblyCopyright("Copyright Dino Chiesa 2009-2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("1.1.1.1")] + + +namespace Ionic.ToolsAndTests +{ + + /// + /// Holds the results of the compression. + /// + /// + /// + /// Compression algorithms can be measured two ways: size of the + /// result, and the time required to compress. This small class + /// just holds the measured result for a particular compression + /// algorithm. + /// + /// + public class CompressionTrialResult + { + public string Label; + public int Cycles; + public byte[] CompressedData; + public TimeSpan TimeForManyCycles; + + public void Show() + { + Console.WriteLine("{0}", this.Label); + Console.WriteLine(" Compressed Size : {0}", this.CompressedData.Length); + Console.WriteLine(" Time for {0} cycles: {1:N1}s", + this.Cycles, + this.TimeForManyCycles.TotalSeconds); + } + } + + + public class QuickCompress + { + internal static string GoPlacidly = + @"Go placidly amid the noise and haste, and remember what peace there may be in silence. + +As far as possible, without surrender, be on good terms with all persons. Speak your truth quietly and clearly; and listen to others, even to the dull and the ignorant, they too have their story. Avoid loud and aggressive persons, they are vexations to the spirit. + +If you compare yourself with others, you may become vain and bitter; for always there will be greater and lesser persons than yourself. Enjoy your achievements as well as your plans. Keep interested in your own career, however humble; it is a real possession in the changing fortunes of time. + +Exercise caution in your business affairs, for the world is full of trickery. But let this not blind you to what virtue there is; many persons strive for high ideals, and everywhere life is full of heroism. Be yourself. Especially, do not feign affection. Neither be cynical about love, for in the face of all aridity and disenchantment it is perennial as the grass. + +Take kindly to the counsel of the years, gracefully surrendering the things of youth. Nurture strength of spirit to shield you in sudden misfortune. But do not distress yourself with imaginings. Many fears are born of fatigue and loneliness. + +Beyond a wholesome discipline, be gentle with yourself. You are a child of the universe, no less than the trees and the stars; you have a right to be here. And whether or not it is clear to you, no doubt the universe is unfolding as it should. + +Therefore be at peace with God, whatever you conceive Him to be, and whatever your labors and aspirations, in the noisy confusion of life, keep peace in your soul. + +With all its sham, drudgery and broken dreams, it is still a beautiful world. + +Be cheerful. Strive to be happy. + +Max Ehrmann c.1920 +"; + + + /// + /// Perform one trial, measuring the effectiveness and speed + /// of compression. + /// + /// + /// the label for the trial + /// + /// a function that accepts a string, + /// and returns a byte array representing the compressed + /// form + /// + /// a function that accepts a byte + /// array, and decompresses it, returning a string. + /// + /// the string to compress and decompress + /// + /// the number of cycles to time + /// + /// the CompressionTrialResult describing the trial results + /// + /// + /// + public CompressionTrialResult DoTrial(string label, + Func compressor, + Func decompressor, + string s, + int nCycles) + { + byte[] compressed = compressor(s); + + // verify that the compression decompresses correctly + string uncompressed = decompressor(compressed); + if (s.Length != uncompressed.Length) + throw new Exception("decompression failed."); + + // compress the same thing 1000 times, and measure the time + var stopwatch = new Stopwatch(); + stopwatch.Start(); + for (int i=0; i < nCycles; i++) + compressed = compressor(s); + + stopwatch.Stop(); + + var result = new CompressionTrialResult + { + Label = label, + CompressedData = compressed, + Cycles = nCycles, + TimeForManyCycles = stopwatch.Elapsed + }; + return result; + } + + + internal static string ByteArrayToHexString(byte[] b) + { + var sb1 = new StringBuilder(); + for (int i = 0; i < b.Length; i++) + { + sb1.Append(String.Format("{0:X2}", b[i])); + } + return sb1.ToString().ToLower(); + } + + + private void Run() + { + Console.WriteLine("Compressing a string..."); + + int lengthOriginal = GoPlacidly.Length; + + // do the compression: + byte[] b = ZlibStream.CompressString(GoPlacidly); + + int lengthCompressed = b.Length; + + Console.WriteLine(); + Console.WriteLine(" Original Length: {0}", lengthOriginal); + Console.WriteLine("Compressed Length: {0}", lengthCompressed); + Console.WriteLine(" Compression %: {0:n1}%", lengthCompressed/(0.01 * lengthOriginal)); + Console.WriteLine("Compressed Data : {0}", ByteArrayToHexString(b)); + Console.WriteLine(); + + // now let's do some timed trials + Console.WriteLine("Doing timing runs...."); + CompressionTrialResult result; + result = DoTrial("Zlib", + ZlibStream.CompressString, + ZlibStream.UncompressString, + GoPlacidly, + 10000); + result.Show(); + result = DoTrial("GZip", + GZipStream.CompressString, + GZipStream.UncompressString, + GoPlacidly, + 10000); + result.Show(); + + result = DoTrial("Deflate", + DeflateStream.CompressString, + DeflateStream.UncompressString, + GoPlacidly, + 10000); + result.Show(); + + // All these classes use the same underlying algorithm - DEFLATE - + // which means they all produce compressed forms that are roughly the + // same size. The difference between them is only in the metadata + // surrounding the raw compressed streams, and the level of integrity + // checking they provide. For example, during compression, the + // GzipStream internally calculates an Alder checksum on the data; + // during decompression, it verifies that checksum, as an integrity + // check. The other classes don't do this. Therefore the GZipStream + // will always take slightly longer in compression and decompression + // than the others, and will produce compressed streams that are + // slightly larger. The results will show that. + } + + + [STAThread] + public static void Main(System.String[] args) + { + try + { + var me = new QuickCompress(); + me.Run(); + } + catch (System.Exception e1) + { + Console.WriteLine("Exception: " + e1); + } + } + } +} diff --git a/dotNetZip/Examples/C#/ZLIB/ZlibDeflateInflate.cs b/dotNetZip/Examples/C#/ZLIB/ZlibDeflateInflate.cs new file mode 100644 index 0000000..3161580 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/ZlibDeflateInflate.cs @@ -0,0 +1,210 @@ +// ZlibDeflateInflate.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 by Dino Chiesa +// All rights reserved! +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Purpose: Demonstrate compression and decompression with the ZlibCodec +// class, which is part of the Ionic.Zlib namespace. +// +// ------------------------------------------------------------------ +// + +using System; +using System.Text; +using System.IO; +using System.Reflection; +using System.Security.Cryptography; // HashAlgorithm +using Ionic.Zlib; + +// to allow fast ngen +[assembly: AssemblyTitle("ZlibDeflateInflate.cs")] +[assembly: AssemblyDescription("Demonstrate compression and decompression with the ZlibCodec class")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Dino Chiesa")] +[assembly: AssemblyProduct("DotNetZip Examples")] +[assembly: AssemblyCopyright("Copyright Dino Chiesa 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("1.1.1.1")] + + +namespace Ionic.ToolsAndTests +{ + public class ZlibDeflateInflate + { + private HashAlgorithm alg = new SHA256CryptoServiceProvider(); + + public ZlibDeflateInflate () {} + + public byte[] ComputeHash(byte[] data) + { + return alg.ComputeHash(data); + } + + + public byte[] ComputeHash(string text) + { + return alg.ComputeHash(UTF8Encoding.UTF8.GetBytes( text )); + } + + private static string ByteArrayToString(byte[] buffer) + { + System.Text.StringBuilder sb = new System.Text.StringBuilder(); + foreach (byte b in buffer) + sb.Append(b.ToString("X2")); + + return (sb.ToString()); + } + + + + public void Run() + { + System.Console.WriteLine("\nThis program demonstrates compression of strings with the\nIonic.Zlib.ZlibCodec class.\n"); + + string textToCompress = File.ReadAllText("ZlibDeflateInflate.cs"); + string hashOfOriginal = ByteArrayToString(ComputeHash(textToCompress)); + System.Console.WriteLine("hash of original: {0}", hashOfOriginal); + System.Console.WriteLine("length of original: {0}", textToCompress.Length); + + byte[] compressed = ZlibCodecCompress(textToCompress); + System.Console.WriteLine("length of compressed: {0}", compressed.Length); + + double compRatio = 100 * (1.0 - (1.0 * compressed.Length) / (1.0 * textToCompress.Length)) ; + + System.Console.WriteLine("compression rate: {0:N1}%", compRatio); + + string decompressed = ZlibCodecDecompress(compressed); + string hashOfDecompressed = ByteArrayToString(ComputeHash(textToCompress)); + System.Console.WriteLine("hash of decompressed: {0}", hashOfDecompressed); + System.Console.WriteLine(); + + if (hashOfOriginal == hashOfDecompressed) + System.Console.WriteLine("Round trip SUCCESS: After compress and decompress, we obtained the original text."); + else + System.Console.WriteLine("Round trip FAIL: After compress and decompress, we did not obtain the original text."); + } + + + private byte[] ZlibCodecCompress(string textToCompress) + { + int outputSize = 2048; + byte[] output = new Byte[ outputSize ]; + byte[] uncompressed = UTF8Encoding.UTF8.GetBytes( textToCompress ); + int lengthToCompress = uncompressed.Length; + + // If you want a ZLIB stream, set this to true. If you want + // a bare DEFLATE stream, set this to false. + bool wantRfc1950Header = false; + + using ( MemoryStream ms = new MemoryStream()) + { + ZlibCodec compressor = new ZlibCodec(); + compressor.InitializeDeflate(CompressionLevel.BestCompression, wantRfc1950Header); + + compressor.InputBuffer = uncompressed; + compressor.AvailableBytesIn = lengthToCompress; + compressor.NextIn = 0; + compressor.OutputBuffer = output; + + foreach (var f in new FlushType[] { FlushType.None, FlushType.Finish } ) + { + int bytesToWrite = 0; + do + { + compressor.AvailableBytesOut = outputSize; + compressor.NextOut = 0; + compressor.Deflate(f); + + bytesToWrite = outputSize - compressor.AvailableBytesOut ; + if (bytesToWrite > 0) + ms.Write(output, 0, bytesToWrite); + } + while (( f == FlushType.None && (compressor.AvailableBytesIn != 0 || compressor.AvailableBytesOut == 0)) || + ( f == FlushType.Finish && bytesToWrite != 0)); + } + + compressor.EndDeflate(); + + ms.Flush(); + return ms.ToArray(); + } + } + + + private string ZlibCodecDecompress(byte[] compressed) + { + int outputSize = 2048; + byte[] output = new Byte[ outputSize ]; + + // If you have a ZLIB stream, set this to true. If you have + // a bare DEFLATE stream, set this to false. + bool expectRfc1950Header = false; + + using ( MemoryStream ms = new MemoryStream()) + { + ZlibCodec compressor = new ZlibCodec(); + compressor.InitializeInflate(expectRfc1950Header); + + compressor.InputBuffer = compressed; + compressor.AvailableBytesIn = compressed.Length; + compressor.NextIn = 0; + compressor.OutputBuffer = output; + + foreach (var f in new FlushType[] { FlushType.None, FlushType.Finish } ) + { + int bytesToWrite = 0; + do + { + compressor.AvailableBytesOut = outputSize; + compressor.NextOut = 0; + compressor.Inflate(f); + + bytesToWrite = outputSize - compressor.AvailableBytesOut ; + if (bytesToWrite > 0) + ms.Write(output, 0, bytesToWrite); + } + while (( f == FlushType.None && (compressor.AvailableBytesIn != 0 || compressor.AvailableBytesOut == 0)) || + ( f == FlushType.Finish && bytesToWrite != 0)); + } + + compressor.EndInflate(); + + return UTF8Encoding.UTF8.GetString( ms.ToArray() ); + } + } + + + public static void Usage() + { + Console.WriteLine("\nZlibDeflateInflate: .\n"); + Console.WriteLine("Usage:\n ZlibDeflateInflate [-arg1 ] [-arg2]"); + } + + + public static void Main(string[] args) + { + try + { + new ZlibDeflateInflate() + .Run(); + } + catch (System.Exception exc1) + { + Console.WriteLine("Exception: {0}", exc1.ToString()); + Usage(); + } + } + } +} diff --git a/dotNetZip/Examples/C#/ZLIB/ZlibStreamExample.cs b/dotNetZip/Examples/C#/ZLIB/ZlibStreamExample.cs new file mode 100644 index 0000000..1745eb7 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/ZlibStreamExample.cs @@ -0,0 +1,118 @@ +// ZlibDeflateInflate.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 by Dino Chiesa +// All rights reserved! +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Purpose: Demonstrate compression and decompression with the ZlibStream +// class, which is part of the Ionic.Zlib namespace. +// +// ------------------------------------------------------------------ +// + +using System; +using System.Reflection; +using Ionic.Zlib; + + +// to allow fast ngen +[assembly: AssemblyTitle("ZlibStreamExample.cs")] +[assembly: AssemblyDescription("Demonstrate compression and decompression using the ZlibStream class")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Dino Chiesa")] +[assembly: AssemblyProduct("DotNetZip Examples")] +[assembly: AssemblyCopyright("Copyright Dino Chiesa 2009-2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("1.1.1.1")] + + +namespace Ionic.ToolsAndTests +{ + + public class ZlibStreamExample + { + + /// + /// Converts a string to a MemoryStream. + /// + static System.IO.MemoryStream StringToMemoryStream(string s) + { + byte[] a = System.Text.Encoding.ASCII.GetBytes(s); + return new System.IO.MemoryStream(a); + } + + /// + /// Converts a MemoryStream to a string. Makes some assumptions about the content of the stream. + /// + /// + /// + static String MemoryStreamToString(System.IO.MemoryStream ms) + { + byte[] ByteArray = ms.ToArray(); + return System.Text.Encoding.ASCII.GetString(ByteArray); + } + + + static void CopyStream(System.IO.Stream src, System.IO.Stream dest) + { + byte[] buffer = new byte[1024]; + int len; + while ((len = src.Read(buffer, 0, buffer.Length)) > 0) + dest.Write(buffer, 0, len); + dest.Flush(); + } + + [STAThread] + public static void Main(System.String[] args) + { + try + { + System.IO.MemoryStream msSinkCompressed; + System.IO.MemoryStream msSinkDecompressed; + ZlibStream zOut; + String originalText = "Hello, World! This String will be compressed... "; + + System.Console.Out.WriteLine("original: {0}", originalText); + + // first, compress: + msSinkCompressed = new System.IO.MemoryStream(); + zOut = new ZlibStream(msSinkCompressed, CompressionMode.Compress, CompressionLevel.BestCompression, true); + CopyStream(StringToMemoryStream(originalText), zOut); + zOut.Close(); + + // at this point, msSinkCompressed contains the compressed bytes + + // now, decompress: + msSinkCompressed.Seek(0, System.IO.SeekOrigin.Begin); + msSinkDecompressed = new System.IO.MemoryStream(); + zOut = new ZlibStream(msSinkDecompressed, CompressionMode.Decompress, true); + CopyStream(msSinkCompressed, zOut); + + // at this point, msSinkDecompressed contains the decompressed bytes + string decompressed = MemoryStreamToString(msSinkDecompressed); + System.Console.Out.WriteLine("decompressed: {0}", decompressed); + System.Console.WriteLine(); + + if (originalText == decompressed) + System.Console.WriteLine("A-OK. Compression followed by decompression gets the original text."); + else + System.Console.WriteLine("The compression/decompression cycle failed."); + } + catch (System.Exception e1) + { + Console.WriteLine("Exception: " + e1); + } + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZLIB/makefile b/dotNetZip/Examples/C#/ZLIB/makefile new file mode 100644 index 0000000..9515aa7 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/makefile @@ -0,0 +1,34 @@ +.SUFFIXES: .tlb .il .dll .cpp .cs .vb .rc .ocx .jsl .java + +#_NETHOME=$(WINDIR)\Microsoft.NET\Framework\v1.1.4322 +#_NETHOME=c:\.net2.0 +_NETHOME=c:\.net3.5 +#_NETSDK=c:\Progra~1\Microsoft.NET\SDK\v1.1\Bin +#_NETSDK=c:\netsdk2.0\bin +_NETSDK=c:\netsdk3.5\bin + +_CS_DBG_FLAGS=/debug+ +_CS_DLL_FLAGS=/t:library $(_CS_DBG_FLAGS) +_CS_EXE_FLAGS=/t:exe $(_CS_DBG_FLAGS) + +_CSC=$(_NETHOME)\csc.exe + +_BASE_IMPORTS=/R:System.dll /R:Ionic.Zlib.dll + + +default: Ionic.Zlib.dll ZlibDeflateInflate.exe test_dict_deflate_inflate.exe test_flush_sync.exe test_large_deflate_inflate.exe ZlibStreamExample.exe QuickCompress.exe + + +Ionic.Zlib.dll: ..\..\..\Zlib\obj\Debug\Ionic.Zlib.dll ..\..\..\Zlib\obj\Debug\Ionic.Zlib.pdb + copy /y ..\..\..\Zlib\obj\Debug\Ionic.Zlib.* . + +.cs.exe: + if not exist Ionic.Zlib.dll ( copy ..\..\..\Zlib\obj\Debug\Ionic.Zlib.* . ) + $(_CSC) $(_CS_EXE_FLAGS) $(_BASE_IMPORTS) /out:$@ $** + + +clean: + -del ZlibDeflateInflate.exe test_dict_deflate_inflate.exe test_flush_sync.exe test_large_deflate_inflate.exe ZlibStreamExample.exe QuickCompress.exe + -del Ionic.Zlib.dll + -del *.pdb + diff --git a/dotNetZip/Examples/C#/ZLIB/test_dict_deflate_inflate.cs b/dotNetZip/Examples/C#/ZLIB/test_dict_deflate_inflate.cs new file mode 100644 index 0000000..52f2075 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/test_dict_deflate_inflate.cs @@ -0,0 +1,118 @@ +using System; +using Ionic.Zlib; + +// Test deflate() with preset dictionary +class test_dict_deflate_inflate +{ + [STAThread] + public static void Main(String[] arg) + { + try + { + var x = new test_dict_deflate_inflate(); + x.Run(); + } + catch (System.Exception e1) + { + Console.WriteLine("Exception: " + e1); + } + } + + private void Run() + { + int rc; + int bufferSize = 40000; + byte[] compressedBytes = new byte[bufferSize]; + byte[] decompressedBytes = new byte[bufferSize]; + + ZlibCodec compressingStream = new ZlibCodec(); + rc = compressingStream.InitializeDeflate(CompressionLevel.LEVEL9_BEST_COMPRESSION); + CheckForError(compressingStream, rc, "InitializeDeflate"); + + string dictionaryWord = "hello "; + byte[] dictionary = System.Text.ASCIIEncoding.ASCII.GetBytes(dictionaryWord); + string TextToCompress = "hello, hello! How are you, Joe? "; + byte[] BytesToCompress = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + + rc = compressingStream.SetDictionary(dictionary); + CheckForError(compressingStream, rc, "SetDeflateDictionary"); + + long dictId = compressingStream.Adler32; + + compressingStream.OutputBuffer = compressedBytes; + compressingStream.NextOut = 0; + compressingStream.AvailableBytesOut = bufferSize; + + compressingStream.InputBuffer = BytesToCompress; + compressingStream.NextIn = 0; + compressingStream.AvailableBytesIn = BytesToCompress.Length; + + rc = compressingStream.Deflate(ZlibConstants.Z_FINISH); + if (rc != ZlibConstants.Z_STREAM_END) + { + System.Console.Out.WriteLine("deflate should report Z_STREAM_END"); + System.Environment.Exit(1); + } + rc = compressingStream.EndDeflate(); + CheckForError(compressingStream, rc, "deflateEnd"); + + ZlibCodec decompressingStream = new ZlibCodec(); + + decompressingStream.InputBuffer = compressedBytes; + decompressingStream.NextIn = 0; + decompressingStream.AvailableBytesIn = bufferSize; + + rc = decompressingStream.InitializeInflate(); + CheckForError(decompressingStream, rc, "inflateInit"); + decompressingStream.OutputBuffer = decompressedBytes; + decompressingStream.NextOut = 0; + decompressingStream.AvailableBytesOut = decompressedBytes.Length; + + while (true) + { + rc = decompressingStream.Inflate(ZlibConstants.Z_NO_FLUSH); + if (rc == ZlibConstants.Z_STREAM_END) + { + break; + } + if (rc == ZlibConstants.Z_NEED_DICT) + { + if ((int)decompressingStream.Adler32 != (int)dictId) + { + System.Console.Out.WriteLine("unexpected dictionary"); + System.Environment.Exit(1); + } + rc = decompressingStream.SetDictionary(dictionary); + } + CheckForError(decompressingStream, rc, "inflate with dict"); + } + + rc = decompressingStream.EndInflate(); + CheckForError(decompressingStream, rc, "EndInflate"); + + int j = 0; + for (; j < decompressedBytes.Length; j++) + if (decompressedBytes[j] == 0) + break; + + var result = System.Text.ASCIIEncoding.ASCII.GetString(decompressedBytes, 0, j); + + Console.WriteLine("orig length: {0}", TextToCompress.Length); + Console.WriteLine("compressed length: {0}", compressingStream.TotalBytesOut); + Console.WriteLine("decompressed length: {0}", decompressingStream.TotalBytesOut); + Console.WriteLine("result length: {0}", result.Length); + Console.WriteLine("result of inflate:\n{0}", result); + } + + internal static void CheckForError(ZlibCodec z, int err, System.String msg) + { + if (err != ZlibConstants.Z_OK) + { + if (z.Message != null) + System.Console.Out.Write(z.Message + " "); + System.Console.Out.WriteLine(msg + " error: " + err); + + System.Environment.Exit(1); + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZLIB/test_flush_sync.cs b/dotNetZip/Examples/C#/ZLIB/test_flush_sync.cs new file mode 100644 index 0000000..a5ad84e --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/test_flush_sync.cs @@ -0,0 +1,120 @@ +using System; +using Ionic.Zlib; + +// Test deflate() with full flush +class test_flush_sync +{ + + [STAThread] + public static void Main(System.String[] args) + { + try + { + var x = new test_flush_sync(); + x.Run(); + } + catch (System.Exception e1) + { + Console.WriteLine("Exception: " + e1); + } + } + + private void Run() + { + int rc; + int comprLen = 40000; + int uncomprLen = comprLen; + byte[] CompressedBytes = new byte[comprLen]; + byte[] DecompressedBytes = new byte[uncomprLen]; + string TextToCompress = "This is the text that will be compressed."; + byte[] BytesToCompress = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + + ZlibCodec compressor = new ZlibCodec(CompressionMode.Compress); + + compressor.InputBuffer = BytesToCompress; + compressor.NextIn = 0; + compressor.OutputBuffer = CompressedBytes; + compressor.NextOut = 0; + compressor.AvailableBytesIn = 3; + compressor.AvailableBytesOut = CompressedBytes.Length; + + rc = compressor.Deflate(ZlibConstants.Z_FULL_FLUSH); + CheckForError(compressor, rc, "Deflate"); + + CompressedBytes[3]++; // force an error in first compressed block // dinoch + compressor.AvailableBytesIn = TextToCompress.Length - 3; + + rc = compressor.Deflate(ZlibConstants.Z_FINISH); + if (rc != ZlibConstants.Z_STREAM_END) + { + CheckForError(compressor, rc, "Deflate"); + } + rc = compressor.EndDeflate(); + CheckForError(compressor, rc, "EndDeflate"); + comprLen = (int) (compressor.TotalBytesOut); + + ZlibCodec decompressor = new ZlibCodec(CompressionMode.Decompress); + + decompressor.InputBuffer = CompressedBytes; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = 2; + + decompressor.OutputBuffer = DecompressedBytes; + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = DecompressedBytes.Length; + + rc = decompressor.Inflate(ZlibConstants.Z_NO_FLUSH); + CheckForError(decompressor, rc, "Inflate"); + + decompressor.AvailableBytesIn = CompressedBytes.Length - 2; + + rc = decompressor.SyncInflate(); + CheckForError(decompressor, rc, "SyncInflate"); + + bool gotException = false; + try + { + rc = decompressor.Inflate(ZlibConstants.Z_FINISH); + } + catch (ZlibException ex1) + { + Console.WriteLine("Got Expected Exception: " + ex1); + gotException = true; + } + + if (!gotException) + { + System.Console.Out.WriteLine("inflate should report DATA_ERROR"); + /* Because of incorrect adler32 */ + System.Environment.Exit(1); + } + + rc = decompressor.EndInflate(); + CheckForError(decompressor, rc, "EndInflate"); + + int j = 0; + for (; j < DecompressedBytes.Length; j++) + if (DecompressedBytes[j] == 0) + break; + + var result = System.Text.ASCIIEncoding.ASCII.GetString(DecompressedBytes, 0, j); + + Console.WriteLine("orig length: {0}", TextToCompress.Length); + Console.WriteLine("compressed length: {0}", compressor.TotalBytesOut); + Console.WriteLine("uncompressed length: {0}", decompressor.TotalBytesOut); + Console.WriteLine("result length: {0}", result.Length); + Console.WriteLine("result of inflate:\n(Thi){0}", result); + } + + internal static void CheckForError(ZlibCodec z, int rc, System.String msg) + { + if (rc != ZlibConstants.Z_OK) + { + if (z.Message != null) + System.Console.Out.Write(z.Message + " "); + System.Console.Out.WriteLine(msg + " error: " + rc); + + System.Environment.Exit(1); + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZLIB/test_large_deflate_inflate.cs b/dotNetZip/Examples/C#/ZLIB/test_large_deflate_inflate.cs new file mode 100644 index 0000000..2a24d82 --- /dev/null +++ b/dotNetZip/Examples/C#/ZLIB/test_large_deflate_inflate.cs @@ -0,0 +1,147 @@ +using System; +using Ionic.Zlib; + +// Test deflate() with large buffers and dynamic change of compression level +class test_large_deflate_inflate +{ + [STAThread] + public static void Main(System.String[] arg) + { + try + { + var x = new test_large_deflate_inflate(); + x.Run(); + } + catch (System.Exception e1) + { + Console.WriteLine("Exception: " + e1); + } + } + + private void Run() + { + int rc; + int j; + int bufferSize = 40000; + byte[] compressedBytes = new byte[bufferSize]; + byte[] bufferToCompress= new byte[bufferSize]; + byte[] decompressedBytes = new byte[bufferSize]; + + ZlibCodec compressingStream= new ZlibCodec(); + + rc = compressingStream.InitializeDeflate(CompressionLevel.BestSpeed); + CheckForError(compressingStream, rc, "InitializeDeflate"); + + compressingStream.OutputBuffer = compressedBytes; + compressingStream.NextOut = 0; + compressingStream.AvailableBytesOut = compressedBytes.Length; + + // At this point, bufferToCompress is all zeroes, so it should compress + // very well: + compressingStream.InputBuffer = bufferToCompress; + compressingStream.AvailableBytesIn = bufferToCompress.Length; + rc = compressingStream.Deflate(FlushType.None); + CheckForError(compressingStream, rc, "deflate"); + if (compressingStream.AvailableBytesIn != 0) + { + System.Console.Out.WriteLine("deflate not greedy"); + System.Environment.Exit(1); + } + + Console.WriteLine("Stage 1: uncompressed bytes in so far: {0,6}", compressingStream.TotalBytesIn); + Console.WriteLine(" compressed bytes out so far: {0,6}", compressingStream.TotalBytesOut); + + + // Feed in already compressed data and switch to no compression: + compressingStream.SetDeflateParams(CompressionLevel.None, CompressionStrategy.Default); + compressingStream.InputBuffer = compressedBytes; + compressingStream.NextIn = 0; + compressingStream.AvailableBytesIn = bufferSize / 2; // why? - for fun + rc = compressingStream.Deflate(FlushType.None); + CheckForError(compressingStream, rc, "Deflate"); + + Console.WriteLine("Stage 2: uncompressed bytes in so far: {0,6}", compressingStream.TotalBytesIn); + Console.WriteLine(" compressed bytes out so far: {0,6}", compressingStream.TotalBytesOut); + + // Insert data into bufferToCompress, and Switch back to compressing mode: + System.Random rnd = new Random(); + + for (int i = 0; i < bufferToCompress.Length / 1000; i++) + { + byte b = (byte) rnd.Next(); + int n = 500 + rnd.Next(500); + for (j = 0; j < n; j++) + bufferToCompress[j + i] = b; + i += j-1; + } + + compressingStream.SetDeflateParams(CompressionLevel.BestCompression, CompressionStrategy.Filtered); + compressingStream.InputBuffer = bufferToCompress; + compressingStream.NextIn = 0; + compressingStream.AvailableBytesIn = bufferToCompress.Length; + rc = compressingStream.Deflate(FlushType.None); + CheckForError(compressingStream, rc, "Deflate"); + + Console.WriteLine("Stage 3: uncompressed bytes in so far: {0,6}", compressingStream.TotalBytesIn); + Console.WriteLine(" compressed bytes out so far: {0,6}", compressingStream.TotalBytesOut); + + rc = compressingStream.Deflate(FlushType.Finish); + if (rc != ZlibConstants.Z_STREAM_END) + { + Console.WriteLine("deflate reported {0}, should report Z_STREAM_END", rc); + Environment.Exit(1); + } + rc = compressingStream.EndDeflate(); + CheckForError(compressingStream, rc, "EndDeflate"); + + Console.WriteLine("Stage 4: uncompressed bytes in (final): {0,6}", compressingStream.TotalBytesIn); + Console.WriteLine(" compressed bytes out (final): {0,6}", compressingStream.TotalBytesOut); + + ZlibCodec decompressingStream = new ZlibCodec(CompressionMode.Decompress); + + decompressingStream.InputBuffer = compressedBytes; + decompressingStream.NextIn = 0; + decompressingStream.AvailableBytesIn = bufferSize; + + // upon inflating, we overwrite the decompressedBytes buffer repeatedly + while (true) + { + decompressingStream.OutputBuffer = decompressedBytes; + decompressingStream.NextOut = 0; + decompressingStream.AvailableBytesOut = decompressedBytes.Length; + rc = decompressingStream.Inflate(FlushType.None); + if (rc == ZlibConstants.Z_STREAM_END) + break; + CheckForError(decompressingStream, rc, "inflate large"); + } + + rc = decompressingStream.EndInflate(); + CheckForError(decompressingStream, rc, "EndInflate"); + + if (decompressingStream.TotalBytesOut != 2 * decompressedBytes.Length + bufferSize / 2) + { + System.Console.WriteLine("bad large inflate: " + decompressingStream.TotalBytesOut); + System.Environment.Exit(1); + } + + for (j = 0; j < decompressedBytes.Length; j++) + if (decompressedBytes[j] == 0) + break; + + Console.WriteLine("compressed length: {0}", compressingStream.TotalBytesOut); + Console.WriteLine("decompressed length (expected): {0}", 2 * decompressedBytes.Length + bufferSize / 2); + Console.WriteLine("decompressed length (actual) : {0}", decompressingStream.TotalBytesOut); + } + + internal static void CheckForError(ZlibCodec z, int rc, System.String msg) + { + if (rc != ZlibConstants.Z_OK) + { + if (z.Message != null) + System.Console.Out.Write(z.Message + " "); + System.Console.Out.WriteLine(msg + " error: " + rc); + + System.Environment.Exit(1); + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZipDir/Properties/AssemblyInfo.cs b/dotNetZip/Examples/C#/ZipDir/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3d5a6fa Binary files /dev/null and b/dotNetZip/Examples/C#/ZipDir/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Examples/C#/ZipDir/ZipDir.cs b/dotNetZip/Examples/C#/ZipDir/ZipDir.cs new file mode 100644 index 0000000..c5fcdd2 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipDir/ZipDir.cs @@ -0,0 +1,73 @@ +// ZipDir.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2006, 2007, 2008 Microsoft Corporation. All rights reserved. +// +// This example is released under the Microsoft Permissive License of +// October 2006. See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This utility zips up a single directory specified on the command line. +// It is like a specialized ZipIt tool (See ZipIt.cs). +// +// compile with: +// csc /debug+ /target:exe /r:Zip.dll /out:ZipDir.exe ZipDir.cs +// +// Wed, 29 Mar 2006 14:36 +// + +using System; +using Ionic.Zip; + +namespace Ionic.Zip.Examples +{ + + public class ZipDir + { + + private static void Usage() + { + Console.WriteLine("usage:\n ZipDir "); + Environment.Exit(1); + } + + public static void Main(String[] args) + { + if (args.Length != 2) Usage(); + if (!System.IO.Directory.Exists(args[1])) + { + Console.WriteLine("The directory does not exist!\n"); + Usage(); + } + if (System.IO.File.Exists(args[0])) + { + Console.WriteLine("That zipfile already exists!\n"); + Usage(); + } + if (!args[0].EndsWith(".zip")) + { + Console.WriteLine("The filename must end with .zip!\n"); + Usage(); + } + + string ZipFileToCreate = args[0]; + string DirectoryToZip = args[1]; + try + { + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = System.Console.Out; + zip.AddDirectory(DirectoryToZip); // recurses subdirectories + zip.Save(ZipFileToCreate); + } + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: " + ex1); + } + + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZipDir/ZipDir.csproj b/dotNetZip/Examples/C#/ZipDir/ZipDir.csproj new file mode 100644 index 0000000..d5e3bb4 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipDir/ZipDir.csproj @@ -0,0 +1,101 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E04C2A53-3981-44D4-94AF-6AC07D97CDE8} + Exe + Properties + ZipDir + ZipDir + + + + + 3.5 + SAK + SAK + SAK + SAK + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + Properties\SolutionInfo.cs + + + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZipTreeView/Form1.Designer.cs b/dotNetZip/Examples/C#/ZipTreeView/Form1.Designer.cs new file mode 100644 index 0000000..029f6c6 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Form1.Designer.cs @@ -0,0 +1,92 @@ +namespace ZipTreeView +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.treeView1 = new System.Windows.Forms.TreeView(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // treeView1 + // + this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.treeView1.Location = new System.Drawing.Point(12, 39); + this.treeView1.Name = "treeView1"; + this.treeView1.Size = new System.Drawing.Size(260, 213); + this.treeView1.TabIndex = 0; + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem; + this.textBox1.Location = new System.Drawing.Point(12, 12); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(206, 20); + this.textBox1.TabIndex = 1; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(225, 11); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(47, 23); + this.button1.TabIndex = 2; + this.button1.Text = "open"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 264); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.treeView1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "Form1"; + this.Text = "Zip TreeView (C#)"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TreeView treeView1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button1; + } +} + diff --git a/dotNetZip/Examples/C#/ZipTreeView/Form1.cs b/dotNetZip/Examples/C#/ZipTreeView/Form1.cs new file mode 100644 index 0000000..1d05b92 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Form1.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.IO; +using System.Windows.Forms; +using Ionic.Zip; + +namespace ZipTreeView +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + this.textBox1.BackColor = System.Drawing.Color.White; + string txt = this.textBox1.Text; + try + { + this.treeView1.Nodes.Clear(); + using (var zip = ZipFile.Read(txt)) + { + foreach (var entry in zip) + { + AddTreeNode(entry.FileName); + } + } + } + catch + { + this.textBox1.BackColor = System.Drawing.Color.MistyRose; + MessageBox.Show("Exception reading that zip file."); + } + } + + private TreeNode AddTreeNode(string name) + { + if (name.EndsWith("/")) + name = name.Substring(0, name.Length - 1); + + TreeNode node = FindNodeForTag(name, this.treeView1.Nodes); + if (node != null) + return node; + String parent = Path.GetDirectoryName(name); + TreeNodeCollection pnodeCollection = (parent == "") + ? this.treeView1.Nodes + : AddTreeNode(parent.Replace("\\", "/")).Nodes; + + node = new TreeNode() + { + Text = Path.GetFileName(name), + Tag = name // ' full path + }; + pnodeCollection.Add(node); + return node; + } + + // Returns the TreeNode for a given name + private TreeNode FindNodeForTag(string name, TreeNodeCollection nodes) + { + foreach (TreeNode node in nodes) + { + if (name == (string) node.Tag) + return node; + else if (name.StartsWith(node.Tag + "/")) + return FindNodeForTag(name, node.Nodes); + } + return null; + } + + } +} diff --git a/dotNetZip/Examples/C#/ZipTreeView/Form1.resx b/dotNetZip/Examples/C#/ZipTreeView/Form1.resx new file mode 100644 index 0000000..e3fee67 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Form1.resx @@ -0,0 +1,1119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAoAMDAQAAEABABoBg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AB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAA + AAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAP///AACAAB////8AAIAH/////wAAg///////AAD///////8AACgA + AAAgAAAAQAAAAAEACAAAAAAAAAQAAAAAAAAAAAAAAAEAAAABAAAAAAAAWEpEAHBPQQBxY14AaWpqAHpt + ZQBhaXAAYnB7AJNtWwCFdWwAnYF5AJeIfwC2jnIAa3yIAHF/igBpgY4AZYSWAHeIkQBmlqgAaJaoAGeZ + qwBrmqsAfpmnAHecqwBvoLEAc6S2AHujswB9q7sAarHNAH25zgBayt8AYc3fAE/N6ABnzegAZ87vAHbL + 5QBzz+oAec3tAGPU7ABl1OwAa9btAGzX7gBx1+4AeNDrAHHZ7wB22e8Acc3xAHbO8QB50PIAfdHyAHzV + 8gB81fQAdNj1AHfe9wB62fUAfdv3AHne9wB83/cAf935AH/g9wB+4PkAj4WCAIuPkQCSj5EAjZCSAI+W + mACRkJIAlZaWAJSXmQCUmZkAlpqcAKKJgQC4loYAtZqNAKOenAC9oIkAv6mIAJueoQCIo6sAn6CgAJOl + rgCkq64Ava6iALesqQDKq5UA1babAM2zpgDZu68A5r+yAOLHpADlx7MA68u0AOLNvQCAr8EAiL3PAIS+ + 0gChvMYAhMDVAIPB2ACRxdgAtsPHALjEyQClxtEApMfUAKfL1wCvydMAqc7bAL/L0QCt098AtdDZALLU + 3QCIzeYAhM/rAIfX6wCF1uwAiNbrAIzW6wCI0ewAhtjsAIXd7gCJ2u0AjNvuAI7c7gCW0eYAn9PiAJHU + 7gCf1+4AgdLxAITT8gCH1PMAitXzAI3W8gCF3/AAhtn1AITc9gCQ1/MAk97wAJLY9ACW2fQAk972AJXf + 9ACa3fUAndz0AKrb5QCg2e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4axsb55v3rPyNVI/35Z35KfeaUV/EdlfXv6zbK3pGGLZ+StlCKOUw7GMa+//hpB4BN0 + OnR8n8FgQH+wQv/8l9A/+EdMpwmf/dyX+PyXfp7HnniRndvX+O4/+Ic8+sTT9Acj+oPMWSulptPplKXQ + 1gVS68dmuQrwuyA8tOMhgDu3x/idoIjoUgV/PVET4LZj270fezmlRUGr0zp1ZVIAs3C6Hq92boD/Dzfr + H5amJQ0rs9efy9wULPnWy5yFTGVmBVz/+Erm4HNdfN/H97OJQEHQYXXzPI9unGVtY4twOuW1117l8cce + 4ntf/0dcu/wo65vnWVnd/v/be/No2a76vvOz9xlrvPPwZr2neUKIwWCQ9ADZBjz0crq9ArFst0k3lpNO + YscYZwXhtbKyLLo72I693B0bMIG2jQ3dxCTGkMTGIxgxGIEQCKQn6c3TnW/dms64+49zqupU1Tl16456 + 0qvvWlV1hn323ufU+f6+vz0zPjlHeeIAhmHGqwEJZPdc4OnPo/2TJL8EqSGEzsaGQ63mUsoXAWXQ/a5m + PYws8vcaibTrrkvs7XwA0VZCfFXfC5lNjh4VTVQobln1M8m/16qflreeOPZB9ZPHlVJRRWAQks/l8X0P + z3NxHCeqkI179hmGxeJSBV0/HVX46RpHjxxkekJhiYs465epr0gWzlnk8mM0Fr/IbNHE0LUelm3yPIQA + ZDQwSeoIYdKohZz6zhXGJgoQjSPx2Vzhh91up5zYv269gn1aGKRro3u/i1zJ391W/c7x9PEAqZkerPqk + GbSsOFPi2IHq9+WjN46M5y6EQMafsfFJNC0aERgGHq7r4nkejuOiFHh+SKNRRamAMFT4nsf8bInpyWje + fyEESikMI6BknWasnMM0k8uBZak+icq+SPUROkIarK66nH1ukeLkIfKFJl5doWtGcGg2p11caGT1B9iu + Idhs/yWPvW8GpPdpDvNs91L1N4+HrHDJIy9YRd+wqp8ehwA0TWAYGvWlJ9hwcmhGDrswhmUXKdpFymOS + 5779efLFcSambgClaDSqIGBiLMeBuRJjJRtDF9GKQUJgWRqFvEnO1pEy495Ub04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AAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvuf3/7X2//+X4/3/sPb//7L3//+y + 9///svf//7L3//+x9///sfb//7D2//+w9v//r/b//671/v+t9f7/rfX+/6fv+//Gqpv/wLq0/3xzcP+l + mZP/sJWL/7/s9f/s/P///////+T7/v+X2vT/ne77/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvuf3/7X2//+X + 4/3/sPb//7L3//+y9///svf//7L3//+y9///sff//7H2//+w9v//sPb//6/2//+v9f//r/X+/7fz/f/1 + 5dz/0c7L/2heWP+rnJD/vaed/9ru8//d+v//0fj+/7/2/v+Z2vT/nu/8/wAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAvuf3/7X2//+X4/3/sPb//7L3//+y9///svf//7L3//+y9///svf//7L3//+x9v//sfb//7D2//+v + 9v//uff//733/v+79Pz/5dzW/36CfP+hr7T/fJun/57h8v+k5vn/oeH3/57e9f+d4/f/nu/8lgAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAvuf3/7X2//+X4/3/sfb//7L3//+y9///svf//7P3//+z9///tPf//7P3//+y + 9///sff//7H1//+x8v3/sPD8/6/s+/+u6fn/oaqu/15xef9kjp3/f7jL9p7f896h5vm5n+j6hp7q+0Ge + 8P0PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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8AAP///////wAA////////AAD///////8AAP///////wAA///gAH//AAD/ + /4AAH/8AAP/4AAAP/wAA/8AAAAP/AAD8AAAAAf8AAMAAAAAB/wAAgAAAAAD/AACAAAAAAH8AAIAAAAAA + PwAAgAAAAAAPAACAAAAAAA8AAIAAAAAADwAAgAAAAAA/AACAAAAAAP8AAIAAAAAD/wAAgAAAAA//AACA + AAAAP/8AAIAAAAD//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf/ + /wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACA + AAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAA// + /wAAgAAH////AACAAf////8AAID//////wAA////////AAAoAAAAIAAAAEAAAAABACAAAAAAAIAQAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFcaW5O3u0ynNSd4Y4AAAAGwAAABYA + AAAOAAAABgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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pr/oPH6/4DL6f8A + AAAAAAAAAAAAAAAAAAAAhM7r/7j8//+1+///sfr+/675/v+s+P3/7uri/7mVh/+ZeHP/pvT8/5Pd8v+E + zuv/AAAAAAAAAAAAAAAAAAAAAIfQ7f+H0O3/h9Dt/4fQ7f+H0O3/h9Dt/6LS5v90q8D/Z77e/4fQ7f+H + 0O3/X7rSdQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACA + AwAAgAcAAIAHAACABwAAgAcAAIAHAAD//wAA + + + \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZipTreeView/Program.cs b/dotNetZip/Examples/C#/ZipTreeView/Program.cs new file mode 100644 index 0000000..af61e8f --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace ZipTreeView +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/dotNetZip/Examples/C#/ZipTreeView/Properties/AssemblyInfo.cs b/dotNetZip/Examples/C#/ZipTreeView/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..236d4fd --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Properties/AssemblyInfo.cs @@ -0,0 +1,12 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ZipTreeView")] +[assembly: AssemblyDescription("Example showing a zipfile in a WinForms TreeView")] +[assembly: AssemblyConfiguration("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("c40b5ebc-ea71-420e-8f61-46582173dbb9")] + diff --git a/dotNetZip/Examples/C#/ZipTreeView/Properties/Resources.Designer.cs b/dotNetZip/Examples/C#/ZipTreeView/Properties/Resources.Designer.cs new file mode 100644 index 0000000..f134458 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.225 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ZipTreeView.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZipTreeView.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/dotNetZip/Examples/C#/ZipTreeView/Properties/Resources.resx b/dotNetZip/Examples/C#/ZipTreeView/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/C#/ZipTreeView/Properties/Settings.Designer.cs b/dotNetZip/Examples/C#/ZipTreeView/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6c4cace --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.225 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ZipTreeView.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/dotNetZip/Examples/C#/ZipTreeView/Properties/Settings.settings b/dotNetZip/Examples/C#/ZipTreeView/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotNetZip/Examples/C#/ZipTreeView/ZipTreeView.csproj b/dotNetZip/Examples/C#/ZipTreeView/ZipTreeView.csproj new file mode 100644 index 0000000..7b3907e --- /dev/null +++ b/dotNetZip/Examples/C#/ZipTreeView/ZipTreeView.csproj @@ -0,0 +1,138 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {1BCEC4DE-A73D-49A6-869F-EDA4AB6B41EF} + WinExe + Properties + ZipTreeView + ZipTreeView + v3.5 + 512 + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + Form + + + Form1.cs + + + + + Properties\SolutionInfo.cs + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/C++/CreateWithProgress.cpp b/dotNetZip/Examples/C++/CreateWithProgress.cpp new file mode 100644 index 0000000..d9b6e00 --- /dev/null +++ b/dotNetZip/Examples/C++/CreateWithProgress.cpp @@ -0,0 +1,127 @@ +// CreateWithProgress.cpp +// +// Example: creating a zip file, with progress events, from C++. +// +// This code is part of DotNetZip. +// +// +// Last saved: <2010-June-01 10:32:21> +// + + +using namespace System; +using namespace System::IO; +using namespace Ionic::Zip; + + +public ref class DnzHelloCppCli +{ + +private: + bool justHadByteUpdate; + +public: + DnzHelloCppCli() + { + } + +public: + void Run() + { + Console::WriteLine(L"Hello World"); + Console::WriteLine("Using DotNetZip version {0}", ZipFile::LibraryVersion); + array^ filesToAdd = System::IO::Directory::GetFiles(".", "*.cpp"); + + ZipFile ^ zip; + try + { + zip = gcnew ZipFile(); + zip->Password = "Harbinger"; + zip->Encryption = EncryptionAlgorithm::WinZipAes128; + zip->SaveProgress += gcnew EventHandler(this, &DnzHelloCppCli::SaveProgress); + zip->AddEntry("Readme.txt", "This is the content for the Readme.txt entry."); + zip->AddFiles(filesToAdd, "files"); + zip->Save("MyArchive.zip"); + } + finally + { + zip->~ZipFile(); + } + + Console::WriteLine(L"Press to quit."); + Console::ReadLine(); + return; + } + +public: + void SaveProgress(Object^ sender, SaveProgressEventArgs^ e) + { + switch (e->EventType) + { + case ZipProgressEventType::Saving_Started: + { + Console::WriteLine("Saving: {0}", e->ArchiveName); + break; + } + case ZipProgressEventType::Saving_BeforeWriteEntry: + { + if (this->justHadByteUpdate) + { + Console::WriteLine(); + } + Console::WriteLine(" Writing: {0} ({1}/{2})", + e->CurrentEntry->FileName, + (e->EntriesSaved + 1), + e->EntriesTotal); + this->justHadByteUpdate = false; + break; + } + case ZipProgressEventType::Saving_AfterWriteEntry: + { + if (e->CurrentEntry->InputStreamWasJitProvided) + { + e->CurrentEntry->InputStream->Close(); + e->CurrentEntry->InputStream = nullptr; + } + break; + } + case ZipProgressEventType::Saving_Completed: + { + this->justHadByteUpdate = false; + Console::WriteLine(); + Console::WriteLine("Done: {0}", e->ArchiveName); + break; + } + case ZipProgressEventType::Saving_EntryBytesRead: + { + if (this->justHadByteUpdate) + { + Console::SetCursorPosition(0, Console::CursorTop); + } + Console::Write(" {0}/{1} ({2:N0}%)", + e->BytesTransferred, + e->TotalBytesToTransfer, + (((double) e->BytesTransferred) / (0.01 * e->TotalBytesToTransfer))); + this->justHadByteUpdate = true; + break; + } + } + } + +}; + + +int main(array ^args) +{ + try + { + DnzHelloCppCli^ me = gcnew DnzHelloCppCli(); + me->Run(); + } + catch (Exception^ ex1) + { + Console::Error->WriteLine(String::Concat("exception: ", ex1)); + } + return 0; +} + diff --git a/dotNetZip/Examples/C++/CreateZipfile.cpp b/dotNetZip/Examples/C++/CreateZipfile.cpp new file mode 100644 index 0000000..c9c21ac --- /dev/null +++ b/dotNetZip/Examples/C++/CreateZipfile.cpp @@ -0,0 +1,38 @@ +// CreateZipFile.cpp +// +// Example: creating a zip file from C++. +// +// This code is part of DotNetZip. +// +// +// Last saved: <2010-June-01 10:32:15> +// + + +using namespace System; +using namespace Ionic::Zip; + +int main(array ^args) +{ + Console::WriteLine(L"Hello World"); + Console::WriteLine(L"Creating a zip file from C++/CLI using DotNetZip..."); + + ZipFile ^ zip; + try + { + zip = gcnew ZipFile(); + zip->AddEntry("Readme.txt", "This is the content for the Readme.txt entry."); + zip->AddFile("CreateZipFile.cpp"); + zip->Save("test.zip"); + } + finally + { + //zip->~ZipFile(); + delete zip; + } + + Console::WriteLine(L"Press to quit."); + Console::ReadLine(); + return 0; +} + diff --git a/dotNetZip/Examples/C++/build.cmd b/dotNetZip/Examples/C++/build.cmd new file mode 100644 index 0000000..101a7eb --- /dev/null +++ b/dotNetZip/Examples/C++/build.cmd @@ -0,0 +1,35 @@ +setlocal + +if not exist Ionic.Zip.dll ( + fsutil hardlink create "Ionic.Zip.dll" "c:\dinoch\dev\dotnet\zip\DotNetZip\Zip Full DLL\bin\Debug\Ionic.Zip.dll" +) + +set CLCMD=\vc9\bin\cl.exe +set LINKCMD=\vc9\bin\link.exe +set MTCMD=c:\netsdk2.0\Bin\mt.exe + +for %%F in (CreateWithProgress CreateZipFile) do call :COMPILE_ONE_APP %%F + +goto ALL_DONE + + + +-------------------------------------------- +:COMPILE_ONE_APP + @REM Arg: basename + set fileToBuild=%1 + %CLCMD% /Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Fo".\\" -I\vc9\include -I\winsdk\include /W3 /c /Zi /clr /TP /FU "c:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU Ionic.Zip.dll %fileToBuild%.cpp + + %LINKCMD% /OUT:%fileToBuild%.exe /MANIFEST /MANIFESTFILE:"%fileToBuild%.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /ASSEMBLYDEBUG /PDB:%fileToBuild%.pdb /DYNAMICBASE /FIXED:No /NXCOMPAT /MACHINE:X86 /LIBPATH:\vc9\lib /LIBPATH:\winsdk\lib %fileToBuild%.obj + + %MTCMD% /outputresource:"%fileToBuild%.exe;#1" /manifest %fileToBuild%.exe.intermediate.manifest + del %fileToBuild%.exe.intermediate.manifest + @GOTO:EOF + + + +-------------------------------------------- +:ALL_DONE + + +endlocal \ No newline at end of file diff --git a/dotNetZip/Examples/C++/clean.cmd b/dotNetZip/Examples/C++/clean.cmd new file mode 100644 index 0000000..1011b67 --- /dev/null +++ b/dotNetZip/Examples/C++/clean.cmd @@ -0,0 +1,13 @@ +del *.obj +del Ionic.Zip.dll +del *.cpp~ +del Create*.exe +del Create*.exp +del Create*.ilk +del *.pdb +del *.exe.intermediate.manifest +del *.idb +del MyArchive.zip +del test.zip +del *.cmd~ + diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/CF-Unzipper.csproj b/dotNetZip/Examples/CompactFramework/CF-Unzipper/CF-Unzipper.csproj new file mode 100644 index 0000000..3d7f9f7 --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/CF-Unzipper.csproj @@ -0,0 +1,146 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D2E7C1EA-6FF1-4E26-96FC-24F6FB68B61B} + WinExe + Properties + Ionic.Examples.Smartphone.Zip + CF-Unzipper + Smartphone + f27da329-3269-4191-98e0-c87d3d7f1db9 + 5.2 + SmartDeviceProject3 + v2.0 + Windows Mobile 6 Standard SDK + + + SAK + SAK + SAK + SAK + + + 4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE;$(PlatformFamilyName); NETCF + true + true + prompt + 512 + 4 + Off + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE;$(PlatformFamilyName); NETCF + true + true + prompt + 512 + 4 + Off + AllRules.ruleset + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + + + + + + + {051C2B3B-8CDF-42CB-9EA2-027232BFC395} + Zip CF DLL + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.Designer.cs b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.Designer.cs new file mode 100644 index 0000000..584b74a --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.Designer.cs @@ -0,0 +1,113 @@ +namespace SmartDeviceProject3 +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + private System.Windows.Forms.MainMenu mainMenu1; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.mainMenu1 = new System.Windows.Forms.MainMenu(); + this.menuItemUnzip = new System.Windows.Forms.MenuItem(); + this.menuItem2 = new System.Windows.Forms.MenuItem(); + this.menuItemDelete = new System.Windows.Forms.MenuItem(); + this.menuItemAbout = new System.Windows.Forms.MenuItem(); + this.menuItemQuit = new System.Windows.Forms.MenuItem(); + this.tvFolders = new System.Windows.Forms.TreeView(); + this.imageList1 = new System.Windows.Forms.ImageList(); + this.SuspendLayout(); + // + // mainMenu1 + // + this.mainMenu1.MenuItems.Add(this.menuItemUnzip); + this.mainMenu1.MenuItems.Add(this.menuItem2); + // + // menuItemUnzip + // + this.menuItemUnzip.Text = "Unzip"; + this.menuItemUnzip.Click += new System.EventHandler(this.menuItemUnzip_Click); + // + // menuItem2 + // + this.menuItem2.MenuItems.Add(this.menuItemDelete); + this.menuItem2.MenuItems.Add(this.menuItemAbout); + this.menuItem2.MenuItems.Add(this.menuItemQuit); + this.menuItem2.Text = "Menu"; + // + // menuItemDelete + // + this.menuItemDelete.Text = "Delete"; + this.menuItemDelete.Click += new System.EventHandler(this.menuItemDelete_Click); + // + // menuItemAbout + // + this.menuItemAbout.Text = "About"; + this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click); + // + // menuItemQuit + // + this.menuItemQuit.Text = "Quit"; + this.menuItemQuit.Click += new System.EventHandler(this.menuItemQuit_Click); + // + // tvFolders + // + this.tvFolders.Dock = System.Windows.Forms.DockStyle.Fill; + this.tvFolders.Location = new System.Drawing.Point(0, 0); + this.tvFolders.Name = "tvFolders"; + this.tvFolders.Size = new System.Drawing.Size(320, 186); + this.tvFolders.TabIndex = 0; + this.tvFolders.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvFolders_AfterSelect); + // + // imageList1 + // + this.imageList1.ImageSize = new System.Drawing.Size(16, 16); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(131F, 131F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoScroll = true; + this.ClientSize = new System.Drawing.Size(320, 186); + this.Controls.Add(this.tvFolders); + this.Font = new System.Drawing.Font("Segoe Condensed", 9F, System.Drawing.FontStyle.Bold); + this.Menu = this.mainMenu1; + this.Name = "Form1"; + this.Text = "Unzipper - browse and unzip"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView tvFolders; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.MenuItem menuItemUnzip; + private System.Windows.Forms.MenuItem menuItem2; + private System.Windows.Forms.MenuItem menuItemDelete; + private System.Windows.Forms.MenuItem menuItemAbout; + private System.Windows.Forms.MenuItem menuItemQuit; + } +} + diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.cs b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.cs new file mode 100644 index 0000000..0f3481a --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.cs @@ -0,0 +1,279 @@ +using System; +using System.IO; +using System.Windows.Forms; +using Ionic.Zip; + +namespace SmartDeviceProject3 +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + + CustomInit(); + } + + #region Helpers + private void CustomInit() + { + //add folder images to imagelist + this.imageList1.Images.Add(new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ionic.Examples.Smartphone.Zip.Images.Folder.gif"))); + this.imageList1.Images.Add(new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ionic.Examples.Smartphone.Zip.Images.Device.gif"))); + this.imageList1.Images.Add(new System.Drawing.Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ionic.Examples.Smartphone.Zip.Images.Card.gif"))); + + //set default image index to 0 + tvFolders.ImageIndex = 0; + tvFolders.SelectedImageIndex = 0; + + //use a backslash between path levels + tvFolders.PathSeparator = "\\"; + + //setup default tree + Reset(); + } + + public void Reset() + { + //restores dialog to initial settings and repopulates folders + this._selectedpath = ""; + tvFolders.Nodes.Clear(); + + //add the root (device) node to the tree + AddRoot(); + + //add root level subfolders + AddChildren(tvFolders.Nodes[0]); + + //expand the top level folders + tvFolders.Nodes[0].Expand(); + } + + + private void AddRoot() + { + //stop updates during filling + tvFolders.BeginUpdate(); + + //add an empty node (use device image) + TreeNode root = tvFolders.Nodes.Add(""); + root.ImageIndex = 1; + root.SelectedImageIndex = 1; + + tvFolders.EndUpdate(); + } + + + + /// + /// Adds subfolders to a specified node in the tree + /// + /// Node to add sub-folders to + private void AddChildren(TreeNode tn) + { + //stop updates during filling + tvFolders.BeginUpdate(); + + //path to query for subfolders + string path = (tn.FullPath == "") + ? "\\" + : tn.FullPath; + + //clear any existing subnodes + tn.Nodes.Clear(); + + //get all folders beneath the selected node + foreach (string directory in System.IO.Directory.GetDirectories(path)) + { + TreeNode node = new TreeNode(); + //format human friendly name + node.Text = directory.Substring(directory.LastIndexOf("\\") + 1, directory.Length - directory.LastIndexOf("\\") - 1); + + //change icon if folder is a storage card + DirectoryInfo di = new DirectoryInfo(directory); + if ((di.Attributes & FileAttributes.Temporary) == FileAttributes.Temporary) + { + node.ImageIndex = 2; + node.SelectedImageIndex = 2; + } + + //add to root of tree + tn.Nodes.Add(node); + } + + //get all files beneath the selected node + foreach (string zipfilename in System.IO.Directory.GetFiles(path)) + { + TreeNode node = new TreeNode(); + //format human friendly name + node.Text = System.IO.Path.GetFileName(zipfilename); + //node.Text = zipfile.Substring(directory.LastIndexOf("\\") + 1, directory.Length - directory.LastIndexOf("\\") - 1); + + //add to root of tree + tn.Nodes.Add(node); + } + + //restore events etc + tvFolders.EndUpdate(); + } + + #endregion + + #region Public Properties + + /// + /// Gets or sets the path selected by the user. + /// + public string SelectedPath + { + get + { + return _selectedpath; + } + set + { + //check that value passed is a valid file system path + if (Directory.Exists(value)) + { + _selectedpath = value; + + //split the path into each folder layer + string[] layers = value.Split('\\'); + + //mark the current node + TreeNode tn = tvFolders.Nodes[0]; + + //loop through the folder levels + foreach (string folderlevel in layers) + { + //ignore blank (top-level node) + if (folderlevel != "") + { + //add sub-folders + AddChildren(tn); + + //find the required subfolder + foreach (TreeNode thisnode in tn.Nodes) + { + //check node text + if (thisnode.Text == folderlevel) + { + //if it does set it and continue processing the next level + tn = thisnode; + break; + } + } + } + } + + //select the final node + tvFolders.SelectedNode = tn; + + } + } + } + #endregion + + #region Private Fields + private string _selectedpath; + #endregion + + #region Events + private void tvFolders_AfterSelect(object sender, TreeViewEventArgs e) + { + //set the currently selected folder/file + _selectedpath = (tvFolders.SelectedNode.FullPath == "") + ? "\\" + : tvFolders.SelectedNode.FullPath; + + if (System.IO.Directory.Exists(_selectedpath)) + { + menuItemUnzip.Enabled = false; + //if there are no child nodes we will check for any and add them + if (tvFolders.SelectedNode.Nodes.Count == 0) + { + AddChildren(tvFolders.SelectedNode); + } + } + else if (Ionic.Zip.ZipFile.IsZipFile(_selectedpath)) + { + menuItemUnzip.Enabled = true; + } + } + + + private void menuItemUnzip_Click(object sender, EventArgs e) + { + if (System.IO.File.Exists(_selectedpath)) + { + UnzipSelectedFile(); + } + } + + + private void UnzipSelectedFile() + { + string parent = System.IO.Path.GetDirectoryName(_selectedpath); + string dir = System.IO.Path.Combine(parent, + System.IO.Path.GetFileNameWithoutExtension(_selectedpath)); + try + { + using (var zip1 = Ionic.Zip.ZipFile.Read(_selectedpath)) + { + foreach (var entry in zip1) + { + entry.Extract(dir, ExtractExistingFileAction.OverwriteSilently); + } + } + + // re-populate the treeview with the extracted files: + AddChildren(tvFolders.SelectedNode.Parent); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } + } + + + private void menuItemDelete_Click(object sender, EventArgs e) + { + try + { + if (System.IO.File.Exists(_selectedpath)) + { + System.IO.File.Delete(_selectedpath); + } + else if (System.IO.Directory.Exists(_selectedpath)) + { + System.IO.Directory.Delete(_selectedpath, true); + } + + // refresh the treeview + AddChildren(tvFolders.SelectedNode.Parent); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } + } + + private void menuItemQuit_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void menuItemAbout_Click(object sender, EventArgs e) + { + MessageBox.Show("DotNetZip CF Unzipper. " + + "This example shows how to use the DotNetZip library in a .NET Compact Framework application. " + + "Built in VS2008 in December 2008.", + "About Unzipper", + MessageBoxButtons.OK, + MessageBoxIcon.Question, + MessageBoxDefaultButton.Button1); + } + + #endregion + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.resx b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.resx new file mode 100644 index 0000000..023f7f8 --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Form1.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 134, 17 + + + Smartphone Landscape + + + True + + \ No newline at end of file diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Card.gif b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Card.gif new file mode 100644 index 0000000..dcc666e Binary files /dev/null and b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Card.gif differ diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Device.gif b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Device.gif new file mode 100644 index 0000000..2d28960 Binary files /dev/null and b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Device.gif differ diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Folder.gif b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Folder.gif new file mode 100644 index 0000000..67bb500 Binary files /dev/null and b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Images/Folder.gif differ diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Program.cs b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Program.cs new file mode 100644 index 0000000..d70d3a2 --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Program.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace SmartDeviceProject3 +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [MTAThread] + static void Main() + { + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/AssemblyInfo.cs b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1c0ab5b Binary files /dev/null and b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/Resources.Designer.cs b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/Resources.Designer.cs new file mode 100644 index 0000000..f262864 --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/Resources.Designer.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.225 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ionic.Examples.Smartphone.Zip.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + #if !NETCF + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + #endif + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ionic.Examples.Smartphone.Zip.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/Resources.resx b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/Resources.resx new file mode 100644 index 0000000..3e18af9 --- /dev/null +++ b/dotNetZip/Examples/CompactFramework/CF-Unzipper/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/PHP/CreateZip-DotNetZip.php b/dotNetZip/Examples/PHP/CreateZip-DotNetZip.php new file mode 100644 index 0000000..0c37236 --- /dev/null +++ b/dotNetZip/Examples/PHP/CreateZip-DotNetZip.php @@ -0,0 +1,43 @@ +'; +echo ' '; +echo ' Calling .NET from PHP through COM'; +echo ' '; +echo ' '; +echo ''; + + echo '

Hello!

' . "
\n"; + echo '

Trying static method

' . "
\n"; + $fname = "archive-" . date('Y-m-d-His') . ".zip"; + echo 'Dynamically generated archive name: ' . "\n" . '

' . $fname . "

\n"; + + $zipOutput = "c:\\temp\\php-" . $fname; + $zipfact = new COM("Ionic.Zip.ZipFile"); + $zip = $zipfact->Read($zipOutput); + $zip->Encryption = 3; + $zip->Password = "AES-Encryption-Is-Secure"; + + $dirToZip= "c:\\temp\\psh"; + $zip->AddDirectory($dirToZip); + $zip->Save(); + + echo '
The file was saved to ' . $zip->Name . '
' . "\n"; + + $zip->Dispose(); + + echo ''; + echo ''; + +} +catch (Exception $e) { + echo 'Caught exception: ', $e->getMessage(), "\n"; + echo '
';
+  echo $e->getTraceAsString(), "\n";
+  echo '
'; +} + + +?> diff --git a/dotNetZip/Examples/SolutionInfo.cs b/dotNetZip/Examples/SolutionInfo.cs new file mode 100644 index 0000000..8cff7d3 Binary files /dev/null and b/dotNetZip/Examples/SolutionInfo.cs differ diff --git a/dotNetZip/Examples/VB/Quick-Unzip/AssemblyInfo.vb b/dotNetZip/Examples/VB/Quick-Unzip/AssemblyInfo.vb new file mode 100644 index 0000000..5ed8cd7 Binary files /dev/null and b/dotNetZip/Examples/VB/Quick-Unzip/AssemblyInfo.vb differ diff --git a/dotNetZip/Examples/VB/Quick-Unzip/QuickUnzip.vbproj b/dotNetZip/Examples/VB/Quick-Unzip/QuickUnzip.vbproj new file mode 100644 index 0000000..7d34727 --- /dev/null +++ b/dotNetZip/Examples/VB/Quick-Unzip/QuickUnzip.vbproj @@ -0,0 +1,120 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {95D9690B-3B37-4800-A511-6FB21436638B} + WinExe + QuickUnzip.Ionic.Zip.Examples.VB.QuickUnzip + QuickUnzip + QuickUnzip + 512 + WindowsForms + v3.5 + On + Binary + Off + On + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + true + true + bin\Debug\ + QuicknUnzip.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AllRules.ruleset + + + pdbonly + false + true + true + bin\Release\ + QuickUnzip.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AllRules.ruleset + + + + + + + + + + + + + + + + + + + + Form + + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/Quick-Unzip/Qunzip.vb b/dotNetZip/Examples/VB/Quick-Unzip/Qunzip.vb new file mode 100644 index 0000000..a72bf73 --- /dev/null +++ b/dotNetZip/Examples/VB/Quick-Unzip/Qunzip.vb @@ -0,0 +1,189 @@ +'' qunzip.vb +'' ------------------------------------------------------------------ +'' +'' A simple app that unzips a file, showing a progress bar. +'' It is both a console app, and a winforms app. +'' +'' It correctly does the multi-threading to allow smooth UI update. +'' +'' compile it with: +'' c:\.net3.5\vbc.exe /t:exe /debug:full /optimize- /R:System.dll /R:System.Data.dll /R:Ionic.Zip.dll +'' /out:Qunzip.exe Qunzip.vb +'' +'' built on host: DINOCH-2 +'' Created Thu Aug 06 15:34:17 2009 +'' +'' last saved: +'' Time-stamp: <2009-October-26 23:03:36> +'' ------------------------------------------------------------------ +'' +'' Copyright (c) 2009 by Dino Chiesa +'' All rights reserved! +'' +'' Licensed under the Microsoft Public License. +'' see http://www.opensource.org/licenses/ms-pl.html +'' +'' ------------------------------------------------------------------ + +Imports System +Imports System.Reflection +Imports System.Windows.Forms +Imports Ionic.Zip + + +Namespace Ionic.Zip.Examples.VB + + Friend Class QuickUnzip + _ + Private Shared Function AllocConsole() As Boolean + End Function + + _ + Private Shared Function AttachConsole(ByVal pid As Integer) As Boolean + End Function + + _ + Public Shared Sub Main(ByVal args As String()) + If (args.Length <> 2) Then + '' open a new window so we can write to it. + QuickUnzip.AllocConsole + QuickUnzip.Usage(args) + Return + Else + Application.EnableVisualStyles + Application.SetCompatibleTextRenderingDefault(False) + Dim f As New QuickUnzipForm(args(0), args(1)) + Application.Run(f) + End If + Return + End Sub + + Private Shared Function Usage(ByVal args As String()) as Integer + Console.WriteLine("QuickUnzip. Usage: QuickUnzip ") + Console.WriteLine(System. Environment.NewLine & " to continue...") + Console.ReadLine + Return 1 + End Function + + End Class + + + + Public Class QuickUnzipForm + Inherits Form + + Public Sub New() + Me.components = Nothing + Me.InitializeComponent + End Sub + + Public Sub New(ByVal zipfile As String, ByVal directory As String) + Me.New() + Me.zipfileName = zipfile + Me.extractDirectory = directory + End Sub + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If (disposing AndAlso (Not Me.components Is Nothing)) Then + Me.components.Dispose + End If + MyBase.Dispose(disposing) + End Sub + + Private Sub FixTitle() + Me.Text = String.Format("Quick Unzip {0}", Me.zipfileName) + End Sub + + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container + Me.label1 = New Label + Me.progressBar1 = New ProgressBar + MyBase.SuspendLayout + Me.label1.AutoSize = True + Me.label1.Location = New System.Drawing.Point(12, 12) + Me.label1.Name = "label1" + Me.label1.Size = New System.Drawing.Size(50, 13) + Me.label1.TabIndex = 2 + Me.label1.Text = "Progress" + Me.progressBar1.Anchor = (AnchorStyles.Right Or (AnchorStyles.Left Or AnchorStyles.Top)) + Me.progressBar1.Location = New System.Drawing.Point(12, 36) + Me.progressBar1.Name = "progressBar1" + Me.progressBar1.Size = New System.Drawing.Size(436, 18) + Me.progressBar1.Step = 1 + Me.progressBar1.TabIndex = 7 + MyBase.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!) + MyBase.AutoScaleMode = AutoScaleMode.Font + MyBase.ClientSize = New System.Drawing.Size(460, 80) + MyBase.Controls.Add(Me.label1) + MyBase.Controls.Add(Me.progressBar1) + MyBase.Name = "QuickUnzipForm" + Me.Text = "QuickUnzip" + AddHandler MyBase.Load, New EventHandler(AddressOf Me.QuickUnzipForm_Load) + AddHandler MyBase.Shown, New EventHandler(AddressOf Me.QuickUnzipForm_Shown) + MyBase.ResumeLayout(False) + MyBase.PerformLayout + End Sub + + Public Sub OnTimerEvent(ByVal source As Object, ByVal e As EventArgs) + MyBase.Close + End Sub + + Private Sub QuickUnzipForm_Load(ByVal sender As Object, ByVal e As EventArgs) + Me.FixTitle + End Sub + + Private Sub QuickUnzipForm_Shown(ByVal sender As Object, ByVal e As EventArgs) + '' For info on running long-running tasks in response to button clicks, + '' in VB.NET WinForms, see + '' http://msdn.microsoft.com/en-us/library/ms951089.aspx + Dim args(2) As String + args(0) = Me.zipfileName + args(1) = Me.extractDirectory + Dim worker As System.Threading.Thread + worker = New System.Threading.Thread(New System.Threading.ParameterizedThreadStart(AddressOf UnzipFile)) + worker.Start(args) + End Sub + + Private Sub UnzipFile(ByVal args As String()) + Try + Using zip As ZipFile = ZipFile.Read(args(0)) + Me.progressBar1.Maximum = zip.Entries.Count + Dim entry As ZipEntry + For Each entry In zip + UpdateUi(entry.FileName) + entry.Extract(args(1), ExtractExistingFileAction.OverwriteSilently) + '' Sleep a little because it's really fast + System.Threading.Thread.Sleep(20) + Next + UpdateUi(String.Format("Finished unzipping {0} entries", zip.Entries.Count)) + End Using + Catch ex1 As Exception + Me.label1.Text = ("Exception: " & ex1.ToString) + End Try + '' close the form 1000 ms after the unzip completes. + Dim timer1 As New System.Timers.Timer(1000) + timer1.Enabled = True + timer1.AutoReset = False + AddHandler timer1.Elapsed, New System.Timers.ElapsedEventHandler(AddressOf Me.OnTimerEvent) + End Sub + + Private Sub UpdateUi(ByVal filename As String) + If Me.InvokeRequired Then + '' invoke on the proper thread + Me.Invoke(New Action(Of String)(AddressOf UpdateUi), New Object() { filename }) + Else + Me.label1.Text = filename + Me.progressBar1.PerformStep + MyBase.Update + End If + End Sub + + ' Fields + Private extractDirectory As String + Private zipfileName As String + Private components As System.ComponentModel.IContainer + Private label1 As Label + Private progressBar1 As ProgressBar + End Class + +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-DotNetZip-VB.sln b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-DotNetZip-VB.sln new file mode 100644 index 0000000..3a530a7 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-DotNetZip-VB.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinForms-ZipUp", "WinForms-ZipUp\WinForms-ZipUp.vbproj", "{58EB3655-40F3-44FC-804E-47A8103DBF99}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinForms-Unzip", "WinForms-Unzip\WinForms-Unzip.vbproj", "{9E4C484D-656E-4E19-8741-5701D027AA51}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {58EB3655-40F3-44FC-804E-47A8103DBF99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58EB3655-40F3-44FC-804E-47A8103DBF99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58EB3655-40F3-44FC-804E-47A8103DBF99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58EB3655-40F3-44FC-804E-47A8103DBF99}.Release|Any CPU.Build.0 = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E4C484D-656E-4E19-8741-5701D027AA51}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Application.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Application.Designer.vb new file mode 100644 index 0000000..8fc568a --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3074 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.WinForms_Unzip.Form1 + End Sub + End Class +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Application.myapp b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/AssemblyInfo.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..9cafc87 Binary files /dev/null and b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/AssemblyInfo.vb differ diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Resources.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f16479e --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3074 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinForms_Unzip.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Resources.resx b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Settings.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Settings.Designer.vb new file mode 100644 index 0000000..4a0eb47 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3074 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.WinForms_Unzip.My.MySettings + Get + Return Global.WinForms_Unzip.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Settings.settings b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.Designer.vb new file mode 100644 index 0000000..8c18860 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.Designer.vb @@ -0,0 +1,170 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.tbZipToOpen = New System.Windows.Forms.TextBox + Me.Label1 = New System.Windows.Forms.Label + Me.btnZipBrowse = New System.Windows.Forms.Button + Me.ProgressBar1 = New System.Windows.Forms.ProgressBar + Me.btnUnzip = New System.Windows.Forms.Button + Me.lblStatus = New System.Windows.Forms.Label + Me.tbExtractDir = New System.Windows.Forms.TextBox + Me.Label2 = New System.Windows.Forms.Label + Me.btnExtractDirBrowse = New System.Windows.Forms.Button + Me.btnCancel = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'tbZipToOpen + ' + Me.tbZipToOpen.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.tbZipToOpen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.tbZipToOpen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem + Me.tbZipToOpen.Location = New System.Drawing.Point(15, 23) + Me.tbZipToOpen.Name = "tbZipToOpen" + Me.tbZipToOpen.Size = New System.Drawing.Size(389, 20) + Me.tbZipToOpen.TabIndex = 5 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 6) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(62, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "Unzip a file:" + ' + 'btnZipBrowse + ' + Me.btnZipBrowse.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnZipBrowse.Location = New System.Drawing.Point(410, 22) + Me.btnZipBrowse.Name = "btnZipBrowse" + Me.btnZipBrowse.Size = New System.Drawing.Size(30, 23) + Me.btnZipBrowse.TabIndex = 7 + Me.btnZipBrowse.Text = "..." + Me.btnZipBrowse.UseVisualStyleBackColor = True + ' + 'ProgressBar1 + ' + Me.ProgressBar1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.ProgressBar1.Location = New System.Drawing.Point(12, 133) + Me.ProgressBar1.Name = "ProgressBar1" + Me.ProgressBar1.Size = New System.Drawing.Size(428, 15) + Me.ProgressBar1.TabIndex = 3 + ' + 'btnUnzip + ' + Me.btnUnzip.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnUnzip.Location = New System.Drawing.Point(365, 104) + Me.btnUnzip.Name = "btnUnzip" + Me.btnUnzip.Size = New System.Drawing.Size(75, 23) + Me.btnUnzip.TabIndex = 0 + Me.btnUnzip.Text = "Unzip" + Me.btnUnzip.UseVisualStyleBackColor = True + ' + 'lblStatus + ' + Me.lblStatus.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.lblStatus.AutoSize = True + Me.lblStatus.Location = New System.Drawing.Point(12, 179) + Me.lblStatus.Name = "lblStatus" + Me.lblStatus.Size = New System.Drawing.Size(16, 13) + Me.lblStatus.TabIndex = 5 + Me.lblStatus.Text = "..." + ' + 'tbExtractDir + ' + Me.tbExtractDir.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.tbExtractDir.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.tbExtractDir.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories + Me.tbExtractDir.Location = New System.Drawing.Point(15, 68) + Me.tbExtractDir.Name = "tbExtractDir" + Me.tbExtractDir.Size = New System.Drawing.Size(389, 20) + Me.tbExtractDir.TabIndex = 10 + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 52) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(66, 13) + Me.Label2.TabIndex = 7 + Me.Label2.Text = "To directory:" + ' + 'btnExtractDirBrowse + ' + Me.btnExtractDirBrowse.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnExtractDirBrowse.Location = New System.Drawing.Point(410, 67) + Me.btnExtractDirBrowse.Name = "btnExtractDirBrowse" + Me.btnExtractDirBrowse.Size = New System.Drawing.Size(30, 23) + Me.btnExtractDirBrowse.TabIndex = 12 + Me.btnExtractDirBrowse.Text = "..." + Me.btnExtractDirBrowse.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCancel.Enabled = False + Me.btnCancel.Location = New System.Drawing.Point(365, 154) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 20 + Me.btnCancel.TabStop = False + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(452, 198) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnExtractDirBrowse) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.tbExtractDir) + Me.Controls.Add(Me.lblStatus) + Me.Controls.Add(Me.btnUnzip) + Me.Controls.Add(Me.ProgressBar1) + Me.Controls.Add(Me.btnZipBrowse) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.tbZipToOpen) + Me.Name = "Form1" + Me.Text = "DotNetZip Simple Unzip" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents tbZipToOpen As System.Windows.Forms.TextBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents btnZipBrowse As System.Windows.Forms.Button + Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar + Friend WithEvents btnUnzip As System.Windows.Forms.Button + Friend WithEvents lblStatus As System.Windows.Forms.Label + Friend WithEvents tbExtractDir As System.Windows.Forms.TextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents btnExtractDirBrowse As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + +End Class diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.resx b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.vb new file mode 100644 index 0000000..0531218 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/Unzip-Form1.vb @@ -0,0 +1,228 @@ +Imports System +Imports System.IO +Imports Ionic.Zip +Imports System.ComponentModel + +Public Class Form1 + + Private _backgroundWorker1 As System.ComponentModel.BackgroundWorker + Private _operationCanceled As Boolean + Private nFilesCompleted As Integer + Private totalEntriesToProcess As Integer + Private _appCuKey As Microsoft.Win32.RegistryKey + Private AppRegyPath As String = "Software\Ionic\VBunZip" + Private rvn_ZipFile As String = "zipfile" + Private rvn_ExtractDir As String = "extractdir" + + Private Delegate Sub ZipProgress(ByVal e As ExtractProgressEventArgs) + + Private Sub btnZipBrowse_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnZipBrowse.Click + Dim openFileDialog1 As New OpenFileDialog + If (String.IsNullOrEmpty(tbZipToOpen.Text)) Then + openFileDialog1.InitialDirectory = "c:\" + Else + openFileDialog1.InitialDirectory = IIf(File.Exists(Me.tbZipToOpen.Text), Path.GetDirectoryName(Me.tbZipToOpen.Text), Me.tbZipToOpen.Text) + End If + openFileDialog1.Filter = "zip files|*.zip|EXE files|*.exe|All Files|*.*" + openFileDialog1.FilterIndex = 1 + openFileDialog1.RestoreDirectory = True + If (openFileDialog1.ShowDialog = DialogResult.OK) Then + Me.tbZipToOpen.Text = openFileDialog1.FileName + If File.Exists(Me.tbZipToOpen.Text) Then + Me.btnUnzip_Click(sender, e) + End If + End If + End Sub + + + Private Sub btnUnzip_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUnzip.Click + If Not File.Exists(Me.tbZipToOpen.Text) Then + MessageBox.Show("That file does not exist", "Cannot Unzip", MessageBoxButtons.OK) + End If + + If Not String.IsNullOrEmpty(tbZipToOpen.Text) And _ + Not String.IsNullOrEmpty(tbExtractDir.Text) Then + If Not Directory.Exists(tbExtractDir.Text) Then + Directory.CreateDirectory(tbExtractDir.Text) + End If + nFilesCompleted = 0 + _operationCanceled = False + btnCancel.Enabled = True + btnUnzip.Enabled = False + btnZipBrowse.Enabled = False + btnExtractDirBrowse.Enabled = False + tbZipToOpen.Enabled = False + tbExtractDir.Enabled = False + KickoffExtract() + End If + End Sub + + + Private Sub KickoffExtract() + lblStatus.Text = "Extracting..." + Dim args(2) As String + args(0) = tbZipToOpen.Text + args(1) = tbExtractDir.Text + _backgroundWorker1 = New System.ComponentModel.BackgroundWorker() + _backgroundWorker1.WorkerSupportsCancellation = False + _backgroundWorker1.WorkerReportsProgress = False + AddHandler Me._backgroundWorker1.DoWork, New DoWorkEventHandler(AddressOf Me.UnzipFile) + _backgroundWorker1.RunWorkerAsync(args) + End Sub + + + + Private Sub btnExtractDirBrowse_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnExtractDirBrowse.Click + Dim dlg As New FolderBrowserDialog + dlg.Description = "Select a folder to zip up:" + dlg.ShowNewFolderButton = False + 'dlg.ShowEditBox = True + dlg.SelectedPath = Me.tbExtractDir.Text + 'dlg.ShowFullPathInEditBox = True + If (dlg.ShowDialog = DialogResult.OK) Then + tbExtractDir.Text = dlg.SelectedPath + End If + End Sub + + + Private Sub UnzipFile(ByVal sender As Object, ByVal e As DoWorkEventArgs) + Dim extractCancelled As Boolean = False + Dim args() As String = e.Argument + Dim zipToRead As String = args(0) + Dim extractDir As String = args(1) + Try + Using zip As ZipFile = ZipFile.Read(zipToRead) + totalEntriesToProcess = zip.Entries.Count + SetProgressBarMax(zip.Entries.Count) + AddHandler zip.ExtractProgress, New EventHandler(Of ExtractProgressEventArgs)(AddressOf Me.zip_ExtractProgress) + zip.ExtractAll(extractDir, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently) + End Using + Catch ex1 As Exception + MessageBox.Show(String.Format("There's been a problem extracting that zip file. {0}", ex1.Message), "Error Extracting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) + End Try + ResetUI() + End Sub + + + Private Sub ResetUI() + If btnCancel.InvokeRequired Then + btnCancel.Invoke(New Action(AddressOf ResetUI), New Object() {}) + Else + btnUnzip.Enabled = True + btnZipBrowse.Enabled = True + btnExtractDirBrowse.Enabled = True + btnCancel.Enabled = False + tbZipToOpen.Enabled = True + tbExtractDir.Enabled = True + ProgressBar1.Maximum = 1 + ProgressBar1.Value = 0 + Me.btnUnzip.Focus() + End If + End Sub + + Private Sub SetProgressBarMax(ByVal n As Integer) + If ProgressBar1.InvokeRequired Then + ProgressBar1.Invoke(New Action(Of Integer)(AddressOf SetProgressBarMax), New Object() {n}) + Else + ProgressBar1.Value = 0 + ProgressBar1.Maximum = n + ProgressBar1.Step = 1 + End If + End Sub + + + Private Sub zip_ExtractProgress(ByVal sender As Object, ByVal e As ExtractProgressEventArgs) + If _operationCanceled Then + e.Cancel = True + Return + End If + + If (e.EventType = Ionic.Zip.ZipProgressEventType.Extracting_AfterExtractEntry) Then + StepEntryProgress(e) + ElseIf (e.EventType = ZipProgressEventType.Extracting_BeforeExtractAll) Then + '' do nothing + End If + End Sub + + + Private Sub StepEntryProgress(ByVal e As ExtractProgressEventArgs) + If ProgressBar1.InvokeRequired Then + ProgressBar1.Invoke(New ZipProgress(AddressOf StepEntryProgress), New Object() {e}) + Else + ProgressBar1.PerformStep() + System.Threading.Thread.Sleep(100) + 'set a label with status information + nFilesCompleted = nFilesCompleted + 1 + lblStatus.Text = String.Format("{0} of {1} files...({2})", nFilesCompleted, totalEntriesToProcess, e.CurrentEntry.FileName) + Me.Update() + End If + End Sub + + + + 'Private Sub StepArchiveProgress(ByVal e As ZipProgressEventArgs) + ' If ProgressBar1.InvokeRequired Then + ' ProgressBar1.Invoke(New ZipProgress(AddressOf StepArchiveProgress), New Object() {e}) + ' ElseIf Not _operationCanceled Then + ' _nFilesCompleted = _nFilesCompleted + 1 + ' ProgressBar1.PerformStep() + ' progressBar2.Value = progressBar2.Maximum = 1 + ' MyBase.Update() + ' End If + 'End Sub + + Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click + _operationCanceled = True + ProgressBar1.Maximum = 1 + ProgressBar1.Value = 0 + lblStatus.Text = "Cancelled..." + End Sub + + + Private Sub SaveFormToRegistry() + If AppCuKey IsNot Nothing Then + If Not String.IsNullOrEmpty(tbZipToOpen.Text) Then + AppCuKey.SetValue(rvn_ZipFile, Me.tbZipToOpen.Text) + End If + If Not String.IsNullOrEmpty(tbExtractDir.Text) Then + AppCuKey.SetValue(rvn_ExtractDir, tbExtractDir.Text) + End If + End If + End Sub + + Private Sub LoadFormFromRegistry() + If AppCuKey IsNot Nothing Then + Dim s As String + s = AppCuKey.GetValue(rvn_ZipFile) + If Not String.IsNullOrEmpty(s) Then + Me.tbZipToOpen.Text = s + End If + s = AppCuKey.GetValue(rvn_ExtractDir) + If Not String.IsNullOrEmpty(s) Then + tbExtractDir.Text = s + End If + End If + End Sub + + + Public ReadOnly Property AppCuKey() As Microsoft.Win32.RegistryKey + Get + If (_appCuKey Is Nothing) Then + Me._appCuKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(AppRegyPath, True) + If (Me._appCuKey Is Nothing) Then + Me._appCuKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(AppRegyPath) + End If + End If + Return _appCuKey + End Get + End Property + + Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing + SaveFormToRegistry() + End Sub + + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + LoadFormFromRegistry() + End Sub +End Class + diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/WinForms-Unzip.vbproj b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/WinForms-Unzip.vbproj new file mode 100644 index 0000000..18601d8 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-Unzip/WinForms-Unzip.vbproj @@ -0,0 +1,132 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9E4C484D-656E-4E19-8741-5701D027AA51} + WinExe + WinForms_Unzip.My.MyApplication + WinForms_Unzip + WinForms-Unzip + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + 3.5 + + + + true + full + true + true + bin\Debug\ + WinForms-Unzip.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + AllRules.ruleset + + + pdbonly + false + true + true + bin\Release\ + WinForms-Unzip.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AllRules.ruleset + + + + False + ..\..\..\..\Zip\bin\Debug\Ionic.Zip.dll + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Unzip-Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Unzip-Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Application.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Application.Designer.vb new file mode 100644 index 0000000..6c1b669 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3074 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.WindowsApplication1.Form1 + End Sub + End Class +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Application.myapp b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/AssemblyInfo.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..9b56651 Binary files /dev/null and b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/AssemblyInfo.vb differ diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Resources.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Resources.Designer.vb new file mode 100644 index 0000000..a455aed --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3074 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsApplication1.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Resources.resx b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Settings.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Settings.Designer.vb new file mode 100644 index 0000000..109f406 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.3074 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.WindowsApplication1.My.MySettings + Get + Return Global.WindowsApplication1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Settings.settings b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/WinForms-ZipUp.vbproj b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/WinForms-ZipUp.vbproj new file mode 100644 index 0000000..ea6a690 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/WinForms-ZipUp.vbproj @@ -0,0 +1,115 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {58EB3655-40F3-44FC-804E-47A8103DBF99} + WinExe + WindowsApplication1.My.MyApplication + WindowsApplication1 + WindowsApplication1 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + WindowsApplication1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + WindowsApplication1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + False + ..\..\..\..\Zip\bin\Debug\Ionic.Zip.dll + + + + + + + + + + + + + + + + + + + + + Form + + + ZipUp-Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + ZipUp-Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.Designer.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.Designer.vb new file mode 100644 index 0000000..6d717f1 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.Designer.vb @@ -0,0 +1,170 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.tbDirToZip = New System.Windows.Forms.TextBox + Me.tbZipToCreate = New System.Windows.Forms.TextBox + Me.btnDirBrowse = New System.Windows.Forms.Button + Me.btnZipUp = New System.Windows.Forms.Button + Me.ProgressBar1 = New System.Windows.Forms.ProgressBar + Me.ProgressBar2 = New System.Windows.Forms.ProgressBar + Me.lblStatus = New System.Windows.Forms.Label + Me.btnCancel = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(11, 13) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(78, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "directory to zip:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(11, 39) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(84, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "zip file to create:" + ' + 'tbDirToZip + ' + Me.tbDirToZip.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.tbDirToZip.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.tbDirToZip.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories + Me.tbDirToZip.Location = New System.Drawing.Point(107, 9) + Me.tbDirToZip.Name = "tbDirToZip" + Me.tbDirToZip.Size = New System.Drawing.Size(327, 20) + Me.tbDirToZip.TabIndex = 2 + ' + 'tbZipToCreate + ' + Me.tbZipToCreate.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.tbZipToCreate.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.tbZipToCreate.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem + Me.tbZipToCreate.Location = New System.Drawing.Point(106, 35) + Me.tbZipToCreate.Name = "tbZipToCreate" + Me.tbZipToCreate.Size = New System.Drawing.Size(327, 20) + Me.tbZipToCreate.TabIndex = 6 + ' + 'btnDirBrowse + ' + Me.btnDirBrowse.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnDirBrowse.Location = New System.Drawing.Point(440, 10) + Me.btnDirBrowse.Name = "btnDirBrowse" + Me.btnDirBrowse.Size = New System.Drawing.Size(32, 19) + Me.btnDirBrowse.TabIndex = 4 + Me.btnDirBrowse.Text = "..." + Me.btnDirBrowse.UseVisualStyleBackColor = True + ' + 'btnZipUp + ' + Me.btnZipUp.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnZipUp.Location = New System.Drawing.Point(377, 72) + Me.btnZipUp.Name = "btnZipUp" + Me.btnZipUp.Size = New System.Drawing.Size(94, 23) + Me.btnZipUp.TabIndex = 0 + Me.btnZipUp.Text = "Zip It!" + Me.btnZipUp.UseVisualStyleBackColor = True + ' + 'ProgressBar1 + ' + Me.ProgressBar1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.ProgressBar1.Location = New System.Drawing.Point(12, 105) + Me.ProgressBar1.Name = "ProgressBar1" + Me.ProgressBar1.Size = New System.Drawing.Size(459, 13) + Me.ProgressBar1.TabIndex = 6 + ' + 'ProgressBar2 + ' + Me.ProgressBar2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.ProgressBar2.Location = New System.Drawing.Point(13, 124) + Me.ProgressBar2.Name = "ProgressBar2" + Me.ProgressBar2.Size = New System.Drawing.Size(459, 13) + Me.ProgressBar2.TabIndex = 7 + ' + 'lblStatus + ' + Me.lblStatus.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.lblStatus.AutoSize = True + Me.lblStatus.Location = New System.Drawing.Point(11, 148) + Me.lblStatus.Name = "lblStatus" + Me.lblStatus.Size = New System.Drawing.Size(16, 13) + Me.lblStatus.TabIndex = 8 + Me.lblStatus.Text = "..." + ' + 'btnCancel + ' + Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnCancel.Enabled = False + Me.btnCancel.Location = New System.Drawing.Point(277, 72) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(94, 23) + Me.btnCancel.TabIndex = 8 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(484, 172) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.lblStatus) + Me.Controls.Add(Me.ProgressBar2) + Me.Controls.Add(Me.ProgressBar1) + Me.Controls.Add(Me.btnZipUp) + Me.Controls.Add(Me.btnDirBrowse) + Me.Controls.Add(Me.tbZipToCreate) + Me.Controls.Add(Me.tbDirToZip) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.MinimumSize = New System.Drawing.Size(500, 208) + Me.Name = "Form1" + Me.Text = "DotNetZip WinForms VB Zip Creator" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents tbDirToZip As System.Windows.Forms.TextBox + Friend WithEvents tbZipToCreate As System.Windows.Forms.TextBox + Friend WithEvents btnDirBrowse As System.Windows.Forms.Button + Friend WithEvents btnZipUp As System.Windows.Forms.Button + Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar + Friend WithEvents ProgressBar2 As System.Windows.Forms.ProgressBar + Friend WithEvents lblStatus As System.Windows.Forms.Label + Friend WithEvents btnCancel As System.Windows.Forms.Button + +End Class diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.resx b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.vb b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.vb new file mode 100644 index 0000000..b9faafe --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-DotNetZip/WinForms-ZipUp/ZipUp-Form1.vb @@ -0,0 +1,265 @@ +Imports System.IO +Imports Ionic.Zip +Imports System.Threading +Imports System.ComponentModel + +Public Class Form1 + + Private _backgroundWorker1 As System.ComponentModel.BackgroundWorker + Private _saveCanceled As Boolean + Private _totalBytesAfterCompress As Long + Private _totalBytesBeforeCompress As Long + Private _nFilesCompleted As Integer + Private _progress2MaxFactor As Integer + Private _entriesToZip As Integer + Private _appCuKey As Microsoft.Win32.RegistryKey + Private AppRegyPath As String = "Software\Ionic\VBzipUp" + Private rvn_ZipFile As String = "zipfile" + Private rvn_DirToZip As String = "dirToZip" + + ' Delegates for invocation of UI from other threads + Private Delegate Sub SaveEntryProgress(ByVal e As SaveProgressEventArgs) + Private Delegate Sub ButtonClick(ByVal sender As Object, ByVal e As EventArgs) + + Private Sub btnDirBrowse_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDirBrowse.Click + Dim folderName As String = Me.tbDirToZip.Text + Dim dlg1 As New FolderBrowserDialog + + dlg1.SelectedPath = IIf(Directory.Exists(folderName), folderName, "c:\") + dlg1.ShowNewFolderButton = False + If (dlg1.ShowDialog = DialogResult.OK) Then + 'Me._folderName = dlg1.get_SelectedPath + Me.tbDirToZip.Text = folderName + End If + End Sub + + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnZipUp.Click + Me.KickoffZipup() + End Sub + + + Private Sub KickoffZipup() + Dim folderName As String = Me.tbDirToZip.Text + If (((Not folderName Is Nothing) AndAlso (folderName <> "")) AndAlso ((Not Me.tbZipToCreate.Text Is Nothing) AndAlso (Me.tbZipToCreate.Text <> ""))) Then + If File.Exists(Me.tbZipToCreate.Text) Then + If (MessageBox.Show(String.Format("The file you have specified ({0}) already exists. Do you want to overwrite this file?", _ + Me.tbZipToCreate.Text), "Confirmation is Required", _ + MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> DialogResult.Yes) Then + Return + End If + File.Delete(Me.tbZipToCreate.Text) + End If + Me._saveCanceled = False + Me._nFilesCompleted = 0 + Me._totalBytesAfterCompress = 0 + Me._totalBytesBeforeCompress = 0 + Me.btnZipUp.Enabled = False + Me.btnZipUp.Text = "Zipping..." + Me.btnCancel.Enabled = True + Me.lblStatus.Text = "Zipping..." + Dim options As New WorkerOptions + options.ZipName = Me.tbZipToCreate.Text + options.Folder = folderName + + _backgroundWorker1 = New System.ComponentModel.BackgroundWorker() + _backgroundWorker1.WorkerSupportsCancellation = False + _backgroundWorker1.WorkerReportsProgress = False + AddHandler Me._backgroundWorker1.DoWork, New DoWorkEventHandler(AddressOf Me.DoSave) + _backgroundWorker1.RunWorkerAsync(options) + + End If + End Sub + + + Private Sub DoSave(ByVal sender As Object, ByVal e As DoWorkEventArgs) + Dim options As WorkerOptions = e.Argument + Try + Using zip1 As ZipFile = New ZipFile + zip1.AddDirectory(options.Folder) + Me._entriesToZip = zip1.EntryFileNames.Count + Me.SetProgressBars() + AddHandler zip1.SaveProgress, New EventHandler(Of SaveProgressEventArgs)(AddressOf Me.zip1_SaveProgress) + zip1.Save(options.ZipName) + End Using + Catch exc1 As Exception + MessageBox.Show(String.Format("Exception while zipping: {0}", exc1.Message)) + Me.btnCancel_Click(Nothing, Nothing) + End Try + End Sub + + + Private Sub zip1_SaveProgress(ByVal sender As Object, ByVal e As SaveProgressEventArgs) + If Me._saveCanceled Then + e.Cancel = True + Return + End If + + Select Case e.EventType + Case ZipProgressEventType.Saving_AfterWriteEntry + Me.StepArchiveProgress(e) + Exit Select + Case ZipProgressEventType.Saving_Completed + Me.SaveCompleted() + Exit Select + Case ZipProgressEventType.Saving_EntryBytesRead + Me.StepEntryProgress(e) + Exit Select + End Select + End Sub + + + + Private Sub StepArchiveProgress(ByVal e As SaveProgressEventArgs) + If Me.progressBar1.InvokeRequired Then + Me.progressBar1.Invoke(New SaveEntryProgress(AddressOf Me.StepArchiveProgress), New Object() {e}) + ElseIf Not Me._saveCanceled Then + Me._nFilesCompleted += 1 + Me.progressBar1.PerformStep() + Me._totalBytesAfterCompress = (Me._totalBytesAfterCompress + e.CurrentEntry.CompressedSize) + Me._totalBytesBeforeCompress = (Me._totalBytesBeforeCompress + e.CurrentEntry.UncompressedSize) + ' progressBar2 is the one dealing with the item being added to the archive + ' if we got this event, then the add of that item (or file) is complete, so we + ' update the progressBar2 appropriately. + Me.progressBar2.Value = Me.progressBar2.Maximum = 1 + MyBase.Update() + End If + End Sub + + + Private Sub SaveCompleted() + If Me.lblStatus.InvokeRequired Then + Me.lblStatus.Invoke(New MethodInvoker(AddressOf SaveCompleted)) + 'Me.lblStatus.Invoke(New MethodInvoker(Me, DirectCast(Me.SaveCompleted, IntPtr))) + Else + Me.lblStatus.Text = String.Format("Done, Compressed {0} files, {1:N0}% of original", Me._nFilesCompleted, ((100 * Me._totalBytesAfterCompress) / CDbl(Me._totalBytesBeforeCompress))) + Me.ResetState() + End If + End Sub + + + Private Sub StepEntryProgress(ByVal e As SaveProgressEventArgs) + If Me.progressBar2.InvokeRequired Then + Me.progressBar2.Invoke(New SaveEntryProgress(AddressOf Me.StepEntryProgress), New Object() {e}) + ElseIf Not Me._saveCanceled Then + If (Me.progressBar2.Maximum = 1) Then + Dim entryMax As Long = e.TotalBytesToTransfer + Dim absoluteMax As Long = &H7FFFFFFF + Me._progress2MaxFactor = 0 + Do While (entryMax > absoluteMax) + entryMax = (entryMax / 2) + Me._progress2MaxFactor += 1 + Loop + If (CInt(entryMax) < 0) Then + entryMax = (entryMax * -1) + End If + Me.progressBar2.Maximum = CInt(entryMax) + Me.lblStatus.Text = String.Format("{0} of {1} files...({2})", (Me._nFilesCompleted + 1), Me._entriesToZip, e.CurrentEntry.FileName) + End If + Dim xferred As Integer = CInt((e.BytesTransferred >> Me._progress2MaxFactor)) + Me.progressBar2.Value = IIf((xferred >= Me.progressBar2.Maximum), Me.progressBar2.Maximum, xferred) + MyBase.Update() + End If + End Sub + + + Private Sub ResetState() + Me.btnCancel.Enabled = False + Me.btnZipUp.Enabled = True + Me.btnZipUp.Text = "Zip it!" + Me.progressBar1.Value = 0 + Me.progressBar2.Value = 0 + Me.Cursor = Cursors.Default + End Sub + + + + Private Sub SetProgressBars() + If Me.ProgressBar1.InvokeRequired Then + 'Me.ProgressBar1.Invoke(New MethodInvoker(Me, DirectCast(Me.SetProgressBars, IntPtr))) + Me.ProgressBar1.Invoke(New MethodInvoker(AddressOf SetProgressBars)) + Else + Me.ProgressBar1.Value = 0 + Me.ProgressBar1.Maximum = Me._entriesToZip + Me.ProgressBar1.Minimum = 0 + Me.ProgressBar1.Step = 1 + Me.ProgressBar2.Value = 0 + Me.ProgressBar2.Minimum = 0 + Me.ProgressBar2.Maximum = 1 + Me.ProgressBar2.Step = 2 + End If + End Sub + + + Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click + If Me.lblStatus.InvokeRequired Then + Me.lblStatus.Invoke(New ButtonClick(AddressOf Me.btnCancel_Click), New Object() {sender, e}) + Else + Me._saveCanceled = True + Me.lblStatus.Text = "Canceled..." + Me.ResetState() + End If + End Sub + + + Private Sub SaveFormToRegistry() + If AppCuKey IsNot Nothing Then + If Not String.IsNullOrEmpty(tbZipToCreate.Text) Then + AppCuKey.SetValue(rvn_ZipFile, Me.tbZipToCreate.Text) + End If + If Not String.IsNullOrEmpty(tbDirToZip.Text) Then + AppCuKey.SetValue(rvn_DirToZip, tbDirToZip.Text) + End If + End If + End Sub + + Private Sub LoadFormFromRegistry() + If AppCuKey IsNot Nothing Then + Dim s As String + s = AppCuKey.GetValue(rvn_ZipFile) + If Not String.IsNullOrEmpty(s) Then + Me.tbZipToCreate.Text = s + End If + s = AppCuKey.GetValue(rvn_DirToZip) + If Not String.IsNullOrEmpty(s) Then + tbDirToZip.Text = s + End If + End If + End Sub + + + Public ReadOnly Property AppCuKey() As Microsoft.Win32.RegistryKey + Get + If (_appCuKey Is Nothing) Then + Me._appCuKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(AppRegyPath, True) + If (Me._appCuKey Is Nothing) Then + Me._appCuKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(AppRegyPath) + End If + End If + Return _appCuKey + End Get + End Property + + Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing + SaveFormToRegistry() + End Sub + + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + LoadFormFromRegistry() + End Sub +End Class + +Public Class WorkerOptions + ' Fields + 'Public Comment As String + 'Public CompressionLevel As CompressionLevel + 'Public Encoding As String + 'Public Encryption As EncryptionAlgorithm + Public Folder As String + 'Public Password As String + 'Public Zip64 As Zip64Option + 'Public ZipFlavor As Integer + Public ZipName As String +End Class + + diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/ReadMe.txt b/dotNetZip/Examples/VB/WinForms-TreeViewZip/ReadMe.txt new file mode 100644 index 0000000..ef61d45 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/ReadMe.txt @@ -0,0 +1,6 @@ +Tue, 27 Oct 2009 00:46 + +This application shows how to open and read a zip file, and display the +contents in a Windows Forms TreeView. + +The app is written in VB. diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip.sln b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip.sln new file mode 100644 index 0000000..48f588e --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinForms-TreeViewZip", "WinForms-TreeViewZip\WinForms-TreeViewZip.vbproj", "{2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.Designer.vb b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.Designer.vb new file mode 100644 index 0000000..8c87bde --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.Designer.vb @@ -0,0 +1,93 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.TreeView1 = New System.Windows.Forms.TreeView + Me.tbZipToOpen = New System.Windows.Forms.TextBox + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'TreeView1 + ' + Me.TreeView1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.TreeView1.Location = New System.Drawing.Point(12, 43) + Me.TreeView1.Name = "TreeView1" + Me.TreeView1.Size = New System.Drawing.Size(280, 232) + Me.TreeView1.TabIndex = 0 + ' + 'tbZipToOpen + ' + Me.tbZipToOpen.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.tbZipToOpen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest + Me.tbZipToOpen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem + Me.tbZipToOpen.Location = New System.Drawing.Point(12, 17) + Me.tbZipToOpen.Name = "tbZipToOpen" + Me.tbZipToOpen.Size = New System.Drawing.Size(204, 20) + Me.tbZipToOpen.TabIndex = 1 + ' + 'Button1 + ' + Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.Button1.Location = New System.Drawing.Point(251, 16) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(41, 20) + Me.Button1.TabIndex = 2 + Me.Button1.Text = "Open" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.Button2.Location = New System.Drawing.Point(222, 18) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(23, 19) + Me.Button2.TabIndex = 3 + Me.Button2.Text = "..." + Me.Button2.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(304, 287) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.tbZipToOpen) + Me.Controls.Add(Me.TreeView1) + Me.MinimumSize = New System.Drawing.Size(320, 320) + Me.Name = "Form1" + Me.Text = "WinForms TreeView of ZipFile (DotNetZip)" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents TreeView1 As System.Windows.Forms.TreeView + Friend WithEvents tbZipToOpen As System.Windows.Forms.TextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + +End Class diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.resx b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.vb b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.vb new file mode 100644 index 0000000..7915f1b --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/Form1.vb @@ -0,0 +1,174 @@ +Imports Ionic.Zip +Imports System.Linq +Imports System.IO + +Public Class Form1 + + Private _appCuKey As Microsoft.Win32.RegistryKey + Private AppRegyPath As String = "Software\Ionic\VBzipTreeView" + Private rvn_ZipFile As String = "zipfile" + + Private Sub Button1_Click(ByVal sender As System.Object, _ + ByVal e As System.EventArgs) Handles Button1.Click + PopulateTreeView() + End Sub + + Private zip As Ionic.Zip.ZipFile + + ''' + ''' Populates TreeView1 with the entries in the zipfile, named by TextBox1 + ''' + Private Sub PopulateTreeView() + Try + zip = ZipFile.Read(Me.tbZipToOpen.Text) + + Me.TreeView1.Nodes.Clear() + For Each e As ZipEntry In zip + AddTreeNode(e.FileName) + Next + + Catch ex As Exception + '' eg, file does not exist, or access denied, etc + MessageBox.Show("Exception: " + ex.ToString(), _ + "Exception during zip processing", _ + MessageBoxButtons.OK, _ + MessageBoxIcon.Exclamation) + + Finally + If Not (zip Is Nothing) Then + zip.Dispose() + End If + + End Try + End Sub + + ''' + ''' Add a node to the Treeview, for the given ZipEntry name + ''' + ''' name of the ZipEntry + ''' the TreeNode added + ''' + ''' + ''' Entries in a zip file exist in a "flat container space": there is a single container, + ''' the zip file itself, that contains all entries. Even though each entry has a filename + ''' attached to it, and that filename may include a hierarchial directory path, the entry is + ''' always contained in the zipfile itself. Even though it is possible to include directory + ''' entries in a zip file, those directory entries are not, themselves, containers - they do + ''' not contain other zip entries. + ''' + ''' + ''' This method overlays the zipentry, which exists only in a flat namespace, into a hierarchial + ''' tree, creating that tree from the pathname on the entry. If the entry name is /a/b/c.txt, + ''' then this method adds 3 nodes to the TreeView, one for each segment in the path. + ''' + ''' + ''' The method is smart enough to find existing nodes matching subsegements of the path + ''' for an entry. + ''' + ''' + Private Function AddTreeNode(ByVal name As String) As TreeNode + If (name.EndsWith("/")) Then + name = name.Substring(0, name.Length - 1) + End If + Dim node As TreeNode = FindNodeForTag(name, Me.TreeView1.Nodes) + If Not (node Is Nothing) Then + Return node + End If + Dim pnodeCollection As TreeNodeCollection + Dim parent As String = Path.GetDirectoryName(name) + If (parent = "") Then + pnodeCollection = Me.TreeView1.Nodes + Else + pnodeCollection = AddTreeNode(parent.Replace("\", "/")).Nodes + End If + node = New TreeNode + node.Text = Path.GetFileName(name) + node.Tag = name ' full path + pnodeCollection.Add(node) + Return node + End Function + + ''' + ''' Returns the TreeNode for a given name + ''' + ''' name of the ZipEntry + ''' The TreeNodeCollection to search + ''' the matching TreeNode, or nothing if none exists + ''' + ''' This method is used by AddTreeNode() to find existing nodes. + ''' + Private Function FindNodeForTag(ByVal name As String, ByRef nodes As TreeNodeCollection) As TreeNode + For Each node As TreeNode In nodes + If (name = node.Tag) Then + Return node + ElseIf (name.StartsWith(node.Tag + "/")) Then + Return FindNodeForTag(name, node.Nodes) + End If + Next + Return Nothing + End Function + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + Dim openFileDialog1 As OpenFileDialog = New OpenFileDialog + + openFileDialog1.InitialDirectory = Me.tbZipToOpen.Text + openFileDialog1.Filter = "zip files|*.zip|EXE files|*.exe|All Files|*.*" + openFileDialog1.FilterIndex = 1 + openFileDialog1.RestoreDirectory = True + + If (openFileDialog1.ShowDialog() = DialogResult.OK) Then + Me.tbZipToOpen.Text = openFileDialog1.FileName + If (System.IO.File.Exists(Me.tbZipToOpen.Text)) Then + Button1_Click(sender, e) + End If + End If + + End Sub + + Private Sub TreeView1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TreeView1.DoubleClick + If (e Is Nothing) Then + '' + End If + End Sub + + + Private Sub SaveFormToRegistry() + If AppCuKey IsNot Nothing Then + If Not String.IsNullOrEmpty(Me.tbZipToOpen.Text) Then + AppCuKey.SetValue(rvn_ZipFile, Me.tbZipToOpen.Text) + End If + End If + End Sub + + Private Sub LoadFormFromRegistry() + If AppCuKey IsNot Nothing Then + Dim s As String + s = AppCuKey.GetValue(rvn_ZipFile) + If Not String.IsNullOrEmpty(s) Then + Me.tbZipToOpen.Text = s + End If + End If + End Sub + + + Public ReadOnly Property AppCuKey() As Microsoft.Win32.RegistryKey + Get + If (_appCuKey Is Nothing) Then + Me._appCuKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(AppRegyPath, True) + If (Me._appCuKey Is Nothing) Then + Me._appCuKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(AppRegyPath) + End If + End If + Return _appCuKey + End Get + End Property + + Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing + SaveFormToRegistry() + End Sub + + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + LoadFormFromRegistry() + End Sub + +End Class diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Application.Designer.vb b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Application.Designer.vb new file mode 100644 index 0000000..cdfc531 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.225 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.WinForms_TreeViewZip.Form1 + End Sub + End Class +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Application.myapp b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/AssemblyInfo.vb b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..d2703bd Binary files /dev/null and b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/AssemblyInfo.vb differ diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Resources.Designer.vb b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Resources.Designer.vb new file mode 100644 index 0000000..a9ad13d --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.225 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinForms_TreeViewZip.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Resources.resx b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Settings.Designer.vb b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Settings.Designer.vb new file mode 100644 index 0000000..1426f01 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.225 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.WinForms_TreeViewZip.My.MySettings + Get + Return Global.WinForms_TreeViewZip.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Settings.settings b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/WinForms-TreeViewZip.vbproj b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/WinForms-TreeViewZip.vbproj new file mode 100644 index 0000000..8a68e82 --- /dev/null +++ b/dotNetZip/Examples/VB/WinForms-TreeViewZip/WinForms-TreeViewZip/WinForms-TreeViewZip.vbproj @@ -0,0 +1,168 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2E78FB6A-EE17-4EE4-9D8D-BE9AE675C69D} + WinExe + WinForms_TreeViewZip.My.MyApplication + WinForms_TreeViewZip + WinForms-TreeViewZip + 512 + WindowsForms + v3.5 + On + Binary + Off + On + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + true + true + bin\Debug\ + WinForms-TreeViewZip.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + AllRules.ruleset + + + pdbonly + false + true + true + bin\Release\ + WinForms-TreeViewZip.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 + AllRules.ruleset + + + + False + ..\..\..\..\Zip\bin\$(Configuration)\Ionic.Zip.dll + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegration.sln b/dotNetZip/Help-VS-Integrated/HelpIntegration.sln new file mode 100644 index 0000000..ed6acdb --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegration.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HelpIntegration", "HelpIntegration\HelpIntegration.vdproj", "{10FE6C88-8E0F-4A48-923A-65A58DDAB426}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HelpIntegrationMergeModule", "HelpIntegrationMergeModule\HelpIntegrationMergeModule.vdproj", "{39B858A8-21BE-40E3-B0C6-D265189C34F4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Default = Debug|Default + Release|Default = Release|Default + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {10FE6C88-8E0F-4A48-923A-65A58DDAB426}.Debug|Default.ActiveCfg = Debug + {10FE6C88-8E0F-4A48-923A-65A58DDAB426}.Debug|Default.Build.0 = Debug + {10FE6C88-8E0F-4A48-923A-65A58DDAB426}.Release|Default.ActiveCfg = Release + {10FE6C88-8E0F-4A48-923A-65A58DDAB426}.Release|Default.Build.0 = Release + {39B858A8-21BE-40E3-B0C6-D265189C34F4}.Debug|Default.ActiveCfg = Debug + {39B858A8-21BE-40E3-B0C6-D265189C34F4}.Debug|Default.Build.0 = Debug + {39B858A8-21BE-40E3-B0C6-D265189C34F4}.Release|Default.ActiveCfg = Release + {39B858A8-21BE-40E3-B0C6-D265189C34F4}.Release|Default.Build.0 = Release + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegration/HelpIntegration.vdproj b/dotNetZip/Help-VS-Integrated/HelpIntegration/HelpIntegration.vdproj new file mode 100644 index 0000000..18750f3 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegration/HelpIntegration.vdproj @@ -0,0 +1,733 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:HelpIntegration" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_5CDA10563C4245259ADDCAA29B0F6911" + "OwnerKey" = "8:_DE2433B8E76B4DFA9DCFA12F14AF5905" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5EDF84279FAA485CAC7F74ECEFDFB2FA" + "OwnerKey" = "8:_DE2433B8E76B4DFA9DCFA12F14AF5905" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_DE2433B8E76B4DFA9DCFA12F14AF5905" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\DotNetZip-HelpIntegration.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\DotNetZip-HelpIntegration.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + } + } + "File" + { + } + "FileType" + { + } + "Folder" + { + "{1525181F-901A-416C-8A58-119130FE478E}:_25C415CCF5F34F86BB4F9B33A68FE0D9" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_7ECC7F10742C4454B7E5C54260252C98" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_8DA414573148486292EBA72D5F681300" + { + "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:HelpIntegration" + "ProductCode" = "8:{3172CCB8-7695-46A4-887D-8364ACDEF3CA}" + "PackageCode" = "8:{FA6EAE1D-EE1B-4B3C-880B-ED32FC29A23A}" + "UpgradeCode" = "8:{2D2BE662-AFC0-4870-A176-C95D63EB8367}" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:FALSE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:FALSE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:MSIT" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:HelpIntegration" + "Subject" = "8:" + "ARPCONTACT" = "8:MSIT" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_6045FB60DEF64A739B765CF1E1EF751A" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_770C7404A5D44B2F9873D780177B02F1" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_6F6D67043550494994DFBD8281164842" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_2FE5172CF11E483DB8E61697E97E6AB9" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_1974BD0F99A74ACEA9A7258D840ABD6A" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_75A3D4526ECF45FC8C2E36C746B9C811" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_488EA2BB134342CEB598B07D663DD3C9" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_903BD2D96DED49F4903E22622F8F396E" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_72557602305844DB94DBBE58DDCBCCCA" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_9CE3E0DBF82940C7A1CC3562A46BD572" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C7F1AF3A317C410DA811BEE7E64528BE" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progress" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_C951FD835AE84D58B95EFDD3373C849E" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_C9E4477B0B3447C9AB2FC6846039CEFA" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_2D7C9B8E1F584A4E9826BAE754047BC6" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_71204350845D459BA0D00BD0C4368093" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C1AD0BA6229E4FB1963F63C995BC9482" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_E2C40A6F8EC54047A564AC3B47D72209" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DEA98FDFED6A4F6DA9D8D085FD40424A" + { + "Sequence" = "3:100" + "DisplayName" = "8:Finished" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_F8AFDE09B57E4810AB9090C81DAD1DFA" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_0879F60EEC274E89AE40883C3E6AECBE" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirm Installation" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_797AE3D27CA040C9A8CB19B12920AACC" + { + "Sequence" = "3:100" + "DisplayName" = "8:Welcome" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_ABAE7D6011A448D8A75CFC877B032C30" + { + "Sequence" = "3:200" + "DisplayName" = "8:Installation Folder" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_5CDA10563C4245259ADDCAA29B0F6911" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:TRUE" + "SourcePath" = "8:HTML_Help_Registration__RTL_X86_---.msm" + "Properties" + { + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_5EDF84279FAA485CAC7F74ECEFDFB2FA" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:TRUE" + "SourcePath" = "8:VSIPCC_Collection_Files_RTL_---_---.msm" + "Properties" + { + } + "LanguageId" = "3:1033" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_DE2433B8E76B4DFA9DCFA12F14AF5905" + { + "SourcePath" = "8:..\\HelpIntegrationMergeModule\\Debug\\HelpIntegrationMergeModule.msm" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_8DA414573148486292EBA72D5F681300" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{39B858A8-21BE-40E3-B0C6-D265189C34F4}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + "KeyOutputModule" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:..\\HelpIntegrationMergeModule\\Debug\\HelpIntegrationMergeModule.msm" + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:_8DA414573148486292EBA72D5F681300" + "Feature" = "8:" + "IsolateTo" = "8:" + } + } + } + } +} diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/FixRegTables.exe b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/FixRegTables.exe new file mode 100644 index 0000000..7b1b8b0 Binary files /dev/null and b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/FixRegTables.exe differ diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/IntegrationWizard.xml b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/IntegrationWizard.xml new file mode 100644 index 0000000..365ea63 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/IntegrationWizard.xml @@ -0,0 +1,48 @@ + + + + MergeModule + VS_2008_VSIPCC + ionic.zip + DotNetZip Help + + + MS.VSIPCC.v90 + FL_vsipcc_hxt_86880_86880_cn_ln.3643236F_FC70_11D3_A536_0090278A1BB8.48273237_1399_45CF_801C_338E1AB00E90 + + + + + + + DotNetZipLib-v1.9.HxS + {63A1258F-C269-6085-81D2-4EDBD83C77D2} + + + _Collection_ac27e462fa6f457eb8ee19031a4b91e1.HxC + {9EC9766F-9C44-5D2D-2A54-BB16F98635E1} + + + _TOC_ac27e462fa6f457eb8ee19031a4b91e1.HxT + {28B9E55C-8BE0-9AA3-D46A-2BE89A6BDB3A} + + + _KIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK + {2E10F8C5-F6D8-1464-CB91-23430483D79F} + + + _AIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK + {89F6125B-F96D-4724-0625-C75215CD602B} + + + _FIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK + {204C3FBE-0129-328B-44AF-DE0F27A6730D} + + + _NUrlIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK + {45435507-EAFD-9D0C-8959-1904ED53DABA} + + + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_AIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_AIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK new file mode 100644 index 0000000..ada3ec9 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_AIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_Collection_ac27e462fa6f457eb8ee19031a4b91e1.HxC b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_Collection_ac27e462fa6f457eb8ee19031a4b91e1.HxC new file mode 100644 index 0000000..5bebd97 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_Collection_ac27e462fa6f457eb8ee19031a4b91e1.HxC @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_FIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_FIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK new file mode 100644 index 0000000..6856a70 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_FIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_KIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_KIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK new file mode 100644 index 0000000..d6e0771 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_KIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_NUrlIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_NUrlIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK new file mode 100644 index 0000000..fa6c7ec --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_NUrlIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_TOC_ac27e462fa6f457eb8ee19031a4b91e1.HxT b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_TOC_ac27e462fa6f457eb8ee19031a4b91e1.HxT new file mode 100644 index 0000000..d58eea2 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/CollectionFiles/_TOC_ac27e462fa6f457eb8ee19031a4b91e1.HxT @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/HelpIntegrationMergeModule.vdproj b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/HelpIntegrationMergeModule.vdproj new file mode 100644 index 0000000..8680458 --- /dev/null +++ b/dotNetZip/Help-VS-Integrated/HelpIntegrationMergeModule/HelpIntegrationMergeModule.vdproj @@ -0,0 +1,370 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{06A35CCD-C46D-44D5-987B-CF40FF872267}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:HelpIntegrationMergeModule" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_340E3967EA834C1AB08BF1E7BABE3AD4" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_3CAF6ECACA0647918F182A03F926BFD6" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_48CA68671B074BD7A662AC6CA4E9FFF7" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_9E03708D4ACD41FE89A10A8DE144C495" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B2D1E188693E4BC9AE1851A3AFB8F4AF" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B9A6CFF7BC124812B653B38559E5D9D3" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_C79061B6FA06410F9D558CF4396F6FF1" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_D427A3A535274528860E7188D37325A4" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_EFAD716E64E549F9A12500B6BE25E566" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\HelpIntegrationMergeModule.msm" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:1" + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\HelpIntegrationMergeModule.msm" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:1" + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "File" + { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_340E3967EA834C1AB08BF1E7BABE3AD4" + { + "SourcePath" = "8:CollectionFiles\\_Collection_ac27e462fa6f457eb8ee19031a4b91e1.HxC" + "TargetName" = "8:_Collection_ac27e462fa6f457eb8ee19031a4b91e1.HxC" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_3CAF6ECACA0647918F182A03F926BFD6" + { + "SourcePath" = "8:..\\..\\Help\\out\\DotNetZipLib-v1.9.HxS" + "TargetName" = "8:DotNetZipLib-v1.9.HxS" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B2D1E188693E4BC9AE1851A3AFB8F4AF" + { + "SourcePath" = "8:CollectionFiles\\_AIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "TargetName" = "8:_AIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B9A6CFF7BC124812B653B38559E5D9D3" + { + "SourcePath" = "8:CollectionFiles\\_TOC_ac27e462fa6f457eb8ee19031a4b91e1.HxT" + "TargetName" = "8:_TOC_ac27e462fa6f457eb8ee19031a4b91e1.HxT" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C79061B6FA06410F9D558CF4396F6FF1" + { + "SourcePath" = "8:CollectionFiles\\_KIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "TargetName" = "8:_KIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D427A3A535274528860E7188D37325A4" + { + "SourcePath" = "8:CollectionFiles\\_FIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "TargetName" = "8:_FIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_EFAD716E64E549F9A12500B6BE25E566" + { + "SourcePath" = "8:CollectionFiles\\_NUrlIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "TargetName" = "8:_NUrlIndex_ac27e462fa6f457eb8ee19031a4b91e1.HxK" + "Tag" = "8:" + "Folder" = "8:_24E53BF792A14F60B4E45B7E00701F39" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{F4FE1E22-A4D2-4EE8-9259-29A1CE8BB2FF}:_24E53BF792A14F60B4E45B7E00701F39" + { + "DefaultLocation" = "8:[TARGETDIR]" + "DisplayName" = "8:Module Retargetable Folder" + "Description" = "8:" + "Name" = "8:Module Retargetable Folder" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:TRUE" + "Property" = "8:NEWRETARGETABLEPROPERTY1" + "Folders" + { + } + } + } + "Sequences" + { + } + "MergeModule" + { + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_48CA68671B074BD7A662AC6CA4E9FFF7" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:C:\\Program Files\\Microsoft Visual Studio 2008 SDK\\HelpIntegrationWizard\\VS_2008\\VSIPCC_Collection_Files_RTL_---_---.msm" + "Properties" + { + } + "LanguageId" = "3:1033" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_9E03708D4ACD41FE89A10A8DE144C495" + { + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:C:\\Program Files\\Microsoft Visual Studio 2008 SDK\\HelpIntegrationWizard\\MSHelp2\\2008\\HTML_Help_Registration__RTL_X86_---.msm" + "Properties" + { + } + "LanguageId" = "3:0" + "Exclude" = "11:FALSE" + "Folder" = "8:" + "Feature" = "8:" + "IsolateTo" = "8:" + } + } + "Module" + { + "ModuleSignature" = "8:MergeModule.5E86696916964FAC870AC72672758E6F" + "Version" = "8:1.0.0.0" + "Title" = "8:HelpIntegrationMergeModule" + "Subject" = "8:" + "Author" = "8:MSIT" + "Keywords" = "8:" + "Comments" = "8:" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:copy \"C:\\Program Files\\Microsoft Visual Studio 2008 SDK\\HelpIntegrationWizard\\MSHelp2\\MSHelp2_RegTables__RTL_---_---.msm\" \"$(ProjectDir)\\CollectionFiles\"" + "PostBuildEvent" = "8:\"$(ProjectDir)\\CollectionFiles\\FixRegTables.exe\" \"$(BuiltOuputPath)\" \"$(ProjectDir)\\\"" + "RunPostBuildEvent" = "3:0" + } + "ProjectOutput" + { + } + "Registry" + { + "HKLM" + { + "Keys" + { + } + } + "HKCU" + { + "Keys" + { + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Shortcut" + { + } + } +} diff --git a/dotNetZip/Help/Code Examples/ASPNET-Csharp.htm b/dotNetZip/Help/Code Examples/ASPNET-Csharp.htm new file mode 100644 index 0000000..62cec9e --- /dev/null +++ b/dotNetZip/Help/Code Examples/ASPNET-Csharp.htm @@ -0,0 +1,237 @@ + + +ASP.NET (C#) + + + + + + + +

DotNetZip - ASP.NET Example in C#

+ +

ASP.NET Example in C#

+ +

Here's an Example ASP.NET page, using C#, that dynamically creates a +zip file and saves it to Response.OutStream. From the browser, the user +will be prompted with the familiar download dialog box, allowing Open, +Save, or Cancel of the generated zip file.

+ + +
+
+<%@ Page
+    Language="C#"
+    Debug="true" %>
+
+<%@ Import Namespace="System.Text" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="Ionic.Zip" %>
+<%@ Import Namespace="System.Collections.Generic" %>
+
+<script language="C#" runat="server">
+
+// ZipExample.aspx
+//
+// This .aspx page demonstrates how to use the DotNetZip library from within ASP.NET.
+//
+// To run it,
+//  1. drop the Ionic.Zip.dll into the \bin directory of your ASP.NET app
+//  2. create a subdirectory called "fodder" in your web app directory.
+//  3. copy into that directory a variety of random files.
+//  4. insure your web.config is properly set up (See below)
+//
+//
+// notes:
+//  This requies the .NET Framework 3.5 - because it uses the ListView control that is
+//  new for ASP.NET in the .NET Framework v3.5.
+//
+//  To use this control, you must add the new web controls.  Also, you must use the v3.5 compiler.
+//  IF you build your app in Visual Studio, this is all done for you. If you don't use VS2008,
+//  here's an example web.config that works with this aspx file:
+//
+//    <configuration>
+//      <system.web>
+//        <trust level="Medium" />
+//        <compilation defaultLanguage="c#" />
+//        <pages>
+//          <controls>
+//            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+//          </controls>
+//        </pages>
+//      </system.web>
+//      <system.codedom>
+//        <compilers>
+//          <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+//            <providerOption name="CompilerVersion" value="v3.5" />
+//            <providerOption name="WarnAsError" value="false" />
+//          </compiler>
+//        </compilers>
+//      </system.codedom>
+//    </configuration>
+//
+//
+//
+
+
+public String width = "100%";
+
+public void Page_Load (Object sender, EventArgs e)
+{
+    try
+    {
+        if ( !Page.IsPostBack ) {
+            // populate the dropdownlist
+            // must have a directory called "fodder" in the web app
+            String homeDir = Server.MapPath(".");
+            String sMappedPath= Server.MapPath("fodder");
+
+            var fqFilenames= new List<String>(System.IO.Directory.GetFiles(sMappedPath));
+            var filenames= fqFilenames.ConvertAll((s) => { return s.Replace(sMappedPath+"\\", ""); });
+
+            ErrorMessage.InnerHtml = "";
+
+            FileListView.DataSource = filenames;
+            FileListView.DataBind();
+        }
+
+    }
+    catch (Exception)
+    {
+        // Ignored
+    }
+}
+
+
+public void btnGo_Click (Object sender, EventArgs e)
+{
+    ErrorMessage.InnerHtml ="";   // debugging only
+    var filesToInclude= new System.Collections.Generic.List<String>();
+    String sMappedPath= Server.MapPath("fodder");
+    var source= FileListView.DataKeys as DataKeyArray ;
+
+    foreach (var item in  FileListView.Items)
+    {
+        CheckBox chkbox= item.FindControl("include") as CheckBox ;
+        Label lbl= item.FindControl("label") as Label ;
+
+        if (chkbox!=null  && lbl != null)
+        {
+            if (chkbox.Checked)
+            {
+                ErrorMessage.InnerHtml += String.Format("adding file: {0}<br/>\n", lbl.Text);
+
+                filesToInclude.Add(System.IO.Path.Combine(sMappedPath,lbl.Text));
+            }
+        }
+    }
+
+    if (filesToInclude.Count==0)
+    {
+        ErrorMessage.InnerHtml += "You did not select any files?<br/>\n";
+
+    }
+    else
+    {
+        Response.Clear();
+
+        System.Web.HttpContext c= System.Web.HttpContext.Current;
+        String ReadmeText= String.Format("README.TXT\n\nHello!\n\n"+
+                                         "This is a zip file that was dynamically generated at {0}\n"+
+                                         "by an ASP.NET Page running on the machine named '{1}'.\n"+
+                                         "The server type is: {2}\n",
+                                         System.DateTime.Now.ToString("G"),
+                                         System.Environment.MachineName,
+                                         c.Request.ServerVariables["SERVER_SOFTWARE"]
+                                         );
+        string archiveName= String.Format("archive-{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
+        Response.ContentType = "application/zip";
+        Response.AddHeader("content-disposition", "filename=" + archiveName);
+
+        using (ZipFile zip = new ZipFile())
+        {
+            foreach (var f in filesToInclude)
+            {
+                zip.AddFile(f, "files");
+            }
+            zip.AddEntry("Readme.txt", ReadmeText);
+            zip.Save(Response.OutputStream);
+        }
+        Response.Close();
+    }
+
+}
+
+</script>
+
+
+
+<html>
+  <head>
+    <link rel="stylesheet" href="style/basic.css">
+  </head>
+
+  <body>
+
+    <form id="Form" runat="server">
+
+      <h3> <span id="Title" runat="server" />Zip Files from ASP.NET </h3>
+
+      <p>This page uses the .NET Zip library
+      (see <a href="http://www.codeplex/com/DotNetZip">http://www.codeplex/com/DotNetZip</a>)
+       to dynamically create a zip archive, and then download it to the browser through Response.OutputStream</p>
+
+      <span class="SampleTitle"><b>Check the boxes to select the files, then click the button to zip them up.</b></span>
+      <br/>
+      <br/>
+      <asp:Button id="btnGo" Text="Zip checked files" AutoPostBack OnClick="btnGo_Click" runat="server"/>
+
+      <br/>
+      <br/>
+      <span style="color:red" id="ErrorMessage" runat="server"/>
+      <br/>
+
+      <asp:ListView ID="FileListView" runat="server">
+
+        <LayoutTemplate>
+          <table>
+            <tr ID="itemPlaceholder" runat="server" />
+          </table>
+        </LayoutTemplate>
+
+        <ItemTemplate>
+          <tr>
+            <td><asp:Checkbox ID="include" runat="server"/></td>
+            <td><asp:Label id="label" runat="server" Text="<%# Container.DataItem %>" /></td>
+          </tr>
+        </ItemTemplate>
+
+        <EmptyDataTemplate>
+          <div>Nothing to see here...</div>
+        </EmptyDataTemplate>
+
+      </asp:ListView>
+
+
+    </form>
+
+  </body>
+
+</html>
+
+
+ + + + + diff --git a/dotNetZip/Help/Code Examples/ASPNET-VB.htm b/dotNetZip/Help/Code Examples/ASPNET-VB.htm new file mode 100644 index 0000000..f8c6455 --- /dev/null +++ b/dotNetZip/Help/Code Examples/ASPNET-VB.htm @@ -0,0 +1,272 @@ + + +ASP.NET (VB) + + + + + + + +

DotNetZip - ASP.NET VB Example

+ +

ASP.NET Example in VB

+ +

Here's an Example ASP.NET page, using VB, that dynamically creates a +zip file and saves it to Response.OutStream. From the browser, the user +will be prompted with the familiar download dialog box, allowing Open, +Save, or Cancel of the generated zip file.

+ +
+
+
+
+<%@ Page
+    Language="VB"
+    Debug="true"
+%>
+
+<%@ Import Namespace="System.Text" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="Ionic.Zip" %>
+<%@ Import Namespace="System.Collections.Generic" %>
+
+<script language="VB" runat="server">
+
+' ZipExample.aspx
+'
+' This .aspx page demonstrates how to use the DotNetZip library from within ASP.NET.
+'
+' To run it,
+'  1. drop the Ionic.Zip.dll into the \bin directory of your asp.net app
+'  2. create a subdirectory called "fodder" in your web app directory.
+'  3. copy into that directory a variety of random files.
+'  4. insure your web.config is properly set up (See below)
+'
+'
+' notes:
+'  This requies the .NET Framework 3.5 - because it uses the ListView control that is
+'  new for ASP.NET in the .NET Framework v3.5.
+'
+'  To use this control, you must add the new web controls.  Also, you must use the v3.5 compiler.
+'  Here's an example web.config that works with this aspx file:
+'
+'    <configuration>
+'      <system.web>
+'        <trust level="Medium" />
+'        <compilation defaultLanguage="c#" />
+'        <pages>
+'          <controls>
+'            <add tagPrefix="asp" namespace="System.Web.UI.WebControls"
+'                 assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+'          </controls>
+'        </pages>
+'      </system.web>
+'      <system.codedom>
+'        <compilers>
+'          <compiler language="c#;cs;csharp"
+'                extension=".cs"
+'                warningLevel="4"
+'                type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+'            <providerOption name="CompilerVersion" value="v3.5" />
+'            <providerOption name="WarnAsError" value="false" />
+'          </compiler>
+'
+'          <compiler language="vb;vbs;visualbasic;vbscript"
+'                    extension=".vb"
+'                    warningLevel="4"
+'                    type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+'            <providerOption name="CompilerVersion" value="v3.5" />
+'            <providerOption name="OptionInfer" value="false" />
+'            <providerOption name="WarnAsError" value="false" />
+'          </compiler>
+'
+'      </system.codedom>
+'    </configuration>
+'
+'
+
+
+Dim width as String = "100%"
+
+Public Sub Page_Load (ByVal sender As Object, ByVal e As System.EventArgs)
+    Try
+        If Not ( Page.IsPostBack ) Then
+            ' populate the dropdownlist
+            ' must have a directory called "fodder" in the web app
+            Dim homeDir as String = Server.MapPath(".")
+            Dim sMappedPath as  String= Server.MapPath("fodder")
+
+            Dim fqFilenames As New List(Of String)(System.IO.Directory.GetFiles(sMappedPath))
+
+            Dim filenames as List(Of String) = _
+                fqFilenames.ConvertAll (Function(s) s.Replace(sMappedPath & "\", ""))
+
+            ErrorMessage.InnerHtml = ""
+
+            FileListView.DataSource = filenames
+            FileListView.DataBind()
+        End If
+
+    Catch
+        ' Ignored
+    End Try
+
+End Sub
+
+
+
+Public Sub btnGo_Click (ByVal sender As System.Object, ByVal e As System.EventArgs)
+
+    ErrorMessage.InnerHtml =""   ' debugging only
+    Dim filesToInclude as New System.Collections.Generic.List(Of String)()
+    Dim sMappedPath as String= Server.MapPath("fodder")
+    Dim source As DataKeyArray= FileListView.DataKeys
+
+    For Each item As ListViewDataItem in FileListView.Items
+
+        Dim chkbox As CheckBox= CType(item.FindControl("include"), CheckBox)
+        Dim lbl As Label = CType(item.FindControl("label"), Label)
+
+        If Not (chkbox Is Nothing  OR  lbl Is Nothing) Then
+            If (chkbox.Checked) Then
+                ErrorMessage.InnerHtml = ErrorMessage.InnerHtml & _
+                        String.Format("adding file: {0}<br/>\n", lbl.Text)
+                filesToInclude.Add(System.IO.Path.Combine(sMappedPath,lbl.Text))
+            End If
+        End If
+    Next
+
+    If (filesToInclude.Count=0) Then
+        ErrorMessage.InnerHtml = ErrorMessage.InnerHtml & "You did not select any files?<br/>\n"
+    Else
+        Response.Clear
+        Response.BufferOutput= false
+
+        Dim enc as Ionic.Zip.EncryptionAlgorithm = Ionic.Zip.EncryptionAlgorithm.None
+        If (chkUseAes.Checked) Then
+            enc = EncryptionAlgorithm.WinZipAes256
+        End If
+
+        Dim c As System.Web.HttpContext = System.Web.HttpContext.Current
+        Dim ReadmeText As String= String.Format("README.TXT\n\nHello!\n\n" & _
+                                         "This is a zip file that was dynamically generated at {0}\n" & _
+                                         "by an ASP.NET Page running on the machine named '{1}'.\n" & _
+                                         "The server type is: {2}\n" & _
+                                         "The password used: {3}\n", _
+                                         "Encryption: {4}\n", _
+                                         System.DateTime.Now.ToString("G"), _
+                                         System.Environment.MachineName, _
+                                         c.Request.ServerVariables("SERVER_SOFTWARE"), _
+                                         tbPassword.Text, _
+                                         enc.ToString )
+        Dim archiveName as String= String.Format("archive-{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"))
+        Response.ContentType = "application/zip"
+        Response.AddHeader("content-disposition", "filename=" + archiveName)
+
+        Using zip as new ZipFile()
+            ' the Readme.txt file will not be password-protected.
+            zip.AddEntry("Readme.txt", ReadmeText, Encoding.Default)
+            If Not String.IsNullOrEmpty(tbPassword.Text) Then
+                zip.Password = tbPassword.Text
+                zip.Encryption = enc
+            End If
+
+            ' filesToInclude is a string[] or List<String>
+            zip.AddFiles(filesToInclude, "files")
+
+            zip.Save(Response.OutputStream)
+        End Using
+        Response.Close
+
+    End If
+
+End Sub
+
+
+</script>
+
+
+
+<html>
+  <head>
+    <link rel="stylesheet" href="style/basic.css">
+  </head>
+
+  <body>
+
+    <form id="Form" runat="server">
+
+      <h3> <span id="Title" runat="server" />Zip Files from ASP.NET </h3>
+
+      <p>This page uses the .NET Zip library (see <a
+      href="http://DotNetZip.codeplex.com">http://DotNetZip.codeplex.com/</a>)
+      to dynamically create a zip archive, and then download it to the
+      browser through Response.OutputStream.  This page is implemented
+      in VB.NET.</p>
+
+      <span class="SampleTitle"><b>Check the boxes to select the files, set a password if you like,
+      then click the button to zip them up.</b></span>
+      <br/>
+      <br/>
+      Password: <asp:TextBox id="tbPassword" Password='true' Text="" AutoPostBack runat="server"/>
+      <span style="color:Red">(Optional)</span>
+      <br/>
+      <br/>
+      Use AES?: <asp:CheckBox id="chkUseAes" AutoPostBack runat="server"/>
+      <br/>
+      <br/>
+      <asp:Button id="btnGo" Text="Zip checked files" AutoPostBack OnClick="btnGo_Click" runat="server"/>
+
+      <br/>
+      <br/>
+      <span style="color:red" id="ErrorMessage" runat="server"/>
+      <br/>
+
+      <asp:ListView ID="FileListView" runat="server">
+
+        <LayoutTemplate>
+          <table>
+            <tr ID="itemPlaceholder" runat="server" />
+          </table>
+        </LayoutTemplate>
+
+        <ItemTemplate>
+          <tr>
+            <td><asp:Checkbox ID="include" runat="server"/></td>
+            <td><asp:Label id="label" runat="server" Text="<%# Container.DataItem %>" /></td>
+          </tr>
+        </ItemTemplate>
+
+        <EmptyDataTemplate>
+          <div>Nothing to see here...</div>
+        </EmptyDataTemplate>
+
+      </asp:ListView>
+
+
+    </form>
+
+  </body>
+
+</html>
+
+
+
+ + + + + + + diff --git a/dotNetZip/Help/Code Examples/COM.htm b/dotNetZip/Help/Code Examples/COM.htm new file mode 100644 index 0000000..10ec131 --- /dev/null +++ b/dotNetZip/Help/Code Examples/COM.htm @@ -0,0 +1,726 @@ + + + +COM - ASP, PHP, VB6, JavaScript, VBScript + + + + + + +

DotNetZip can be used from COM Environments

+ +

You can use DotNetZip from COM environments, via an +IDispatch (late bound) interface. This means you can call into the DotNetZip +library (the Ionic.Zip.dll assembly) from programming environments like PHP, +Perl, Javascript, and VBScript (including old-school ASP pages), among others. +

+ +

If you download and install the DotNetZip Runtime MSI package, it +will set up DotNetZip for use with COM.

+ +

If for some reason you prefer to not use the MSI package, then you will need to perform some manual steps to enable DotNetZip for COM usage.

+ +
    +
  1. open a CMD.exe prompt.
  2. +
  3. Install into the GAC: gacutil -i Ionic.Zip.dll
  4. +
  5. Register for COM use: regasm Ionic.Zip.dll
  6. +
+ +

Notes: You will need to be local administrator in order to +perform these steps. You need to perform those steps just once, on each +computer where COM applications will run that use DotNetZip. The gacutil +and regasm tools are included in the .NET Framework SDK.

+ + +

Using the COM interface to DotNetZip

+ +

Via the COM exposure, applications written in COM-capable environments like +old-school ASP using VBScript or Javascript, VBScript or Javascript running in Windows +Script Host, PHP, Perl, and others, can create instances of the ZipFile class, add +entries, and save archives, as any .NET application could. Most of DotNetZip's advanced +features are available to these COM environments, including ZIP64 support, +self-extracting archives, password-protected zip files, AES Encryption, spanned Zip +files, and Unicode support. Beyond creating zips, COM environments can also read zips, +modify them, or extract files from zip files.

+ +

Some of the advanced features of DotNetZip are not available through +COM, including eventing, and streaming.

+ +

IDispatch

+ +

The key classes in DotNetZip that are exposed to COM are: ZipFile, +ZipEntry, and the various ZipExceptions. These are all exposed via +IDispatch interfaces - late binding only. (For those familiar with +.NET, DotNetZip is decorated with ClassInterfaceType.AutoDispatch.) There is no explicit +typelib exposed by DotNetZip.

+ +

COM supports calling instance methods and properties on .NET classes; COM does not +support calling static methods on .NET objects via interop. To allow the various static +methods on the ZipFile class, such as ZipFile.CheckZip() and ZipFile.IsZipFile(), to be called from COM, DotNetZip includes a +ComHelper class. Instead of calling ZipFile.IsZipFile(), which is inaccessible to COM clients because it is +a static method, COM clients should call Ionic.Zip.ComHelper.IsZipFile(). Use ComHelper as you would, any other +class. The methods on the class are documented as with all the other classes in +DotNetZip. If you are not programming DotNetZip from COM, you don't need the ComHelper +class.

+ + +

Overloaded Methods

+ +

COM does not directly support calling overloaded methods. In a .NET +assembbly exposed to COM via interop, only the simplest method in a +method group is directly available to COM callers. For example, +consider ZipFile.AddFile. There are two overloads. Only the overload +that accepts a single string will be accessible via the name "AddFile" +to COM clients.

+ +

In most cases the thing you need to accomplish is achievable anyway. +In the AddFile() case, setting the FileName on the entry after calling +AddFile() will do the trick.

+ +

Also, the overloaded methods are available, via "mangled" +names: each successive overload gets a numeric suffix. Consider the +ZipFile.ExtractSelectedEntries method group; there are 5 overloads. The first, +simplest, is available via the name ExtractSelectedEntries. Then, +additional overloads are available via ExtractSelectedEntries_2, +ExtractSelectedEntries_3, and so on. The same is true for other +overloaded methods on the ZipFile and ZipEntry classes. +

+ + +

For the ZipFile class:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method OverloadIDispatch name
AddItem(string)AddItem
AddItem(string, string)AddItem_2
AddFile(string)AddFile
AddFile(string, string)AddFile_2
UpdateFile(string)UpdateFile
UpdateFile(string, string)UpdateFile_2
UpdateDirectory(string)UpdateDirectory
UpdateDirectory(string, string)UpdateDirectory_2
UpdateItem(string)UpdateItem
UpdateItem(string, string)UpdateItem_2
AddEntry(string,string)AddEntry
AddEntry(string,string,Encoding)AddEntry_2
AddEntry(string,Stream)AddEntry_3
AddEntry(string,byte[])AddEntry_4
UpdateEntry(string,string)UpdateEntry
UpdateEntry(string,string,Encoding)UpdateEntry_2
UpdateEntry(string,Stream)UpdateEntry_3
UpdateEntry(string,byte[])UpdateEntry_4
AddDirectory(string)AddDirectory
AddDirectory(string,string)AddDirectory_2
RemoveEntry(ZipEntry)RemoveEntry
RemoveEntry(string)RemoveEntry_2
ExtractAll(string)ExtractAll
ExtractAll(string, bool)ExtractAll_2
ExtractAll(string, ExtractExistingFileAction)ExtractAll_3
Save()Save
Save(string)Save_2
Save(Stream)Save_3
AddSelectedFiles(string)AddSelectedFiles
AddSelectedFiles(string, bool)AddSelectedFiles_2
AddSelectedFiles(string, string)AddSelectedFiles_3
AddSelectedFiles(string, string, bool)AddSelectedFiles_4
AddSelectedFiles(string, string, string)AddSelectedFiles_5
AddSelectedFiles(string, string, string, bool)AddSelectedFiles_6
RemoveSelectedEntries(string)RemoveSelectedEntries
AddSelectedFiles(string, string)RemoveSelectedEntries_2
ExtractSelectedEntries(string)ExtractSelectedEntries
ExtractSelectedEntries(string, ExtractExistingFileAction)ExtractSelectedEntries_2
ExtractSelectedEntries(string, string)ExtractSelectedEntries_3
ExtractSelectedEntries(string, string, string)ExtractSelectedEntries_4
ExtractSelectedEntries(string, string, string, ExtractExistingFileAction)ExtractSelectedEntries_5
SaveSelfExtractor(string, SelfExtractorFlavor)SaveSelfExtractor
SaveSelfExtractor(string, SelfExtractorFlavor, string)SaveSelfExtractor_2
SaveSelfExtractor(string, SelfExtractorFlavor, string, string)SaveSelfExtractor_3
+ + + + +

For the ZipEntry class:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method OverloadIDispatch name
Extract()Extract
Extract(ExtractExistingFileAction)Extract_2
Extract(Stream)Extract_3
Extract(string)Extract_4
Extract(string, ExtractExistingFileAction)Extract_5
ExtractWithPassword(string)ExtractWithPassword
ExtractWithPassword(string,string)ExtractWithPassword_2
ExtractWithPassword(ExtractExistingFileAction,string)ExtractWithPassword_3
ExtractWithPassword(string, ExtractExistingFileAction, string)ExtractWithPassword_4
ExtractWithPassword(Stream, string)ExtractWithPassword_5
+ + +

The bad news is that the mappings between names and actual methods +will change over releases of DotNetZip. This means depending on these +names is a bit fragile, but it will work.

+ + + +

Destroy the ZipFile object

+ +

After you call .Dispose() on the ZipFile object, you should destroy +it completely. In VBSCript, this is done by setting the object +reference to Nothing. +

+ +

The usage model for the ZipFile object

+ +

After you initialize a ZipFile object, you can't reuse the same +object instance for another zip file. If for example, you have a set of +6 zip files, and you want to read and extract them in a loop, then +you'll need to instantiate a new ZipFile object to read each one. You +should call Dispose() on each one when you're finished, and then set it +to null/Nothing.

+ + +

For enumerations

+ +

DotNetZip exposes various enumerations to specify behavior in the +interface - for example, the Ionic.Zlib.CompressionLevel enum, and the +Ionic.Zip.ExtractExistingFileAction enum. Enums are not available to +IDispatch clients. COM applications that need to use enum values can +simply use the integer equivalent for those enums. In most cases those +integer values are specified in the documentation for the enum. For +example, for Ionic.Zip.ExtractExistingFileAction, the value of Throw is +0, while OverwriteSilently is 1.

+ +

+Some examples follow. +

+ +
+ +

Using DotNetZip in PHP

+ +

+This is a PHP script that dynamically creates a ZIP file on the server, +then downloads it to the requesting client. The Zip archive will use +256-bit AES encryption. +

+ +
+  $fname = "zip-generated-from-php-" . date('Y-m-d-His') . ".zip";
+  $zipOutput = "c:\\temp\\" . $fname;
+  $zip = new COM("Ionic.Zip.ZipFile");
+  $zip->Name = $zipOutput;
+  $dirToZip= "c:\\temp\\psh";
+  $zip->Encryption = 3;
+  $zip->Password = "AES-Encryption-Is-Secure";
+  $zip->AddDirectory($dirToZip);
+  $zip->Save();
+  $zip->Dispose();
+
+  if (file_exists($zipOutput))
+  {
+    header('Cache-Control: no-cache, must-revalidate');
+    header('Content-Type: application/x-zip');
+    header('Content-Disposition: attachment; filename=' . $fname);
+    header('Content-Length: ' . filesize($zipOutput));
+    readfile($zipOutput);
+    unlink($zipOutput);
+  }
+
+ + + + +

Using DotNetZip in Javascript

+ +

This example dynamically creates a zipfile, using AES 256-bit encryption. +

+ + +
+var filename = "C:\\temp\\ZipFile-created-from-javascript-" + generateTimestamp() + ".zip";
+
+try
+{
+    WScript.echo("Instantiating a ZipFile object...");
+    var zip = new ActiveXObject("Ionic.Zip.ZipFile");
+
+    WScript.echo("setting the encryption...");
+    // 3 = AES256, 2 = AES128, 1 = PKZIP, 0 = none
+    zip.Encryption = 3;
+
+    WScript.echo("setting the password...");
+    zip.Password = "This is the Password.";
+
+    WScript.echo("adding a selection of files...");
+    zip.AddSelectedFiles("*.js");
+    zip.AddSelectedFiles("*.vbs");
+
+    WScript.echo("setting the save name...");
+    zip.Name = filename;
+
+    WScript.echo("Saving...");
+    zip.Save();
+
+    WScript.echo("Disposing...");
+    zip.Dispose();
+
+    WScript.echo("Done.");
+}
+catch (e2)
+{
+    WScript.echo(e2.number + ": " + e2.name);
+    WScript.echo(e2.message);
+}
+
+ +

This example lists the entries in a zipfile. +

+ +
+
+var filename = "C:\\temp\\CompressedData.zip";
+
+try
+{
+    WScript.echo("Instantiating a ZipFile object...");
+    var zip = new ActiveXObject("Ionic.Zip.ZipFile");
+
+    WScript.echo("Initialize (Read)...(" + filename + ")");
+    zip.Initialize(filename);
+
+    WScript.echo("listing entries...");
+    var e = new Enumerator(zip);
+    for (; !e.atEnd(); e.moveNext())
+    {
+        var entry= e.item();
+        WScript.Echo ("  " + entry.FileName);
+    }
+
+    WScript.echo("Disposing...")
+    zip.Dispose();
+
+    WScript.echo("Done.");
+}
+catch (e2)
+{
+    WScript.echo(e2.number + ": " + e2.name);
+    WScript.echo(e2.message);
+}
+
+ + + +

This example checks a ZipFile using the ComHelper class. +

+ +
+
+function checkZip(filename)
+{
+    var obj = new ActiveXObject("Ionic.Zip.ComHelper");
+    return obj.IsZipFile(filename);
+}
+
+function checkZipWithExtract(filename)
+{
+    var obj = new ActiveXObject("Ionic.Zip.ComHelper");
+    return obj.IsZipFileWithExtract(filename);
+}
+
+function main()
+{
+    var result;
+    var args = WScript.Arguments;
+
+    if (args.Length == 1)
+    {
+        result = checkZip(args(0));
+    }
+    else if (args.Length == 2 && args(0) == "-x")
+    {
+        result = checkZipWithExtract(args(1));
+    }
+    else
+    {
+        WScript.Echo("TestCheckZip.js - check a zipfile using Javascript.");
+        WScript.Echo("  usage: TestCheckZip.js [-x]  ");
+        WScript.Quit(1);
+    }
+
+    WScript.Echo((result==0)?"That zip is not OK":"That zip is OK");
+    WScript.Quit(0);
+}
+
+main();
+
+ + + +

Using DotNetZip in VBScript

+ +

This example creates a zipfile, using AES 256-bit encryption. +

+ + +
+
+  dim filename
+  filename = "C:\temp\ZipFile-created-from-VBScript.zip"
+
+  WScript.echo("Instantiating a ZipFile object...")
+  dim zip
+  set zip = CreateObject("Ionic.Zip.ZipFile")
+
+  WScript.echo("Setting the encryption...")
+  ' 3=AES256, 2=AES128, 1=PKZIP, 0=none
+  zip.Encryption = 3
+
+  WScript.echo("setting the password...")
+  zip.Password = "This is the Password."
+
+  WScript.echo("adding a selection of files...")
+  zip.AddSelectedFiles "*.js"
+  zip.AddSelectedFiles "*.vbs"
+
+  WScript.echo("setting the save name...")
+  zip.Name = filename
+
+  WScript.echo("Saving...")
+  zip.Save
+
+  WScript.echo("Disposing...")
+  zip.Dispose
+
+  zip = Nothing
+
+  WScript.echo("Done.")
+
+
+ + + +

This example extracts all entries from a zipfile. +

+ +
+
+  WScript.echo("Instantiating a ZipFile object...")
+  dim zip
+  set zip = CreateObject("Ionic.Zip.ZipFile")
+
+  WScript.echo("Initialize (Read)...")
+  zip.Initialize("CompressedData.zip")
+
+  WScript.echo("setting the password for extraction...")
+  zip.Password = "This is the Password."
+
+  WScript.echo("extracting all files...")
+  zip.ExtractAll "DotNetZip-extract"
+
+  WScript.echo("Disposing...")
+  zip.Dispose
+
+  WScript.echo("Done.")
+
+
+ + + +

This example lists the entries in a zipfile, and extracts some of them. +

+ +
+
+    WScript.echo("")
+    Dim zip
+    WScript.echo("Instantiating a ZipFile object...")
+    Set zip = CreateObject("Ionic.Zip.ZipFile")
+
+    WScript.echo("Initialize (Read)...")
+    zip.Initialize filename
+
+    Set fso = CreateObject("Scripting.FileSystemObject")
+    If Not fso.FolderExists("unpack") Then
+        fso.CreateFolder("unpack")
+    End If
+
+    ' Any call to ZipEntry.Extract() will put files into the
+    ' current working directory.  So set it here:
+    Set objShell = CreateObject("Wscript.Shell")
+    objShell.CurrentDirectory = "unpack"
+
+    WScript.echo("listing...")
+    For Each entry in zip
+       WScript.echo("  " & entry.FileName)
+       ext = Right(entry.FileName,4)
+       If (ext = ".vbs") Then
+          ' set password for extraction if necessary
+          entry.Password = "This is the Password."
+          entry.Extract
+       End If
+    Next
+
+    WScript.echo("Disposing...")
+    zip.Dispose
+
+    WScript.echo("Done.")
+
+
+ + +

This example extracts selected entries from a zip archive, via the +ExtractSelectedEntries overload. It uses the mangled name to access the +method, as described above.

+ +
+
+    Sub extractZip()
+        If Not (extractLocation = "") Then
+          Dim OverwriteSilently
+          OverwriteSilently = 1
+
+          Dim zip
+          Set zip = CreateObject("Ionic.Zip.ZipFile")
+
+          zip.Initialize filename
+
+          If password <> "" Then
+            zip.Password = password
+          End If
+
+          zip.ExtractSelectedEntries_5 "name = *.xml", Null, extractLocation, OverwriteSilently
+
+          zip.Dispose
+          zip = Nothing
+        End If
+
+    End Sub
+
+
+ + + diff --git a/dotNetZip/Help/Code Examples/Code Examples.htm b/dotNetZip/Help/Code Examples/Code Examples.htm new file mode 100644 index 0000000..4b06c1f --- /dev/null +++ b/dotNetZip/Help/Code Examples/Code Examples.htm @@ -0,0 +1,7 @@ + + + + +Code Examples + + diff --git a/dotNetZip/Help/Code Examples/Cpp.htm b/dotNetZip/Help/Code Examples/Cpp.htm new file mode 100644 index 0000000..197b0db --- /dev/null +++ b/dotNetZip/Help/Code Examples/Cpp.htm @@ -0,0 +1,312 @@ + + +C++/CLI + + + + + + +

You can use DotNetZip from C++/CLI

+ +

+ A program written in C++/CLI can take advantage of any managed + library. It"s easy to use DotNetZip from a C++/CLI application. This + page will show some examples. +

+ +

+ Using C++/CLI, the key difference from VB and C#, is that there is + no using statement in C++. C++ applications need to + surround the use of the ZipFile class with a try..catch.. and call the + ZipFile destructor, or call delete, in the finally clause. +

+ +
+ +

Create a zip file

+ +

This example just creates a simple zipfile. It uses the destructor. +

+ +
+
+using namespace System;
+using namespace Ionic::Zip;
+
+int main(array<System::String ^> ^args)
+{
+    Console::WriteLine(L"Hello World");
+
+    ZipFile ^ zip;
+    try
+    {
+        zip = gcnew ZipFile();
+        zip->AddEntry("Readme.txt", "This is the content for the Readme.txt entry.");
+        zip->AddFile("CreateZipFile.cpp");
+        zip->Save("test.zip");
+    }
+    finally
+    {
+        zip->~ZipFile();
+    }
+
+    Console::WriteLine(L"Press <ENTER> to quit.");
+    Console::ReadLine();
+    return 0;
+}
+
+
+ +

This alternative uses the C++ deleee syntax: +

+ + +
+
+using namespace System;
+using namespace Ionic::Zip;
+
+int main(array<System::String ^> ^args)
+{
+    Console::WriteLine(L"Hello World");
+
+    ZipFile ^ zip;
+    try
+    {
+        zip = gcnew ZipFile();
+        zip->AddEntry("Readme.txt", "This is the content for the Readme.txt entry.");
+        zip->AddFile("CreateZipFile.cpp");
+        zip->Save("test.zip");
+    }
+    finally
+    {
+        delete zip;
+    }
+
+    Console::WriteLine(L"Press <ENTER> to quit.");
+    Console::ReadLine();
+    return 0;
+}
+
+
+ + +

Building C++/CLI program that uses DotNetZip

+ +

Build a C++/CLI program that uses DotNetZip, just as you would build +any C++/CLI program.

+ +

The easiest way is to use Visual Studio, and create a C++/CLI +project. Right click on the project and select References.... Add a reference to the Ionic.Zip.dll +assembly. Click OK, then build your application.

+ +

You can also build using command-line tools. To do this, you will +need to compile using the c++ source using the cl.exe tool, specifying +the /clr option, and specifying where to find the Ionic.Zip.dll +assembly. A typical series of steps to build a simple C++/CLI program +that uses DotNetZip from one source file, supposing the name of the +source file is CreateZipFile.cpp, is:

+ +
+  \vc9\bin\cl.exe /Od /FD /EHa /MDd  /Fo".\\"  -I\vc9\include /W3 /c /Zi /clr /TP
+      /FU "c:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll"
+      /FU Ionic.Zip.dll CreateZipFile.cpp
+
+  \vc9\bin\link.exe /OUT:CreateZipFile.exe  /DEBUG /ASSEMBLYDEBUG
+      /MANIFEST /MANIFESTFILE:"CreateZipFile.exe.intermediate.manifest"
+      /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
+      /PDB:CreateZipFile.pdb /DYNAMICBASE /FIXED:No /NXCOMPAT /MACHINE:X86
+      /LIBPATH:\vc9\lib /LIBPATH:\winsdk\lib CreateZipFile.obj
+
+  c:\netsdk2.0\Bin\mt.exe /outputresource:"CreateZipFile.exe;#1"
+      /manifest CreateZipFile.exe.intermediate.manifest
+
+ + + +

Create a zip file using AES encryption

+ +

This example creates a zipfile, using AES 128-bit +encryption to encrypt the entries. +

+ +
+
+#include "stdafx.h"
+
+using namespace System;
+using namespace Ionic::Zip;
+
+int main(array<System::String ^> ^args)
+{
+    Console::WriteLine(L"Hello World");
+
+    ZipFile ^ zip;
+    try
+    {
+        zip = gcnew ZipFile();
+        zip->Password = verySecret;
+        zip->Encryption = EncryptionAlgorithm::WinZipAes128;
+        zip->AddEntry("Readme.txt", "This is the content for the Readme.txt entry.");
+        zip->AddFile("Data.csv");
+        zip->Save("test.zip");
+    }
+    finally
+    {
+        zip->~ZipFile();
+    }
+
+    Console::WriteLine(L"Press <ENTER> to quit.");
+    Console::ReadLine();
+    return 0;
+}
+
+
+ + +

Use a SaveProgress event from C++

+ +

This example creates a zipfile, and uses a SaveProgress event. +

+ +
+
+
+#include "stdafx.h"
+
+using namespace System;
+using namespace System::IO;
+using namespace Ionic::Zip;
+
+
+public ref class DnzHelloCppCli
+{
+
+private:
+    bool justHadByteUpdate;
+
+public:
+    DnzHelloCppCli()
+        {
+        }
+
+public:
+    void Run()
+        {
+            Console::WriteLine(L"Hello World");
+            Console::WriteLine("Using DotNetZip version {0}", ZipFile::LibraryVersion);
+            array<String^>^ filesToAdd = System::IO::Directory::GetFiles(".", "*.cpp");
+
+            ZipFile ^ zip;
+            try
+            {
+                zip = gcnew ZipFile();
+                zip->Password = "Harbinger";
+                zip->Encryption = EncryptionAlgorithm::WinZipAes128;
+                zip->SaveProgress += gcnew EventHandler<SaveProgressEventArgs^>(this, &DnzHelloCppCli::SaveProgress);
+                zip->AddEntry("Readme.txt", "This is the content for the Readme.txt entry.");
+                zip->AddFiles(filesToAdd, "files");
+                zip->Save("MyArchive.zip");
+            }
+            finally
+            {
+                zip->~ZipFile();
+            }
+
+            Console::WriteLine(L"Press <ENTER> to quit.");
+            Console::ReadLine();
+            return;
+        }
+
+public:
+    void SaveProgress(Object^ sender, SaveProgressEventArgs^ e)
+        {
+            switch (e->EventType)
+            {
+                case ZipProgressEventType::Saving_Started:
+                {
+                    Console::WriteLine("Saving: {0}", e->ArchiveName);
+                    break;
+                }
+                case ZipProgressEventType::Saving_BeforeWriteEntry:
+                {
+                    if (this->justHadByteUpdate)
+                    {
+                        Console::WriteLine();
+                    }
+                    Console::WriteLine("  Writing: {0} ({1}/{2})",
+                                       e->CurrentEntry->FileName,
+                                       (e->EntriesSaved + 1),
+                                       e->EntriesTotal);
+                    this->justHadByteUpdate = false;
+                    break;
+                }
+                case ZipProgressEventType::Saving_AfterWriteEntry:
+                {
+                    if (e->CurrentEntry->InputStreamWasJitProvided)
+                    {
+                        e->CurrentEntry->InputStream->Close();
+                        e->CurrentEntry->InputStream = nullptr;
+                    }
+                    break;
+                }
+                case ZipProgressEventType::Saving_Completed:
+                {
+                    this->justHadByteUpdate = false;
+                    Console::WriteLine();
+                    Console::WriteLine("Done: {0}", e->ArchiveName);
+                    break;
+                }
+                case ZipProgressEventType::Saving_EntryBytesRead:
+                {
+                    if (this->justHadByteUpdate)
+                    {
+                        Console::SetCursorPosition(0, Console::CursorTop);
+                    }
+                    Console::Write("     {0}/{1} ({2:N0}%)",
+                                   e->BytesTransferred,
+                                   e->TotalBytesToTransfer,
+                                   (((double) e->BytesTransferred) / (0.01 * e->TotalBytesToTransfer)));
+                    this->justHadByteUpdate = true;
+                    break;
+                }
+            }
+        }
+
+};
+
+
+int main(array<System::String ^> ^args)
+{
+    try
+    {
+        DnzHelloCppCli^ me = gcnew DnzHelloCppCli();
+        me->Run();
+    }
+    catch (Exception^ ex1)
+    {
+        Console::Error->WriteLine(String::Concat("exception: ", ex1));
+    }
+    return 0;
+}
+
+
+ + + + diff --git a/dotNetZip/Help/Code Examples/Csharp.htm b/dotNetZip/Help/Code Examples/Csharp.htm new file mode 100644 index 0000000..d6ef6fa --- /dev/null +++ b/dotNetZip/Help/Code Examples/Csharp.htm @@ -0,0 +1,449 @@ + + +C# + + + + + + +

DotNetZip - C# Examples

+ +

Here are a bunch of examples in C# that illustrate how to use the library. +

+ +

There are a few complete, working example applications shipped in the source code distribution.

+ +
+

Create a zip file, and add items to it.

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.AddFile("ReadMe.txt");
+    zip.AddFile("Resume.doc");
+    zip.AddFile("Portrait.png");
+    zip.Save("Package.zip");
+  }
+
+ + +
+ +

Add items to a zip file, using Zip 2.0 encryption, and the same password for all items.

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.Password= "123456!";
+    zip.AddFile("ReadMe.txt");
+    zip.AddFile("7440-N49th.png");
+    zip.AddFile("2005_Annual_Report.pdf");
+    zip.Save("Backup.zip");
+  }
+
+ + +
+ +

Add files to a zip file, using Zip 2.0 encryption, and different passwords for different files.

+
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.AddFile("ReadMe.txt"); // no password for this one
+    zip.Password= "123456!";
+    zip.AddFile("7440-N49th.png");
+    zip.Password= "!Secret1";
+    zip.AddFile("2005_Annual_Report.pdf");
+
+    zip.Save("Backup.zip");
+  }
+
+ + +

Create a zip archive, and add files to it, using WinZip-compatible AES 256-bit encryption for one of the files.

+
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.AddFile("ReadMe.txt"); // no password for this one
+    zip.Password= "Cool.Hand.Luke!";
+    zip.Encryption= EncryptionAlgorithm.WinZipAes256;
+    zip.AddFile("Rawdata-2008-12-18.csv");
+    zip.Save("Backup-AES-Encrypted.zip");
+  }
+
+ + + +
+ +

+Create a zip, and add a file, telling the library to not use compression +when adding in the file. This makes sense with previously-compressed +files such as those in .mp3 format. The Deflate algorithm can actually +increase the size of a data stream that has already been compressed. +The DotNetZip library intelligently turns off compression for those +files that get bigger with compression, but the ForceNoCompression +property allows you to do it explicitly. +

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.ForceNoCompression = true;
+    zip.AddFile(@"MyMusic\Handel\Messiah-01.mp3");
+    zip.Save(ZipFileToCreate);
+  }
+
+ + + +
+ +

Zip up an entire directory, recursively. Use unicode to encode +entries in the archive, for those files in that directory tree that have +characters outside the ANSI range. Finally, specify a comment on the +zip archive when creating it. (Be careful using Unicode - it is not +widely supported by other zip utilities)

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.UseUnicode= true;  // utf-8
+    zip.AddDirectory(@"MyDocuments\ProjectX");
+    zip.Comment = "This zip was created at " + System.DateTime.Now.ToString("G") ;
+    zip.Save(ZipFileToCreate);
+  }
+
+ + + +
+ +

Zip up an entire directory, recursively. Use the "big5" encoding for +those files in that directory tree that have +chinese characters. +

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.Encoding = System.Text.Encoding.GetEncoding("big5"); // chinese
+    zip.AddDirectory(@"MyDocuments\ProjectX");
+    zip.Save(ZipFileToCreate);
+  }
+
+ + + +
+ +

Zip up an file, using the ZIP64 extensions if necessary to support large files. +

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.UseZip64WhenSaving = Zip64Option.AsNecessary;
+    zip.AddFile(@"RawData-HugeFile-13800.dat");
+    zip.Save(ZipFileToCreate);
+  }
+
+ + + +
+ +

Zip up a set of files, each protected by the same password. Also, +explicitly override the last modified time for all of the files as they are stored +in the zip archive.

+ +
+
+
+ +

Zip up a set of files and directories, and re-map them into a +different directory hierarchy in the zip file.

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    // files in the filesystem like MyDocuments\ProjectX\File1.txt , will be stored in the zip archive as  backup\File1.txt
+    zip.AddDirectory(@"MyDocuments\ProjectX", "backup");
+    // files in the filesystem like MyMusic\Santana\OyeComoVa.mp3, will be stored in the zip archive as  tunes\Santana\OyeComoVa.mp3
+    zip.AddDirectory("MyMusic", "tunes");
+    // The Readme.txt file in the filesystem will be stored in the zip archive as documents\Readme.txt
+    zip.AddDirectory("Readme.txt", "documents");
+
+    zip.Comment = "This zip was created at " + System.DateTime.Now.ToString("G") ;
+    zip.Save(ZipFileToCreate);
+  }
+
+ +
+ +

Add content obtained from a stream (MemoryStrean, FileStream, etc) +into a zip archive. Also, add a comment to the entry that was added from +the stream.

+ +
+  using (ZipFile zip = new ZipFile())
+  {
+    ZipEntry e= zip.AddEntry("Content-From-Stream.bin", StreamToRead);
+    e.Comment = "The content for entry in the zip file was obtained from a stream";
+    zip.AddFile("Readme.txt");
+    zip.Save(ZipToCreate);
+  }
+
+ + +
+ +

Open an existing zip file, remove an entry from it, and save the archive. This was first supported in v1.5 of the library.

+
+  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
+  {
+    // use the indexer to remove the file from the zip archive
+    zip["Readme.txt"] = null;
+    zip.Comment = "This archive has been modified from its original version. Some files have been removed.";
+    zip.Save();
+  }
+
+ + +
+ +

Open an existing zip file, rename an entry, then save it. This was first supported in v1.7 of the library.

+
+ int renameCount = 0;
+ using (ZipFile zip2 = ZipFile.Read(ExistingZipFile))
+ {
+    foreach (ZipEntry e in zip2)
+    {
+      if (e.FileName.EndsWith(".txt"))
+      {
+         var newname = "renamed_files\\" + e.FileName;
+
+         e.FileName = newname;
+         e.Comment = "renamed";
+         renameCount++;
+      }
+    }
+    zip2.Comment = String.Format("This archive has been modified. {0} files have been renamed.", renameCount);
+    zip2.Save();
+ }
+
+ + +
+ +

Extract all files from a zip archive:

+
+  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
+  {
+    foreach (ZipEntry e in zip)
+    {
+      e.Extract(TargetDirectory);
+    }
+  }
+
+ + +
+ +

The default behavior of extraction is to NOT overwrite existing +files. In this example, the app Extracts all files, and overwrites +existing files in the filesystem:

+ +
+  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
+  {
+    foreach (ZipEntry e in zip)
+    {
+      e.Extract(TargetDirectory, true);  // overwrite == true
+    }
+  }
+
+ + +
+

Extract an entry from the zip archive into a previously-opened stream:

+ +
+  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
+  {
+    ZipEntry e = zip["MyReport.doc"];
+    e.Extract(OutputStream);
+  }
+
+ +
+ +

Extract an Entry that was encrypted with a password, into the +specified base directory:

+ +
+  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
+  {
+    ZipEntry e = zip["TaxInformation-2008.xls"];
+    e.ExtractWithPassword(BaseDirectory, Password);
+  }
+
+ +
+ +

List all the entries in a zip file:

+ +
+  using (ZipFile zip = ZipFile.Read(ExistingZipFile))
+  {
+    foreach (ZipEntry e in zip)
+    {
+      if (header)
+      {
+        System.Console.WriteLine("Zipfile: {0}", zip.Name);
+        if ((zip.Comment != null) && (zip.Comment != ""))
+          System.Console.WriteLine("Comment: {0}", zip.Comment);
+        System.Console.WriteLine("\n{1,-22} {2,8}  {3,5}   {4,8}  {5,3} {0}",
+                                 "Filename", "Modified", "Size", "Ratio", "Packed", "pw?");
+        System.Console.WriteLine(new System.String('-', 72));
+        header = false;
+      }
+      System.Console.WriteLine("{1,-22} {2,8} {3,5:F0}%   {4,8}  {5,3} {0}",
+                               e.FileName,
+                               e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"),
+                               e.UncompressedSize,
+                               e.CompressionRatio,
+                               e.CompressedSize,
+                               (e.UsesEncryption) ? "Y" : "N");
+
+    }
+  }
+
+ +
+ +

Read in zip archive content from a stream, and extract the content +for one entry to another stream. In this example, the filename +"NameOfEntryInArchive.doc", refers only to the name of the entry within +the zip archive. A file by that name is not created in the +filesystem. The I/O is done strictly with the given streams.

+ +
+  using (ZipFile zip = ZipFile.Read(InputStream))
+  {
+    zip.Extract("NameOfEntryInArchive.doc", OutputStream);
+  }
+
+ +
+ +

Create a zip dynamically within an ASP.NET postback method, then +download that zipfile to the requesting browser through +Response.OutputStream. This works in DotNetZip v1.5 and later.

+ +
+public void btnGo_Click (Object sender, EventArgs e)
+{
+  Response.Clear();
+  String ReadmeText= "This is a zip file dynamically generated at " + System.DateTime.Now.ToString("G");
+  string filename = System.IO.Path.GetFileName(ListOfFiles.SelectedItem.Text) + ".zip";
+  Response.ContentType = "application/zip";
+  Response.AddHeader("content-disposition", "filename=" + filename);
+
+  using (ZipFile zip = new ZipFile())
+  {
+    zip.AddFile(ListOfFiles.SelectedItem.Text, "files");
+    zip.AddStringAsFile(ReadmeText, "Readme.txt", "");
+    zip.Save(Response.OutputStream);
+  }
+
+  Response.End();
+}
+
+ +
+

Create a zip with a single entry, obtaining the content for that entry +from a string. Attach a comment to that entry. Specify the name of the zip file at the time of +save.

+ +
+  string content = "......whatever....";
+  using (ZipFile zip = new ZipFile())
+  {
+    ZipEntry e = zip.AddEntry("README.txt", content);
+    e.Comment = "This entry in the zip archive was created from a string.";
+    zip.Save("archive-2008july12.zip");
+  }
+
+ +
+ +

Open an existing zip archive and modify it: update one entry, +remove another, and rename a third. Update the comment on the archive as well.

+ +
+  using (ZipFile zip = ZipFile.Read("ExistingArchive.zip"))
+  {
+    ZipEntry e = zip["README.txt"];
+    e.RemoveEntry();
+
+    // for this entry, update the archive  with content from the filesystem
+    zip.UpdateItem("Portfolio.doc");
+
+    // update the filename of an entry
+    e = zip["Table1.jpg"];
+    e.FileName = "Figure1.jpg";
+
+    zip.Comment = "This zip archive was updated " + System.DateTime.ToString("G");
+    zip.Save();
+  }
+
+ + + diff --git a/dotNetZip/Help/Code Examples/Powershell.htm b/dotNetZip/Help/Code Examples/Powershell.htm new file mode 100644 index 0000000..b7638bd --- /dev/null +++ b/dotNetZip/Help/Code Examples/Powershell.htm @@ -0,0 +1,99 @@ + + +Powershell + + + + + + +

You can use DotNetZip from Powershell

+ +

The programming model is the same as for VB or C#, with a few syntactic changes for Powershell. +This page will show some examples. +

+ + +
+ +

Create a zip file

+ +

This example just creates a simple zipfile +

+ + +
+
+# Load the assembly - replace this with your own path
+[System.Reflection.Assembly]::LoadFrom("c:\\dinoch\\bin\\Ionic.Zip.dll");
+
+$directoryToZip = "c:\\temp";
+$zipfile =  new-object Ionic.Zip.ZipFile;
+$e= $zipfile.AddEntry("Readme.txt", "This is a zipfile created from within powershell.")
+$e= $zipfile.AddDirectory($directoryToZip, "home")
+$zipfile.Save("ZipFiles.ps1.out.zip");
+$zipfile.Dispose();
+
+ + +

Create a zip file using AES encryption

+ +

This example creates a zipfile, using AES 256-bit +encryption to encrypt the entries. +

+ +
+
+# Load the assembly - replace this with your own path
+[System.Reflection.Assembly]::LoadFrom("c:\\dinoch\\bin\\Ionic.Zip.dll")
+
+$directoryToZip = "c:\\dinoch\\dev\\powershell"
+$zipfile =  new-object Ionic.Zip.ZipFile
+$zipfile.Encryption = [Ionic.Zip.EncryptionAlgorithm]::WinZipAes256
+$zipfile.Password = "Albatros$"
+$e= $zipfile.AddEntry("Readme.txt", "This is a zipfile created from within powershell.")
+$e= $zipfile.AddSelectedFiles("name != *.zip", $directoryToZip, "home")
+$zipfile.Save("ZipFiles.ps1.out.zip")
+$zipfile.Dispose()
+
+
+ + + +

Create a number of zip files, each containing a single file

+ +

This example iterates through a set of files, and creates a +zipfile containing a single file, for each one. +

+ +
+
+# Load the assembly - replace this with your own path
+[System.Reflection.Assembly]::LoadFrom("c:\\dinoch\\bin\\Ionic.Zip.dll");
+
+foreach ($file in gci $LogPath -filter $FileType -recurse |
+        where{$_.LastWriteTime -lt [DateTime]::Now.AddDays($DaysOld)})
+{
+    $FileName = $File.FullName
+    $ZipName = $File.FullName + ".zip"
+    $zip = new-object Ionic.Zip.ZipFile
+    $zip.AddFile($FileName, "");
+    $zip.Save($ZipName)
+    $zip.Dispose()
+}
+
+ + + diff --git a/dotNetZip/Help/Code Examples/VB.htm b/dotNetZip/Help/Code Examples/VB.htm new file mode 100644 index 0000000..517e241 --- /dev/null +++ b/dotNetZip/Help/Code Examples/VB.htm @@ -0,0 +1,319 @@ + + +VB.NET + + + + + + +

DotNetZip - VB.NET Examples

+ +

Here are a bunch of examples in VB.NET showing how to use the library. +

+ +

There are also a few complete, working example applications shipped in the source code distribution.

+ +
+

Add items to a zip file:

+ +
+ Try
+     Using zip As ZipFile = New ZipFile
+         zip.AddFile("c:\photos\personal\7440-N49th.png", "")
+         zip.AddFile("c:\Desktop\2005_Annual_Report.pdf", "")
+         zip.AddFile("ReadMe.txt")
+         zip.Save("MyZipFile.zip")
+     End Using
+ Catch ex1 As Exception
+     Console.Error.WriteLine("exception: {0}", ex1.ToString)
+ End Try
+
+ + +
+

Extract items from a zip file:

+ +
+ Try
+     Using zip As ZipFile = ZipFile.Read(ZipFileToExtract)
+        Dim e As ZipEntry
+        For Each e In zip
+            e.Extract
+        Next
+     End Using
+ Catch ex1 As Exception
+     Console.Error.WriteLine("exception: {0}", ex1.ToString)
+ End Try
+
+ + +
+

Extract all entries, and set the StatusMessageTextWriter so that verbose messages are generated:

+ +
+Using zip As  ZipFile = ZipFile.Read(FilePath)
+  zip.StatusMessageTextWriter= System.Console.Out
+  'Status Messages will be sent to the console during extraction
+  zip.ExtractAll()
+End Using
+
+ + + +
+

Add a few files to a zip file, specifying different passwords for different items:

+ +
+Try
+  Using zip As New ZipFile
+    'the first entry is not protected by a password
+    zip.AddFile("c:\datafiles\ReadMe.txt", "")
+    zip.Password = "123456!"
+    zip.AddFile("c:\photos\personal\7440-N49th.png", "images")
+    zip.Password= "!Secret1";
+    zip.AddFile("c:\Desktop\2005_Annual_Report.pdf", "files\documents")
+    zip.Save("Secret.zip")
+  End Using
+Catch ex1 As System.Exception
+  System.Console.Error.WriteLine("exception: {0}", ex1)
+End Try
+
+ +
+

Add a few files to a zip file, using WinZip-compatible AES encryption on the entries:

+ +
+Try
+  Using zip As New ZipFile
+    zip.Password = "The.Silvertones.Box.Set!"
+    zip.Encryption = EncryptionAlgorithm.WinZipAes256
+    zip.AddFile("c:\datafiles\RawData-2008-12-20.csv", "")
+    zip.AddFile("c:\photos\personal\7440-N49th.png", "images")
+    zip.AddFile("c:\Desktop\2005_Annual_Report.pdf", "files\documents")
+    zip.Save("AES-Encrypted-Secret.zip")
+  End Using
+Catch ex1 As System.Exception
+  System.Console.Error.WriteLine("exception: {0}", ex1)
+End Try
+
+ + +
+

Extract entries using a password:

+ +
+Using zip As new ZipFile(FilePath)
+    Dim e As ZipEntry
+    For Each e In zip
+        If (e.UsesEncryption)
+          e.ExtractWithPassword("Secret!")
+        Else
+          e.Extract
+        End If
+    Next
+End Using
+
+ + +
+

This example creates a zip using ZIP64 extensions. ZIP64 allows you to exceed 4gb in a zip, or 65535 entries in a zip.

+ +
+ Try
+     Using zip As ZipFile = New ZipFile
+         zip.UseZip64WhenSaving = Zip64Option.AsNecessary
+         zip.AddFile("c:\datafiles\RawData-2009-02-12.csv", "")
+         zip.AddFile("ReadMe.txt")
+         zip.Save(String.Format("backup-{0}.zip", DateTime.Now.ToString("yyyyMMMdd")))
+     End Using
+ Catch ex1 As Exception
+     Console.Error.WriteLine("exception: {0}", ex1.ToString)
+ End Try
+
+ + + + +
+ +

Create a zip file, add a file, and also add an entry from a +string. When the zip is unzipped, the content from the string will be +inserted into the file "Readme.txt".

+ +
+Dim Content As String = "This string will be the content of the Readme.txt file in the zip archive."
+Using zip1 As ZipFile = New ZipFile
+    zip1.AddEntry("Readme.txt", "This is the readme content...")
+    zip1.AddFile("MyDocuments\Resume.doc", "files")
+    zip1.Comment = ("This zip file was created at " & DateTime.Now.ToString("G"))
+    zip1.Save("Content.zip")
+End Using
+
+ +
+ +

Create a zip file, and add an entry taking content from a stream, like a MemoryStream or a FileStream. +

+ +
+Dim Content As String = "This string will be the content of the Readme.txt file in the zip archive."
+Using zip1 As ZipFile = New ZipFile
+    zip1.AddEntry("Readme.txt", stream)
+    zip1.AddFile("MyDocuments\Resume.doc", "files")
+    zip1.Comment = ("This zip file was created at " & DateTime.Now.ToString("G"))
+    zip1.Save("Content.zip")
+End Using
+
+ + + +
+

Read in a zip file, remove a few entries, save the file:

+ +
+Dim sw As New System.IO.StringWriter
+Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip", sw)
+    Dim Threshold As New DateTime(2007, 7, 4)
+    ' We cannot remove the entry from the list, within the context of
+    ' an enumeration of said list.
+    ' So we add the doomed entry to a list to be removed later.
+    ' pass 1: mark the entries for removal
+    Dim MarkedEntries As New System.Collections.Generic.List(Of ZipEntry)
+    Dim e As ZipEntry
+    For Each e In zip
+        If (e.LastModified < Threshold) Then
+            MarkedEntries.Add(e)
+        End If
+    Next
+    ' pass 2: actually remove the entry.
+    Dim zombie As ZipEntry
+    For Each zombie In MarkedEntries
+        zip.RemoveEntry(zombie)
+    Next
+    zip.Comment = "This archive has been updated."
+    zip.Save
+End Using
+
+ + + +
+

Add a bunch of items, whether files or directories:

+ +
+Dim itempaths As String() = _
+  New String() { "c:\temp\Readme.txt", _
+                 "MyProposal.docx", _
+                 "SupportingFiles", _
+                 "images\Image1.jpg" }
+Try
+    Using zip As New ZipFile(ZipToCreate, Console.Out)
+        Dim i As Integer
+        For i = 1 To itempaths.Length - 1
+            ' will add Files or Dirs, recursing and flattening subdirectories.
+            zip.AddItem(itempaths(i), "flat")
+        Next i
+        zip.Save
+    End Using
+Catch ex1 As Exception
+    Console.Error.WriteLine("exception: {0}", ex1.ToString())
+End Try
+
+ + +
+

Create a self-extracting archive:

+ +
+Dim DirectoryPath As String = "c:\Documents\Project7"
+Using zip As New ZipFile()
+    zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath))
+    zip.Comment = "This will be embedded into a self-extracting console-based exe"
+    zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication)
+End Using
+
+ + + +
+

Update some entries in a Zip file:

+ +
+Using zip1 As New ZipFile
+    ' the UpdateFile method works even if the entry does not yet exist.
+    ' Really it should be called "AddOrUpdateFile"
+    zip1.UpdateFile("MyDocuments\Readme.txt", "")
+    zip1.UpdateFile("CustomerList.csv", "")
+    zip1.Comment = "This zip archive has been created."
+    zip1.Save("Content.zip")
+End Using
+
+Using zip2 As ZipFile = ZipFile.Read("Content.zip")
+    zip2.UpdateFile("Updates\Readme.txt", "")
+    zip2.Comment = "This zip archive has been updated: the Readme has been changed."
+    zip2.Save
+End Using
+
+ + + +
+ +

Produce a zip file that contains embedded zip files.

+ +
+
+Public Sub Run()
+    Using s1 As Stream = ZipIntoMemory("c:\temp\dir1")
+        Using s2 As Stream = ZipIntoMemory("c:\temp\dir2")
+            Using zip1 as New ZipFile
+                zip1.AddEntry("test1.zip", s1)
+                zip1.AddEntry("test2.zip", s2)
+                ' save to a file.  Could also save to a stream here
+                zip1.Save("Tescher.zip")
+            End Using
+        End Using
+    End Using
+End Sub
+
+Public Function ZipIntoMemory(ByVal path As String) As Stream
+    Dim ms As New MemoryStream
+    Using zip1 as New ZipFile
+        zip1.AddDirectory(path, "Result")
+        zip1.Save(ms)
+    End Using
+    ' move the stream position to the beginning
+    ms.Seek(0,SeekOrigin.Begin)
+    Return ms
+End Function
+
+
+ + + + + diff --git a/dotNetZip/Help/HelpViewer.shfbproj b/dotNetZip/Help/HelpViewer.shfbproj new file mode 100644 index 0000000..a5123b3 --- /dev/null +++ b/dotNetZip/Help/HelpViewer.shfbproj @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + 2.0 + {f0d56889-aa19-4331-b4f0-2bfe3e970a4f} + 1.9.0.0 + + Documentation + Documentation + Documentation + + .\bin\HelpViewer + DotNetZipLib-v1.9.1.6 + DotNetZip is a small, easy-to-use class library for manipulating .zip files. It can enable .NET applications written in VB.NET, C#, any .NET language, to easily create, read, and update zip files. DotNetZip is donationware: http://cheeso.members.winisp.net/DotNetZipDonate.aspx + Summary, Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter + InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected + + + c:\Program Files (x86)\Common Files\microsoft shared\Help 2.0 Compiler\ + + + + + 3.0 + Ionic Zip Library v1.9.1.6 + dpchiesa%40hotmail.com + Prototype + + + + + + + The Ionic namespace includes supporting classes used in the DotNetZip library. + Classes in the Ionic.Zip namespace allow applications to read and write zip files according to the format +described by pkware, at: +http://www.pkware.com/business_and_developers/developer/popups/appnote.txt. + +This implementation utilizes a DeflateStream class implemented in managed code, in the Ionic.Zlib namespace. It does not use System.IO.Compression.DeflateStream in the .NET Framework +v2.0 base class library. + +DotNetZip is donationware. Please donate. Proceeds go to the Boys &amp; Girls Club in Pennsylvania, USA. http://cheeso.members.winisp.net/DotNetZipDonate.aspx + Ionic.Zlib namespace includes classes for doing ZLIB, DEFLATE, and GZIP compression and decompression, according to RFC 1950, RFC 1951, and RFC 1952. It includes stream classes that can directly replace the DeflateStream and GZipStream classes that are included in the Base Class Library of the .NET Framework. + + Copyright 2009-2011, Dino Chiesa + True + Reference + MSHelpViewer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Help/HtmlHelp1.shfbproj b/dotNetZip/Help/HtmlHelp1.shfbproj new file mode 100644 index 0000000..0d89d01 --- /dev/null +++ b/dotNetZip/Help/HtmlHelp1.shfbproj @@ -0,0 +1,94 @@ + + + + Debug + AnyCPU + 2.0 + {b4390741-ad2c-41f3-9c33-937bd218b91c} + 1.9.0.0 + + Documentation + Documentation + Documentation + + .\bin\HtmlHelp1 + DotNetZipLib-v1.9.1.6 + DotNetZip is a small, easy-to-use class library for manipulating .zip files. It can enable .NET applications written in VB.NET, C#, any .NET language, to easily create, read, and update zip files. DotNetZip is donationware: http://cheeso.members.winisp.net/DotNetZipDonate.aspx + Summary, Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter + InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected + + + c:\Program Files (x86)\Common Files\microsoft shared\Help 2.0 Compiler\ + + + + + 3.0 + Ionic Zip Library v1.9.1.6 + dpchiesa%40hotmail.com + Prototype + + + + + + +The Ionic namespace includes supporting classes used in the DotNetZip library. +<para>Classes in the Ionic.Zip namespace allow applications to read and write zip files according to +<see href='http://www.pkware.com/business_and_developers/developer/popups/appnote.txt.'>the format +described by PKWARE</see> +</para> +<para> +DotNetZip is donationware. <see href='http://cheeso.members.winisp.net/DotNetZipDonate.aspx'>Please donate.</see></para> +Ionic.Zlib namespace includes classes for doing ZLIB, DEFLATE, and GZIP compression and decompression, according to RFC 1950, RFC 1951, and RFC 1952. It includes stream classes that can directly replace the DeflateStream and GZipStream classes that are included in the Base Class Library of the .NET Framework. +The Ionic.BZip2 namespace includes classes for doing BZip2 compression and decompression, according to the BZip2 specification provided by Julian Seward. +The Ionic.Crc namespace includes a classes that calculate 32-bit Cyclic Redundancy Checks (CRC32) for data. + Copyright 2009-2011, Dino Chiesa + True + Reference + HtmlHelp1, Website + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip Full DLL + + + + + \ No newline at end of file diff --git a/dotNetZip/Help/Introduction/About.htm b/dotNetZip/Help/Introduction/About.htm new file mode 100644 index 0000000..9f0796d --- /dev/null +++ b/dotNetZip/Help/Introduction/About.htm @@ -0,0 +1,422 @@ + + +About DotNetZip + + + + + + + +

DotNetZip - Zip file manipulation in .NET languages

+ + +

+ DotNetZip is a small, easy-to-use class library for manipulating .zip files. It + can enable .NET applications written in VB.NET, C#, or any .NET language, to + easily create, read, and update zip files. Zip Compression is easy with + DotNetZip. The DotNetZip project also includes a library for performing ZLIB, + Deflate, or GZIP compression and decompression, a library for BZip2 compression + and decompression, a GUI ZIP tool, and a few command line tools. +

+ + +

+ DotNetZip works on Windows-powered PCs with the full .NET Framework, and also runs + on Windows Mobile devices that use the .NET Compact Framework. Create and read zip + files in VB, C#, or any .NET language. The library can also be used from COM + enironments, like PHP, Classivc ASP, or VBSCript. DotNetZip supports these + scenarios: +

+
    +
  • creating a zip archive, adding files or directories into the archive
  • +
  • listing files in an archive, extracting files from an archive
  • +
  • modifying an existing archive - renaming entries, removing entries from an archive, or adding new entries to an archive
  • +
  • creating zip files from stream content, saving to a stream, extracting to a stream, reading from a stream
  • +
  • dynamically creating ZIP files from ASP.NET or Silverlight applications
  • +
+ + +

+ If all you want is a better DeflateStream or GZipStream class to replace the one + that is built-into the .NET BCL, that is here, too. DotNetZip's DeflateStream + and GZipStream are available in a standalone assembly, based on a .NET port of + Zlib. These streams support compression levels and deliver much better performance + that the built-in classes. There is also a ZlibStream to complete the set (RFC + 1950, 1951, 1952). +

+ +

+ This 100% managed code library can be used in any .NET application - Console, + Winforms, WPF, ASP.NET, Sharepoint, Web services apps, Powershell scripts, and so + on. It produces zip files that are fully interoperable with Windows Explorer, as + well as Java applications, apps running on Linux. +

+ +

+ It is designed to be simple and easy to use. DotNetZip is packaged as a single + DLL, about 400k in size. It has no third-party dependencies. It is Medium Trust, + so can be used on most hosters. Get zipping just by referencing the DLL. The + library supports zip passwords, Unicode, ZIP64, stream input and output, AES + encryption, multiple compression levels, self-extracting archives, and more. +

+ +

+ The release includes the library, as well as some sample applications (with + source) showing how to use the library. +

+ + +

DotNetZip is DonationWare

+ +

If you find DotNetZip useful, consider donating. I am now accepting +donations on behalf of my favorite charity. and Yes, it is a real +charity.

+ + +

Example Usage

+
+  using (ZipFile zip = new ZipFile("MyZipFile.zip")
+  {
+    zip.AddFile("c:\\images\\personal\\7440-N49th.png");
+    zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf");
+    zip.AddFile("ReadMe.txt");
+    zip.Save();
+  }
+
+ +

Tons more examples on Codeplex, +and later in this helpfile.

+ + + +

Frequently Asked Questions

+ +

How does this Zip Library work?
+DotNetZip is packaged as a single DLL, a single assembly. It is fully +managed code, written in C#, and provides support for reading and +writing Zip archive files and streams. The main type is ZipFile, +featuring methods like Add(), Extract() and Save(). There are string and +int indexers for the entries of the ZipFile. There are properties for +things like password protection, unicode and codepage support, and ZIP64 +behavior. And there are progress events for Reading, Saving, and +Extracting. +

+ + +

What do I need, in order to be able to create and read zip files from within my application using this library?
+To use the zip capability in your applications, you need to be using the .NET Framework 2.0 or later, and you need the DotNetZip assembly. You can use the Zip library from any application, whether a console application, a Windows-Forms application, a server-based application like an ASP.NET page, or something else. You can use C#, VB.NET, COBOL.NET, IronPython, IronRuby, F#, or any other .NET language.

+ +

What do I need to build this library from the source?
+ +To use the zip capability in your applications, you need to be using the +.NET Framework 2.0 or later, and you need the DotNetZip assembly. You +can use the Zip library from any application, whether a console +application, a Windows-Forms application, a server-based application +like an ASP.NET page, a smart-device app, a Windows Service, or +something else. You can use C#, VB.NET, COBOL.NET, IronPython, +IronRuby, F#, or any other .NET language. You can use the full version +of Visual Studio, or one of the Visual Studio Express tools, or just a +text editor. + +

+ + + +

What if I just want to use the graphical tool?
+ +No problem. Just download the Utils download from the latest releases +tab, and you will get an easy-to-use fully-functional ZIP creation and +extraction tool, a free functional-equialent replacement for WinZip. It +supports all the DotNetZip capability, like SFX, AES, ZIP64, arbitrary +Code Pages, Unicode, zip comments, file and entry selection, and more. +

+ + + +

What do I need to _build_ this library from the source?f
+ +You need the .NET Framework SDK v3.5, or later; or, Visual Studio 2008 +or later. While the library is usable by .NET 2.0 and later, to build +it you need .NET 3.5 or later. This is because the source code uses +features that were introduced in the C# v3.0 compiler, vars and array +initializers and so on. The .NET 3.5 SDK is available +here. +I don't know if the library will _build_ in Visual C# Express 2008; I +never tried it. It should. + +

+ + + +

How big is the library?
+ +As of version 1.9, the Ionic zip DLL is about 420k in size. The +self-extracting capability comprises about 200k of that. There is a "Reduced" build of the +library in the Developer's Kit, that eliminates the SFX capability and results in a DLL of about half the size. The +Compact-Framework version of the library is about 130k. There is just +one DLL. There is no other pre-requisite. +

+ + +

Why would you want to produce yet another Zip Library?
+ +There are a number of options in the .NET world for manipulating zip +files. Some are commercial libraries, some are open-source. You can +even shoe-horn the System.IO.Packaging API, which is included in .NET +3.0, into a zip library. But there are tradeoffs for all of them. Some +people are willing to give up commercial support for a lower price. +Some people don't like the GPL. Some of those other packages are +complex to use for zip files. Some of them don't have enough features +(Eg, AES encryption, ZIP64). Some are too slow. What I found is that +most people want something simple and easy to use, that works well, has +good features, compresses effectively and fast, and is the right price. +DotNetZip is that option. It's fast, it's simple, it's free. + +

+ + + +

Does this library make self-extracting zip files?
+ +Yes. It can make self-extracting zip files or standard zip files. The +self-extracting archives can either be Windows (GUI) apps or +command-line applications. The self-extractors require .NET 2.0 on the +computer doing the extraction.

+ + + +

Does this library read self-extracting zip files?
+ +Yes. As of v1.7, DotNetZip can read self-extracting zip files generated by +WinZip. As of v1.8 (currently in preview), DotNetZip can read SFX +archives generated by itself. DotNetZip does not (yet) read SFX +archives built by some other tools. I've not tested it. + +

+ + +

Are the zip files this library makes compatible with the java.util.zip classes in the Java class library?
+ +Yes. This library makes standard zip files. If you use some advanced +features not supported by the built-in Java library, like AES encryption +or ZIP64, then the zip files won't be readable by Java. This is a +shortcoming in Java, not in DotNetZip. + +

+ +

If I create a zipfile with this library, can I open it from within a Java/PHP/Python/C/Perl application? From within WinRar/WinZIP?
+ +Yes. This library makes standard zip files, so anything that can read +and write zip files, on any platform, can work with zipfiles generated +from this library. In Java, you would use the java.util.zip library. In +Python, you would use the zipfile module. Keep in mind that not all +languages and environments support all ZIP features. For example, +currently the Java library does not do ZIP64, and the zipfile module in +Python does not support zipfile comments, while DotNetZip can create and +read zip archives using those features. You need to be careful with +interop testing. If you don't know what these features are, you probably +don't need them and you won't run into interop problems. + +

+ + +

If I create a zipfile with a java/PHP/Python/C/Perl application, or with WinRar/WinZip/7zip, can I open it from within a .NET application, using this library?
+ +Yes. This library reads compliant zip files. +

+ + +

Can I use Windows Explorer to open the zip files that this library creates, and vice versa?
+ +Yes. This library reads and writes standard zip files. If you use extensions to the ZIP spec not supported by Windows, like ZIP64 or AES encryption, Windows Explorer will not be able to extract the files. + +

+ + +

Does the library work with applications that depend on the .NET Compact Framework?
+ +Yes. DotNetZip is built for the .NET Compact Framework (v2.0 or later) as well as for the regular .NET Framework (v2.0 or later). This means you can build a Smart Device application in Visual Studio 2008, that uses the capabilities of DotNetZip. + +

+ +

Does the library support zero-length zip entries, zipfile comments, zip entry comments, zipping up empty directories, recursive directory traversal, zipping up selected files by filename (with wildcards), and password-protecting entries?
+Yes.

+ + + +

Does the library handle ZIP64?
+ +Yes. This was added in December 2008 in v1.7. The original ZIP +specification allowed up to 65535 entries in a zip archive, and archive +and entry sizes up to 4.2g. The ZIP64 extensions raise those +restrictions, at the expense of compatibility and +interoperability. DotNetZip can read or write "standard" zip files or +ZIP64 zip files. +

+ +

Does this library support any compression algorithm other than deflate?
+ +No. Entries are either Stored or Deflated. +

+ +

Does this library use System.IO.Compression.DeflateStream for the DEFLATE algorithm?
+ +No. In earlier versions, it did. But the DeflateStream built-into the +.NET Framework BCL exhibits anomalous compression behavior on previously +compressed data, like mp3 or jpg files. DotNetZip includes a managed +compression library, based on ZLIB. It's fast, fully DEFLATE compliant, +and it compresses better than the built in version! And, the +DeflateStream that is included in DotNetZip is available for any +application to use, under the same terms as the rest of the DotNetZip +library. +

+ + + + +

Why would a developer not just use the Packaging APIs included in the .NET Framework 3.0?
+ +The Packaging APIs are optimized for producing .docx files and .xlsx +files. This library is generally simpler and cleaner for creating or +reading plain, generic zipfiles. Also this library takes advantage of +ZIP features like ZIP64 or AES, in a much nicer way. And it provides +nice features like progress events and file selectors. +

+ +

Does the library support reading or writing encrypted or password protected zip files?
+ +Yes, this library helps applications read and write zip files that use +passwords to protect the entries in the zip archive. Either PKZIP +("weak") encryption or WinZip-compatible AES encryption. +

+ +

Can Windows Explorer ("compressed folders") read and extract the zip files created by this library if the zip has password protection?
+ +Yes. It just works. +

+ + +

Can I use the DotNetZip library to read .docx files, .xslx files?
+Yes. They are just zip files. Keep in mind, the Packaging APIs included in .NET 3.0 are optimized for producing .docx files and .xlsx files.

+ + +

Does the library support Unicode filenames and comments?
+Yes, as of September 2008, the library can create and read zip files +that have Unicode (UTF-8) filenames and comments. You can also specify +arbitrary code pages when reading or writing zipfiles. But, Windows +Explorer does not support UTF-8 encoded zip files. To read the zip you +create, you will have to use a tool or library that supports unicode, +such as WinRar, DotNetZip, etc.

+ + +

Can the library be used to read a zip file that has entries with filenames containing Chinese characters, as produced by WinRAR?
+Yes. To do this you would specify the "big5" code page (cp 950) when reading the zip. In addition to Chinese, it can handle any code page. +

+ +

What about reading and writing zip files with other languages and code pages? Portugese? Hebrew? Arabic? Greek? Cyrillic? Norwegian? Finnish? etc?
+ +Yes. Just specify the appropriate code page when reading or writing the +zip archive. +

+ + + + + +

Can Windows Explorer ("compressed folders") read the zip files created by this library if the zip has entries with Unicode-encoded filenames?
+No. But that is a limitation of Windows XP and Windows Vista. It is not a limitation of this library.

+ +

Is there documentation for the library?
+Yes, there is a CHM file in MSDN helpfile format, generated from the xml comments in the code. All the public interfaces are thoroughly documented. There are tons of code examples in the doc. +

+ + + +

Does the library support zipping to a stream? Or unzipping from a stream?
+ +Yes, you can zip up files and Save the zip archive to a stream. As well +you can Read a zip archive from an open stream - I use this for embedded +resources in apps: I call GetManifestResourceStream(), and then unzip +that resource. Reading and writing streams complements the capability of +being able to Save to a plain file or read from a plain file. The +Save-to-a-stream capability allows you to write a zip archive out to, +for example, the ASP.NET Response.Output stream, without creating an +intermediate file. Very nice for ASP.NET applications. +

+ +

Ok, the library can write a zip archive to a stream, and read a zip from a stream, But... can the library add an entry to a zipfile, grabbing content from a stream? can the library unzip a single entry into a stream? Can an application read an entry as a stream?
+ +Yes. Yes. Yes. Unlike some other libraries, in most cases DotNetZip +handles the streaming; your application does not need to implement a +Read/Write data pump. The application needs only to open the +streams. Using the stream support, you could, for example, open a zip +archive, and then modify the files in the archive, and Save out to a +Response.OutputStream in ASP.NET, without ever writing a file to the +disk. All the zip file content can be maniulated in memory (using +MemoryStream for example). +

+ +

Does this library allow removal of entries from zip files, or updating of entries in zip files?
+ +Yes. +

+ +

Do I have to write programs to take advantage of this thing? or is there some other way I can take advantage of the DotNetZip?
+ +Typically people will embed this DLL into an application. But, the +DotNetZip downloads includes a package of "example" applications: +command-line utilities that utilize the library, that you can use out of +the box to zip and unzip. I drop these in my own bin directory and it +allows me to zip and unzip from the command line or from batch +files. Also, you can take advantage of the DotNetZip library from within +Powershell, if that is your bag. Creating or extracting zips within a +script is pretty handy. +

+ +

Can I grab the source for DotNetZip and embed it into my own project?
+ +Yes - that's allowed by the license. But you may want to think about +just redistributing the binary DLL - it is a much easier option. +

+ +

Can I distribute the binary DLL with my own project?
+ +Yes - that's allowed by the license. +

+ + +

What's the mainstream approach for using DotNetZip in a 3rd party app?
+ +The mainstream approach is to distribute the binary DLL with your own +app. +

+ +

What if I want to use DotNetZip in my app, but I don't want to distribute it as a separate DLL?
+ +You have options. The most mainstream and generally easiest way to embed +DotNetZip into your application is to redistribute the DLL. But if you +don't want to do that, there are alternatives. One option is to embed +the source for DotNetZip into your own project. This may seem like the +obvious approach, but it is probably not what you want, unless you +really need to modify the source of DotNetZip. A better approach is to +merge the DLL into your EXE, with ILMerge. +This works with your app regardless of what language it uses, whether it +is a Winforms app, a WPF app, a service, etc. +

+ + + + diff --git a/dotNetZip/Help/Introduction/CompactFramework.htm b/dotNetZip/Help/Introduction/CompactFramework.htm new file mode 100644 index 0000000..05e02f3 --- /dev/null +++ b/dotNetZip/Help/Introduction/CompactFramework.htm @@ -0,0 +1,98 @@ + + +.NET Compact Framework Applications + + + + + + +

DotNetZip works with the .NET Compact Framework

+ +

+There is a special version of DotNetZip, specifically built for the +.NET Compact Framework v2.0 or v3.5. +

+ +

The programming model is exactly the same as for the regular +DotNetZip library. There are a few features not supported in the CF version of DotNetZip:

+ +
    + +
  1. Self-extracting +archives. The ZipFile.SaveSelfExtractor() method is not available in +the CF version of DotNetZip. There's no strong technical reason for this +limnitation; I just didn't think it would be of mainstream interest, and +in order to keep the size of the library down, I omitted that part from +the CF version. It amounts to about a 120k savings. +
  2. + +
  3. WinZip AES encryption. The CF version does not +support encryption using WinZipAes128 or WinZipAes256. This is because +the crypto classes from the .NET Framework are not available on .NET CF. +I would have to write my own SHA1HMAC() and so on, which I haven't got +'round to doing, especially because no one is clamoring for it.
  4. + +
  5. ParallelDeflateStream. Most mobile devices do not +use multicore processors, so a parallel deflater would offer no +benefit. Even aside from that, parallel deflation shows its strength +when cmopressing larger files, and when larger memory resources are +available. Both of these are unlikely in .NET CF applications.
  6. + +
+ +
+ +

Using DotNetZip in a Smart Device project

+ +

To build a smart device application that uses DotNetZip, you will +need to use Visual Studio 2008 or later.

+ +
    + +
  1. Open Visual Studio 2008. +
  2. + +
  3. Create a smart device project. Specify that it will use the .NET +Compact Framework v2.0 or v3.5. +
  4. + +
  5. Add a Reference to the CF Library for DotNetZip. +The filename is Ionic.Zip.CF.dll
  6. + +
  7. Build your application as normal.
  8. + +
+ + +

About the Project Design

+ +

If you are a developer who wants to modify or extend the DotNetZip library itself, +the following may be of interest. +

+ +

The CF-Library project in the DotNetZip source distribution includes +all of the source files as Links to the original files in the +Library project. This means, the source files are not duplicated. Any +changes need to be made only once. The CF-Library project is simply a +"build project" in that regard. There is no additional source code +specifically for the .NET Compact Framework.

+ +

NETCF is defined as a conditional compile symbol for the CF-Library +project. This symbol is used in the source to exclude code that will +not run on the .NET Compact Framework, for example, the calls to +SetLastModifiedTime() method on the System.IO.File class.

+ + + + diff --git a/dotNetZip/Help/Introduction/GettingStarted.htm b/dotNetZip/Help/Introduction/GettingStarted.htm new file mode 100644 index 0000000..aee0e05 --- /dev/null +++ b/dotNetZip/Help/Introduction/GettingStarted.htm @@ -0,0 +1,234 @@ + + +Getting Started + + + + + + +

Getting Started with DotNetZip

+ +

This page describes how to get started using DotNetZip.

+ +

Which download to choose?

+ +

DotNetZip is free to use. You just need to download it and start using it. Different downloads +of DotNetZip are available. Which one you choose depends on what +you want to do.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
If your goal is...Download this...which contains...
To read the documentation for the library and toolsDotNetZipLib-*.chma compiled helpfile containing all the documentation.
To build .NET, COM, or PowerShell apps that use the Zip + library. + DotNetZipLib-DevKit-vx.x.zipthe signed DLLs for Zip and Zlib, for both the desktop and Compact + Framework; the XML Documentation file for intellisense; the + compiled help file (CHM); an MSI file that installs help into Visual Studio; + and the License. +
To modify or view the source code for the Zip & Zlib Libraries, + the setup (msi) project, or the examples. DotNetzip-src-vx.x.x.x.zipthe VS2008 solution, containing a number of VS projects and the + source code for the library and various examples that use the + library.
To distribute .NET applications that use the Zip library, or if + you want to run a .NET application that depends on this library. + DotNetZipLib-Runtime-vx.x.zipthe signed DLLs for Zip and Zlib, for both the desktop and Compact + Framework; and the License. This is a strict subset of the DevKit + download. +
To distribute .NET applications that use the Zip library, or if + you want to run a .NET application that depends on this library. + DotNetZipLib-Runtime-vx.x.msian .MSI version of the Runtime release, containing signed DLLs for + Zip and Zlib, for both the desktop and Compact Framework; and the + License.
To create, read, or modify ZIP files from within a Windows GUI interface, + or from the command line, or from within batch files. + DotNetZipUtils-v1.8.zipa set of exe tools (command-line and GUI) that rely on the + DotNetZip library, to create and manage zip files.
To create, read, or modify ZIP files from within a Windows GUI interface, + or from the command line, or from within batch files. + DotNetZipUtils-v1.8.msian .MSI version of the Utils download. This installs a set of exe + tools (command-line and GUI) that rely on the DotNetZip library, + to create and manage zip files. There's also an + uninstaller.
+ + + + +

Which DLL to use?

+ +

When you are building an application that manipulates ZIP files, you +will want to use one of the binary releases of DotNetZip. These +releases include multiple distinct DLLs or assemblies. Which one should +you use?

+ +

The likely answer is: Ionic.Zip.dll

+ +

That's the mainstream library, the full library, and it includes all the +capability of DotNetZip. The other DLLs are reduced in various ways, to suite particular requirements. +

+ +

For example, you may want a +smaller library, or you want to exclude the Self-Extracting capability, or +you only want the ZLIB capability. In these cases, you may want to choose a +different assembly. +

+ +

Here's a summary of the options.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Usage scenarioDLL
Basic reading or writing of Zip files Ionic.Zip.dll
raw block or stream compression using ZLIB, DEFLATE, or + GZip Ionic.Zlib.dll
compression using the BZip2 algorithmIonic.BZip2.dll
Some combination of ZLIB/DEFLATE/GZIP compression, BZip2 + compression, and reading or writing Zip + files Ionic.Zip.dll
reading or writing Zip files on .NET Compact Framework Ionic.Zip.CF.dll
ZLIB/DEFLATE/GZIP compression on .NET Compact Framework Ionic.Zlib.CF.dll
compression using the BZip2 algorithm on .NET Compact Framework Ionic.BZip2.CF.dll
Some combination of ZLIB/DEFLATE/GZIP compression, BZip2 + compression, and reading or writing Zip + files on .NET CFIonic.Zip.CF.dll
reading or writing Zip files, but never creating a self-extracting + archive Ionic.Zip.Reduced.dll
+ +

There are also Silverlight versions of the Zlib, BZip2, and Zip + libraries.

+ +

+ Never reference both Ionic.Zlib.dll and Ionic.Zip.dll in the same + application, or both Ionic.BZip2.dll and Ionic.Zip.dll. If your + application does both Zlib and Zip things, or both BZip2 and Zip + things, or all three, you need only add a reference to Ionic.Zip.dll. + Ionic.Zip.dll includes all the capability in Ionic.Zlib.dll and + Ionic.BZip2.dll. You always need to reference only a single Ionic + DLL, regardless whether you use Zlib or BZip2 or Zip or some + combination. +

+ +

+ If you use COM, then you want to reference the main DLL, + Ionic.Zip.dll. If you install the DotNetZip Runtime library via the + .MSI installer, the correct DLL will automatically be installed and + registered for use with COM. If you don't use the .MSI + installer, you will have to perform these steps yourself. Consult the + documentation on using DotNetZip with COM for more information. +

+ + + diff --git a/dotNetZip/Help/Introduction/Introduction.htm b/dotNetZip/Help/Introduction/Introduction.htm new file mode 100644 index 0000000..b6d3bf6 --- /dev/null +++ b/dotNetZip/Help/Introduction/Introduction.htm @@ -0,0 +1,7 @@ + + + + +Introduction + + diff --git a/dotNetZip/Help/MSHelp2.shfbproj b/dotNetZip/Help/MSHelp2.shfbproj new file mode 100644 index 0000000..7ec3193 --- /dev/null +++ b/dotNetZip/Help/MSHelp2.shfbproj @@ -0,0 +1,88 @@ + + + + Debug + AnyCPU + 2.0 + {47122ab7-f040-4735-a59a-5b2d7f073b57} + 1.9.0.0 + + Documentation + Documentation + Documentation + + .\bin\MSHelp2 + DotNetZipLib-v1.9.1.6 + DotNetZip is a small, easy-to-use class library for manipulating .zip files. It can enable .NET applications written in VB.NET, C#, any .NET language, to easily create, read, and update zip files. DotNetZip is donationware: http://cheeso.members.winisp.net/DotNetZipDonate.aspx + Summary, Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter + InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected + + + c:\Program Files (x86)\Common Files\microsoft shared\Help 2.0 Compiler\ + + + + + 3.0 + Ionic Zip Library v1.9.1.6 + dpchiesa%40hotmail.com + Prototype + + + + + + + The Ionic namespace includes supporting classes used in the DotNetZip library. + Classes in the Ionic.Zip namespace allow applications to read and write zip files according to the format +described by pkware, at: +http://www.pkware.com/business_and_developers/developer/popups/appnote.txt. + +This implementation utilizes a DeflateStream class implemented in managed code, in the Ionic.Zlib namespace. It does not use System.IO.Compression.DeflateStream in the .NET Framework +v2.0 base class library. + +DotNetZip is donationware. Please donate. Proceeds go to the Boys &amp; Girls Club in Pennsylvania, USA. http://cheeso.members.winisp.net/DotNetZipDonate.aspx + Ionic.Zlib namespace includes classes for doing ZLIB, DEFLATE, and GZIP compression and decompression, according to RFC 1950, RFC 1951, and RFC 1952. It includes stream classes that can directly replace the DeflateStream and GZipStream classes that are included in the Base Class Library of the .NET Framework. + + Copyright 2009-2011, Dino Chiesa + True + Reference + MSHelp2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Help/Tools and Utilities/BZip2GZip.htm b/dotNetZip/Help/Tools and Utilities/BZip2GZip.htm new file mode 100644 index 0000000..0c31ccd --- /dev/null +++ b/dotNetZip/Help/Tools and Utilities/BZip2GZip.htm @@ -0,0 +1,188 @@ + + +GZip.exe and BZip2.exe + + + + + + +

Compression Command-Line Tools

+ +

The Tools/Utilities downloads for DotNetZip includes a pair of + command-line tools that perform raw compression and decompression: + GZip.exe and BZip2.exe . These tools can be used from the command + line to compress or decompress .gz and .bz2 files, respectively, from + within batch scripts, or CMD.exe windows. +

+ + + +

GZip.exe

+ +

This tool can be used to compress a regular file into a .gz file, or + to decompress a .gz files into its original, uncompressed form. It + handles files in the .gz format created by other GZIP tools, such as + the gzip tool that is included with Linux and other operating systems, + and the .gz files it produces on Windows can be read by the gzip tool + on other platforms. +

+ +

Of interest, the GZip format handled by this tool is specified + in IETF RFC + 1952. While the GZIP format can handle multiple entries within a + single archive, in general that feature is rarely used. Instead, most + uses of GZip compress a single file to a single .gz file.

+ + + +

Usage

+ +
+  GZip.exe <FileToProcess> [arguments]
+
+ arguments:
+   -v         - verbose output.
+   -f         - force overwrite of any existing files.
+   -keep      - don't delete the original file after compressing or
+                decompressing it.
+
+ + + + +

BZip2.exe

+ +

This tool can be used to create .bz2 files, that conform to the BZIP2 + format. Bzip2 was created in 1996 as a compression method and format + that can be applied to single files. Unlike ZIP, it is not a + multi-entry archive format - you use bzip2 to compress a single file + into a single compressed image. By convention, for a given filename, a + bzip2 compressor creates a new file called filename.bz2 . + +

Using the BZip2.exe command line tool included with DotNetZip, you + can compress regular files into .bz2 files, and you can decompress + .bz2 files into the corresponding original file.

+ +

This tool such is compatible with other bzip2 tools, such as the one + that is included with Linux and other operating systems. The .bz2 + files that this tool produces on Windows can be read by the bzip2 tool + on other platforms.

+ +

Most Bzip2 utilities delete the original file after producing the + compressed version, and delete the compressed version after + decompressing. This utility follows that convention.

+ +

BZip2 is a compression format, similar to ZLIB, GZIP, or DEFLATE. + BZIP2 tends to compress better than these other algorithms, + but BZIP2 compressors tend to require more time to compress. +

+ + + +

Usage

+
+
+BZip2.exe <FileToProcess> [arguments]
+
+  arguments:
+    -v         - verbose output.
+    -f         - force overwrite of any existing files.
+    -keep      - don't delete the original file after compressing
+                 or decompressing it.
+
+ + + + +

Command Examples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
gzip.exe LargeFile.txt
  + compress the LargeFile.txt to produce LargeFile.txt.gz . +
gzip.exe LargeFile.txt.gz
  + decompress the LargeFile.txt.gz to produce LargeFile.txt , and + delete LargeFile.txt.gz . +
gzip.exe LargeFile.txt.gz -keep
  + decompress the LargeFile.txt.gz to produce LargeFile.txt ; the original + LargeFile.txt.gz will not be deleted. +
bzip2.exe LargeFile.txt
  + compress the LargeFile.txt to produce LargeFile.txt.bz2 , and delete + the LargeFile.txt when finished. +
bzip2.exe LargeFile.txt -keep
  + compress the LargeFile.txt to produce LargeFile.txt.bz2 , and keep + the LargeFile.txt when finished. +
bzip2.exe LargeFile.txt.bz2
  + decompress the LargeFile.txt.bz2 to produce LargeFile.txt , and + delete the original compressed file when finished. +
+ + + + + + diff --git a/dotNetZip/Help/Tools and Utilities/CmdLine.htm b/dotNetZip/Help/Tools and Utilities/CmdLine.htm new file mode 100644 index 0000000..3645ee1 --- /dev/null +++ b/dotNetZip/Help/Tools and Utilities/CmdLine.htm @@ -0,0 +1,529 @@ + + +ZipIt.exe and UnZip.exe + + + + + + +

DotNetZip Command-Line Tools

+ +

The Tools/Utilities downloads for DotNetZip include a pair of tools - +Zipit.exe and Unzip.exe - that can be used from the command line to +manipulate zip files from within batch scripts, or CMD.exe windows. +

+ + +

ZipIt.exe

+ +

This tool can be used to create ZIP files, or update existing ZIP +files, from the command line or from a batch file.

+ +

Using the command line tools, you can do virtually everything you can +do by using the library directly from a custom application. You can +create self-extracting archives or archives that use ZIP64 extensions. +You can create archives that use encryption or passwords. You can +create split or spanned archives. And there are many other options.

+ + + + +

Usage

+
+
+ZipIt.exe <ZipFileToCreate> [arguments]
+
+arguments:
+  <directory> | <file> - a directory or file to add to the archive.
+  <selector>           - a file selection expression.  Examples:
+                           *.txt
+                           (name = *.txt) OR (name = *.xml)
+                           (attrs = H) OR (name != *.xml)
+                           (ctime < 2009/02/28-10:20:00)
+                           (size > 1g) AND (mtime < 2009-06-29)
+                           (ctime > 2009-04-29) AND (size < 10kb)
+                         Filenames can include full paths. You must surround a filename
+                         that includes spaces with single quotes.
+  -64                  - use ZIP64 extensions, for large files or large numbers of files.
+  -aes                 - use WinZip-compatible AES 256-bit encryption for entries
+                         subsequently added to the archive. Requires a password.
+  -cp <codepage>       - use the specified numeric codepage for entries with comments
+                         or filenames that cannot be encoded with the default IBM437
+                         code page.
+  -d <path>            - use the given directory path in the archive for
+                         succeeding items added to the archive.
+  -D <path>            - find files in the given directory on disk.
+  -e<s,r,q,a>          - when there is an error reading a file to be zipped, either skip
+                         the file, retry, quit, or ask the user what to do.
+  -j-                  - do not traverse NTFS junctions
+  -j+                  - traverse NTFS junctions (default)
+  -L <level>           - compression level, 0..9 (Default is 6).
+  -p <password>        - apply the specified password for all succeeding files added.
+                         use "" to reset the password to nil.
+  -progress            - emit progress reports (good when creating large zips)
+  -r-                  - don't recurse directories (default).
+  -r+                  - recurse directories.
+  -s <entry> 'string'  - insert an entry of the given name into the
+                         archive, with the given string as its content.
+  -sfx [w|c]           - create a self-extracting archive, either a Windows or console app.
+  -split <maxsize>     - produce a split zip, with the specified maximum size.  You can
+                         optionally use kb or mb as a suffix to the size.
+                         -split is not compatible with -sfx.
+                         This is not compatible with -sfx.
+  -Tw+                 - store Windows-format extended times (default).
+  -Tw-                 - don't store Windows-format extended times.
+  -Tu+                 - store Unix-format extended times (default).
+  -Tu-                 - don't store Unix-format extended times (default).
+  -UTnow               - use uniform date/time, NOW, for all entries.
+  -UTnewest            - use uniform date/time, newest entry, for all entries.
+  -UToldest            - use uniform date/time, oldest entry, for all entries.
+  -UT <datetime>       - use uniform date/time, specified, for all entries.
+  -utf8                - use UTF-8 encoding for entries with comments or
+                         filenames that cannot be encoded with the default IBM437
+                         code page.
+  -zc <comment>        - use the given comment for the archive.
+
+
+ + + + +

Command Examples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
zipit.exe NewZip.zip -64 *.doc
  + create a new zip file called NewZip.zip, adding all .doc files from + the current directory + into the zip. Use ZIP64 extensions. +
zipit.exe NewZip.zip -r+ *.doc
  + create a new zip file called NewZip.zip, adding all .doc files, in the + current directory and any child directories, + into the zip. +
zipit.exe Backup.zip -d c:\MyDocuments -r+ -j- *.*
  + create a new zip file called Backup.zip, adding all files within the c:\MyDocuments + directory. Do not traverse NTFS Junction points (like My Videos). +
zipit.exe Package.exe -sfx -d c:\files -r+ *.*
  + create a new self-extracting archive file called Package.exe, adding + all files within the c:\files directory hierarchy. +
zipit.exe Package.zip -split 1mb -d c:\files -r+ *.*
  + create a new "spanned" or multi-segment zip file called Package.zip, adding + all files within the c:\files directory hierarchy. Each segment of the zipfile should be + limited to 1mb in size, and the segments will be named Package.z01, Package.z02, etc. +
zipit.exe ImageLibrary.zip -split 1mb -d c:\images -r+ "name = *.jpg AND size > 100kb"
  + create a new "spanned" or multi-segment zip file called ImageLibrary.zip, adding + all .jpg files within the c:\images directory hierarchy that have a size larger than 100kb. Each segment of the zipfile should be + limited to 1mb in size, and the segments will be named Package.z01, Package.z02, etc. +
zipit.exe Portfolio.zip -p Secret! -aes -d c:\portfolio -r+ "name != *.tfs"
  + create a new aip file called Portfolio.zip, adding + all files within the c:\portfolio directory hierarchy that do not have the .tfs extension. + Encrypt all entries using AES 256-bit encryption. +
zipit.exe Portfolio.zip -p Secret! -aes -L 9 -d c:\portfolio -r+ "name != *.tfs"
  + create a new aip file called Portfolio.zip, adding + all files within the c:\portfolio directory hierarchy that do not have the .tfs extension. + Encrypt all entries using AES 256-bit encryption, and use level 9 (Best) compression. +
+ + + + +

Syntax for the Selection Criteria

+ +

Using the a selector string, you can specify a set of criteria for +the files to be added to the zip file. Specify the criteria in +statements of 3 elements: a noun, an operator, and a value. Consider +the string "name != *.doc" . The noun is "name". The operator is "!=", +implying "Not Equal". The value is "*.doc". That criterion, in +English, says "all files with a name that does not end in the .doc +extension."

+ +

Supported nouns include name for the filename; atime, +mtime, and ctime for last access time, last modfied time, +and created time of the file, respectively; attributes for the +file attributes; and size for the file length (uncompressed). +The attributes and name nouns both support = and != as +operators. The size, atime, mtime, and +ctime nouns support = and !=, and >, >=, <, <= as +well. The times are taken to be expressed in local time.

+ +

Specify values for the file attributes as a string with one or more +of the characters H,R,S,A in any order, implying Hidden, ReadOnly, +System, and Archive, respectively. To specify a time, use +YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as the format. If you omit the HH:mm:ss portion, it +is assumed to be 00:00:00 (midnight). The value for a size criterion is +expressed in integer quantities of bytes, kilobytes (use k or kb after +the number), megabytes (m or mb), or gigabytes (g or gb). The value for +a name is a pattern to match against the filename, potentially including +wildcards. The pattern follows CMD.exe glob rules: * implies one or +more of any character (not including dot), while ? implies one character +(not including dot). If the name pattern contains any slashes, it is +matched to the entire filename, including the path; otherwise, it is +matched against only the filename without the path. This means a +pattern of "*\*.*" matches all files one directory level deep, while a +pattern of "*.*" matches all files in all directories.

+ + +

To specify a name pattern that includes spaces, use single quotes +around the pattern. A pattern of "'* *.*'" will match all files that +have spaces in the filename. The full criteria string for that would be +"name = '* *.*'" .

+ + + + + +

Examples of Selection Criteria

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
name = *.jpg
 any .jpg file +
mtime > 2009-07-14
 any file with a last modified time after midnight on 14 July + 2009. There is also ctime and atime for created time and accessed + time. +
ctime > 2009-07-14-07:53:00
 any file with a created time after 7:53am (local time) on 14 July 2009. +
size > 320mb
  +any file with a size over 320mb. You can use kb or gb, too. Or +omit the characters to specify a filesize in bytes. And you can use <, >, or = as +operations. +
attr != H
  +any file that does not have the Hidden attribute set. Other attributes +include S=system, R=Readonly, A=Archive. Of course you can test that +the attribute is ON as well, using = instead of !=. +
attr != H and size > 320mb
  +include the files that satisfy both conditions. You can also use OR as a conjuction. Use parens to group complex expressions. + +
name = *.jpg or name = *.gif
  +include the files that satisfy one or the other condition. +
(name = *.jpg) or (name = *.gif)
  +same as above. +
(mtime >= 2009-07-01) and (mtime < 2009-07-02)
  +any file modified on July 1st. From midnight to midnight. +
(name = *.jpg) AND (mtime >= 2009/07/01) and (mtime < 2009/07/02)
  +any .jpg file modified on July 1st. +
(name = *.jpg) and (size >= 100kb) and (mtime >= 2009/07/01) and (mtime < 2009/07/02)
  +any .jpg file, 100kb or more in size, modified on July 1st. +
+ + + + +

UnZip.exe

+ +

This tool can be used to view, extract, or test and verify ZIP files, +from the command line or from a batch file.

+ + + + +

Usage

+ +
+  UnZip.exe [options] <zipfile> [<entryname>...]
+     unzips all files in the archive.
+     options:
+       -o                overwrite existing files if necessary.
+       -f                flatten directory structure when extracting.
+       -p <password>     specify password for extraction.
+       -t                test the file for consistency.
+       -q                operate quietly (no verbose messages).
+       -cp <codepage>    extract with the specified numeric codepage.  Only do this if you
+                         know the codepage, and it is neither IBM437 nor UTF-8. If the
+                         codepage you specify here is different than the codepage of
+                         the cmd.exe, then the verbose messages will look odd, but the
+                         files will be extracted properly.
+       -d <directory>    unpack to the specified directory. If none provided, it will
+                         unzip to the current directory.
+       <entryname>       unzip only the specified filename.
+
+  unzip -l <zipfile>
+     lists the entries in the zip archive.
+  unzip -i <zipfile>
+     displays full information about all the entries in the zip archive.
+  unzip -t <zipfile> [-p <password>] [-cp <codepage>]
+     tests the zip archive.
+  unzip -?
+     displays this message.
+
+
+ + + + +

Command Examples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
UnZip.exe -l Package.zip
  + list the entries in the zipfile, along with basic information about each entry. +
UnZip.exe Package.zip
  + extract the entries in the zipfile, into the current directory. +
UnZip.exe Package.zip -d ex1
  + extract the entries in the zipfile, into the directory 'ex1'. The directory will + be created if it does not exist. +
UnZip.exe Package.zip -f -d ex1
  + extract the entries in the zipfile, into the directory 'ex1'. The directory will + be created if it does not exist. Any directory hierarchy within the zip file + will be ignored or "flattened" upon extraction. +
UnZip.exe Package.zip -o -d ex1
  + extract the entries in the zipfile, into the directory 'ex1'. The directory will + be created if it does not exist. During extraction, any existing files in the + directory hierarchy will be overwritten if necessary. +
+ + + + + diff --git a/dotNetZip/Help/Tools and Utilities/GUI.htm b/dotNetZip/Help/Tools and Utilities/GUI.htm new file mode 100644 index 0000000..93b205c --- /dev/null +++ b/dotNetZip/Help/Tools and Utilities/GUI.htm @@ -0,0 +1,339 @@ + + +The Graphical Tool + + + + + + + + +

The DotNetZip Graphical Tool

+ +

The Tools/Utilities downloads for DotNetZip include a graphical tool +for creating and extracting zip files.

+ +

If you use the MSI installer, you will have the chance to associate +.zip files to this tool. If you associate .zip files to this tool, +double-clicking on a zip file from within Windows Explorer will open the +zip file in the tool. If you don't associate .zip files to this tool, +you can open the tool using the Start menu.

+ + + + +

The tool uses a tabbed-pane interface. One tab is used for reading +or extracting zip files, another is used for creating zip files. +

+ + + + +

Creating a Zip Archive

+ +

Create a zip file in two steps: first, select which files to add into +the zip, then add creating the zip with those files.

+ + + + +

An overview of the UI elements:

+
    + +
  1. the directory to add. Specify where in the filesystem to find the +files to be added into the zip file.
  2. + +
  3. check this box to traverse Windows NTFS Junctions; leave it unchecked to not traverse junctions
  4. + +
  5. the directory to be used within the zip archive for the files that get added. +
  6. + +
  7. The selection criteria for the files to be added to the zip.
  8. + +
  9. Click this button to add the files that match the selection criteria, to the listbox below (label #18) +To select additional files, you can then repeat steps 1-5 as many times as is necessary. +
    +
    +When you've selected the files you want to include in the archive, +
  10. + +
  11. Specify the name of the zip file to create.
  12. + +
  13. Specify whether to save a regular zip file, or a self-extracting archive.
  14. + +
  15. Specify the compression level to use. Higher compression levels requires more compression time.
  16. + +
  17. The text encoding to use for the filenames.
  18. + +
  19. Whether to use ZIP64 extensions
  20. + +
  21. whether to encrypt the file data, and if so, whether to use AES encryption.
  22. + +
  23. the password to use. The adjacent checkbox allows you to show or +obscure the password characters. This box is enabled only if encryption is in use.
  24. + +
  25. Use these checkboxes to specify whether to include extended timestamps in the generated zip file, in Windows or Unix formats.
  26. + +
  27. Whether to create a split archive, and if so, the size of the segment.
  28. + +
  29. The comment attached to the zip file
  30. + +
  31. The default extraction directory. This feature is enabled only for self-extracting archives.
  32. + +
  33. The command to run after extraction. This feature is enabled only for self-extracting archives.
  34. + +
  35. The list of files to be added to the zip archive. Each file has a checkbox associated to it.
  36. + +
  37. Click this button to remove any checked files from the list.
  38. + +
  39. Finally, click this button to actually create the zip archive.
  40. + +
+ + +

Extracting files from a Zip Archive

+ +

Extract files from a zip archive by opening the DotNetZip-WinformsTool.exe, and selecting the Read/Extract tab in the UI. +

+ + + + + + + + +

An overview of the UI elements:

+
    + +
  1. the zip file to read or extract. +
  2. + +
  3. click here to open and read the specified zip file. The list of +entries in the zip will be displayed in the listbox below (label #7). +
  4. + +
  5. The directory to extract entries into
  6. + +
  7. The selection criteria for entries to extract.
  8. + +
  9. Check this to overwrite existing files during extraction.
  10. + +
  11. Check this box to open Windows Explorer after extraction.
  12. + +
  13. The list of entries in the zip file.
  14. + +
  15. Click this button to extract the specified entries in the zip file. +
  16. +
+ + + + + +

Syntax for the Selection Criteria

+ +

Using the a selector string, you can specify a set of criteria for +the files to be added to the zip file. Specify the criteria in +statements of 3 elements: a noun, an operator, and a value. Consider +the string "name != *.doc" . The noun is "name". The operator is "!=", +implying "Not Equal". The value is "*.doc". That criterion, in +English, says "all files with a name that does not end in the .doc +extension."

+ +

Supported nouns include name for the filename; atime, +mtime, and ctime for last access time, last modfied time, +and created time of the file, respectively; attributes for the +file attributes; and size for the file length (uncompressed). +The attributes and name nouns both support = and != as +operators. The size, atime, mtime, and +ctime nouns support = and !=, and >, >=, <, <= as +well. The times are taken to be expressed in local time.

+ +

Specify values for the file attributes as a string with one or more +of the characters H,R,S,A in any order, implying Hidden, ReadOnly, +System, and Archive, respectively. To specify a time, use +YYYY-MM-DD-HH:mm:ss as the format. If you omit the HH:mm:ss portion, it +is assumed to be 00:00:00 (midnight). The value for a size criterion is +expressed in integer quantities of bytes, kilobytes (use k or kb after +the number), megabytes (m or mb), or gigabytes (g or gb). The value for +a name is a pattern to match against the filename, potentially including +wildcards. The pattern follows CMD.exe glob rules: * implies one or +more of any character (not including dot), while ? implies one character +(not including dot). If the name pattern contains any slashes, it is +matched to the entire filename, including the path; otherwise, it is +matched against only the filename without the path. This means a +pattern of "*\*.*" matches all files one directory level deep, while a +pattern of "*.*" matches all files in all directories.

+ + +

To specify a name pattern that includes spaces, use single quotes +around the pattern. A pattern of "'* *.*'" will match all files that +have spaces in the filename. The full criteria string for that would be +"name = '* *.*'" .

+ + + + + +

Examples of Selection Criteria

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
name = *.jpg
 any .jpg file +
mtime > 07/01/2009
 any file with a last modified time after midnight on 1 July + 2009. There is also ctime and atime for created time and accessed + time. +
ctime > 07/01/2009-07:53:00
 any file with a created time after 7:53am on 1 July 2009. +
size > 320mb
  +any file with a size over 320mb. You can use kb or gb, too. Or +omit the characters for a size in bytes. And you can use <, >, or = as +operations. +
attr != H
  +any file that does not have the Hidden attribute set. Other attributes +include S=system, R=Readonly, A=Archive. Of course you can test that +the attribute is ON as well, using = instead of !=. +
attr != H and size > 320mb
  +include the files that satisfy both conditions. You can also use OR as a conjuction. Use parens to group complex expressions. + +
name = *.jpg or name = *.gif
  +include the files that satisfy one or the other condition. +
(name = *.jpg) or (name = *.gif)
  +same as above. +
(mtime >= 07/01/2009) and (mtime < 07/02/2009)
  +any file modified on July 1st. From midnight to midnight. +
(name = *.jpg) AND (mtime >= 07/01/2009) and (mtime < 07/02/2009)
  +any .jpg file modified on July 1st. +
(name = *.jpg) and (size >= 100kb) and (mtime >= 07/01/2009) and (mtime < 07/02/2009)
  +any .jpg file, 100kb or more in size, modified on July 1st. +
+ + + + + + diff --git a/dotNetZip/Help/Tools and Utilities/Tools and Utilities.htm b/dotNetZip/Help/Tools and Utilities/Tools and Utilities.htm new file mode 100644 index 0000000..4fdd6c9 --- /dev/null +++ b/dotNetZip/Help/Tools and Utilities/Tools and Utilities.htm @@ -0,0 +1,3 @@ + + +Tools and Utilities diff --git a/dotNetZip/Help/Tools and Utilities/ZipTool1.png b/dotNetZip/Help/Tools and Utilities/ZipTool1.png new file mode 100644 index 0000000..7a0d2f4 Binary files /dev/null and b/dotNetZip/Help/Tools and Utilities/ZipTool1.png differ diff --git a/dotNetZip/Help/Tools and Utilities/ZipTool2.png b/dotNetZip/Help/Tools and Utilities/ZipTool2.png new file mode 100644 index 0000000..cfcab13 Binary files /dev/null and b/dotNetZip/Help/Tools and Utilities/ZipTool2.png differ diff --git a/dotNetZip/Help/Tools and Utilities/ZipTool3.png b/dotNetZip/Help/Tools and Utilities/ZipTool3.png new file mode 100644 index 0000000..cbd795d Binary files /dev/null and b/dotNetZip/Help/Tools and Utilities/ZipTool3.png differ diff --git a/dotNetZip/Help/Zip Tools/BZip2GZip.htm b/dotNetZip/Help/Zip Tools/BZip2GZip.htm new file mode 100644 index 0000000..0c31ccd --- /dev/null +++ b/dotNetZip/Help/Zip Tools/BZip2GZip.htm @@ -0,0 +1,188 @@ + + +GZip.exe and BZip2.exe + + + + + + +

Compression Command-Line Tools

+ +

The Tools/Utilities downloads for DotNetZip includes a pair of + command-line tools that perform raw compression and decompression: + GZip.exe and BZip2.exe . These tools can be used from the command + line to compress or decompress .gz and .bz2 files, respectively, from + within batch scripts, or CMD.exe windows. +

+ + + +

GZip.exe

+ +

This tool can be used to compress a regular file into a .gz file, or + to decompress a .gz files into its original, uncompressed form. It + handles files in the .gz format created by other GZIP tools, such as + the gzip tool that is included with Linux and other operating systems, + and the .gz files it produces on Windows can be read by the gzip tool + on other platforms. +

+ +

Of interest, the GZip format handled by this tool is specified + in IETF RFC + 1952. While the GZIP format can handle multiple entries within a + single archive, in general that feature is rarely used. Instead, most + uses of GZip compress a single file to a single .gz file.

+ + + +

Usage

+ +
+  GZip.exe <FileToProcess> [arguments]
+
+ arguments:
+   -v         - verbose output.
+   -f         - force overwrite of any existing files.
+   -keep      - don't delete the original file after compressing or
+                decompressing it.
+
+ + + + +

BZip2.exe

+ +

This tool can be used to create .bz2 files, that conform to the BZIP2 + format. Bzip2 was created in 1996 as a compression method and format + that can be applied to single files. Unlike ZIP, it is not a + multi-entry archive format - you use bzip2 to compress a single file + into a single compressed image. By convention, for a given filename, a + bzip2 compressor creates a new file called filename.bz2 . + +

Using the BZip2.exe command line tool included with DotNetZip, you + can compress regular files into .bz2 files, and you can decompress + .bz2 files into the corresponding original file.

+ +

This tool such is compatible with other bzip2 tools, such as the one + that is included with Linux and other operating systems. The .bz2 + files that this tool produces on Windows can be read by the bzip2 tool + on other platforms.

+ +

Most Bzip2 utilities delete the original file after producing the + compressed version, and delete the compressed version after + decompressing. This utility follows that convention.

+ +

BZip2 is a compression format, similar to ZLIB, GZIP, or DEFLATE. + BZIP2 tends to compress better than these other algorithms, + but BZIP2 compressors tend to require more time to compress. +

+ + + +

Usage

+
+
+BZip2.exe <FileToProcess> [arguments]
+
+  arguments:
+    -v         - verbose output.
+    -f         - force overwrite of any existing files.
+    -keep      - don't delete the original file after compressing
+                 or decompressing it.
+
+ + + + +

Command Examples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
gzip.exe LargeFile.txt
  + compress the LargeFile.txt to produce LargeFile.txt.gz . +
gzip.exe LargeFile.txt.gz
  + decompress the LargeFile.txt.gz to produce LargeFile.txt , and + delete LargeFile.txt.gz . +
gzip.exe LargeFile.txt.gz -keep
  + decompress the LargeFile.txt.gz to produce LargeFile.txt ; the original + LargeFile.txt.gz will not be deleted. +
bzip2.exe LargeFile.txt
  + compress the LargeFile.txt to produce LargeFile.txt.bz2 , and delete + the LargeFile.txt when finished. +
bzip2.exe LargeFile.txt -keep
  + compress the LargeFile.txt to produce LargeFile.txt.bz2 , and keep + the LargeFile.txt when finished. +
bzip2.exe LargeFile.txt.bz2
  + decompress the LargeFile.txt.bz2 to produce LargeFile.txt , and + delete the original compressed file when finished. +
+ + + + + + diff --git a/dotNetZip/Help/Zip Tools/CmdLine.htm b/dotNetZip/Help/Zip Tools/CmdLine.htm new file mode 100644 index 0000000..3645ee1 --- /dev/null +++ b/dotNetZip/Help/Zip Tools/CmdLine.htm @@ -0,0 +1,529 @@ + + +ZipIt.exe and UnZip.exe + + + + + + +

DotNetZip Command-Line Tools

+ +

The Tools/Utilities downloads for DotNetZip include a pair of tools - +Zipit.exe and Unzip.exe - that can be used from the command line to +manipulate zip files from within batch scripts, or CMD.exe windows. +

+ + +

ZipIt.exe

+ +

This tool can be used to create ZIP files, or update existing ZIP +files, from the command line or from a batch file.

+ +

Using the command line tools, you can do virtually everything you can +do by using the library directly from a custom application. You can +create self-extracting archives or archives that use ZIP64 extensions. +You can create archives that use encryption or passwords. You can +create split or spanned archives. And there are many other options.

+ + + + +

Usage

+
+
+ZipIt.exe <ZipFileToCreate> [arguments]
+
+arguments:
+  <directory> | <file> - a directory or file to add to the archive.
+  <selector>           - a file selection expression.  Examples:
+                           *.txt
+                           (name = *.txt) OR (name = *.xml)
+                           (attrs = H) OR (name != *.xml)
+                           (ctime < 2009/02/28-10:20:00)
+                           (size > 1g) AND (mtime < 2009-06-29)
+                           (ctime > 2009-04-29) AND (size < 10kb)
+                         Filenames can include full paths. You must surround a filename
+                         that includes spaces with single quotes.
+  -64                  - use ZIP64 extensions, for large files or large numbers of files.
+  -aes                 - use WinZip-compatible AES 256-bit encryption for entries
+                         subsequently added to the archive. Requires a password.
+  -cp <codepage>       - use the specified numeric codepage for entries with comments
+                         or filenames that cannot be encoded with the default IBM437
+                         code page.
+  -d <path>            - use the given directory path in the archive for
+                         succeeding items added to the archive.
+  -D <path>            - find files in the given directory on disk.
+  -e<s,r,q,a>          - when there is an error reading a file to be zipped, either skip
+                         the file, retry, quit, or ask the user what to do.
+  -j-                  - do not traverse NTFS junctions
+  -j+                  - traverse NTFS junctions (default)
+  -L <level>           - compression level, 0..9 (Default is 6).
+  -p <password>        - apply the specified password for all succeeding files added.
+                         use "" to reset the password to nil.
+  -progress            - emit progress reports (good when creating large zips)
+  -r-                  - don't recurse directories (default).
+  -r+                  - recurse directories.
+  -s <entry> 'string'  - insert an entry of the given name into the
+                         archive, with the given string as its content.
+  -sfx [w|c]           - create a self-extracting archive, either a Windows or console app.
+  -split <maxsize>     - produce a split zip, with the specified maximum size.  You can
+                         optionally use kb or mb as a suffix to the size.
+                         -split is not compatible with -sfx.
+                         This is not compatible with -sfx.
+  -Tw+                 - store Windows-format extended times (default).
+  -Tw-                 - don't store Windows-format extended times.
+  -Tu+                 - store Unix-format extended times (default).
+  -Tu-                 - don't store Unix-format extended times (default).
+  -UTnow               - use uniform date/time, NOW, for all entries.
+  -UTnewest            - use uniform date/time, newest entry, for all entries.
+  -UToldest            - use uniform date/time, oldest entry, for all entries.
+  -UT <datetime>       - use uniform date/time, specified, for all entries.
+  -utf8                - use UTF-8 encoding for entries with comments or
+                         filenames that cannot be encoded with the default IBM437
+                         code page.
+  -zc <comment>        - use the given comment for the archive.
+
+
+ + + + +

Command Examples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
zipit.exe NewZip.zip -64 *.doc
  + create a new zip file called NewZip.zip, adding all .doc files from + the current directory + into the zip. Use ZIP64 extensions. +
zipit.exe NewZip.zip -r+ *.doc
  + create a new zip file called NewZip.zip, adding all .doc files, in the + current directory and any child directories, + into the zip. +
zipit.exe Backup.zip -d c:\MyDocuments -r+ -j- *.*
  + create a new zip file called Backup.zip, adding all files within the c:\MyDocuments + directory. Do not traverse NTFS Junction points (like My Videos). +
zipit.exe Package.exe -sfx -d c:\files -r+ *.*
  + create a new self-extracting archive file called Package.exe, adding + all files within the c:\files directory hierarchy. +
zipit.exe Package.zip -split 1mb -d c:\files -r+ *.*
  + create a new "spanned" or multi-segment zip file called Package.zip, adding + all files within the c:\files directory hierarchy. Each segment of the zipfile should be + limited to 1mb in size, and the segments will be named Package.z01, Package.z02, etc. +
zipit.exe ImageLibrary.zip -split 1mb -d c:\images -r+ "name = *.jpg AND size > 100kb"
  + create a new "spanned" or multi-segment zip file called ImageLibrary.zip, adding + all .jpg files within the c:\images directory hierarchy that have a size larger than 100kb. Each segment of the zipfile should be + limited to 1mb in size, and the segments will be named Package.z01, Package.z02, etc. +
zipit.exe Portfolio.zip -p Secret! -aes -d c:\portfolio -r+ "name != *.tfs"
  + create a new aip file called Portfolio.zip, adding + all files within the c:\portfolio directory hierarchy that do not have the .tfs extension. + Encrypt all entries using AES 256-bit encryption. +
zipit.exe Portfolio.zip -p Secret! -aes -L 9 -d c:\portfolio -r+ "name != *.tfs"
  + create a new aip file called Portfolio.zip, adding + all files within the c:\portfolio directory hierarchy that do not have the .tfs extension. + Encrypt all entries using AES 256-bit encryption, and use level 9 (Best) compression. +
+ + + + +

Syntax for the Selection Criteria

+ +

Using the a selector string, you can specify a set of criteria for +the files to be added to the zip file. Specify the criteria in +statements of 3 elements: a noun, an operator, and a value. Consider +the string "name != *.doc" . The noun is "name". The operator is "!=", +implying "Not Equal". The value is "*.doc". That criterion, in +English, says "all files with a name that does not end in the .doc +extension."

+ +

Supported nouns include name for the filename; atime, +mtime, and ctime for last access time, last modfied time, +and created time of the file, respectively; attributes for the +file attributes; and size for the file length (uncompressed). +The attributes and name nouns both support = and != as +operators. The size, atime, mtime, and +ctime nouns support = and !=, and >, >=, <, <= as +well. The times are taken to be expressed in local time.

+ +

Specify values for the file attributes as a string with one or more +of the characters H,R,S,A in any order, implying Hidden, ReadOnly, +System, and Archive, respectively. To specify a time, use +YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as the format. If you omit the HH:mm:ss portion, it +is assumed to be 00:00:00 (midnight). The value for a size criterion is +expressed in integer quantities of bytes, kilobytes (use k or kb after +the number), megabytes (m or mb), or gigabytes (g or gb). The value for +a name is a pattern to match against the filename, potentially including +wildcards. The pattern follows CMD.exe glob rules: * implies one or +more of any character (not including dot), while ? implies one character +(not including dot). If the name pattern contains any slashes, it is +matched to the entire filename, including the path; otherwise, it is +matched against only the filename without the path. This means a +pattern of "*\*.*" matches all files one directory level deep, while a +pattern of "*.*" matches all files in all directories.

+ + +

To specify a name pattern that includes spaces, use single quotes +around the pattern. A pattern of "'* *.*'" will match all files that +have spaces in the filename. The full criteria string for that would be +"name = '* *.*'" .

+ + + + + +

Examples of Selection Criteria

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
name = *.jpg
 any .jpg file +
mtime > 2009-07-14
 any file with a last modified time after midnight on 14 July + 2009. There is also ctime and atime for created time and accessed + time. +
ctime > 2009-07-14-07:53:00
 any file with a created time after 7:53am (local time) on 14 July 2009. +
size > 320mb
  +any file with a size over 320mb. You can use kb or gb, too. Or +omit the characters to specify a filesize in bytes. And you can use <, >, or = as +operations. +
attr != H
  +any file that does not have the Hidden attribute set. Other attributes +include S=system, R=Readonly, A=Archive. Of course you can test that +the attribute is ON as well, using = instead of !=. +
attr != H and size > 320mb
  +include the files that satisfy both conditions. You can also use OR as a conjuction. Use parens to group complex expressions. + +
name = *.jpg or name = *.gif
  +include the files that satisfy one or the other condition. +
(name = *.jpg) or (name = *.gif)
  +same as above. +
(mtime >= 2009-07-01) and (mtime < 2009-07-02)
  +any file modified on July 1st. From midnight to midnight. +
(name = *.jpg) AND (mtime >= 2009/07/01) and (mtime < 2009/07/02)
  +any .jpg file modified on July 1st. +
(name = *.jpg) and (size >= 100kb) and (mtime >= 2009/07/01) and (mtime < 2009/07/02)
  +any .jpg file, 100kb or more in size, modified on July 1st. +
+ + + + +

UnZip.exe

+ +

This tool can be used to view, extract, or test and verify ZIP files, +from the command line or from a batch file.

+ + + + +

Usage

+ +
+  UnZip.exe [options] <zipfile> [<entryname>...]
+     unzips all files in the archive.
+     options:
+       -o                overwrite existing files if necessary.
+       -f                flatten directory structure when extracting.
+       -p <password>     specify password for extraction.
+       -t                test the file for consistency.
+       -q                operate quietly (no verbose messages).
+       -cp <codepage>    extract with the specified numeric codepage.  Only do this if you
+                         know the codepage, and it is neither IBM437 nor UTF-8. If the
+                         codepage you specify here is different than the codepage of
+                         the cmd.exe, then the verbose messages will look odd, but the
+                         files will be extracted properly.
+       -d <directory>    unpack to the specified directory. If none provided, it will
+                         unzip to the current directory.
+       <entryname>       unzip only the specified filename.
+
+  unzip -l <zipfile>
+     lists the entries in the zip archive.
+  unzip -i <zipfile>
+     displays full information about all the entries in the zip archive.
+  unzip -t <zipfile> [-p <password>] [-cp <codepage>]
+     tests the zip archive.
+  unzip -?
+     displays this message.
+
+
+ + + + +

Command Examples

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
UnZip.exe -l Package.zip
  + list the entries in the zipfile, along with basic information about each entry. +
UnZip.exe Package.zip
  + extract the entries in the zipfile, into the current directory. +
UnZip.exe Package.zip -d ex1
  + extract the entries in the zipfile, into the directory 'ex1'. The directory will + be created if it does not exist. +
UnZip.exe Package.zip -f -d ex1
  + extract the entries in the zipfile, into the directory 'ex1'. The directory will + be created if it does not exist. Any directory hierarchy within the zip file + will be ignored or "flattened" upon extraction. +
UnZip.exe Package.zip -o -d ex1
  + extract the entries in the zipfile, into the directory 'ex1'. The directory will + be created if it does not exist. During extraction, any existing files in the + directory hierarchy will be overwritten if necessary. +
+ + + + + diff --git a/dotNetZip/Help/Zip Tools/GUI.htm b/dotNetZip/Help/Zip Tools/GUI.htm new file mode 100644 index 0000000..93b205c --- /dev/null +++ b/dotNetZip/Help/Zip Tools/GUI.htm @@ -0,0 +1,339 @@ + + +The Graphical Tool + + + + + + + + +

The DotNetZip Graphical Tool

+ +

The Tools/Utilities downloads for DotNetZip include a graphical tool +for creating and extracting zip files.

+ +

If you use the MSI installer, you will have the chance to associate +.zip files to this tool. If you associate .zip files to this tool, +double-clicking on a zip file from within Windows Explorer will open the +zip file in the tool. If you don't associate .zip files to this tool, +you can open the tool using the Start menu.

+ + + + +

The tool uses a tabbed-pane interface. One tab is used for reading +or extracting zip files, another is used for creating zip files. +

+ + + + +

Creating a Zip Archive

+ +

Create a zip file in two steps: first, select which files to add into +the zip, then add creating the zip with those files.

+ + + + +

An overview of the UI elements:

+
    + +
  1. the directory to add. Specify where in the filesystem to find the +files to be added into the zip file.
  2. + +
  3. check this box to traverse Windows NTFS Junctions; leave it unchecked to not traverse junctions
  4. + +
  5. the directory to be used within the zip archive for the files that get added. +
  6. + +
  7. The selection criteria for the files to be added to the zip.
  8. + +
  9. Click this button to add the files that match the selection criteria, to the listbox below (label #18) +To select additional files, you can then repeat steps 1-5 as many times as is necessary. +
    +
    +When you've selected the files you want to include in the archive, +
  10. + +
  11. Specify the name of the zip file to create.
  12. + +
  13. Specify whether to save a regular zip file, or a self-extracting archive.
  14. + +
  15. Specify the compression level to use. Higher compression levels requires more compression time.
  16. + +
  17. The text encoding to use for the filenames.
  18. + +
  19. Whether to use ZIP64 extensions
  20. + +
  21. whether to encrypt the file data, and if so, whether to use AES encryption.
  22. + +
  23. the password to use. The adjacent checkbox allows you to show or +obscure the password characters. This box is enabled only if encryption is in use.
  24. + +
  25. Use these checkboxes to specify whether to include extended timestamps in the generated zip file, in Windows or Unix formats.
  26. + +
  27. Whether to create a split archive, and if so, the size of the segment.
  28. + +
  29. The comment attached to the zip file
  30. + +
  31. The default extraction directory. This feature is enabled only for self-extracting archives.
  32. + +
  33. The command to run after extraction. This feature is enabled only for self-extracting archives.
  34. + +
  35. The list of files to be added to the zip archive. Each file has a checkbox associated to it.
  36. + +
  37. Click this button to remove any checked files from the list.
  38. + +
  39. Finally, click this button to actually create the zip archive.
  40. + +
+ + +

Extracting files from a Zip Archive

+ +

Extract files from a zip archive by opening the DotNetZip-WinformsTool.exe, and selecting the Read/Extract tab in the UI. +

+ + + + + + + + +

An overview of the UI elements:

+
    + +
  1. the zip file to read or extract. +
  2. + +
  3. click here to open and read the specified zip file. The list of +entries in the zip will be displayed in the listbox below (label #7). +
  4. + +
  5. The directory to extract entries into
  6. + +
  7. The selection criteria for entries to extract.
  8. + +
  9. Check this to overwrite existing files during extraction.
  10. + +
  11. Check this box to open Windows Explorer after extraction.
  12. + +
  13. The list of entries in the zip file.
  14. + +
  15. Click this button to extract the specified entries in the zip file. +
  16. +
+ + + + + +

Syntax for the Selection Criteria

+ +

Using the a selector string, you can specify a set of criteria for +the files to be added to the zip file. Specify the criteria in +statements of 3 elements: a noun, an operator, and a value. Consider +the string "name != *.doc" . The noun is "name". The operator is "!=", +implying "Not Equal". The value is "*.doc". That criterion, in +English, says "all files with a name that does not end in the .doc +extension."

+ +

Supported nouns include name for the filename; atime, +mtime, and ctime for last access time, last modfied time, +and created time of the file, respectively; attributes for the +file attributes; and size for the file length (uncompressed). +The attributes and name nouns both support = and != as +operators. The size, atime, mtime, and +ctime nouns support = and !=, and >, >=, <, <= as +well. The times are taken to be expressed in local time.

+ +

Specify values for the file attributes as a string with one or more +of the characters H,R,S,A in any order, implying Hidden, ReadOnly, +System, and Archive, respectively. To specify a time, use +YYYY-MM-DD-HH:mm:ss as the format. If you omit the HH:mm:ss portion, it +is assumed to be 00:00:00 (midnight). The value for a size criterion is +expressed in integer quantities of bytes, kilobytes (use k or kb after +the number), megabytes (m or mb), or gigabytes (g or gb). The value for +a name is a pattern to match against the filename, potentially including +wildcards. The pattern follows CMD.exe glob rules: * implies one or +more of any character (not including dot), while ? implies one character +(not including dot). If the name pattern contains any slashes, it is +matched to the entire filename, including the path; otherwise, it is +matched against only the filename without the path. This means a +pattern of "*\*.*" matches all files one directory level deep, while a +pattern of "*.*" matches all files in all directories.

+ + +

To specify a name pattern that includes spaces, use single quotes +around the pattern. A pattern of "'* *.*'" will match all files that +have spaces in the filename. The full criteria string for that would be +"name = '* *.*'" .

+ + + + + +

Examples of Selection Criteria

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use this Command...to do this...
name = *.jpg
 any .jpg file +
mtime > 07/01/2009
 any file with a last modified time after midnight on 1 July + 2009. There is also ctime and atime for created time and accessed + time. +
ctime > 07/01/2009-07:53:00
 any file with a created time after 7:53am on 1 July 2009. +
size > 320mb
  +any file with a size over 320mb. You can use kb or gb, too. Or +omit the characters for a size in bytes. And you can use <, >, or = as +operations. +
attr != H
  +any file that does not have the Hidden attribute set. Other attributes +include S=system, R=Readonly, A=Archive. Of course you can test that +the attribute is ON as well, using = instead of !=. +
attr != H and size > 320mb
  +include the files that satisfy both conditions. You can also use OR as a conjuction. Use parens to group complex expressions. + +
name = *.jpg or name = *.gif
  +include the files that satisfy one or the other condition. +
(name = *.jpg) or (name = *.gif)
  +same as above. +
(mtime >= 07/01/2009) and (mtime < 07/02/2009)
  +any file modified on July 1st. From midnight to midnight. +
(name = *.jpg) AND (mtime >= 07/01/2009) and (mtime < 07/02/2009)
  +any .jpg file modified on July 1st. +
(name = *.jpg) and (size >= 100kb) and (mtime >= 07/01/2009) and (mtime < 07/02/2009)
  +any .jpg file, 100kb or more in size, modified on July 1st. +
+ + + + + + diff --git a/dotNetZip/Help/Zip Tools/Zip Tools.htm b/dotNetZip/Help/Zip Tools/Zip Tools.htm new file mode 100644 index 0000000..3dea2a1 --- /dev/null +++ b/dotNetZip/Help/Zip Tools/Zip Tools.htm @@ -0,0 +1,3 @@ + + +Zip Tools diff --git a/dotNetZip/Help/Zip Tools/ZipTool1.png b/dotNetZip/Help/Zip Tools/ZipTool1.png new file mode 100644 index 0000000..7a0d2f4 Binary files /dev/null and b/dotNetZip/Help/Zip Tools/ZipTool1.png differ diff --git a/dotNetZip/Help/Zip Tools/ZipTool2.png b/dotNetZip/Help/Zip Tools/ZipTool2.png new file mode 100644 index 0000000..cfcab13 Binary files /dev/null and b/dotNetZip/Help/Zip Tools/ZipTool2.png differ diff --git a/dotNetZip/Help/Zip Tools/ZipTool3.png b/dotNetZip/Help/Zip Tools/ZipTool3.png new file mode 100644 index 0000000..cbd795d Binary files /dev/null and b/dotNetZip/Help/Zip Tools/ZipTool3.png differ diff --git a/dotNetZip/License.BZip2.txt b/dotNetZip/License.BZip2.txt new file mode 100644 index 0000000..f8b4346 --- /dev/null +++ b/dotNetZip/License.BZip2.txt @@ -0,0 +1,29 @@ + +The managed BZIP2 code included in Ionic.BZip2.dll and Ionic.Zip.dll is +modified code, based on the bzip2 code in the Apache commons compress +library. + +The original BZip2 was created by Julian Seward, and is licensed under +the BSD license. + +The following license applies to the Apache code: +----------------------------------------------------------------------- + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/dotNetZip/License.Combined.rtf b/dotNetZip/License.Combined.rtf new file mode 100644 index 0000000..e418545 --- /dev/null +++ b/dotNetZip/License.Combined.rtf @@ -0,0 +1,275 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;} +{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f39\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f40\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f42\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f44\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f46\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f379\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f380\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;} +{\f382\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f383\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f386\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f387\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);} +{\f409\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f410\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f412\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f413\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\f416\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f417\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} +{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0; +\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192; +\chyperlink\ctint255\cshade255\red0\green0\blue255;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 \styrsid2831265 Normal;}{\*\cs10 \additive +\ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31506\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{ +\s15\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext15 \sqformat \spriority34 \styrsid12654801 List Paragraph;}{\*\cs16 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf17 \sbasedon10 \sunhideused \styrsid12654801 Hyperlink;}}{\*\listtable{\list\listtemplateid-444059256\listhybrid{\listlevel +\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698703\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2 +\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\lvltentative\levelspace360\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative +\levelspace360\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360 +\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0 +{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext +\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid137696069}{\list\listtemplateid1444199352\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698703\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace360\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace360 +\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0 +{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext +\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext +\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext +\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext +\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace360\levelindent0{\leveltext +\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid333995038}{\list\listtemplateid-2077955012\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0 +\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid1091706244}}{\*\listoverridetable{\listoverride\listid137696069\listoverridecount0\ls1}{\listoverride\listid1091706244 +\listoverridecount0\ls2}{\listoverride\listid333995038\listoverridecount0\ls3}}{\*\rsidtbl \rsid1395907\rsid1599071\rsid1639370\rsid2831265\rsid2840296\rsid4537929\rsid5062432\rsid5376635\rsid6358681\rsid6962690\rsid7287725\rsid7959479\rsid8155306 +\rsid8258241\rsid10224083\rsid11415624\rsid11736570\rsid12266757\rsid12654801\rsid12911876\rsid13976247\rsid14944920}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info +{\author Dino Chiesa}{\operator Dino}{\creatim\yr2008\mo7\dy3\hr11\min53}{\revtim\yr2011\mo7\dy27\hr10\min34}{\version10}{\edmins30}{\nofpages3}{\nofwords979}{\nofchars5585}{\*\company Microsoft}{\nofcharsws6551}{\vern49273}}{\*\xmlnstbl {\xmlns1 http://s +chemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale110\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot8258241\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid2831265\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8258241 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs28 \ltrch\fcs0 \fs28\insrsid12654801 Software }{\rtlch\fcs1 \af0\afs28 \ltrch\fcs0 \fs28\insrsid12654801\charrsid12654801 Licenses }{\rtlch\fcs1 \af0\afs28 \ltrch\fcs0 +\fs28\insrsid12654801 that apply to DotNetZip}{\rtlch\fcs1 \af0\afs28 \ltrch\fcs0 \fs28\insrsid12654801\charrsid12654801 +\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801\charrsid12654801 This software,}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\i\insrsid12654801 t}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\i\insrsid12654801\charrsid12654801 he}{\rtlch\fcs1 \af0 \ltrch\fcs0 +\b\i\insrsid8258241\charrsid12654801 DotNetZip}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\i\insrsid8258241\charrsid5376635 library}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\i\insrsid12911876 and tools}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 }{\rtlch\fcs1 \af0 +\ltrch\fcs0 \insrsid12654801 is provided for your use under several }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\insrsid12654801\charrsid12654801 licenses}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 . }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 + One license applies to DotNetZip, and }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid7287725 several}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 other licenses apply to work that DotNetZip derives from. To }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 +use the software, you }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 must accept the}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 license}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 s}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 +. If you do not accept the license}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid7287725 s}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 , do not use the software. +\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 The following license, the }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801\charrsid12654801 Microsoft Public License (Ms-PL)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 ,}{\rtlch\fcs1 \af0 \ltrch\fcs0 +\insrsid12654801\charrsid12654801 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 applies to the original intellectual property in DotNetZip: }{\rtlch\fcs1 \af0\afs28 \ltrch\fcs0 \fs28\insrsid12654801\charrsid12654801 +\par }\pard \ltrpar\ql \li360\ri0\sa80\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid1639370 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 1. Definitions +\par }\pard \ltrpar\ql \li720\ri0\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid1639370 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. +\par A "contribution" is the original software, or any additions or changes to the software. +\par A "contributor" is any person that distributes its contribution under this license. +\par "Licensed patents" are a contributor's patent claims that read directly on its contribution. +\par }\pard \ltrpar\ql \li360\ri0\sa80\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid1639370 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 2. Grant of Rights +\par }\pard \ltrpar\ql \li720\ri0\sa80\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid1639370 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 (A +) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivativ +e works of its contribution, and distribute its contribution or any derivative works that you create. +\par (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-ex +clusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of th}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 +\fs18\insrsid1639370\charrsid1639370 e contribution in the software.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 +\par }\pard \ltrpar\ql \li360\ri0\sa80\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid1639370 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 3. Conditions and Limitations +\par }\pard \ltrpar\ql \li720\ri0\sa80\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid1639370 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 (A) No Trademark License}{\rtlch\fcs1 +\af0\afs18 \ltrch\fcs0 \fs18\insrsid11736570\charrsid1639370 }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 - This license does not grant you rights to use any contributor}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 +\fs18\insrsid5376635\charrsid1639370 \rquote s}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid8258241\charrsid1639370 name, logo, or trademarks. +\par (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +\par (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. +\par (D) If you distribute any p +ortion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under +a license that complies with this license. +\par (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this l +icense cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid8258241 +\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14944920 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12654801 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12654801 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zi +p.dll is derived from the jzlib, which is Copyright (c) 2000,2001,2002,2003 ymnk, JCraft, Inc., and is licensed under the following terms: +\par }\pard \ltrpar\ql \li360\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid12654801 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +\par {\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f31506\fs18\insrsid12654801\charrsid14944920 \hich\af31506\dbch\af0\loch\f31506 1.\tab}}\pard\plain \ltrpar\s15\ql \fi-360\li1080\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin1080\itap0\pararsid12654801\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs18 +\ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +\par {\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f31506\fs18\insrsid12654801\charrsid14944920 \hich\af31506\dbch\af0\loch\f31506 2.\tab}Redistributions in binary form must reproduce the above copyright notice, this list of conditions +and the following disclaimer in the documentation and/or other materials provided with the distribution. +\par {\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f31506\fs18\insrsid12654801\charrsid14944920 \hich\af31506\dbch\af0\loch\f31506 3.\tab}}\pard \ltrpar\s15\ql \fi-360\li1080\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin1080\itap0\pararsid11415624\contextualspace {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 +The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. +\par }\pard\plain \ltrpar\ql \li360\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid12654801 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid12654801 THIS S +OFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, INC. OR ANY CONTRIBUTORS TO THIS + +SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12654801 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12654801 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12654801 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid12654801 The jzlib library, itself, is based + on the C-language ZLIB library, v1.1.3. The following notice and license applies to zlib: +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid12654801 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 +ZLIB is Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler +\par The ZLIB software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. +\par Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: +\par {\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f31506\fs18\insrsid12654801\charrsid14944920 \hich\af31506\dbch\af0\loch\f31506 1.\tab}}\pard\plain \ltrpar\s15\ql \fi-360\li1440\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin1440\itap0\pararsid12654801\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0\afs18 +\ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 +The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +\par {\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f31506\fs18\insrsid12654801\charrsid14944920 \hich\af31506\dbch\af0\loch\f31506 2.\tab} +Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +\par {\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \f31506\fs18\insrsid12654801\charrsid14944920 \hich\af31506\dbch\af0\loch\f31506 3.\tab}This notice may not be removed or altered from any source distribution. +\par }\pard\plain \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid12654801 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 Jean-loup Gailly }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid6962690\charrsid14944920 }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 +jloup@gzip.org\line Mark Adler}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid6962690\charrsid14944920 }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid12654801\charrsid14944920 madler@alumni.caltech.edu}{\rtlch\fcs1 \af0 \ltrch\fcs0 +\insrsid12654801 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4537929 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4537929 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4537929 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4537929 +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4537929 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4537929 +The managed BZIP2 code included in Ionic.BZip2.dll and Ionic.Zip.dll is modified code, based on the bzip2 code in the Apache commons compress library. +\par The original BZip2 was created by Julian Seward, and is licensed under the BSD license. +\par The following license applies to the Apache code:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid4537929 +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid4537929 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid4537929\charrsid4537929 +Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF lice +nses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at +\par http://www.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid4537929 apache.org/licenses/LICENSE-2.0}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid4537929\charrsid4537929 +\par Unless required by applicabl +e law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitat +ions under the License.}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid4537929 +\par }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid7287725\charrsid4537929 +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f +7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 +615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad +79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b +5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab +999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 +699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 +8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 +0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f +9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be +15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 +3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d +32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a +f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 +e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb +44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a +6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c +3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256 +5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276 +b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8 +c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e +51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95 +b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff +6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6 +9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239 +b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449 +59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8 +2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468 +656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4 +350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624 +52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141 +73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000 +0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000 +000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019 +0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000 +000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027 +00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000c0f9 +b4436a4ccc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/dotNetZip/License.rtf b/dotNetZip/License.rtf new file mode 100644 index 0000000..7bb8e2b --- /dev/null +++ b/dotNetZip/License.rtf @@ -0,0 +1,184 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;} +{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f39\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f40\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f42\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f44\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f46\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f379\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f380\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;} +{\f382\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f383\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f386\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f409\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\f410\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f412\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f413\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f416\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;} +{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;} +{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 +\ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 \styrsid2831265 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31506\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused \sqformat Normal Table;}} +{\*\rsidtbl \rsid1395907\rsid1599071\rsid2831265\rsid2840296\rsid5062432\rsid5376635\rsid6358681\rsid8155306\rsid8258241\rsid10224083\rsid11736570\rsid12266757\rsid12911876\rsid13976247}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1 +\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Dino Chiesa}{\operator Dino}{\creatim\yr2008\mo7\dy3\hr11\min53}{\revtim\yr2009\mo6\dy26\hr21\min16}{\version4}{\edmins5}{\nofpages2}{\nofwords409}{\nofchars2233} +{\*\company Microsoft}{\nofcharsws2637}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale110\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot8258241\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid2831265\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8258241 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 +\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af31507\afs28 \ltrch\fcs0 \fs28\insrsid8258241\charrsid5376635 Microsoft Public License (Ms-PL) +\par }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 This license governs use of }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \b\i\insrsid8258241\charrsid5376635 the DotNetZip library}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \b\i\insrsid12911876 and tools}{\rtlch\fcs1 +\af31507 \ltrch\fcs0 \insrsid8258241 ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software. +\par 1. Definitions +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid11736570 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. +\par A "contribution" is the original software, or any additions or changes to the software. +\par A "contributor" is any person that distributes its contribution under this license. +\par "Licensed patents" are a contributor's patent claims that read directly on its contribution. +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8258241 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 2. Grant of Rights +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid11736570 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license + to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. +\par (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations +in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works o +f the contribution in the software. +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8258241 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 +\par 3. Conditions and Limitations +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid11736570 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 (A) No Trademark License}{\rtlch\fcs1 \af31507 \ltrch\fcs0 +\insrsid11736570 }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 - This license does not grant you rights to use any contributor}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid5376635 \rquote s}{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8258241 + name, logo, or trademarks. +\par (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +\par (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. +\par (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compi +led or object code form, you may only do so under a license that complies with this license. +\par (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional + consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. +\par }{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid1599071 +\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8 +72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7 +2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b +44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7 +065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000 +00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08 +84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc +52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353 +bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468 +656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c +070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7 +29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65 +312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8 +a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04 +98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c +94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471 +7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671 +9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1 +e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5 +193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1 +17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2 +8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6 +6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a +668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847 +bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e +16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b +5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0 +8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2 +c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966 +0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b +7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb +9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0 +088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf +8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26 +ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0 +28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6 +345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93 +b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30 +254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74 +68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24 +51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198 +720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528 +a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000 +000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000 +002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468 +656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000 +00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000 +00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000c0fd +57f4c4f6c901feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/dotNetZip/License.txt b/dotNetZip/License.txt new file mode 100644 index 0000000..ade678c --- /dev/null +++ b/dotNetZip/License.txt @@ -0,0 +1,33 @@ +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + +A "contribution" is the original software, or any additions or changes to the software. + +A "contributor" is any person that distributes its contribution under this license. + +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. + + diff --git a/dotNetZip/License.zlib.txt b/dotNetZip/License.zlib.txt new file mode 100644 index 0000000..801e941 --- /dev/null +++ b/dotNetZip/License.zlib.txt @@ -0,0 +1,70 @@ + +The following licenses govern use of the accompanying software, the +DotNetZip library ("the software"). If you use the software, you accept +these licenses. If you do not accept the license, do not use the software. + +The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zip.dll is +modified code, based on jzlib. + + + +The following notice applies to jzlib: +----------------------------------------------------------------------- + +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the distribution. + +3. The names of the authors may not be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----------------------------------------------------------------------- + +jzlib is based on zlib-1.1.3. + +The following notice applies to zlib: + +----------------------------------------------------------------------- + +Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler + + The ZLIB software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly jloup@gzip.org + Mark Adler madler@alumni.caltech.edu + + +----------------------------------------------------------------------- diff --git a/dotNetZip/LocalTestRun.testrunconfig b/dotNetZip/LocalTestRun.testrunconfig new file mode 100644 index 0000000..2951f54 --- /dev/null +++ b/dotNetZip/LocalTestRun.testrunconfig @@ -0,0 +1,19 @@ + + + This is a default test run configuration for a local test run. + + + + + + +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/dotNetZip/MakeReleaseZips.bat b/dotNetZip/MakeReleaseZips.bat new file mode 100644 index 0000000..e5123e8 --- /dev/null +++ b/dotNetZip/MakeReleaseZips.bat @@ -0,0 +1,538 @@ +@echo off +goto START + +------------------------------------------------------- + MakeReleaseZips.bat + + Makes the zips, msi's, and chm for the DotNetZip release content. + + created: Thu, 19 Jun 2008 22:17 + + This batch file is part of DotNetZip. + DotNetZip is Copyright 2008-2011 Dino Chiesa. + + DotNetZip is licensed under the MS-PL. See the accompanying + License.txt file. + + Last Updated: <2011-August-06 01:37:07> + +------------------------------------------------------- + + +:START + +setlocal +set baseDir=%~dps0 +set SNEXE=c:\winsdk\bin\sn.exe +set MSBUILD=c:\.net4.0\msbuild.exe +set POWERSHELL=c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +@REM set zipit=c:\users\dino\bin\zipit.exe +set zipit=%baseDir%tools\Zipit\bin\Debug\zipit.exe +set ExpectedSignedDlls=32 +set stamp=%DATE% %TIME% +set stamp=%stamp:/=-% +set stamp=%stamp: =-% +set stamp=%stamp::=% + + +@REM get the version: +for /f "delims==" %%I in ('type SolutionInfo.cs ^| c:\bin\grep.exe AssemblyVersion ^| c:\bin\sed.exe -e "s/^.*(.\(.*\).).*/\1 /"') do set longversion=%%I + +set version=%longversion:~0,3% +echo version is %version% + +%MSBUILD% DotNetZip.sln /p:Configuration=Debug +%MSBUILD% DotNetZip.sln /p:Configuration=Release + +call :CheckSignatures +if ERRORLEVEL 1 ( + echo exiting. + exit /b 1 +) + + set releaseDir=releases\v%version%-%stamp% + echo making release dir %releaseDir% + mkdir %releaseDir% + + call :MakeDocumentation + + ::REM call :MakeIntegratedHelpMsi + + call :MakeDevelopersRedist + + call :MakeRuntimeRedist + + call :MakeSilverlightRedist + + call :MakeZipUtils + + call :MakeUtilsMsi + + call :MakeRuntimeMsi + + %POWERSHELL% .\clean.ps1 + + call :MakeSrcZip + + +goto :END + + + +-------------------------------------------- +:CheckSignatures + + @REM check the digital signatures on the various DLLs + + SETLOCAL EnableExtensions EnableDelayedExpansion + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Checking signatures... + echo. + + set verbose=1 + set rcode=0 + set ccount=0 + set okcount=0 + set notsigned=0 + + for /R %%D in (*.dll) do ( + @REM don't check DLLs from some directories + set thisfile=%%D + + echo !thisfile! | findstr TestResults >nul: + if ERRORLEVEL 1 ( + echo !thisfile! | findstr Examples >nul: + if ERRORLEVEL 1 ( + echo !thisfile! | findstr Tests >nul: + if ERRORLEVEL 1 ( + echo !thisfile! | findstr \obj\ >nul: + if ERRORLEVEL 1 ( + call :BACKTICK pubkey %SNEXE% -q -T "!thisfile!" + set /a ccount=!ccount!+1 + If "!pubkey:~-44!"=="does not represent a strongly named assembly" ( + set /a notsigned=!notsigned!+1 + if %verbose% GTR 0 (echo !pubkey!) + ) else ( + if %verbose% GTR 0 (echo %%D !pubkey!) + If /i "!pubkey:~-16!"=="edbe51ad942a3f5c" ( + set /a okcount=!okcount!+1 + ) else ( + set /a rcode=!rcode!+1 + ) + ) + ) + ) + ) + ) + ) + + if %verbose% GTR 0 ( + echo Checked !ccount! DLLs + echo !notsigned! were not signed + echo !okcount! were signed, with the correct key + echo !rcode! were signed, with the wrong key + ) + + if !rcode! GTR 0 ( + echo. + echo Found !rcode! assemblies signed with an unexpected key. + exit /b 1 + ) + if !okcount! NEQ %ExpectedSignedDlls% ( + echo. + echo There are !okcount! correctly signed assemblies. + echo That does not agree with the configured expected value of %ExpectedSignedDlls%. + exit /b 1 + ) + + echo. + echo. + + endlocal + +goto :EOF +------------------------------------------------------- + + + +-------------------------------------------- +:MakeDocumentation + + @REM This batch subroutine invokes MSBUILD using the shfbproj files + @REM for Documentation. Example output htmlhelp1 file name: + @REM DotNetZipLib-v1.9.chm + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Building Documentation Files + echo. + + echo build Help\HtmlHelp1.shfbproj + %MSBUILD% /nologo /p:Configuration=Release Help\HtmlHelp1.shfbproj + + echo build Help\HelpViewer.shfbproj + %MSBUILD% /nologo /p:Configuration=Release Help\HelpViewer.shfbproj + + set zipfile=DotNetZip-Documentation-v%version%.zip + set rzipfile=%releaseDir%\%zipfile% + echo zipfile is %rzipfile% + + %zipit% %rzipfile% -s Readme.txt "This zip contains the documentation for DotNetZip in various help formats. This is for DotNetZip v%version%. This package was packed %stamp%. " -s You-can-Donate.txt "FYI: DotNetZip is donationware. Consider donating. It's for a good cause. http://cheeso.members.winisp.net/DotNetZipDonate.aspx" + + %zipit% %rzipfile% -d . -D Help\bin\HtmlHelp1 -E *.chm -d "Help Viewer 1.0" -D Help\bin\HelpViewer -r+ -E "(name != *.chm) AND (name != *.log)" + +goto :EOF +-------------------------------------------- + + + + +-------------------------------------------- +:MakeDevelopersRedist + + @REM example output zipfile name: DotNetZipLib-DevKit-v1.5.zip + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the Developer's redistributable zip... + echo. + + set zipfile=DotNetZipLib-DevKit-v%version%.zip + @REM for %%f in (%releaseDir%\%zipfile%) do set rzipfile=%%~ff + set rzipfile=%releaseDir%\%zipfile% + echo zipfile is %rzipfile% + + %zipit% %rzipfile% -s Contents.txt "This is the Developer's Kit package for DotNetZip v%version%. This package was packed %stamp%. In this zip you will find Debug and Release DLLs for the various versions of the assemblies: Ionic.Zip, Ionic.Zlib, and Ionic.BZip2. There is a separate top-level folder for each distinct version of the DLL, and within those top-level folders there are Debug and Release folders. In the Debug folders you will find a DLL, a PDB, and an XML file for the given library, while the Release folder will have just a DLL. The DLL is the actual library (either Debug or Release flavor), the PDB is the debug information, and the XML file is the intellisense doc for use within Visual Studio. There are also files containing the documentation. If you have any questions, please check the forums on http://www.codeplex.com/DotNetZip" -s PleaseDonate.txt "DotNetZip is donationware. Consider donating. You'll feel good about it, and it's for a good cause. http://cheeso.members.winisp.net/DotNetZipDonate.aspx" Readme.txt License.txt License.zlib.txt License.bzip2.txt + + %zipit% %rzipfile% -d zip-v%version% -s Readme.txt "DotNetZip Library Developer's Kit package, v%version% packed %stamp%. This is the DotNetZip library. It includes the classes in the Ionic.Zip namespace as well as the classes in the Ionic.Zlib namespace. Use this library if you want to manipulate ZIP files within .NET applications." + + %zipit% %rzipfile% -d zip-v%version%\Debug -D Zip\bin\Debug Ionic.Zip.dll Ionic.Zip.xml Ionic.Zip.pdb + %zipit% %rzipfile% -d zip-v%version%\Release Zip\bin\Release\Ionic.Zip.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d zip-v%version%-Reduced -s Readme.txt "DotNetZip Reduced Library, Developer's Kit package, v%version% packed %stamp%. This is the reduced version of the DotNetZip library. It includes the classes in the Ionic.Zip namespace as well as the classes in the Ionic.Zlib namespace. The reduced library differs from the full library in that it lacks the ability to save self-Extracting archives (aka SFX files), and is much smaller than the full library." + + %zipit% %rzipfile% -d zip-v%version%-Reduced\Debug -D "Zip Reduced\bin\Debug" Ionic.Zip.Reduced.dll Ionic.Zip.Reduced.pdb Ionic.Zip.Reduced.XML + %zipit% %rzipfile% -d zip-v%version%-Reduced\Release -D "Zip Reduced\bin\Release" Ionic.Zip.Reduced.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d zip-v%version%-CompactFramework -s Readme.txt "DotNetZip CF Library v%version% packed %stamp%. This assembly is built for the Compact Framework v2.0 or later, and includes all the classes in the Ionic.Zip namespace, as well as all the classes in the Ionic.Zlib namespace. Use this library if you want to manipulate ZIP files in smart-device applications, and if you want to use ZLIB compression directly, or if you want to use the compressing stream classes like GZipStream, DeflateStream, or ZlibStream." + + %zipit% %rzipfile% -d zip-v%version%-CompactFramework\Debug -D "Zip CF\bin\Debug" Ionic.Zip.CF.dll Ionic.Zip.CF.pdb + %zipit% %rzipfile% -d zip-v%version%-CompactFramework\Release -D "Zip CF\bin\Release" Ionic.Zip.CF.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d zip-v%version%-Silverlight -s Readme.txt "Ionic.Zip Silverlight v%version% packed %stamp%. This is the Ionic.Zip library packaged for Silverlight 3.0 or later. Use this library if you want to manipulate ZIP files from within Silverlight applications." + + %zipit% %rzipfile% -d zip-v%version%-Silverlight\Debug -D "Zip SL\bin\Debug" Ionic.Zip.dll Ionic.Zip.pdb Ionic.Zip.XML + %zipit% %rzipfile% -d zip-v%version%-Silverlight\Release -D "Zip SL\bin\Release" Ionic.Zip.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d zlib-v%version% -s Readme.txt "Ionic.Zlib v%version% packed %stamp%. This is the Ionic.Zlib assembly; it includes only the classes in the Ionic.Zlib namespace. Use this library if you want to take advantage of ZLIB compression directly, or if you want to use the compressing stream classes like GZipStream, DeflateStream, or ZlibStream." + %zipit% %rzipfile% -d zlib-v%version%\Debug -D Zlib\bin\Debug Ionic.Zlib.dll Ionic.Zlib.pdb Ionic.Zlib.XML + %zipit% %rzipfile% -d zlib-v%version%\Release -D Zlib\bin\Release Ionic.Zlib.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d zlib-v%version%-CompactFramework -s Readme.txt "Ionic.Zlib CF v%version% packed %stamp%. This is the Ionic.Zlib library packaged for the .NET Compact Framework v2.0 or later. Use this library if you want to take advantage of ZLIB compression directly from within Smart device applications, using the compressing stream classes like GZipStream, DeflateStream, or ZlibStream." + + %zipit% %rzipfile% -d zlib-v%version%-CompactFramework\Debug -D "Zlib CF\bin\Debug" Ionic.Zlib.CF.dll Ionic.Zlib.CF.pdb Ionic.Zlib.CF.XML + %zipit% %rzipfile% -d zlib-v%version%-CompactFramework\Release -D "Zlib CF\bin\Release" Ionic.Zlib.CF.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d zlib-v%version%-Silverlight -s Readme.txt "Ionic.Zlib Silverlight v%version% packed %stamp%. This is the Ionic.Zlib library packaged for Silverlight 3.0 or later. Use this library if you want to take advantage of ZLIB compression directly from within Silverlight applications, using the compressing stream classes like GZipStream, DeflateStream, or ZlibStream." + + %zipit% %rzipfile% -d zlib-v%version%-Silverlight\Debug -D "Zlib SL DLL\bin\Debug" Ionic.Zlib.dll Ionic.Zlib.pdb Ionic.Zlib.XML + %zipit% %rzipfile% -d zlib-v%version%-Silverlight\Release -D "Zlib SL DLL\bin\Release" Ionic.Zlib.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d bzip2-v%version% -s Readme.txt "Ionic.BZip2 v%version% packed %stamp%. This is the Ionic.BZip2 assembly; it includes only the classes in the Ionic.BZip2 namespace. Use this library if you want to take advantage of BZip2 compression directly, via the compressing stream classes like BZip2OutputStream, or BZip2InputStream." + %zipit% %rzipfile% -d bzip2-v%version%\Debug -D "BZip2\bin\Debug" Ionic.BZip2.dll Ionic.BZip2.pdb Ionic.BZip2.XML + %zipit% %rzipfile% -d bzip2-v%version%\Release -D "BZip2\bin\Release" Ionic.BZip2.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d bzip2-v%version%-CompactFramework -s Readme.txt "Ionic.BZip2 CF v%version% packed %stamp%. This is the Ionic.BZip2 library packaged for the .NET Compact Framework v2.0 or later. Use this library if you want to compress or decompress using BZip2, via the stream classes BZip2InputStream and BZip2OutputStream." + + %zipit% %rzipfile% -d bzip2-v%version%-CompactFramework\Debug -D "BZip2 CF\bin\Debug" Ionic.BZip2.CF.dll Ionic.BZip2.CF.pdb Ionic.BZip2.CF.XML + %zipit% %rzipfile% -d bzip2-v%version%-CompactFramework\Release -D "BZip2 CF\bin\Release" Ionic.BZip2.CF.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d bzip2-v%version%-Silverlight -s Readme.txt "Ionic.BZip2 Silverlight v%version% packed %stamp%. This is the Ionic.BZip2 library packaged for Silverlight 3.0 or later. Use this library if you want to take advantage of BZip2 compression directly from within Silverlight applications, using the stream classes like BZip2InputStream, or BZip2OutputStream." + + %zipit% %rzipfile% -d bzip2-v%version%-Silverlight\Debug -D "BZip2 SL DLL\bin\Debug" Ionic.BZip2.dll Ionic.BZip2.pdb Ionic.BZip2.XML + %zipit% %rzipfile% -d bzip2-v%version%-Silverlight\Release -D "BZip2 SL DLL\bin\Release" Ionic.BZip2.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d Tools ^ + -s Readme.txt "These are tools that may be useful as you develop applications that manipulate zip files." ^ + -D Tools\ZipIt\bin\Release Zipit.exe Ionic.Zip.dll ^ + -D Tools\Unzip\bin\Release Unzip.exe ^ + -D Tools\ConvertZipToSfx\bin\Release ConvertZipToSfx.exe ^ + -D Tools\WinFormsApp\bin\Release DotNetZip-WinFormsTool.exe ^ + -D Tools\BZip2\bin\Release BZip2.exe Ionic.BZip2.dll ^ + -D Tools\GZip\bin\Release GZip.exe Ionic.Zlib.dll + + @REM -------------------------------------------- + + %zipit% %rzipfile% -d VS2008-IntegratedHelp -s Readme.txt "This MSI installs the DotNetZip help content into the VisualStudio Integrated help system. After installing this MSI, pressing F1 within Visual Studio, with your cursor on a type defined within the DotNetZip assembly, will open the appropriate help within Visual Studio." -D Help-VS-Integrated\HelpIntegration\Debug DotNetZip-HelpIntegration.msi + + %zipit% %rzipfile% -d Examples\WScript -D "Zip Tests\resources" VbsCreateZip-DotNetZip.vbs VbsUnZip-DotNetZip.vbs TestCheckZip.js + + %zipit% %rzipfile% -d Examples -D Examples -r+ -E "name != *.cache and name != *.*~ and name != *.suo and name != *.user and name != #*.*# and name != *.vspscc and name != Examples\*\*\bin\*.* and name != Examples\*\*\obj\*.* and name != Examples\*\bin\*.* and name != Examples\*\obj\*.*" + + %zipit% %rzipfile% -D %releaseDir% -E "name = DotNetZip-Documentation-*.zip" + + cd %baseDir% + +goto :EOF +-------------------------------------------- + + + +-------------------------------------------- +:MakeRuntimeRedist + + @REM example output zipfile name: DotNetZipLib-Runtime-v1.5.zip + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the user's redistributable zip... + echo. + + set zipfile=DotNetZipLib-Runtime-v%version%.zip + set rzipfile=%releaseDir%\%zipfile% + + echo zipfile is %rzipfile% + + %zipit% %rzipfile% -s Contents.txt "This is the redistributable package for DotNetZip v%version%. Packed %stamp%. In this zip you will find a separate folder for each separate version of the DLL. In each folder there is a RELEASE build DLL, suitable for redistribution with your app. If you have any questions, please check the forums on http://www.codeplex.com/DotNetZip " -s DotNetZip-is-DonationWare.txt "DotNetZip is donationware. Consider donating. It's for a good cause. http://cheeso.members.winisp.net/DotNetZipDonate.aspx" Readme.txt License.txt License.zlib.txt License.bzip2.txt + + %zipit% %rzipfile% -d zip-v%version% -s Readme.txt "DotNetZip Redistributable Library v%version% packed %stamp%" Zip\bin\Release\Ionic.Zip.dll + + %zipit% %rzipfile% -d zip-v%version%-Reduced -s Readme.txt "DotNetZip Reduced Redistributable Library v%version% packed %stamp%" "Zip Reduced\bin\Release\Ionic.Zip.Reduced.dll" + + %zipit% %rzipfile% -d zip-v%version%-CompactFramework -s Readme.txt "DotNetZip Library for .NET Compact Framework v%version% packed %stamp%" "Zip CF\bin\Release\Ionic.Zip.CF.dll" + + %zipit% %rzipfile% -d zlib-v%version% -s Readme.txt "Ionic.Zlib Redistributable Library v%version% packed %stamp%" Zlib\bin\Release\Ionic.Zlib.dll + + %zipit% %rzipfile% -d zlib-v%version%-CompactFramework -s Readme.txt "Ionic.Zlib Library for .NET Compact Framework v%version% packed %stamp%" "Zlib CF\bin\Release\Ionic.Zlib.CF.dll" + + %zipit% %rzipfile% -d bzip2-v%version% -s Readme.txt "Ionic.BZip2 Redistributable Library v%version% packed %stamp%" BZip2\bin\Release\Ionic.BZip2.dll + + %zipit% %rzipfile% -d bzip2-v%version%-CompactFramework -s Readme.txt "Ionic.BZip2 Library for .NET Compact Framework v%version% packed %stamp%" "BZip2 CF\bin\Release\Ionic.BZip2.CF.dll" + +goto :EOF +-------------------------------------------- + + + +-------------------------------------------- +:MakeSilverlightRedist + + @REM example output zipfile name: DotNetZipLib-Silverlight-v1.9.zip + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the silverlight redistributable zip... + echo. + + set zipfile=DotNetZipLib-Silverlight-v%version%.zip + set rzipfile=%releaseDir%\%zipfile% + + echo zipfile is %rzipfile% + + %zipit% %rzipfile% -s Contents.txt "This is the Silverlight redistributable package for DotNetZip v%version%. Packed %stamp%. There is an assembly for BZip2, one for ZLIB/Deflate/GZIP, and one for Zip, in the Release folder, and debug builds of the same in the Debug folder, for a total of 6 DLLs. You need to reference exactly one of those DLLs; which one depends on your application requirements. If you have any questions, please check the forums on http://dotnetzip.codeplex.com/discussions " -s DotNetZip-is-DonationWare.txt "DotNetZip is donationware. Consider donating. It's for a good cause. http://cheeso.members.winisp.net/DotNetZipDonate.aspx" License.txt License.zlib.txt License.bzip2.txt + + %zipit% %rzipfile% -d Release "Zip SL\bin\Release\Ionic.Zip.dll" "Zlib SL DLL\bin\Release\Ionic.Zlib.dll" "BZip2 SL DLL\bin\Release\Ionic.BZip2.dll" + + %zipit% %rzipfile% -d Debug -D "Zip SL\bin\Debug" Ionic.Zip.dll Ionic.Zip.xml Ionic.Zip.pdb -D "Zlib SL DLL\bin\Debug" Ionic.Zlib.dll Ionic.Zlib.xml Ionic.Zlib.pdb -D "BZip2 SL DLL\bin\Debug" Ionic.BZip2.dll Ionic.BZip2.xml Ionic.BZip2.pdb + +goto :EOF +-------------------------------------------- + + + + +-------------------------------------------- +:MakeZipUtils + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the Zip Utils zip... + echo. + + set zipfile=DotNetZipUtils-v%version%.zip + + @REM for %%f in (%releaseDir%\%zipfile%) do set rzipfile=%%~ff + + set rzipfile=%releaseDir%\%zipfile% + echo zipfile is %rzipfile% + + %zipit% %rzipfile% -zc "Zip utilities v%version% packed %stamp%" -s Contents.txt "These are the DotNetZip utilities and tools, for DotNetZip v%version%. Packed %stamp%." -s I-Welcome-Donations.txt "DotNetZip is donationware. I welcome donations. It's for a good cause. http://cheeso.members.winisp.net/DotNetZipDonate.aspx" License.txt License.zlib.txt License.bzip2.txt + + %zipit% %rzipfile% ^ + -D Tools\ZipIt\bin\Release Zipit.exe Ionic.Zip.dll ^ + -D Tools\Unzip\bin\Release Unzip.exe ^ + -D Tools\ConvertZipToSfx\bin\Release ConvertZipToSfx.exe ^ + -D Tools\WinFormsApp\bin\Release DotNetZip-WinFormsTool.exe ^ + -D Tools\BZip2\bin\Release BZip2.exe Ionic.BZip2.dll ^ + -D Tools\GZip\bin\Release GZip.exe Ionic.Zlib.dll + +goto :EOF +-------------------------------------------- + + + +-------------------------------------------- +:MakeIntegratedHelpMsi + + @REM example output zipfile name: DotNetZip-HelpIntegration.msi + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the Integrated help MSI... + echo. + + c:\vs2008\Common7\ide\devenv.exe Help-VS-Integrated\HelpIntegration.sln /build Debug /project HelpIntegration + echo waiting for Help-VS-Integrated\HelpIntegration\Debug\DotNetZip-HelpIntegration.msi + c:\dinoch\dev\dotnet\AwaitFile Help-VS-Integrated\HelpIntegration\Debug\DotNetZip-HelpIntegration.msi + @REM move Help-VS-Integrated\HelpIntegration\Debug\DotNetZip-HelpIntegration.msi %releaseDir%\DotNetZip-HelpIntegration.msi + +goto :EOF +-------------------------------------------- + + + + +-------------------------------------------- +:MakeUtilsMsi + + @REM example output zipfile name: DotNetZipUtils-v1.8.msi + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the Utils MSI... + echo. + + cd "Setup Utils" + %MSBUILD% /p:Configuration=Release + cd .. + move "Setup Utils\bin\Release\en-us\DotNetZipUtils.msi" %releaseDir%\DotNetZipUtils-v%version%.msi + +goto :EOF +-------------------------------------------- + + + + +-------------------------------------------- +:MakeRuntimeMsi + + @REM example output zipfile name: DotNetZip-Runtime-v1.8.msi + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the Runtime MSI... + echo. + + cd "Setup Runtime" + %MSBUILD% /p:Configuration=Release + cd .. + move "Setup Runtime\bin\Release\en-us\DotNetZip-Runtime.msi" %releaseDir%\DotNetZip-Runtime-v%version%.msi + +goto :EOF +-------------------------------------------- + + + + +-------------------------------------------- +:MakeSrcZip + + echo. + echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + echo. + echo Making the Source Zip... + echo. + + @REM set zipfile=DotNetZip-src-v%version%.zip + + cd.. + @REM Delete any existing src zips + for %%f in (DotNetZip-src-v*.zip) do del %%f + + %POWERSHELL% DotNetZip\ZipSrc.ps1 + + @REM edit in place to remove Ionic.pfx and Ionic.snk from the csproj files + + @REM glob the filename: + for %%f in (DotNetZip-src-v*.zip) do set actualFilename=%%f + + DotNetZip\EditCsproj.exe -z %actualFileName% + + cd %baseDir% + move ..\%actualFileName% %releaseDir% + +goto :EOF +-------------------------------------------- + + +-------------------------------------------- +:BACKTICK + call :GET_CMDLINE %* + set varspec=%1 + setlocal EnableDelayedExpansion + for /f "usebackq delims==" %%I in (`%CMDLINE%`) do set output=%%I + endlocal & set %varspec%=%output% + goto :EOF +-------------------------------------------- + + +-------------------------------------------- +:GET_CMDLINE + @REM given a set of params [0..n], sets CMDLINE to + @REM the join of params[1..n] + setlocal enableextensions EnableDelayedExpansion + set PRIOR= + set PARAMS= + shift + :GET_PARAMs_LOOP + if [%1]==[] goto GET_PARAMS_DONE + set PARAMS=%PARAMS% %1 + shift + goto GET_PARAMS_LOOP + :GET_PARAMS_DONE + REM strip the first space + set PARAMS=%PARAMS:~1% + endlocal & set CMDLINE=%PARAMS% + goto :EOF +-------------------------------------------- + + + +:END +@if exist c:\users\dino\dev\dotnet\pronounceword.exe (c:\users\dino\dev\dotnet\pronounceword.exe All Done > nul:) +echo. +echo release zips are in %releaseDir% +echo. + +endlocal + diff --git a/dotNetZip/Readme.txt b/dotNetZip/Readme.txt new file mode 100644 index 0000000..059d27b --- /dev/null +++ b/dotNetZip/Readme.txt @@ -0,0 +1,1105 @@ +Mon, 11 Jul 2011 20:10 + + +Introducing the DotNetZip Library and Tools +------------------------------------------- + +DotNetZip is the name of an open-source project that delivers a .NET +library for handling ZIP files, and some associated tools. + + - The library allows .NET or Silverlight programmers to build + applications that read, create and modify ZIP files. + + - The tools are .NET programs that rely on the library, and can be used + by anyone on any Windows machine to build or extract ZIP files. + + + +Why DotNetZip? +--------------------------------- + +The Microsoft .NET Framework base class library lacks a good set of +built-in classes for creating and reading ZIP files, and Windows itself +lacks full-powered built-in ZIP tools. DotNetZip fills those needs. + +There are other ZIP libraries available, but some of them have licenses +that may be unfriendly, some of them are too hard to use or not powerful +enough, and some of them are too expensive (not free). DotNetZip +provides one more alternative. The goals for this alternative: + + - easy to adopt - low cost (Free), and a friendly license + - fully-featured + - good performance - in speed and compression + - easy to use. + + + +DotNetZip background +--------------------------------- + +Many people seem to think, incorrectly, that the classes in the +System.IO.Compression namespace, like GZipStream or DeflateStream, can +create or read zip files. Not true. + +The System.IO.Compression namespace, available starting with .NET v2.0 +for the desktop Framework and v3.5 for the Compact Framework, includes +base class libraries supporting compression within streams - both the +Deflate and Gzip formats are supported. But these classes are not +directly useful for creating compressed ZIP archives. GZIP is not +ZIP. Deflate is not ZIP. The GZipStream in System.IO.Compression is +able to read and write GZIP streams, but that is not the same as reading +or writing a zip file. Also, these classes deliver poor compression in +practice, especially with binary data, or previously-compressed data. + + +Yes, it is possible to read and write zip files, using the classes in +the .NET Framework. + + - You can do it with the System.IO.Packaging.ZipPackage class, added + in .NET v3.0. Actually this class lets you create a package file, + which is a zipfile with a particular internal structure. It includes + a manifest and some other things. But the interface is odd and + confusing if all you want is a regular-old ZIP file. Also, the + classes in this namespace do not provide control for things like + passwords, comments, AES encryption, ZIP64, Unicode, and so on. + + - You can also create and read zip files with the J# runtime. This + also has ita drawbacks. First, J# is going out of support, or may + be out of support now. Second, the J# runtime is huge, and you have + to swallow the whole thing, even if all you want is zip file + capability. Also, the J# runtime is based on the java.util.zip + classes from Java v1.4, dating from 1998. The runtime hasn't been + updated in years and still includes bugs in zip file handling. It + lacks support for AES, for ZIP64, and Unicode. It is not accessible + from COM. Finally, the zip classes in the J# runtime are decidedly + un-dotnet. There's no support for events, or enumerators to let you + do things like For Each in VB, or foreach in C#. The interface is + clunky. It does not feel like a .NET class library, because it isn't + a .NET class library. So for all those reasons, J# isn't ideal. + + - You can also rely on P/Invoke to the shell32.dll, and the + ShellClass. This works in a limited fashion. The drawbacks here: it + isn't documented. It isn't a very intuitive or powerful programming + interface. There are no events, so embedding it into a Winforms app + with a progress bar would be difficult. Again it lacks an easy way + to use or access many ZIP features, like encryption or ZIP64 or + self-extracting archives. Also, the shell32.dll is designed for use + within Windows Explorer, and presumes a user interface. In fact in + some cases, calling into this DLL to perform a ZIP extraction can + display a dialog box, so it may not be suitable for use within + server or "headless" applications. + + +There are other libraries out there than do zip files for .NET. But +there are compromises with each one. Some are commercial and expensive. +Some are slow. Some are complicated to use. Some of these options lack +features. Some of them have more than one of these drawbacks. + +DotNetZip provides another option. It's a very simple-to-use class +library that provides good ZIP file support. Using this library, you +can write .NET applications that read and write zip-format files, +including files with passwords, Unicode filenames, ZIP64, AES +encryption, and comments. The library also supports self-extracting +archives. It is well documented and provides good performance. + +Though DotNetZip is implemented in .NET and was originally intended to +provide a managed-code library for ZIP files, you can now use it library +from any COM environment, including Javascript, VBScript, VB6, VBA, PHP, +Perl, and others. Using DotNetZip, you could generate an AES-encrypted +zip file from within the code of a macro running in MS-Excel, for example. + +DotNetZip works with applications running on PCs with Windows. There is a +version of this library available for the .NET Compact Framework, too. + +I have not tested DotNetZip for use with Mono, but I've heard reports +that people use the binary releases with Mono successfully, without +change. + + +License +-------- + +This software is open source. It is released under the Microsoft Public +License of October 2006. The use of the "Microsoft Public License" does +not mean it is licensed by Microsoft. See the License.txt file for +details. + +DotNetZip is derived in part from ZLIB, the C-language library by Mark +Adler and Jean-loup Gailly . See the License.ZLIB.txt file included in +the DotNetZip download for details. + + + +What is DotNetZip? and How is it packaged? +--------------------------------------------- + +DotNetZip is primarily a managed library for dealing with ZIP files. + +It is packaged as a DLL that your application must reference: +Ionic.Zip.dll. In the "developer's kit" package, there is +documentation, code examples, and debug versions of the DLL. + +The ZIP library depends on a set of supporting classes for doing +compression and decompression; these are exposed in other namespaces. + +The classes in the ZIP library reside in these namespaces: + + namespace interesting classes + ------------------------------------------------------------ + Ionic.Zip ZipFile, ZipEntry, ZipOutputStream, and + ZipInputStream. + + Ionic.Zlib DeflateStream, GZipStream, ZlibStream + + Ionic.BZip2 BZip2InputStream, BZip2OutputStream + + Ionic.Crc CRC32 + + +If you want only ZLIB (raw compression and decompression, RFC 1950, +1951, and 1952), the ZLIB classes are packaged independently, in +Ionic.Zlib.dll. Likewise, if you want to do BZIP2 compression, outside +the scope of a zip file, you can use the Ionic.BZip2.dll assembly. + +If you want ZIP, or both ZIP and ZLIB, then your application should +depend soly on Ionic.Zip.dll; this assembly includes a superset of the +classes in Ionic.Zlib.dll and Ionic.BZip2.dll. + +For each DLL, there is a version for the regular .NET Framework and +another for the Compact Framework. + +DotNetZip also includes command-line and GUI tools for manipulating zip +files; these can be helpful to developers when building applications +that create or manipulate zip files. They also can be helpful as +end-user tools. + +There are other downloads for DotNetZip - the source package, the +runtime-only package (DLLs and no helpfile or tools), the +documentation-only package, etc. + + + + +Using the Zip Class Library: The Basics +---------------------------------------- + +The examples here provide just the basics. + +There are many other examples available: some are included in the source +package, some in the class reference documentation in the help file, and +others on the web. Those examples provide many illustrate how to read +and write zip files, taking advantage of all the various features of zip +files exposed by the library. For a full set of examples, your best bet +is to see the documentation. Here's a basic primer: + +The main type you will use to fiddle with zip files is the ZipFile +class. Full name: Ionic.Zip.ZipFile. You use this to create, read, or +update zip files. There is also a ZipOutputStream class, which offers a +Stream metaphor, for those who want it. You should choose one or the +other for your application. + +The simplest way to create a ZIP file in C# looks like this: + + using(ZipFile zip= new ZipFile()) + { + zip.AddFile(filename); + zip.Save(NameOfZipFileTocreate); + } + + +Or in VB.NET, like this: + + Using zip As ZipFile = New ZipFile + zip.AddFile(filename) + zip.Save("MyZipFile.zip") + End Using + + +The using clause is important; don't leave it out. + + +The simplest way to Extract all the entries from a zipfile looks +like this: + + using (ZipFile zip = ZipFile.Read(NameOfExistingZipFile)) + { + zip.ExtractAll(args[1]); + } + +But you could also do something like this: + + using (ZipFile zip = ZipFile.Read(NameOfExistingZipFile)) + { + foreach (ZipEntry e in zip) + { + e.Extract(); + } + } + + +Or in VB, extraction would be like this: + Using zip As ZipFile = ZipFile.Read(NameOfExistingZipFile) + zip.ExtractAll + End Using + +Or this: + Using zip As ZipFile = ZipFile.Read(NameOfExistingZipFile) + Dim e As ZipEntry + For Each e In zip + e.Extract + Next + End Using + + +That covers the basics. + +Notice that a using clause is always employed. DOn't forget this. Don't +leave it off. If you don't understand what it is, don't just skip it. +It's important. + +There are a number of other options for using the class library. For +example, you can read zip archives from streams, or you can create +(write) zip archives to streams, or you can extract into streams. You +can apply passwords for weak encryption. You can specify a code page +for the filenames and metadata of entries in an archive. You can rename +entries in archives, and you can add or remove entries from archives. +You can set up save and read progress events. You can do LINQ queries on +the Entries collection. Check the documentation for complete +information, or use Visual Studio's intellisense to explore some of the +properties and methods on the ZipFile class. + +Another type you will use is ZipEntry. This represents a single entry - +either a file or a directory - within a ZipFile. To add an entry to a +zip file, you call one of the AddEntry (or AddFile) methods on the +ZipFile class. You never directly instantiate a ZipEntry type. The +AddEntry/AddFile returns a ZipEntry type; you can then modify the +properties of the entry within the zip file, using that object. + +For example, the following code adds a file as an entry into a ZipFile, +then renames the entry within the zip file: + + using(ZipFile zip= new ZipFile()) + { + ZipEntry e = zip.AddFile(filename); + e.FileName = "RenamedFile.txt"; + zip.Save(NameOfZipFileTocreate); + } + +Extracting a zip file that was created in this way will produce a file +called "RenamedFile.txt", regardless of the name of the file originally +added to the ZipFile. + + +As an alternative to using ZipFile type to create a zip file, you can +use the ZipOutputStream type to create zip files . To do so, wrap it +around a stream, and write to it. + + using (var fs = File.Create(filename)) + { + using(var s = new ZipOutputStream(fs)) + { + s.PutNextEntry("entry1.txt"); + byte[] buffer = Encoding.ASCII.GetBytes("This is the content for entry #1."); + s.Write(buffer, 0, buffer.Length); + } + } + +Unlike the ZipFile class, the ZipOutputStream class can only create zip +files. It cannot read or update zip files. + +If you want to read zip files using a streaming metaphor, you can use +ZipInputStream. Think of ZipInputStream and ZipOutputStream as +alternatives to using ZipFile to manipulate zip files. The former is for +reading zip files; the latter is for writing them. + + + +About Directory Paths +--------------------------------- + +One important note: the ZipFile.AddXxx methods add the file or +directory you specify, including the directory. In other words, +logic like this: + ZipFile zip = new ZipFile(); + zip.AddFile("c:\\a\\b\\c\\Hello.doc"); + zip.Save(); + +...will produce a zip archive that contains a single entry, or file, and +that file is stored with the relative directory information. When you +extract that file from the zip, either using this Zip library or winzip +or the built-in zip support in Windows, or some other package, all those +directories will be created, and the file will be written into that +directory hierarchy. At extraction time, if you were to extract that +file into a directory like c:\documents, then resulting file would be +named c:\documents\a\b\c\Hello.doc . + +This is by design. + +If you don't want that directory information in your archive, +then you need to use the overload of the AddFile() method that +allows you to explicitly specify the directory used for the entry +within the archive: + + zip.AddFile("c:\\a\\b\\c\\Hello.doc", "files"); + zip.Save(); + +This will create an archive with an entry called "files\Hello.doc", +which contains the contents of the on-disk file located at +c:\a\b\c\Hello.doc . + +If you extract that file into a directory e:\documents, then the +resulting file will be called e:\documents\files\Hello.doc . + +If you want no directory at all, specify "" (the empty string). +Specifying null (Nothing in VB) will include all the directory hierarchy +in the filename, as in the orginal case. + + + + +Pre-requisites to run Applications that use DotNetZip +----------------------------------------------------- + +To run desktop applications that depend on DotNetZip: + .NET Framework 2.0 or later + + +To run smart device applications that depend on DotNetZip: + .NET Compact Framework 2.0 or later + + + + + +In more detail: The Zip Class Library +---------------------------------------------- + +The Zip class library is packaged as Ionic.Zip.DLL for the regular .NET +Framework and Ionic.Zip.CF.dll for the Compact Framework. The Zip +library allows applications to create, read, and update zip files. + +This library uses the DeflateStream class to compress file data, +and extends it to support reading and writing of the metadata - +the header, CRC, and other optional data - defined or required +by the zip format spec. + +The key object in the class library is the ZipFile class. Some of the +important methods on it: + + - AddItem - adds a file or a directory to a zip archive + - AddDirectory - adds a directory to a zip archive + - AddFile - adds a file to a zip archive + - AddFiles - adds a set of files to a zip archive + - Extract - extract a single element from a zip file + - Read - static methods to read in an existing zipfile, for + later extraction + - Save - save a zipfile to disk + +There is also a supporting class, called ZipEntry. Applications can +enumerate the entries in a ZipFile, via ZipEntry. There are other +supporting classes as well. Typically, 80% of apps will use just the +ZipFile class, and will not need to directly interact with these other +classes. But they are there if you need them. + +If you want to create or read zip files, the Ionic.Zip.DLL assembly is +the one you want. + +When building applications that do zip stuff, you need to add a reference to +the Ionic.Zip.dll in Visual Studio, or specify Ionic.Zip.dll with the +/R flag on the CSC.exe or VB.exe compiler line. + + + + +In more detail: The Zlib Class Library +----------------------------------------- + +The Zlib class library is packaged as Ionic.Zlib.DLL for the regular .NET +Framework and Ionic.Zlib.CF.dll for the Compact Framework. The ZLIB +library does compression and decompression according to IETF RFC's 1950 (ZLIB), +1951 (Deflate), and 1952 (GZIP). + +See http://www.ietf.org/rfc/rfc1950.txt + http://www.ietf.org/rfc/rfc1951.txt + and http://www.ietf.org/rfc/rfc1952.txt + + +The key classes are: + + ZlibCodec - a class for Zlib (RFC1950/1951/1952) encoding and decoding. + This low-level class does deflation and inflation on buffers. + + DeflateStream - patterned after the DeflateStream in + System.IO.Compression, this class supports compression + levels and other options. + + GZipStream - patterned after the GZipStream in + System.IO.Compression, this class supports compression + levels and other options. + + ZlibStream - similar to the GZipStream in + System.IO.Compression, this class generates or consumes raw ZLIB + streams. + + +If you want to simply compress (deflate) raw block or stream data, this +library is the thing you want. + +When building applications that do zlib things, you need to add a reference to +the Ionic.Zlib.dll in Visual Studio, or specify Ionic.Zlib.dll with the +/R flag on the CSC.exe or VB.exe compiler line. + +NB: If your application does both Zlib and Zip stuff, you need only add +a reference to Ionic.Zip.dll. Ionic.Zip.dll includes all the capability +in Ionic.Zlib.dll. Ionic.Zip.dll is a superset. + + + +In more detail: The BZip2 Class Library +----------------------------------------- + +The BZip2 class library is packaged as Ionic.BZip2.DLL for the regular .NET +Framework and Ionic.BZip2.CF.dll for the Compact Framework. The BZip2 +library does compression according to the bzip2 format created by +Julian Seward. +See http://en.wikipedia.org/wiki/Bzip2 + +NB: If your application does a combination of BZip2, Zlib and Zip stuff, +you need only add a reference to Ionic.Zip.dll. Ionic.Zip.dll includes +all the capability in Ionic.Zlib.dll and Ionic.BZip2.dll. Ionic.Zip.dll +is a superset. + +If you try to link to more than one of these, you will get compiler +warnings about "duplicate types". + + + +Namespace changes for DotNetZip +----------------------------------------- + +The namespace for the DotNetZip classes is Ionic.Zip. +Classes are like: + Ionic.Zip.ZipFile + Ionic.Zip.ZipEntry + Ionic.Zip.ZipException + etc + +(check the .chm file for the full list) + +For the versions prior to v1.7, the namespace DotNetZip was Ionic.Utils.Zip. +The classes were like so: + Ionic.Utils.Zip.ZipFile + Ionic.Utils.Zip.ZipEntry + etc + +If you have code that depends on an older version of the library, with +classes in the Ionic.Utils.Zip namespace), a simple namespace +replacement will allow your code to compile against the new version of +the library. + + +In addition to the Zip capability, DotNetZip includes capability (new +for v1.7). For Zlib, the classes are like this: + Ionic.Zlib.DeflateStream + Ionic.Zlib.ZlibStream + Ionic.Zlib.ZlibCodec + ... + +(again, check the .chm file for the full list) + +For v1.9.1.6, the CRC class moved from the Ionic.Zlib namespace to the +Ionic.Crc namespace. + + + + +Dependencies +--------------------------------- + +Originally, this library was designed to depend upon the built-in +System.IO.Compression.DeflateStream class for the compression. This +proved to be less than satisfactory because the built-in compression +library did not support compression levels and also was not available on +.NET CF 2.0. + +As of v1.7, the library includes a managed code version of zlib, the +library that produces RFC1950 and RFC1951 compressed streams. Within +that version of zlib, there is also a DeflateStream class which is +similar to the built-in System.IO.Compression.DeflateStream, but more +flexible, and often more effective as well. + +As a result, this library depends only on the .NET Framework v2.0, or the +.NET Compact Framework v2.0. + + + + +The Documentation +-------------------------------------------- + +There is a single set of developer reference documentation for all of +the DotNetZip library features, including Zip and Zlib stuff. It is +packaged in two ways: As a .chm file, and as a Help Viewer 1.0 resource. +The latter is the new format suitable for viewing within VS2010. + +If you only use the Zlib stuff, then you should focus on the doc in the +Ionic.Zlib namespace. Likewise BZip2. If you are building apps for +mobile devices running the Compact Framework, then ignore the pieces +that deal with SaveSelfExtractor() and AES. + +Consult the help file for more specifics here. + +In some cases, upon opening the .chm file for DotNetZip, the help +items tree loads, but the contents are empty. You may see an error: +"This program cannot display the webpage." or, "Address is invalid." +If this happens, it's likely that you've encountered a problem with Windows +protection of files downloaded from less trusted locations. To work around +this, within Windows Explorer, right-click on the CHM file, select properties, +and Unblock it, using the button in lower part of properties window. + +The help is also packaged in a format that you can integrate into Visual +Studio 2008, or Visual Studio 2010. VS2008 requires MS Help 2.0, while +VS2010 requires a different, newer format, sometimes called MS Help 3, +and sometimes (confusingly) called "MS Help Viewer 1.0 format". + +The DotNetZip "devkit" download includes help in all these formats. + + + +The Zip Format +--------------------------------- +The zip format is described by PKWare, at + http://www.pkware.com/business_and_developers/developer/popups/appnote.txt + +Every valid zipfile conforms to this specification. For example, the +spec says that for each compressed file contained in the zip archive, +the zipfile contains a byte array of compressed data. (The byte array +is something the DeflateStream class can produce directly.) But the +zipfile also contains header and "directory" information - you might +call this "metadata". In other words, the zipfile must contain a list +of all the compressed files in the archive. The zipfile also contains +CRC checksums, and can also contain comments, and other optional +attributes for each file. These are things the DeflateStream class - +either the one included in the .NET Framework Class Library, or the one +embedded in this library - does not read or write. + +Managing the metadata in a zip file is most of what DotNetZip does. + + +Which DLL to use? +-------------------------------- +The binary releases of DotNetZip include multiple distinct DLLs or +assemblies. Which one should you use? + +The likely answer is: use Ionic.Zip.dll. + +That's the mainstream library, the full library, and it includes all the +capability. If you have particular requirements, like you want a +smaller library, or you want to exclude the Self-Extracting stuff, or +you only want the ZLIB capability, then you may want to choose a +different assembly. + +Here's a summary of the options. + + +Usage scenario Reference this DLL +------------------------------------------------------------------ +reading or writing Zip files Ionic.Zip.dll + +raw block or stream compression, ZLIB, GZIP, Ionic.Zlib.dll + or DEFLATE + +raw block or stream compression, BZIP2 Ionic.BZip2.dll + +both raw compression as well as reading Ionic.Zip.dll + or writing Zip files + +reading or writing Zip files on Compact Ionic.Zip.CF.dll + Framework + +raw compression on Compact Framework Ionic.Zlib.CF.dll + -and/or- + Ionic.BZip2.CF.dll + +both raw compression as well as reading Ionic.Zip.CF.dll + or writing Zip files on CF + +reading or writing Zip files, using desktop Ionic.Zip.Reduced.dll + .NET framework but never creating a + self-extracting archive + + +Never reference both Ionic.Zlib.dll and Ionic.Zip.dll, or both +Ionic.BZip2.dll and Ionic.Zip.dll in the same application. If your +application does both Zlib and Zip stuff, you need only add a reference +to Ionic.Zip.dll. Ionic.Zip.dll includes all the capability in +Ionic.Zlib.dll and Ionic.BZip2.dll You always need to reference only a +single Ionic DLL, regardless whether you use Zlib or BZip2 or Zip or +some combination. + + + + +Self-Extracting Archive support +-------------------------------- + +The Self-Extracting Archive (SFX) support in the library allows you to +create a self-extracting zip archive. An SFX is both a standard EXE +file *and* a ZIP file. The exe contains boilerplate program logic to +unzip the embedded zip file. When the user executes the SFX runs, the +boilerplate application logic just reads the zip content and +then unzips itself. You can open an SFX in WinZip and other zip tools, +as well, if you want to view it. + +Running the SFX (unpacking from the SFX) requires the .NET Framework +installed on the machine, but does not require the DotNetZip library. + +There are two versions of the SFX - one that presents a GUI form, and +another that runs as a console (command line) application. + +NB: Creation of SFX is not supported in the Compact Framework version of +the library. + +Also, there is no way, currently, to produce an SFX file that can run on +the .NET Compact Framework. + + + + +The Reduced ZIP library +-------------------------------- + +The full DotNetZip library is currently about 400k in size. The SFX +(Self-Extracting Archive) support is responsible for more than half the +total size of the library. Some deployments may wish to omit the SFX +support in order to get a smaller DLL. For that you can rely on the +Ionic.Zip.Reduced.dll. It provides everything the normal library does, +except the SaveSelfExtractor() method on the ZipFile class. + +For size comparisons...these approximate figures are for v1.9.1.6 of the +library: + + +Desktop Framework: + + assembly ~size comment + ------------------------------------------------------- + Ionic.Zlib.dll 100k {Deflate,GZip,Zlib}Stream and ZlibCodec + + Ionic.BZip2.dll 57k BZip2{Input,Output}Stream + + Ionic.Zip.dll 460k includes ZLIB and BZIP2 compression, + SFX, selector logic, WinZIP AES encryption, + and the ComHelper class + + Ionic.Zip.Reduced.dll 250k includes everything in the main ZIP + library except SFX. (ability to save + Self-extracting archives) + + + +Compact Framework: + + assembly ~size comment + ------------------------------------------------------- + Ionic.Zlib.CF.dll 74k {Deflate,GZip,Zlib}Stream and ZlibCodec + + Ionic.BZip2.CF.dll 36k BZip2{Input,Output}Stream + + Ionic.Zip.CF.dll 204k includes ZLIB and BZIP2 compression, but + no SFX. + + +Silverlight: + + assembly ~size comment + ------------------------------------------------------- + Ionic.Zlib.dll 80k {Deflate,GZip,Zlib}Stream and ZlibCodec + + Ionic.BZip2.dll 41k BZip2{Input,Output}Stream + + Ionic.Zip.dll 226k includes ZLIB and BZIP2 compression, and + the selector logic. No SFX, no WinZIP AES. + + + + + + + + +Support +-------------------------------------------- + +There is no official support for this library. I try to make a good +effort to answer questions and monitor the work items raised on the +project portal at: + + http://DotNetZip.codeplex.com. + + + + + +About Intellectual Property +--------------------------------- + +I am no lawyer, but before using this library in your app, it +may be worth reviewing the various licenses. + +The specification for the zip format, which PKWARE owns, includes a +paragraph that reads: + + PKWARE is committed to the interoperability and advancement of the + .ZIP format. PKWARE offers a free license for certain technological + aspects described above under certain restrictions and conditions. + However, the use or implementation in a product of certain technological + aspects set forth in the current APPNOTE, including those with regard to + strong encryption or patching, requires a license from PKWARE. Please + contact PKWARE with regard to acquiring a license. + +Contact pkware at: zipformat@pkware.com + +This library does not do strong encryption as described by PKWare, nor +does it do patching. But again... I am no lawyer. + + +This library uses a ZLIB implementation that is based on a conversion of +the jzlib project http://www.jcraft.com/jzlib/. The license and +disclaimer required by the jzlib source license is referenced in the +relevant source files of DotNetZip, specifically in the sources for the +Zlib module. + +This library uses a BZip2 implementation that is based on a conversion +of the bzip2 implementation in the Apache Commons compression library. +The Apache license is referenced in the relevant source files of +DotNetZip, specifically in the sources for the BZip2 module. + + + + +Limitations +--------------------------------- + +There are a few limitations to this library: + + It does not do strong encryption. + + The GUI tool for creating zips is functional but basic. This isn't a limitation + of the library per se. + + ...and, I'm sure, many others + +But it is a good basic library for reading and writing zipfiles +in .NET applications. + + + + +Building the Library +============================================ + +This section is mostly interesting to developers who will work on or +view the source code of DotNetZip, to extend or re-purpose it. If you +only plan to use DotNetZip in applications of your own, you probably +don't need to concern yourself with the information that follows. + + + + + +Pre-requisites to build DotNetZip +--------------------------------- + +.NET Framework 4.0 SDK or later + -or- +Visual Studio 2010 or later + + -and- + +ILMerge - a tool from Microsoft that combines +multiple managed assemblies into a single DLL or image. It is in +similar in some respects to the lib tool in C toolkits. + +You can get it here: + http://www.microsoft.com/downloads/details.aspx?familyid=22914587-b4ad-4eae-87cf-b14ae6a939b0&displaylang=en + + + + + +Building DotNetZip with the .NET SDK +------------------------------------- + +To build the library using the .NET Framework SDK v3.5, + +1. extract the contents of the source zip into a new directory. + +2. be sure the .NET 2.0 SDK, .NET 3.5 runtime, and .NET 2.0 runtime + directories are on your path. These are typically + + C:\Program Files\Microsoft.NET\SDK\v2.0\bin + c:\windows\Microsoft.NET\Framework\v3.5 + and + c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 + + The .NET 3.5 runtime is necessary because building DotNetZip requires + the csc.exe compiler from NET 3.5. (Using DotNetZip from within C# + requires the v2.0 csc compiler.) + + +3. Modify the .csproj files in Zip and ZLIB and BZip2 to eliminate + mention of the Ionic.pfx and Ionic.snk files. + + The various DLLs (Zip Partial, ZLIB, etc.) are signed with my private + key. You will want to remove the mention of the private key in the + project files. I cannot distribute my private key, so don't ask me! + That would be silly. So you have to modify the project in order to + build without the key. + + +4. open a CMD prompt and CD to the DotNetZip directory. + + +5. msbuild + + Be sure you are using the .NET 3.5 version of MSBuild. + This builds the "Debug" version of the library. To build the + "Release" version, do this: + + msbuild /t:Release + + +6. to clean and rebuild, do + msbuild /t:clean + msbuild + + +7. There are two setup directories, which contain the projects necessary + to build the MSI file. Unfortunately msbuild does not include + support for building setup projects (vdproj). You need Visual Studio + to build the setup directories. + + I am in the process of converting these from .vdproj to .wixproj, so + they can be built from the command line using msbuild. . + + + + +Building DotNetZip with Visual Studio +------------------------------------- + +To build DotNetZip using Visual Studio 2010, + +1. Open the DotNetZip.sln file in VS2010. + +2. If necessary, Remove the dependencies on Ionic.pfx and Ionic.snk. + + (References to these will have already been removed from the zipped + source distributions, but if you get your source from the TFS server, + then you will have to remove references to the keyfiles manually) + + The various DLLs (Zip, ZLIB, etc.) are signed with my (Dino + Chiesa's) private key. I do not distribute that key for anyone + else's use. If you build the DotNetZip library from source, You will + want to remove the mention of the private key in the project files. I + will not distribute my private key, that would be silly. So don't + ask me! + +3. Press F6 to build everything. + + + + +The Project Structure and Build approach +---------------------------------------------------- + +The function here is grouped into three basic sets: Zip, +ZLIB/Deflate/GZIP, and BZip2. The Zip group is a superset of the ZLIB +and BZIP2 groups. + +Each group of functionality is packaged into various assemblies, one +assembly per "platform". The platforms supported are: .NET (Desktop), +Compact Framework 2.0, and Silverlight. + +There is also a special "Zip Reduced" library, available only on the +Desktop platform; it is a reduced-function version of the regular +Desktop Framework zip library. It provides an option of using a smaller +library for those zip-handling applications that don't produce +Self-extracting archives. + +In a previous guise, DotNetZip relied on the ILMerge tool to combine +distinct DLLs into a single package. This is no longer the case. + +Because the ZIP projects include the ZLIB and BZIP2 function, the +appropriate source modules for the ZLIB and Bzip2 are "linked" into each +of the ZIP projects (Desktop, CF, and Silverlight). + + + + +Regarding the missing Ionic.pfx and Ionic.snk files +------------------------------------------------------------------------- + +The binary DLLs shipped in the codeplex project are signed by me, Dino +Chiesa. This provides a "strong name" for the assembly, which itself +provides some assurance as to the integrity of the library, and also +allows it to be run within restricted sites, like apps running inside +web hosters. + +For more on strong names, see this article: +http://msdn.microsoft.com/en-gb/magazine/cc163583.aspx + +Signing is done automatically at build time in the Visual Studio project or in +the msbuild build. There +is a .pfx file that holds the crypto stuff for signing the assembly, and +that pfx file is itself protected by a password. There is also an +Ionic.snk file which is referenced by the project, but which I do not +distribute. + +People opening the project ask me: what's the password to this .pfx +file? Where's the .snk file? + +Here's the problem; those files contain my private key. if I give +everyone the password to the PFX file or the .snk file, then anyone can +go and build a modified Ionic.Zip.dll, and sign it with my key, and +apply any version number they like. This means there could be multiple +distinct assemblies with the same signature. This is obviously not +good. + +Since I don't release the ability to sign DLLs with my key, the DLL +signed with my key is guaranteed to be produced by me only, which is in +fact the exact intent of code signing in .NET. + +If anyone wants to modify the project and re-compile it, they have a +couple options: + + - sign the assembly themselves, using their own key. + - produce a modified, unsigned assembly + +In either case it is not the same as the assembly I am shipping, +therefore it should not be signed with the same key. + +All clear? + +As for those options above, here is some more detail: + + 1. If you want a strong-named assembly, then create your own PFX file + and .snk file and modify the appropriate projects to use those new + files. + + 2. If you don't need a strong-named assembly, then remove all the + signing from the various projects. + +In either case, you will need to modify the "Zip" and "Zip CF DLL" +projects, the BZip and BZip CF projects, and the "Zlib" and "Zlib CF" +projects. + + + + +Building the Documentation +-------------------------------------------- + +The documentation files are built using the Sandcastle Helpfile Builder +tool, also available on CodePlex at http://www.codeplex.com/SHFB . It +is built from in-code xml documentation, augmented with some additional +out-of-band html documentation. + +If you want to build the help files yourself, you will need to have +Sandcastle from May 2008 (or later, I guess), and SHFB, from February +2009. Both are free tools available from http://codeplex.com . I think +you can get a package download of both of these by installing v1.9.3.0 +of SHFB . + +The helpfile projects are: + + HtmlHelp1.shfbproj - to build the .chm file + MSHelp2.shfbproj - to build the MS Help 2.0 content + HelpViewer.shfbproj - to build the MS Help Viewer 1.0 content + + (The MSHelp2 project is broken at the moment.) + +To build the documentation in any of these formats, first build the "zip +Full DLL" project in the source (Ionic.Zip.dll), then run: + + msbuild HtmlHelp1.shfbproj + + -or- + + msbuild HelpViewer.shfbproj + + +The Help Viewer 1.0 content can be viewed in the help viewer that is +integrated into VS 2010, or in an alternative viewer, such as +H3Viewer.exe. See http://mshcmigrate.helpmvp.com/viewer . + + + + +Examples +-------------------------------------------- + +The source solution also includes a number of example applications +showing how to use the DotNetZip library and all its features - creating +ZIPs, using Unicode, passwords, comments, streams, and so on. Most of +these will be built when you build the solution. Some of them do not - +you will need to build them independently. + + + +Tests +-------------------------------------------- + +There are two source projects in the VS Solution that contain Unit +Tests: one for the zlib library, one for the bzip2 library, and another +for the Zip library. If you develop any new tests for DotNetZip, I'd be +glad to look at them. + + + + + + +Origins +============================================ + +This library is mostly original code. + +There is a GPL-licensed library called SharpZipLib that writes zip +files, it can be found at +http://www.sharpdevelop.net/OpenSource/SharpZipLib/Default.aspx + +This library is not based on SharpZipLib. + +I think there may be a Zip library shipped as part of the Mono +project. This library is also not based on that. + +Now that the Java class library is open source, there is at least one +open-source Java implementation for zip. This implementation is not +based on a port of Sun's JDK code. + +There is a zlib.net project from ComponentAce.com. This library is not +based on that code. + +This library is all new code, written by me, with these exceptions: + + - the CRC32 class - see above for credit. + - the zlib library - see above for credit. + - the bzip2 compressor - see above for credit. + + + +You can Donate +-------------------------------- + +If you think this library is useful, consider donating to my chosen +cause: The Boys and Girls Club of Southwestern Pennsylvania, in the USA. +(In the past I accepted donations for the Boys and Girls Club of +Washington State, also in the USA. I've moved, and so changed the +charity.) I am accepting donations on my paypal account. + +http://cheeso.members.winisp.net/DotNetZipDonate.aspx + +Thanks. + diff --git a/dotNetZip/SetVersion.ps1 b/dotNetZip/SetVersion.ps1 new file mode 100644 index 0000000..1841166 --- /dev/null +++ b/dotNetZip/SetVersion.ps1 @@ -0,0 +1,151 @@ +# ------------------------------------------------------- +# SetVersion.ps1 +# +# Set the version in all the AssemblyInfo.cs or AssemblyInfo.vb files in +# any subdirectory. Also set the version in the Product.wxs file, in +# any subdirectory. +# +# usage: +# from cmd.exe: +# powershell.exe SetVersion.ps1 2.8.3.0 +# +# from powershell.exe prompt: +# .\SetVersion.ps1 2.8.3.0 +# +# +# This script is part of DotNetZip. +# DotNetZip is Copyright 2008-2011 Dino Chiesa. +# +# DotNetZip is licensed under the MS-PL. See the accompanying +# License.txt file. +# +# Last Updated: <2011-August-02 19:51:41> +# +# ------------------------------------------------------- + + +function Usage +{ + echo "Usage: "; + echo " from cmd.exe: "; + echo " powershell.exe SetVersion.ps1 2.8.3.0"; + echo " "; + echo " from powershell.exe prompt: "; + echo " .\SetVersion.ps1 2.8.3.0"; + echo " "; +} + + +function Update-SourceVersion +{ + Param ([string]$Version) + + $NewVersion = 'AssemblyVersion("' + $Version + '")'; + $NewFileVersion = 'AssemblyFileVersion("' + $Version + '")'; + + foreach ($o in $input) + { + $av = select-string AssemblyVersion $o + $fv = select-string AssemblyVersion $o + + if ($av -ne $null -or $fv -ne $null) + { + Write-output $o.FullName + if ($o.Attributes -band [System.IO.FileAttributes]::ReadOnly) + { + # checkout the file for edit, using the tf.exe tool, and + # passing the CodePlex authn info on cmd line. + c:\vs2010\common7\IDE\tf.exe edit $o.FullName $env:cplogin + if (-not $?) + { + Write-output " --> The TF checkout failed. " + # See exit code in $LASTEXITCODE + exit + } + } + $TmpFile = $o.FullName + ".tmp" + + get-content $o.FullName | + %{$_ -replace 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)', $NewVersion } | + %{$_ -replace 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)', $NewFileVersion } > $TmpFile + + move-item $TmpFile $o.FullName -force + } + } +} + + + + +function Update-SourceWxsVersion +{ + Param ([string]$Version) + + $NewVersion = 'productVersion = "' + $Version + '"'; + + foreach ($o in $input) + { + $pv = select-string productVersion $o + + if ($pv -ne $null) + { + Write-output $o.FullName + if ($o.Attributes -band [System.IO.FileAttributes]::ReadOnly) + { + # checkout the file for edit, using the tf.exe tool, and + # passing the CodePlex authn info on cmd line + c:\vs2010\common7\IDE\tf edit $o.FullName $env:cplogin + if (-not $?) + { + Write-output " --> The TF checkout failed. " + # See exit code in $LASTEXITCODE + exit + } + } + $TmpFile = $o.FullName + ".tmp" + $newGuid = 'productId = "'+ [System.Guid]::NewGuid().ToString() + '"' + + get-content $o.FullName | + %{$_ -replace 'productVersion *= *"[1-9]+(\.([0-9]+|\*)){1,3}"', $NewVersion } | + %{$_ -replace 'productId *= *"([0-9A-Fa-f]){8}-([0-9A-Fa-f]){4}-([0-9A-Fa-f]){4}-([0-9A-Fa-f]){4}-([0-9A-Fa-f]){12}"', $newGuid } > $TmpFile + + move-item $TmpFile $o.FullName -force + } + } +} + + + +function Update-AllAssemblyInfoFiles ( $version ) +{ + foreach ($file in "SolutionInfo.cs", "AssemblyInfo.cs", "AssemblyInfo.vb" ) + { + get-childitem -recurse |? {$_.Name -eq $file} | Update-SourceVersion $version ; + } +} + + +function Update-AllProductWxsFiles ( $version ) +{ + foreach ($file in "Product.wxs", "ComRegistration.wxs" ) + { + get-childitem -recurse |? {$_.Name -eq $file} | Update-SourceWxsVersion $version ; + } +} + + +# validate arguments +$r= [System.Text.RegularExpressions.Regex]::Match($args[0], "^[0-9]+(\.[0-9]+){1,3}$"); + +if ($r.Success) +{ + Update-AllAssemblyInfoFiles $args[0]; + Update-AllProductWxsFiles $args[0]; +} +else +{ + echo " "; + echo "Bad Input!" + echo " "; + Usage ; +} diff --git a/dotNetZip/Setup Runtime/ComRegistration.wxs b/dotNetZip/Setup Runtime/ComRegistration.wxs new file mode 100644 index 0000000..a0b4539 --- /dev/null +++ b/dotNetZip/Setup Runtime/ComRegistration.wxs @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotNetZip/Setup Runtime/CustomText.wxl b/dotNetZip/Setup Runtime/CustomText.wxl new file mode 100644 index 0000000..a3ac32d --- /dev/null +++ b/dotNetZip/Setup Runtime/CustomText.wxl @@ -0,0 +1,46 @@ + + + + + {\WixUI_Font_Bigger}Welcome to the Setup Wizard for [ProductName] + {\WixUI_Font_Bigger}Welcome to the Setup Wizard for [ProductName] + {\WixUI_Font_Bigger}Welcome to the Setup Wizard for [ProductName] + + + The Setup Wizard will install the [ProductName], the assemblies required for running applications that manipulate ZIP archive files, on your computer. The version to be installed is [ProductVersion]. Click Next to continue or Cancel to exit the Setup Wizard. + + {\WixUI_Font_Bigger}The Setup Wizard for DotNetZip was interrupted + + {\WixUI_Font_Title}You are now installing DotNetZip... + + + {\WixUI_Font_Bigger}You've Completed the Setup Wizard for [ProductName] + + + {\WixUI_Font_Title}Ready to install DotNetZip Tools 1.9 + + + Are you ready to install the runtime? Click Next to proceed. + + Check here to accept the required licenses + + {\WixUI_Font_Title}What would you like to Install? + + {\WixUI_Font_Title}Install options + Specify the options you prefer, then click Next. + + {\WixUI_Font_Bigger}Setup for [ProductName] ended prematurely + The Setup Wizard for the DotNetZip runtime ended prematurely because of an error. Your system has not been modified. To install the DotNetZip runtime at a later time, run the Setup again. + + + + + + diff --git a/dotNetZip/Setup Runtime/DotNetZip Runtime.wixproj b/dotNetZip/Setup Runtime/DotNetZip Runtime.wixproj new file mode 100644 index 0000000..a4676a2 --- /dev/null +++ b/dotNetZip/Setup Runtime/DotNetZip Runtime.wixproj @@ -0,0 +1,87 @@ + + + + Debug + AnyCPU + 3.0 + {cc0b949c-4f52-4dc1-9925-64daa1cdd79f} + 2.0 + DotNetZip-Runtime + Package + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets + false + DotNetZip Runtime Setup + + + + bin\$(Configuration)\ + obj\$(Configuration)\ + Debug + + + bin\$(Configuration)\ + obj\$(Configuration)\ + + + False + True + ICE69; + 1076 + + + + + + + + + + + + + WixUIExtension + $(ProgramFileS)\Windows Installer XML v3.5\bin\WixUIExtension.dll + + + WixUtilExtension + $(ProgramFileS)\Windows Installer XML v3.5\bin\WixUtilExtension.dll + + + WixNetFxExtension + $(ProgramFileS)\Windows Installer XML v3.5\bin\WixNetFxExtension.dll + + + + + + + + + + + + Zip DLL + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + diff --git a/dotNetZip/Setup Runtime/PostProcessMsi.js b/dotNetZip/Setup Runtime/PostProcessMsi.js new file mode 100644 index 0000000..e82d157 --- /dev/null +++ b/dotNetZip/Setup Runtime/PostProcessMsi.js @@ -0,0 +1,176 @@ +// PostProcessMSi.js +// +// Post-process the generated MSI : +// +// - move things around on the installdir dialog, and on the progress +// dialog, to make the UI look better. +// +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code, like all of DotNetZip, is licensed under the Microsoft +// Public License. See the file License.txt accompanying this source +// modeule for the license details. More info on: +// http://dotnetzip.codeplex.com +// +// Created: Thu, 14 Jul 2011 17:31 +// Last saved: <2011-July-28 12:36:05> +// + +// Constant values from Windows Installer +var msiOpenDatabaseMode = { + Transact : 1 +}; +var msiViewModify = { + Insert : 1, + Update : 2, + Assign : 3, + Replace : 4, + Delete : 6 +}; + + +if (WScript.Arguments.Length != 1){ + WScript.StdErr.WriteLine(WScript.ScriptName + " file"); + WScript.Quit(1); +} + + +var filespec = WScript.Arguments(0); +WScript.Echo(WScript.ScriptName + " " + filespec); +var installer = WScript.CreateObject("WindowsInstaller.Installer"); +var database = installer.OpenDatabase(filespec, msiOpenDatabaseMode.Transact); + +var sql; +var view; +var record; + +try { + // var fileId = FindFileIdentifier(database, filename); + // if (!fileId){ + // throw new Error ("Unable to find '" + filename + "' in File table"); + // } + + WScript.Echo("Updating the Control table..."); + + // // Move the checkbox on the exit dialog, so that it appears in the row of buttons. + // // We do this because the background on the checkbox is gray, unchangeably so. + // // but the bg for the row of buttons is gray, so it looks ok if moved there. + // sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height` FROM `Control` WHERE `Dialog_`='ExitDialog' AND `Control`='OptionalCheckBox'"; + // view = database.OpenView(sql); + // view.Execute(); + // record = view.Fetch(); + // // index starts at 1 + // record.IntegerData(4) = 14; // X + // record.IntegerData(5) = 243; // Y + // record.IntegerData(6) = 120; // Width + // record.IntegerData(7) = 16; // Height + // view.Modify(msiViewModify.Replace, record); + // view.Close(); + + + + // Insert a new checkbox into the InstallDirDlg. + // This one controls whether to associate zip files to DotNetZip. + + // sql = "SELECT `Control` FROM `Control` WHERE `Control`='CheckboxAssoc'"; + // view = database.OpenView(sql); + // view.Execute(); + // record = view.Fetch(); + // var controlExists = null; + // if (record != null) controlExists = record.StringData(1); + // if (record == null || controlExists != "CheckboxAssoc") { + // + // sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, " + + // "`Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) " + + // "VALUES ('InstallDirDlg', 'CheckboxAssoc', 'CheckBox', '20', '124', '184', '14', '3', "+ + // "'WANT_ZIP_ASSOCIATIONS', 'Associate .zip files to DotNetZip', 'Next', '|')"; + // view = database.OpenView(sql); + // view.Execute(); + // view.Close(); + // + // sql = "UPDATE `Control` SET `Control`.`Control_Next` = 'CheckboxAssoc' " + + // "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='ChangeFolder'"; + // view = database.OpenView(sql); + // view.Execute(); + // view.Close(); + // } + + // Tweak the existing controls on the InstallDirDlg: move them up a bit, shrink the label + sql = "UPDATE `Control` SET `Control`.`Y` = 76 " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='Folder'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 96 " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='ChangeFolder'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Height` = 16 " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='FolderLabel'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + + + // Tweak the existing controls on the ProgressDlg: move the status + // text up a bit, and make it taller, because it was being clipped + // by its own height, and also by the proximity of the progress bar. + // These seem like basic fit-and-finish problems that Wix shouldn't have. + // WIX is an idiot. + sql = "UPDATE `Control` SET `Control`.`Y` = 96, `Control`.`Height` = 14 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='StatusLabel'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 96, `Control`.`Height` = 14 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='ActionText'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextInstalling'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextChanging'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextRepairing'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextRemoving'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + + // if (checkboxChecked) { + // WScript.Echo("Updating the Property table..."); + // // Set the default value of the CheckBox + // sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP', '1')"; + // view = database.OpenView(sql); + // view.Execute(); + // view.Close(); + // } + // WScript.Echo("G"); + + database.Commit(); +} +catch(e) { + WScript.StdErr.WriteLine(e); + WScript.Quit(1); +} + + + diff --git a/dotNetZip/Setup Runtime/Product.wxs b/dotNetZip/Setup Runtime/Product.wxs new file mode 100644 index 0000000..687f365 Binary files /dev/null and b/dotNetZip/Setup Runtime/Product.wxs differ diff --git a/dotNetZip/Setup Runtime/SideBanner.bmp b/dotNetZip/Setup Runtime/SideBanner.bmp new file mode 100644 index 0000000..39512ff Binary files /dev/null and b/dotNetZip/Setup Runtime/SideBanner.bmp differ diff --git a/dotNetZip/Setup Runtime/TopBanner.bmp b/dotNetZip/Setup Runtime/TopBanner.bmp new file mode 100644 index 0000000..fd082bf Binary files /dev/null and b/dotNetZip/Setup Runtime/TopBanner.bmp differ diff --git a/dotNetZip/Setup Runtime/UI.wxs b/dotNetZip/Setup Runtime/UI.wxs new file mode 100644 index 0000000..156ac42 --- /dev/null +++ b/dotNetZip/Setup Runtime/UI.wxs @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + "1"]]> + + + 1 + + + + 1 + + 1 + LicenseAccepted = "1" + + + + + Installed + NOT Installed + + + 1 + + 1 + 1 + 1 + 1 + 1 + + + + + + + + + + + + diff --git a/dotNetZip/Setup Utils/CA.ZipAssociation.js b/dotNetZip/Setup Utils/CA.ZipAssociation.js new file mode 100644 index 0000000..46c04f7 --- /dev/null +++ b/dotNetZip/Setup Utils/CA.ZipAssociation.js @@ -0,0 +1,270 @@ +// CA.ZipAssociation.js +// +// Store and Reset file associations for .zip files, as necessary, when +// DotNetZip is being installed and uninstalled, respectively. This +// script defines custom actions that are invoked as part of the MSI. +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code, like all of DotNetZip, is licensed under the Microsoft +// Public License. See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// Created: Thu, 14 Jul 2011 17:31 +// Last saved: <2011-July-16 18:01:37> +// + + +/************************************************/ +/* Message level */ +/************************************************/ +var msiMessageLevel = { + FatalExit : 0x00000000, + Error : 0x01000000, + Warning : 0x02000000, + User : 0x03000000, + Info : 0x04000000, + ActionStart : 0x08000000, + Progress : 0x0A000000, + ActionData : 0x09000000 +}; + + +/************************************************/ +/* Button styles */ +/************************************************/ +var msiButtonType = { + Ok : 0, + OkCancel : 1, + AbortRetryIgnore : 2, + YesNoCancel : 3, + YesNo : 4, + RetryCancel : 5 +}; + + +/************************************************/ +/* Default button */ +/************************************************/ +var msiDefaultButton = { + First : 0x000, + Second : 0x100, + Third : 0x200 +}; + +/************************************************/ +/* Return values */ +/************************************************/ +var msiMessageStatus = { + Error : -1, + None : 0, + Ok : 1, + Cancel : 2, + Abort : 3, + Retry : 4, + Ignore : 5, + Yes : 6, + No : 7 +}; + + +var DotNetZipAssocId = "DotNetZip.zip.1"; +var regPathZipAssoc = "HKEY_LOCAL_MACHINE\\SOFTWARE\\CLASSES\\.zip\\"; +var regPathDnzPrior = "HKEY_CURRENT_USER\\SOFTWARE\\Dino Chiesa\\DotNetZip Tools v1.9\\PriorZipAssociation"; +var verbose = true; + +function DisplayMessageBox(message, options) { + if (options === null) { + options = msiMessageLevel.User + msiButtonType.Ok + msiDefaultButton.First; + } + + if (typeof(Session) === undefined) { + WScript.Echo(message); + if ((options & 0xF) == 1) { + // ask: cancel? + } + return 0; + } + + var record = Session.Installer.CreateRecord(1); + record.StringData(0) = "[1]"; + record.StringData(1) = message; + + return Session.Message(options, record); +} + + +function DisplayUserDiagnostic(message){ + if (!verbose) return 0; + + if (typeof(Session) === undefined) { + WScript.Echo(message); + return 0; + } + + var options = msiMessageLevel.User + msiButtonType.Ok + msiDefaultButton.First; + var record = Session.Installer.CreateRecord(1); + record.StringData(0) = "[1]"; + record.StringData(1) = message; + + return Session.Message(options, record); +} + +function LogMessage(msg) { + var record = Session.Installer.CreateRecord(0); + record.StringData(0) = "CustomAction: " + msg; + Session.Message(msiMessageLevel.Info, record); +} + + +function mytrace(arg){ + if (verbose == false) return; + // This just causes a regRead to be logged. + // Then in PerfMon or RegMon, you can use it as a "trace" + try { + var junkTest = WSHShell.RegRead(regValue2 + arg); + } + catch (e2b) { + } +} + + + + +function RestoreZipAssocInRegistry_CA() { + // restore the app association for zip files, if possible. + var WSHShell = new ActiveXObject("WScript.Shell"); + var priorAssociation = null; + var phase = ""; + var currentAssociation; + var stillInstalled; + var parkingLot = "__DeleteThis"; + + try { + currentAssociation = WSHShell.RegRead(regPathZipAssoc); + LogMessage("Current assoc for .zip: " + currentAssociation); + + if (currentAssociation == DotNetZipAssocId) + phase = "1"; + else if (currentAssociation == "") + phase = "2"; + + LogMessage("phase " + phase); + + if (phase == "1" || phase=="2") { + if (phase=="1") + priorAssociation= WSHShell.RegRead(regPathDnzPrior); + else + priorAssociation= WSHShell.RegRead(regPathZipAssoc + parkingLot); + + LogMessage("prior assoc for .zip: " + priorAssociation); + if (priorAssociation != "") { + mytrace("A"+phase); + try { + mytrace("B"+phase); + stillInstalled = WSHShell.RegRead(regPathZipAssoc + "OpenWithProgIds\\" + priorAssociation); + // the value will be the empty string + LogMessage("the prior app is still installed."); + mytrace("C"); + if (phase=="1") + WSHShell.RegWrite(regPathZipAssoc + parkingLot, priorAssociation ); + else { + WSHShell.RegWrite(regPathZipAssoc, priorAssociation ); + WSHShell.RegDelete(regPathZipAssoc + parkingLot); + } + } + catch (e2a) { + mytrace("F"); + LogMessage("the prior app is NOT still installed."); + WSHShell.RegWrite(regPathZipAssoc, "CompressedFolder"); + } + } + else { + mytrace("G"); + LogMessage("the prior assoc is empty?"); + WSHShell.RegWrite(regPathZipAssoc, "CompressedFolder"); + } + } + else { + LogMessage("the associated app has changed."); + // The association has been changed since install of DotNetZip. + // We won't try to reset it. + } + } + catch (e1) { + LogMessage("there is no associated app."); + WSHShell.RegWrite(regPathZipAssoc, "CompressedFolder"); + } +} + + + + +function PreserveZipAssocInRegistry_CA() { + // get and store the existing association for zip files, if any + LogMessage("Hello from PreserveZipAssocInRegistry_CA()"); + var WSHShell = new ActiveXObject("WScript.Shell"); + var wantZipAssociation = Session.Property("WANT_ZIP_ASSOCIATIONS"); + LogMessage("wantZipAssociation = " + wantZipAssociation); + + if (wantZipAssociation == "1") { + try { + var association = WSHShell.RegRead(regPathZipAssoc); + if (association != "") { + LogMessage("PreserveFileAssoc: Current assoc for .zip: " + association); + if (association != DotNetZipAssocId) { + LogMessage("PreserveFileAssoc: it is NOT DotNetZip."); + // there is an association, and it is not DotNetZip + WSHShell.RegWrite(regPathDnzPrior, association); + } + else { + LogMessage("PreserveFileAssoc: it is DotNetZip."); + // the existing association is for DotNetZip + try { + var priorAssoc = WSHShell.RegRead(regPathDnzPrior); + if (priorAssoc == "" || priorAssoc == DotNetZipAssocId) { + LogMessage("PreserveFileAssoc: defaulting (0)"); + WSHShell.RegWrite(regPathDnzPrior, "CompressedFolder"); + } + else { + // there already is a stored prior association. + // don't change it. + } + } + catch (e1a) { + LogMessage("PreserveFileAssoc: exception: " + e1a.message); + LogMessage("PreserveFileAssoc: defaulting (1)"); + WSHShell.RegWrite(regPathDnzPrior, "CompressedFolder"); + } + } + } + else { + // there is no default association for .zip files + WSHShell.RegWrite(regPathDnzPrior, "CompressedFolder"); + } + } + catch (e1) { + // the key doesn't exist (no app for .zip files at all) + WSHShell.RegWrite(regPathDnzPrior, "CompressedFolder"); + } + } +} + + + +// var parameters = Session.Property("CustomActionData").split("|"); +// var targetDir = parameters[0]; +// var checkBoxState = parameters[1]; + +// DisplayDiagnostic("Checkbox state; " + checkBoxState); +// +// PreserveFileAssociation(); +// DeleteSelf(); +// +// +// RestoreRegistry(); diff --git a/dotNetZip/Setup Utils/CustomActions.wxs b/dotNetZip/Setup Utils/CustomActions.wxs new file mode 100644 index 0000000..3ec0259 --- /dev/null +++ b/dotNetZip/Setup Utils/CustomActions.wxs @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotNetZip/Setup Utils/CustomText.wxl b/dotNetZip/Setup Utils/CustomText.wxl new file mode 100644 index 0000000..f7fc883 --- /dev/null +++ b/dotNetZip/Setup Utils/CustomText.wxl @@ -0,0 +1,47 @@ + + + + + {\WixUI_Font_Bigger}Welcome to the Setup Wizard for [ProductName] + {\WixUI_Font_Bigger}Welcome to the Setup Wizard for [ProductName] + {\WixUI_Font_Bigger}Welcome to the Setup Wizard for [ProductName] + + + The Setup Wizard will install the [ProductName], graphical and command-line tools for manipulating ZIP archive files, on your computer. The version to be installed is [ProductVersion]. Click Next to continue or Cancel to exit the Setup Wizard. + + {\WixUI_Font_Bigger}The Setup Wizard for DotNetZip was interrupted + + {\WixUI_Font_Title}You are now installing DotNetZip... + + + {\WixUI_Font_Bigger}You've Completed the Setup Wizard for [ProductName] + + + {\WixUI_Font_Title}Ready to install DotNetZip Tools 1.9 + + + Are you ready? Are you ready to transport yourself to a world in which free zip tools are at your fingertips? Where you can create and extract zip archives using the full power of the ZIP specification? Where you have absolute control over ZIP64, Self-extracting archives, AES encryption, Unicode filenames, extended timestamps, and archive splitting? Well? Are you?? + + Check here to accept the required licenses + + {\WixUI_Font_Title}What would you like to Install? + + {\WixUI_Font_Title}Install options + Specify the options you prefer, then click Next. + + {\WixUI_Font_Bigger}Setup for [ProductName] ended prematurely + The Setup Wizard for DotNetZip ended prematurely because of an error. Your system has not been modified. To install DotNetZip at a later time, run the Setup again. + + + + + + diff --git a/dotNetZip/Setup Utils/DotNetZipUtils.wixproj b/dotNetZip/Setup Utils/DotNetZipUtils.wixproj new file mode 100644 index 0000000..6eaffb1 --- /dev/null +++ b/dotNetZip/Setup Utils/DotNetZipUtils.wixproj @@ -0,0 +1,117 @@ + + + + Debug + AnyCPU + 3.0 + {18b1cdb1-709d-46d4-a894-9fe0bf929686} + 2.0 + DotNetZipUtils + Package + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets + false + DotNetZipUtils Setup + + + + bin\$(Configuration)\ + obj\$(Configuration)\ + Debug + + + bin\$(Configuration)\ + obj\$(Configuration)\ + + + + + + + + + + + + + WixUIExtension + $(ProgramFileS)\Windows Installer XML v3.5\bin\WixUIExtension.dll + + + WixUtilExtension + $(ProgramFileS)\Windows Installer XML v3.5\bin\WixUtilExtension.dll + + + WixNetFxExtension + $(ProgramFileS)\Windows Installer XML v3.5\bin\WixNetFxExtension.dll + + + + + + + + + + + + ConvertZipToSfx + {276b8174-a24e-4257-9969-42d692f8cac2} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + UnZip + {a22c89e0-b5d4-4881-a61f-4b1fd82f2453} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + {6BCCF138-2EFB-464C-B872-E3079F0A4708} + Win Forms App + + + ZipIt + {98008721-c4dd-4f34-b3ae-a3453e29bb65} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + BZip2 + {c2241050-f23c-420b-aa67-60e94b34c2b2} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + GZip + {52542d59-25ec-4ee4-8af2-85de50c70ea6} + True + True + Binaries;Content;Satellites + INSTALLLOCATION + + + \ No newline at end of file diff --git a/dotNetZip/Setup Utils/PostProcessMsi.js b/dotNetZip/Setup Utils/PostProcessMsi.js new file mode 100644 index 0000000..59ce1d4 --- /dev/null +++ b/dotNetZip/Setup Utils/PostProcessMsi.js @@ -0,0 +1,197 @@ +// PostProcessMSi.js +// +// Post-process the generated MSI to do these things: +// +// - move the (optional) checkbox control that is presented on the exit +// dialog. WIX produces a checkbox control with a greay background; I +// don't know why, and that seems like the wrong color to choose as a +// default. I also don't know how to reset the color in a .wxs +// file. But, I do know how to move the checkbox and resize it, by +// updating the MSI database from a script. Moving it to the lower +// part of the form - where the Finish button is presented, allows the +// grey to match the existing background. +// +// - Add a second checkbox to allow users to optionally associate the +// .zip extension to the GUI Zip tool. I think this also could be +// done in the UI.wxs, but once again, I don't know how to do that +// simply. I find WIX to be very hard to use. It's easier for me, to +// just uypdate the MSI table, so that's what I will do right here. +// +// - Move things around on the progress and the installdir dialog. For +// the progress dialog, the default settings emitted by WIX are not +// correct - the progress text is too close to the actual progress +// bar, and the default height of the progress text is too small so +// that the text gets clipped. For the installdir dialog, similar +// concerns: the default layout doesn't look very nice. Slight tweaks +// make a nice improvement. I'm pretty sure that there's a way to do +// this in the .wxs file, but once again, I don't know how to do it, +// and I think it will be hard to find out. Wix is a pain in the +// ass. So I'll just do it here. +// +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code, like all of DotNetZip, is licensed under the Microsoft +// Public License. See the file License.txt accompanying this source +// modeule for the license details. More info on: +// http://dotnetzip.codeplex.com +// +// Created: Thu, 14 Jul 2011 17:31 +// Last saved: <2011-July-28 12:28:42> +// + +// Constant values from Windows Installer +var msiOpenDatabaseMode = { + Transact : 1 +}; +var msiViewModify = { + Insert : 1, + Update : 2, + Assign : 3, + Replace : 4, + Delete : 6 +}; + + +if (WScript.Arguments.Length != 1){ + WScript.StdErr.WriteLine(WScript.ScriptName + " file"); + WScript.Quit(1); +} + + +var filespec = WScript.Arguments(0); +WScript.Echo(WScript.ScriptName + " " + filespec); +var installer = WScript.CreateObject("WindowsInstaller.Installer"); +var database = installer.OpenDatabase(filespec, msiOpenDatabaseMode.Transact); + +var sql; +var view; +var record; + +try { + // var fileId = FindFileIdentifier(database, filename); + // if (!fileId){ + // throw new Error ("Unable to find '" + filename + "' in File table"); + // } + + WScript.Echo("Updating the Control table..."); + + // Move the checkbox on the exit dialog, so that it appears in the row of buttons. + // We do this because the background on the checkbox is gray, unchangeably so. + // but the bg for the row of buttons is gray, so it looks ok if moved there. + sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height` FROM `Control` WHERE `Dialog_`='ExitDialog' AND `Control`='OptionalCheckBox'"; + view = database.OpenView(sql); + view.Execute(); + record = view.Fetch(); + // index starts at 1 + record.IntegerData(4) = 14; // X + record.IntegerData(5) = 243; // Y + record.IntegerData(6) = 120; // Width + record.IntegerData(7) = 16; // Height + view.Modify(msiViewModify.Replace, record); + view.Close(); + + // Insert a new checkbox into the InstallDirDlg. + // This one controls whether to associate zip files to DotNetZip. + + sql = "SELECT `Control` FROM `Control` WHERE `Control`='CheckboxAssoc'"; + view = database.OpenView(sql); + view.Execute(); + record = view.Fetch(); + var controlExists = null; + if (record != null) controlExists = record.StringData(1); + if (record == null || controlExists != "CheckboxAssoc") { + + sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, " + + "`Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) " + + "VALUES ('InstallDirDlg', 'CheckboxAssoc', 'CheckBox', '20', '124', '184', '14', '3', "+ + "'WANT_ZIP_ASSOCIATIONS', 'Associate .zip files to DotNetZip', 'Next', '|')"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + + sql = "UPDATE `Control` SET `Control`.`Control_Next` = 'CheckboxAssoc' " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='ChangeFolder'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + } + + // Tweak the existing controls on the InstallDirDlg: move them up a bit, shrink the label + sql = "UPDATE `Control` SET `Control`.`Y` = 76 " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='Folder'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 96 " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='ChangeFolder'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Height` = 16 " + + "WHERE `Control`.`Dialog_`='InstallDirDlg' AND `Control`.`Control`='FolderLabel'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + + + // Tweak the existing controls on the ProgressDlg: move the status + // text up a bit, and make it taller, because it was being clipped + // by its own height, and also by the proximity of the progress bar. + // These seem like basic fit-and-finish problems that Wix shouldn't have. + // WIX is an idiot. + sql = "UPDATE `Control` SET `Control`.`Y` = 96, `Control`.`Height` = 14 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='StatusLabel'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 96, `Control`.`Height` = 14 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='ActionText'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextInstalling'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextChanging'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextRepairing'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + sql = "UPDATE `Control` SET `Control`.`Y` = 58 " + + "WHERE `Control`.`Dialog_`='ProgressDlg' AND `Control`.`Control`='TextRemoving'"; + view = database.OpenView(sql); + view.Execute(); + view.Close(); + + // if (checkboxChecked) { + // WScript.Echo("Updating the Property table..."); + // // Set the default value of the CheckBox + // sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP', '1')"; + // view = database.OpenView(sql); + // view.Execute(); + // view.Close(); + // } + // WScript.Echo("G"); + + database.Commit(); +} +catch(e) { + WScript.StdErr.WriteLine(e); + WScript.Quit(1); +} + + + diff --git a/dotNetZip/Setup Utils/Product.wxs b/dotNetZip/Setup Utils/Product.wxs new file mode 100644 index 0000000..281b809 --- /dev/null +++ b/dotNetZip/Setup Utils/Product.wxs @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + = 502)]]> + + + + + + + + + + = "3.1"]]> + + + + + + + + + + + + + + + (&F.Complete=3) AND WANT_ZIP_ASSOCIATIONS + + + (&F.Complete=2) AND (!F.Complete=3) + + (&F.Complete=2) AND (!F.Complete=3) + + + (&F.Complete=2) AND (!F.Complete=3) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WANT_ZIP_ASSOCIATIONS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotNetZip/Setup Utils/SideBanner.bmp b/dotNetZip/Setup Utils/SideBanner.bmp new file mode 100644 index 0000000..39512ff Binary files /dev/null and b/dotNetZip/Setup Utils/SideBanner.bmp differ diff --git a/dotNetZip/Setup Utils/TopBanner.bmp b/dotNetZip/Setup Utils/TopBanner.bmp new file mode 100644 index 0000000..fd082bf Binary files /dev/null and b/dotNetZip/Setup Utils/TopBanner.bmp differ diff --git a/dotNetZip/Setup Utils/UI.wxs b/dotNetZip/Setup Utils/UI.wxs new file mode 100644 index 0000000..816a0f7 --- /dev/null +++ b/dotNetZip/Setup Utils/UI.wxs @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + "1"]]> + + + 1 + + + + 1 + + 1 + LicenseAccepted = "1" + + + + + Installed + NOT Installed + + + 1 + + 1 + 1 + 1 + 1 + 1 + + WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed + + + + + + + + + + + diff --git a/dotNetZip/SolutionInfo.cs b/dotNetZip/SolutionInfo.cs new file mode 100644 index 0000000..4f39da0 Binary files /dev/null and b/dotNetZip/SolutionInfo.cs differ diff --git a/dotNetZip/Tools/BZip2/AssemblyInfo.cs b/dotNetZip/Tools/BZip2/AssemblyInfo.cs new file mode 100644 index 0000000..b9b7e09 Binary files /dev/null and b/dotNetZip/Tools/BZip2/AssemblyInfo.cs differ diff --git a/dotNetZip/Tools/BZip2/BZip2.cs b/dotNetZip/Tools/BZip2/BZip2.cs new file mode 100644 index 0000000..a42aff2 --- /dev/null +++ b/dotNetZip/Tools/BZip2/BZip2.cs @@ -0,0 +1,191 @@ +// BZip2.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2011 Dino Chiesa. All rights reserved. +// +// This example is released under the Microsoft Permissive License of +// October 2006. See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This utility creates a compresses the file specified on the command line, +// using BZip2, creating a new file, with the .bz2 suffix. Or, if the +// file specified on the command-line has a .bz2 suffix, this utility +// decompresses it, restoring the original file. +// +// compile with: +// csc /debug+ /target:exe /r:Ionic.Zip.dll /out:BZip2.exe BZip2.cs +// +// Sat, 23 Jul 2011 22:32 +// + +using System; +using System.IO; +using Ionic.BZip2; + +namespace Ionic.Zip.Examples +{ + public class BZip2 + { + private static void Usage() + { + string UsageMessage = + "BZip2.exe: compress a file using BZip2, or decompress a BZip2-compressed file. \n"+ + " The original file is deleted after processing.\n" + + " This tool depends on Ionic's DotNetZip library. This is version {0} \n" + + " of the utility. See http://dotnetzip.codeplex.com for info.\n"+ + " usage:\n BZip2.exe [arguments]\n" + + "\n arguments: \n" + + " -v - verbose output.\n" + + " -f - force overwrite of any existing files.\n" + + " -keep - don't delete the original file after compressing or \n"+ + " decompressing it.\n"; + + Console.WriteLine(UsageMessage, + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Environment.Exit(1); + } + + + + static void CtrlC_Handler(object sender, ConsoleCancelEventArgs args) + { + Console.WriteLine("\nCtrl-C"); + //cleanupCompleted.WaitOne(); + // prevent the process from exiting until cleanup is done: + args.Cancel = true; + } + + private static void Pump(Stream src, Stream dest) + { + byte[] buffer = new byte[2048]; + int n; + while ((n = src.Read(buffer, 0, buffer.Length)) > 0) + dest.Write(buffer, 0, n); + + } + + + static string Compress(string fname, bool forceOverwrite) + { + var outFname = fname + ".bz2"; + if (File.Exists(outFname)) + { + if (forceOverwrite) + File.Delete(outFname); + else + return null; + } + + using (Stream fs = File.OpenRead(fname), + output = File.Create(outFname), + compressor = new Ionic.BZip2.ParallelBZip2OutputStream(output)) + Pump(fs, compressor); + + return outFname; + } + + + public static string Decompress(string fname, bool forceOverwrite) + { + var outFname = Path.GetFileNameWithoutExtension(fname); + if (File.Exists(outFname)) + { + if (forceOverwrite) + File.Delete(outFname); + else + return null; + } + + using (Stream fs = File.OpenRead(fname), + output = File.Create(outFname), + decompressor = new Ionic.BZip2.BZip2InputStream(fs)) + Pump(decompressor, output); + + return outFname; + } + + + public static void Main(String[] args) + { + bool keepOriginal = false; + bool force = false; + bool verbose = false; + if (args.Length < 1) Usage(); + + if (!File.Exists(args[0])) + { + System.Console.WriteLine("That file ({0}) does not exist.", args[0]); + return; + } + + Console.CancelKeyPress += CtrlC_Handler; + + try + { + for (int i = 1; i < args.Length; i++) + { + switch (args[i]) + { + case "-keep": + keepOriginal = true; + break; + + case "-f": + force = true; + break; + + case "-v": + verbose = true; + break; + + default: + throw new ArgumentException(args[i]); + } + } + + string fname = args[0]; + bool decompress = (fname.ToLower().EndsWith(".bz") || fname.ToLower().EndsWith(".bz2")); + string result = decompress + ? Decompress(fname, force) + : Compress(fname, force); + + if (result==null) + { + Console.WriteLine("No action taken. The file already exists."); + } + else + { + if (verbose) + { + var fi1 = new FileInfo(fname); + var fi2 = new FileInfo(result); + if (decompress) + { + Console.WriteLine(" Original : {0} bytes", fi1.Length); + Console.WriteLine(" Decompressed: {0} bytes", fi2.Length); + Console.WriteLine(" Comp Ratio : {0:N1}%", 100.0 - (fi1.Length/(0.01 * fi2.Length))); + } + else + { + Console.WriteLine(" Original : {0} bytes", fi1.Length); + Console.WriteLine(" Compressed: {0} bytes", fi2.Length); + Console.WriteLine(" Comp Ratio: {0:N1}%", 100.0 - (fi2.Length/(0.01 * fi1.Length))); + } + } + + if (!keepOriginal) + { + File.Delete(fname); + } + } + + } + catch (System.Exception ex1) + { + System.Console.WriteLine("Exception: " + ex1); + } + } + } +} diff --git a/dotNetZip/Tools/BZip2/BZip2.csproj b/dotNetZip/Tools/BZip2/BZip2.csproj new file mode 100644 index 0000000..030bf35 --- /dev/null +++ b/dotNetZip/Tools/BZip2/BZip2.csproj @@ -0,0 +1,107 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {c2241050-f23c-420b-aa67-60e94b34c2b2} + Exe + Properties + BZip2 + BZip2 + + + + + 3.5 + SAK + SAK + SAK + SAK + true + ..\..\Ionic.snk + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + SolutionInfo.cs + + + + + {e2ce0d56-7af8-4404-bd0c-bc562cbd74d4} + BZip2 DLL + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Tools/ConvertZipToSfx/ConvertZipToSfx.cs b/dotNetZip/Tools/ConvertZipToSfx/ConvertZipToSfx.cs new file mode 100644 index 0000000..31ba005 --- /dev/null +++ b/dotNetZip/Tools/ConvertZipToSfx/ConvertZipToSfx.cs @@ -0,0 +1,187 @@ +// ConvertZipToSfx.cs +// ------------------------------------------------------------------ +// +// This is a command-line tool that creates a self-extracting Zip archive, given a +// standard zip archive. +// It requires the .NET Framework 2.0 on the target machine in order to run. +// +// +// The Visual Studio Project is a little weird. There are code files that ARE NOT compiled +// during a normal build of the VS Solution. They are marked as embedded resources. These +// are the various "boilerplate" modules that are used in the self-extractor. These modules are: +// WinFormsSelfExtractorStub.cs +// WinFormsSelfExtractorStub.Designer.cs +// CommandLineSelfExtractorStub.cs +// PasswordDialog.cs +// PasswordDialog.Designer.cs +// ZipContentsDialog.cs +// ZipContentsDialog.Designer.cs +// FolderBrowserDialogEx.cs +// +// At design time, if you want to modify the way the GUI looks, you have to mark those modules +// to have a "compile" build action. Then tweak em, test, etc. Then again mark them as +// "Embedded resource". +// +// +// Author: Dinoch +// built on host: DINOCH-2 +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2008 by Dino Chiesa +// All rights reserved! +// +// +// ------------------------------------------------------------------ + +using System; +using System.Reflection; +using System.IO; +using System.Collections.Generic; + +using Ionic.Zip; + +namespace Ionic.Zip.Examples +{ + + public class ConvertZipToSfx + { + private ConvertZipToSfx() { } + + public ConvertZipToSfx(string[] args) + { + for (int i = 0; i < args.Length; i++) + { + switch (args[i]) + { + case "-extractdir": + if (i >= args.Length - 1 || ExtractDir != null) + { + Usage(); + return; + } + ExtractDir = args[++i]; + break; + + case "-cmdline": + flavor = Ionic.Zip.SelfExtractorFlavor.ConsoleApplication; + break; + + case "-comment": + if (i >= args.Length-1 || ZipComment != null) + { + Usage(); + return; + } + ZipComment = args[++i]; + break; + + case "-exeonunpack": + if (i >= args.Length-1 || ExeOnUnpack != null) + { + Usage(); + return; + } + ExeOnUnpack = args[++i]; + break; + + case "-?": + case "-help": + Usage(); + return; + + default: + // positional args + if (ZipFileToConvert == null) + ZipFileToConvert = args[i]; + else + { + Usage(); + return; + } + break; + } + } + } + + string ExeOnUnpack; + string ZipComment; + string ZipFileToConvert = null; + string ExtractDir = null; + bool _gaveUsage; + SelfExtractorFlavor flavor = Ionic.Zip.SelfExtractorFlavor.WinFormsApplication; + + public void Run() + { + if (_gaveUsage) return; + if (ZipFileToConvert == null) + { + Console.WriteLine("No zipfile specified.\n"); + Usage(); + return; + } + + if (!System.IO.File.Exists(ZipFileToConvert)) + { + Console.WriteLine("That zip file does not exist!\n"); + Usage(); + return; + } + + Convert(); + } + + + + private void Convert() + { + string TargetName = ZipFileToConvert.Replace(".zip", ".exe"); + + Console.WriteLine("Converting file {0} to SFX {1}", ZipFileToConvert, TargetName); + + var options = new ReadOptions { StatusMessageWriter = System.Console.Out }; + using (ZipFile zip = ZipFile.Read(ZipFileToConvert, options)) + { + zip.Comment = ZipComment; + SelfExtractorSaveOptions sfxOptions = new SelfExtractorSaveOptions(); + sfxOptions.Flavor = flavor; + sfxOptions.DefaultExtractDirectory = ExtractDir; + sfxOptions.PostExtractCommandLine = ExeOnUnpack; + zip.SaveSelfExtractor(TargetName, sfxOptions ); + } + } + + + private void Usage() + { + Console.WriteLine("usage:"); + Console.WriteLine(" CreateSelfExtractor [-cmdline] [-extractdir ] [-comment ]"); + Console.WriteLine(" [-exec ] "); + Console.WriteLine(" Creates a self-extracting archive (SFX) from an existing zip file.\n"); + Console.WriteLine(" options:"); + Console.WriteLine(" -cmdline - the generated SFX will be a console/command-line exe."); + Console.WriteLine(" The default is that the SFX is a Windows (GUI) app."); + Console.WriteLine(" -exec - The command line to execute after the SFX runs."); + Console.WriteLine(" -comment - embed a comment into the self-extracting archive."); + Console.WriteLine(" It is displayed when the SFX is extracted."); + Console.WriteLine(); + _gaveUsage = true; + } + + + + public static void Main(string[] args) + { + try + { + new ConvertZipToSfx(args).Run(); + } + catch (System.Exception exc1) + { + Console.WriteLine("Exception while creating the self extracting archive: {0}", exc1.ToString()); + } + } + + + } +} diff --git a/dotNetZip/Tools/ConvertZipToSfx/ConvertZipToSfx.csproj b/dotNetZip/Tools/ConvertZipToSfx/ConvertZipToSfx.csproj new file mode 100644 index 0000000..2fd770c --- /dev/null +++ b/dotNetZip/Tools/ConvertZipToSfx/ConvertZipToSfx.csproj @@ -0,0 +1,118 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {276B8174-A24E-4257-9969-42D692F8CAC2} + Exe + Properties + Ionic.Utils.Zip + ConvertZipToSfx + v2.0 + 512 + + + false + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + true + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + \ No newline at end of file diff --git a/dotNetZip/Tools/ConvertZipToSfx/Properties/AssemblyInfo.cs b/dotNetZip/Tools/ConvertZipToSfx/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0e76e7b Binary files /dev/null and b/dotNetZip/Tools/ConvertZipToSfx/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Tools/GZip/AssemblyInfo.cs b/dotNetZip/Tools/GZip/AssemblyInfo.cs new file mode 100644 index 0000000..c83b625 Binary files /dev/null and b/dotNetZip/Tools/GZip/AssemblyInfo.cs differ diff --git a/dotNetZip/Tools/GZip/GZip.cs b/dotNetZip/Tools/GZip/GZip.cs new file mode 100644 index 0000000..73a62d9 --- /dev/null +++ b/dotNetZip/Tools/GZip/GZip.cs @@ -0,0 +1,205 @@ +// GZip.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2011 Dino Chiesa. All rights reserved. +// +// This example is released under the Microsoft Permissive License of +// October 2006. See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This utility creates a compresses the file specified on the command line, +// using GZip, creating a new file, with the .gz suffix. Or, if the +// file specified on the command-line has a .gz suffix, this utility +// decompresses it, restoring the original file. +// +// compile with: +// csc /debug+ /target:exe /r:Ionic.Zip.dll /out:GZip.exe GZip.cs +// +// Sat, 23 Jul 2011 22:32 +// + +using System; +using System.IO; +using Ionic.Zlib; + +namespace Ionic.Zip.Examples +{ + public class GZip + { + private static void Usage() + { + string UsageMessage = + "GZip.exe: compress a file using GZip, or decompress a GZip-compressed file. \n"+ + " The original file is deleted after processing.\n" + + " This tool depends on Ionic's DotNetZip library. This is version {0} \n" + + " of the utility. See http://dotnetzip.codeplex.com for info.\n"+ + " usage:\n GZip.exe [arguments]\n" + + "\n arguments: \n" + + " -v - verbose output.\n" + + " -f - force overwrite of any existing files.\n" + + " -keep - don't delete the original file after compressing or \n"+ + " decompressing it.\n"; + + Console.WriteLine(UsageMessage, + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Environment.Exit(1); + } + + + + static void CtrlC_Handler(object sender, ConsoleCancelEventArgs args) + { + Console.WriteLine("\nCtrl-C"); + //cleanupCompleted.WaitOne(); + // prevent the process from exiting until cleanup is done: + args.Cancel = true; + } + + private static void Pump(Stream src, Stream dest) + { + byte[] buffer = new byte[2048]; + int n; + while ((n = src.Read(buffer, 0, buffer.Length)) > 0) + { + dest.Write(buffer, 0, n); + } + } + + + static string Compress(string fname, bool forceOverwrite) + { + var outFname = fname + ".gz"; + if (File.Exists(outFname)) + { + if (forceOverwrite) + File.Delete(outFname); + else + return null; + } + + using (var fs = File.OpenRead(fname)) + { + using (var output = File.Create(outFname)) + { + using (var compressor = new Ionic.Zlib.GZipStream(output, Ionic.Zlib.CompressionMode.Compress)) + { + compressor.FileName = fname; + var fi = new FileInfo(fname); + compressor.LastModified = fi.LastWriteTime; + Pump(fs, compressor); + } + } + } + return outFname; + } + + + public static string Decompress(string fname, bool forceOverwrite) + { + var outFname = Path.GetFileNameWithoutExtension(fname); + if (File.Exists(outFname)) + { + if (forceOverwrite) + File.Delete(outFname); + else + return null; + } + + using (var fs = File.OpenRead(fname)) + { + using (var decompressor = new Ionic.Zlib.GZipStream(fs, Ionic.Zlib.CompressionMode.Decompress)) + { + using (var output = File.Create(outFname)) + { + Pump(decompressor, output); + } + } + } + return outFname; + } + + + public static void Main(String[] args) + { + bool keepOriginal = false; + bool force = false; + bool verbose = false; + if (args.Length < 1) Usage(); + + if (!File.Exists(args[0])) + { + System.Console.WriteLine("That file ({0}) does not exist.", args[0]); + return; + } + + Console.CancelKeyPress += CtrlC_Handler; + + try + { + for (int i = 1; i < args.Length; i++) + { + switch (args[i]) + { + case "-keep": + keepOriginal = true; + break; + + case "-f": + force = true; + break; + + case "-v": + verbose = true; + break; + + default: + throw new ArgumentException(args[i]); + } + } + + string fname = args[0]; + bool decompress = fname.ToLower().EndsWith(".gz"); + string result = decompress + ? Decompress(fname, force) + : Compress(fname, force); + + if (result==null) + { + Console.WriteLine("No action taken. The file already exists."); + } + else + { + if (verbose) + { + var fi1 = new FileInfo(fname); + var fi2 = new FileInfo(result); + if (decompress) + { + Console.WriteLine(" Original : {0} bytes", fi1.Length); + Console.WriteLine(" Decompressed: {0} bytes", fi2.Length); + Console.WriteLine(" Comp Ratio : {0:N1}%", 100.0 - (fi1.Length/(0.01 * fi2.Length))); + } + else + { + Console.WriteLine(" Original : {0} bytes", fi1.Length); + Console.WriteLine(" Compressed: {0} bytes", fi2.Length); + Console.WriteLine(" Comp Ratio: {0:N1}%", 100.0 - (fi2.Length/(0.01 * fi1.Length))); + } + } + + if (!keepOriginal) + { + File.Delete(fname); + } + } + + } + catch (System.Exception ex1) + { + System.Console.WriteLine("Exception: " + ex1); + } + } + } +} diff --git a/dotNetZip/Tools/GZip/GZip.csproj b/dotNetZip/Tools/GZip/GZip.csproj new file mode 100644 index 0000000..322af9d --- /dev/null +++ b/dotNetZip/Tools/GZip/GZip.csproj @@ -0,0 +1,107 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {52542d59-25ec-4ee4-8af2-85de50c70ea6} + Exe + Properties + GZip + GZip + + + + + 3.5 + SAK + SAK + SAK + SAK + true + ..\..\Ionic.snk + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + SolutionInfo.cs + + + + + {9816BA86-9250-4C00-A912-25F07F8677D1} + Zlib DLL + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Tools/UnZip/Properties/AssemblyInfo.cs b/dotNetZip/Tools/UnZip/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ff028d7 Binary files /dev/null and b/dotNetZip/Tools/UnZip/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Tools/UnZip/UnZip.cs b/dotNetZip/Tools/UnZip/UnZip.cs new file mode 100644 index 0000000..54523e2 --- /dev/null +++ b/dotNetZip/Tools/UnZip/UnZip.cs @@ -0,0 +1,353 @@ +// UnZip.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2006, 2007, 2008 Microsoft Corporation. All rights reserved. +// +// This example is released under the Microsoft Public License . +// See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This command-line utility unzips a zipfile into the specified directory, +// or lists the entries in a zipfile without unzipping. +// +// compile with: +// csc /target:exe /r:Ionic.Zip.dll /out:UnZip.exe UnZip.cs +// +// created +// Wed, 29 Mar 2006 14:36 +// + + +using System; +using System.Collections.Generic; +using Ionic.Zip; + +namespace Ionic.Zip.Examples +{ + public class UnZip + { + + private static void Usage() + { + Console.WriteLine("UnZip.exe: extract or list or test the entries in a zip file."); + Console.WriteLine(" Depends on Ionic's DotNetZip library. This is version {0} of the utility.", + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Console.WriteLine("usage:\n" + + " unzip [options] [...] \n" + + " unzips all files in the archive.\n" + + " options:\n" + + " - emit extracted content to stdout.\n" + + " -o overwrite existing files if necessary.\n" + + " -f flatten directory structure when extracting.\n" + + " -p specify password for extraction.\n" + + " -t test the file for consistency. \n" + + " -q operate quietly (no verbose messages). \n" + + " -cp extract with the specified numeric codepage. Only do this if you\n" + + " know the codepage, and it is neither IBM437 nor UTF-8. If the \n" + + " codepage you specify here is different than the codepage of \n" + + " the cmd.exe, then the verbose messages will look odd, but the \n" + + " files will be extracted properly.\n" + + " -d unpack to the specified directory. If none provided, it will\n" + + " unzip to the current directory.\n" + + " unzip only the specified filename.\n\n" + + " unzip -l \n" + + " lists the entries in the zip archive.\n" + + " unzip -i \n" + + " displays full information about all the entries in the zip archive.\n" + + " unzip -t [-p ] [-cp ]\n" + + " tests the zip archive.\n" + + " unzip -r \n" + + " repairs the zip archive - rewriting the directory.\n" + + " unzip -?\n" + + " displays this message.\n" + ); + Environment.Exit(1); + } + + enum ActionDesired + { + Extract, + List, + Info, + Test, + Repair + } + + public static void Main(String[] args) + { + int startArgs = 0; + int i; + int codePage = 0; + string zipfile = null; + string targdir = null; + string password = null; + List entriesToExtract = new List(); + bool extractToConsole = false; + ActionDesired action = ActionDesired.Extract; + ExtractExistingFileAction behaviorForExistingFile = ExtractExistingFileAction.DoNotOverwrite; + bool wantQuiet = false; + bool wantFlatten = false; + System.IO.Stream bitbucket = System.IO.Stream.Null; + System.IO.Stream outstream = null; + + // because the comments and filenames on zip entries may be UTF-8 + //System.Console.OutputEncoding = new System.Text.UTF8Encoding(); + + if (args.Length == 0) Usage(); + if (args[0] == "-") + { + extractToConsole = true; + outstream = Console.OpenStandardOutput(); + startArgs = 1; + } + + for (i = startArgs; i < args.Length; i++) + { + switch (args[i]) + { + case "-cp": + i++; + if (args.Length <= i) Usage(); + if (codePage != 0) Usage(); + System.Int32.TryParse(args[i], out codePage); + break; + + case "-d": + i++; + if (args.Length <= i) Usage(); + if (targdir != null) Usage(); + if (extractToConsole) Usage(); + if (action != ActionDesired.Extract) Usage(); + targdir = args[i]; + break; + + case "-f": + wantFlatten = true; + if (action != ActionDesired.Extract) Usage(); + break; + + case "-i": + if (password != null) Usage(); + if (targdir != null) Usage(); + if (wantQuiet) Usage(); + if (entriesToExtract.Count > 0) Usage(); + action = ActionDesired.Info; + break; + + case "-l": + if (password != null) Usage(); + if (targdir != null) Usage(); + if (wantQuiet) Usage(); + if (entriesToExtract.Count > 0) Usage(); + if (behaviorForExistingFile == ExtractExistingFileAction.OverwriteSilently) Usage(); + action = ActionDesired.List; + break; + + case "-o": + behaviorForExistingFile = ExtractExistingFileAction.OverwriteSilently; + if (action != ActionDesired.Extract) Usage(); + break; + + case "-r": + if (wantFlatten == true) Usage(); + if (targdir != null) Usage(); + if (action == ActionDesired.Test) Usage(); + action = ActionDesired.Repair; + break; + + case "-p": + i++; + if (args.Length <= i) Usage(); + if (password != null) Usage(); + password = args[i]; + break; + + case "-q": + if (action == ActionDesired.List) Usage(); + wantQuiet = true; + break; + + case "-t": + action = ActionDesired.Test; + if (targdir != null) Usage(); + //if (wantQuiet) Usage(); + if (entriesToExtract.Count > 0) Usage(); + break; + + case "-?": + Usage(); + break; + + default: + // positional args + if (zipfile == null) + zipfile = args[i]; + else if (action != ActionDesired.Extract) Usage(); + else entriesToExtract.Add(args[i]); + break; + } + + } + if (zipfile == null) + { + Console.WriteLine("unzip: No zipfile specified.\n"); + Usage(); + } + + if (!System.IO.File.Exists(zipfile)) + { + Console.WriteLine("unzip: That zip file does not exist!\n"); + Usage(); + } + + if (targdir == null) targdir = "."; + + try + { + if (action == ActionDesired.Repair) + { + ZipFile.FixZipDirectory(zipfile); + } + else + { + var options = new ReadOptions { + Encoding = (codePage != 0) + ? System.Text.Encoding.GetEncoding(codePage) + : null + }; + using (ZipFile zip = ZipFile.Read(zipfile, options)) + { + + if (entriesToExtract.Count > 0) + { + // extract specified entries + foreach (var entryToExtract in entriesToExtract) + { + // find the entry + ZipEntry e= zip[entryToExtract]; + if (e == null) + { + System.Console.WriteLine(" entry ({0}) does not exist in the zip archive.", entryToExtract); + } + else + { + if (wantFlatten) e.FileName = System.IO.Path.GetFileName(e.FileName); + + if (password == null) + { + if (e.UsesEncryption) + System.Console.WriteLine(" That entry ({0}) requires a password to extract.", entryToExtract); + else if (extractToConsole) + e.Extract(outstream); + else + e.Extract(targdir, behaviorForExistingFile); + } + else + { + if (extractToConsole) + e.ExtractWithPassword(outstream, password); + else + e.ExtractWithPassword(targdir, behaviorForExistingFile, password); + } + } + } + } + else if (action == ActionDesired.Info) + { + System.Console.WriteLine("{0}", zip.Info); + } + else + { + // extract all, or list, or test + + // The logic here does almost the same thing as the ExtractAll() method + // on the ZipFile class. But in this case we *could* have control over + // it, for example only extract files of a certain type, or whose names + // matched a certain pattern, or whose lastmodified times fit a certain + // condition, or use a different password for each entry, etc. We can + // also display status for each entry, as here. + + Int64 totalUncompressedSize = 0; + bool header = true; + foreach (ZipEntry e in zip.EntriesSorted) + { + if (!wantQuiet) + { + if (header) + { + System.Console.WriteLine("Zipfile: {0}", zip.Name); + if ((zip.Comment != null) && (zip.Comment != "")) + System.Console.WriteLine("Comment: {0}", zip.Comment); + + System.Console.WriteLine("\n{1,-22} {2,10} {3,5} {4,10} {5,3} {6,8} {0}", + "Filename", "Modified", "Size", "Ratio", "Packed", "pw?", "CRC"); + System.Console.WriteLine(new System.String('-', 80)); + header = false; + } + totalUncompressedSize += e.UncompressedSize; + System.Console.WriteLine("{1,-22} {2,10} {3,5:F0}% {4,10} {5,3} {6:X8} {0}", + e.FileName, + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + e.UncompressedSize, + e.CompressionRatio, + e.CompressedSize, + (e.UsesEncryption) ? "Y" : "N", + e.Crc); + + if ((e.Comment != null) && (e.Comment != "")) + System.Console.WriteLine(" Comment: {0}", e.Comment); + } + + if (action == ActionDesired.Extract) + { + if (e.UsesEncryption) + { + if (password == null) + System.Console.WriteLine("unzip: {0}: Cannot extract this entry without a password.", e.FileName); + else + { + if (wantFlatten) e.FileName = System.IO.Path.GetFileName(e.FileName); + if (extractToConsole) + e.ExtractWithPassword(outstream, password); + else + e.ExtractWithPassword(targdir, behaviorForExistingFile, password); + } + } + else + { + if (wantFlatten) e.FileName = System.IO.Path.GetFileName(e.FileName); + if (extractToConsole) + e.Extract(outstream); + else + e.Extract(targdir, behaviorForExistingFile); + + } + } + else if (action == ActionDesired.Test) + { + e.ExtractWithPassword(bitbucket, password); + } + + } // foreach + + if (!wantQuiet) + { + System.Console.WriteLine(new System.String('-', 80)); + System.Console.WriteLine("{1,-22} {2,10} {3,5} {4,10} {5,3} {6,8} {0}", + zip.Entries.Count.ToString() + " files", "", totalUncompressedSize, "", "", "", ""); + } + } // else (extract all) + } // end using(), the underlying file is closed. + } + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: " + ex1); + } + + Console.WriteLine(); + } + } +} diff --git a/dotNetZip/Tools/UnZip/UnZip.csproj b/dotNetZip/Tools/UnZip/UnZip.csproj new file mode 100644 index 0000000..52d5120 --- /dev/null +++ b/dotNetZip/Tools/UnZip/UnZip.csproj @@ -0,0 +1,108 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453} + Exe + Properties + UnZip + UnZip + + + + + 3.5 + SAK + SAK + SAK + SAK + true + ..\..\Ionic.snk + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Tools/WinFormsApp/About.rtf b/dotNetZip/Tools/WinFormsApp/About.rtf new file mode 100644 index 0000000..724fea2 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/About.rtf @@ -0,0 +1,7099 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;} +{\f36\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;} +{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f39\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\f40\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f44\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f45\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f379\fbidi \froman\fcharset238\fprq2 Cambria Math CE;} +{\f380\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f382\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f383\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f386\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;} +{\f387\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f399\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\f400\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\f402\fbidi \froman\fcharset161\fprq2 Cambria Greek;} +{\f403\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\f406\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\f407\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\f409\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\f410\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f412\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f413\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f416\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\f417\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f419\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f420\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f422\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;} +{\f423\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f424\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f425\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f426\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;} +{\f427\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f428\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;} +{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} +{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0; +\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192; +\caccentone\ctint255\cshade191\red54\green95\blue145;\caccentone\ctint255\cshade255\red79\green129\blue189;\ctexttwo\ctint255\cshade191\red23\green54\blue93;\chyperlink\ctint255\cshade255\red0\green0\blue255;}{\*\defchp \f31506\fs22 }{\*\defpap +\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 +\af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\sb480\sl276\slmult1 +\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs28\alang1025 \ltrch\fcs0 \b\fs28\cf17\lang1033\langfe1033\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext0 \slink15 \sqformat \spriority9 \styrsid11291379 heading 1;}{\s2\ql \li0\ri0\sb200\sl276\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs26\alang1025 +\ltrch\fcs0 \b\fs26\cf18\lang1033\langfe1033\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink16 \sunhideused \sqformat \spriority9 \styrsid7287596 heading 2;}{\s3\ql \li0\ri0\sb200\sl276\slmult1 +\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs22\alang1025 \ltrch\fcs0 \b\fs22\cf18\lang1033\langfe1033\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext0 \slink17 \sunhideused \sqformat \spriority9 \styrsid12153459 heading 3;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31506\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive +\rtlch\fcs1 \ab\af0\afs28 \ltrch\fcs0 \b\fs28\cf17\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 \styrsid11291379 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs26 \ltrch\fcs0 +\b\fs26\cf18\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked \spriority9 \styrsid7287596 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b\cf18\loch\f31502\hich\af31502\dbch\af31501 +\sbasedon10 \slink3 \slocked \spriority9 \styrsid12153459 Heading 3 Char;}{\s18\ql \li0\ri0\sa300\widctlpar\brdrb\brdrs\brdrw20\brsp80\brdrcf18 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\contextualspace \rtlch\fcs1 +\af0\afs52\alang1025 \ltrch\fcs0 \fs52\expnd1\expndtw5\cf19\lang1033\langfe1033\kerning28\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink19 \sqformat \spriority10 \styrsid7287596 Title;}{\*\cs19 \additive +\rtlch\fcs1 \af0\afs52 \ltrch\fcs0 \fs52\expnd1\expndtw5\cf19\kerning28\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink18 \slocked \spriority10 \styrsid7287596 Title Char;}{ +\s20\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \f38\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext20 \slink21 \ssemihidden \sunhideused \styrsid2837595 Balloon Text;}{\*\cs21 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16 \sbasedon10 \slink20 \slocked \ssemihidden \styrsid2837595 Balloon Text Char;}{\*\cs22 \additive +\rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf20 \sbasedon10 \sunhideused \styrsid10709506 Hyperlink;}}{\*\pgptbl {\pgp\ipgp2\itap2\li0\ri0\sb0\sa0}{\pgp\ipgp4\itap1\li0\ri0\sb0\sa0}{\pgp\ipgp6\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp8\itap1\li0\ri0\sb0\sa0}{\pgp\ipgp0 +\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp10\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp9\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp5\itap1\li0\ri0\sb0\sa0}{\pgp\ipgp1\itap2\li0\ri0\sb0\sa0}{\pgp\ipgp7\itap0\li240\ri240\sb0\sa0}}{\*\rsidtbl \rsid1053480\rsid1774901\rsid2168267 +\rsid2837595\rsid4327730\rsid6647841\rsid6830883\rsid6895449\rsid6951347\rsid7287596\rsid7564013\rsid8347551\rsid10098615\rsid10709506\rsid11291379\rsid11567049\rsid12153459\rsid12654957\rsid13461213\rsid13582222\rsid13845429\rsid14751135\rsid14842421 +\rsid15034817\rsid16526446}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Dino}{\operator Dino}{\creatim\yr2011\mo5\dy16\min48} +{\revtim\yr2011\mo6\dy15\hr7\min39}{\version17}{\edmins79}{\nofpages4}{\nofwords1352}{\nofchars7713}{\nofcharsws9047}{\vern49255}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} +\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale125\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot7287596\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang +{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} +\pard\plain \ltrpar\s1\ql \li0\ri0\sb480\sl276\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid11291379 \rtlch\fcs1 \ab\af0\afs28\alang1025 \ltrch\fcs0 +\b\fs28\cf17\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 \hich\af31502\dbch\af31501\loch\f31502 About DotNetZip }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid7287596 + +\par }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11567049 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 This is DotNetZip, a free zip tool. It reads or creates zip files. The tool is built on the DotNetZip library. +\par This zip tool and the library that it uses are part of the DotNetZip project, an open-source effort to build a zip library and tools for .NET. In addition to the library and the tool, the DotNetZip project delivers various command-line tools for creating + and unpacking zip files. +\par The DotNetZip library enables any .NET application to read and write ZIP files, simply and easily. This graphical tool is just one example of the things you can build with the library. +\par The DotNetZip library supports many advanced +ZIP features like ZIP64, WinZip-compatible AES encryption, Unicode or arbitrary code pages, self-extracting archives, archive and entry comments, split archives, and more. DotNetZip has a simple and clean programming interface, which takes advantage of n +ice .NET features like eventing and generic collections. There is a full helpfile with plenty of code examples to get you started. +\par DotNetZip is really nice to use with .NET apps, but it can also be used from Powershell scripts, as well as any COM-compliant + language or environment. For example, you can write VBScript code that uses DotNetZip, to script the creation of AES-encrypted ZIP files. +\par DotNetZip is CLS-compliant, FxCop-approved, fair-trade, color-blind, family-friendly, low-fat, and totally free of co +st. The library can be used from any .NET programming language. There are versions of the library for the Compact Framework, Silverlight, and the regular .NET Framework, though this tool runs only on the desktop Framework. DotNetZip requires .NET 2.0 at + a minimum. +\par The library and this tool are produced in an open source project hosted at CodePlex: http://}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049\charrsid11567049 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 DotNetZip.codeplex.com/. +\par DotNetZip is donationware. This tool and the library that supports it are free to use, but if you like the tool or library an +d find it them useful, you are encouraged to donate. Proceeds benefit a charity. (which may be me, if I am unemployed). To learn more: http://cheeso.members.winisp.net/DotNetZipDonate.aspx +\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb200\sl276\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid11567049 \rtlch\fcs1 \ab\af0\afs26\alang1025 \ltrch\fcs0 +\b\fs26\cf18\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 \hich\af31502\dbch\af31501\loch\f31502 Licensing. +\par }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11567049 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 DotNetZip is licensed under the MS-PL. +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid11567049 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid11567049\charrsid11567049 Microsoft Public License (Ms-PL) +\par This license governs use of the accompanying software, DotNetZip ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software. +\par 1. Definitions +\par The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. +\par A "contribution" is the original software, or any additions or changes to the software. +\par A "contributor" is any person that distributes its contribution under this license. +\par "Licensed patents" are a contributor's patent claims that read directly on its contribution. +\par 2. Grant of Rights +\par (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, e +ach contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. +\par (B) Patent Grant- Su +bject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, impor +t, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. +\par 3. Conditions and Limitations +\par (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +\par (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +\par (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. +\par (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this lic +ense with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. +\par (E) The software is licensed "as-is." You bear the risk of using it. The contrib +utors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of m +erchantability, fitness for a particular purpose and non-infringement. +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11567049 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 +DotNetZip is based in part on code derived from jzlib, which itself is derived from ZLIB, which are both licensed separately. +\par The following applies to ZLIB: +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid11567049 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid11567049\charrsid11567049 +Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler +\par The ZLIB software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. +\par Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: +\par 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +\par 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +\par 3. This notice may not be removed or altered from any source distribution. +\par +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid10709506 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid11567049\charrsid11567049 }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 +\fs18\insrsid10709506 Jean-loup Gailly }{\field{\*\fldinst {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid10709506 HYPERLINK "mailto:jloup@gzip.org" }{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid14842421 {\*\datafield +00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b440000006d00610069006c0074006f003a006a006c006f0075007000400067007a00690070002e006f00720067000000795881f43b1d7f48af2c825dc485276300000000a5ab000000}}}{\fldrslt {\rtlch\fcs1 +\af0\afs18 \ltrch\fcs0 \cs22\fs18\ul\cf20\insrsid10709506\charrsid12654957 jloup@gzip.org}}}\sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid10709506 \line }{\rtlch\fcs1 \af0\afs18 +\ltrch\fcs0 \fs18\insrsid11567049\charrsid11567049 Mark Adler madler@alumni.caltech.edu +\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11567049 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 +\par The following applies to jzlib: +\par }\pard \ltrpar\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid11567049 {\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid11567049\charrsid11567049 +JZlib 0.0.* were released under the GNU LGPL license. Later, we have switched over to a BSD-style license. +\par ------------------------------------------------------------------------------ +\par Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +\par Redistribution and use in source and binary forms, with or without modification, are permitted provided that th}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 \fs18\insrsid11567049 e following conditions are met:}{\rtlch\fcs1 \af0\afs18 \ltrch\fcs0 +\fs18\insrsid11567049\charrsid11567049 +\par 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +\par 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +\par 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. +\par THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY E +XPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, IND +I +RECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb200\sl276\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid14842421 \rtlch\fcs1 \ab\af0\afs26\alang1025 \ltrch\fcs0 +\b\fs26\cf18\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14842421 \hich\af31502\dbch\af31501\loch\f31502 Tool Usage}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11567049 +\par }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid14842421 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid14842421 The tool is pretty self-explanatory. You should be able to figure it out. +\par There are 3 tabs \endash one is used for creating zip files; one is used for reading zip files, and this tab provides this text. +\par In the create tab, the top groupbox lets you specify which files to add into a zip. +\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid7564013\charrsid16080314 {\*\shppict{\pict{\*\picprop\shplid1026{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLockAspectRatio}{\sv 1}}{\sp{\sn fLockPosition}{\sv 0}}{\sp{\sn fLockAgainstSelect}{\sv 0}}{\sp{\sn fLockAgainstGrouping}{\sv 0}}{\sp{\sn pictureGray}{\sv 0}}{\sp{\sn pictureBiLevel}{\sv 0}}{\sp{\sn fFilled}{\sv 0}} +{\sp{\sn fNoFillHitTest}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn wzName}{\sv Picture 1}}{\sp{\sn dhgt}{\sv 251658240}}{\sp{\sn fHidden}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex74\picscaley74\piccropl0\piccropr0\piccropt0\piccropb0 +\picw15348\pich2275\picwgoal8701\pichgoal1290\pngblip\bliptag-1350385587{\*\blipuid af82c04d624ccb83612fe808581f0552}89504e470d0a1a0a0000000d49484452000002440000005608060000002e6189e3000000017352474200aece1ce90000000467414d410000b18f0bfc61050000 +00097048597300000ec300000ec301c76fa8640000136d49444154785eed9ddf8fdc5615c7e74f2a0f7d19410b1294e5c71b4545fcae0483d40754444a5079e0 +05a112109dd0d252297d40a580a85a409506d2b44a690b22b461b35136844cdadd6edab49b6ce86eb24df34b3af8786ccff51d7bec595fcf7aee7c2c5d653363 +9f7befe79ef1f9eeb967bc2de180000420000108400002734ea035e7f367fa10800004200001084040104438010420000108400002734f2057102dafbc2d3418 +e003f8003e800fe003f8804f3e90a7fc3205914e9c03021080000420000108f846204fe38c0822c4906f4bcf7c2000010840000210300964691d04113e020108 +4000021080c05c114010cdd57233590840000210800004b2082088f00b0840000210800004e69e008268ee5d0000108000042000010820883cf08195d53539f4 +c24bf2d4d3cfd260800fe00353f301bdefe8fd8703023e10401079b08a6b67cfcbfac6a60733610a1080c02c11d0fb4e7fe55ce1901f7ae821d9bb77afdc7bef +bd959ada505b1c10a8830082a80eaa53b6a9828803021080c06e102812443fd9b74ff6efdf2fefbefbaedcbc79b352531b6a4b6d7240c0350104916ba2bb600f +41b40bd0e912021008091409a2fbeebb4fce9f3f2fd7af5f974b972e556a6a436da9cd9d1c3f7ff04199b4eda41fae994d0208a2d95cb7d4a811441e2c225380 +c08c12281244ba4da699a1aa6228be5e6da9cd9d1c2a86b6b7b773dbd5ab57e5dab56b72e5ca95f01c3d7f1e8e4945a2af5c10441e78fb6482a8279d7657fa53 +9f77897efb5d69571a5b461f956d4e1d141d4260a608941144376edc90adad2d274d6d551544cf3c7b50ec76e4b563f2f8ef5e94bd3f7e4aceacbc25efbffffe +5c09a2ca42f1f01e692d1c90d5babcb76efbc1b8eb1144f31884f2e63c05169309a220c5dd6d4ba75797d7e6db2dec37665581d9481fbbb82ed3274c8f10983e +81b282687373535c345782e8d5c56589db6bc74ecac5ff6dc95df73c2e1fffe22fe4e0e1636196c8d74c88ed2571e6ac714271f5802cd429b22c10f50aa20a81 +2d19a70b1be6a45ddb8b6def62e09d54108994c8d6d4725f2de8d7c9da587d38b1590b0c8c42c00b02650491d6fe5cbc78d149535b2e3244b1183aba745256d7 +cec91fffba289f08c4d037f73e29efbcf3eedc6d996986480551a384a25782c8c5c7dd7540736daf7182281004ad96b4a236cc04e9eb9d400a0d8e5426c56662 +fc5fcf8b6db5bbd1469bbe9ff4d196f0e5f09a4eb01da77d77a49b759dddef602086ade05add32b33245dd4ec67c52d70de7953db7785c83b1850ccaf4e1c27f +b10101cf099415441b1b1be2a2b91244cbff7d5d56d6de96e55367e4d2e56df9ea777e2d9ffcf2c3f2fccb27a57fe6cc784164ddef7a59f7c470dd33eec779f7 +db32f7d0dc7eaa39999921dab15034b7b4f4e73d8793411dded392f0bfe1397b64cf42744f37b23fab0716925833b876550e98e7595b66a3e78fb37f58f61871 +d1185a0a9cbb0c5161601b06cbf2ced3976e1860a340391240cde066043d633fa81704d32490079533a5ec59bea5366251a0ff26e6b3e69c17e4930f473a7857 +73e3c1d5668648e7971641916019e9c8c8a4e40a2243448573d5b12b43c3a6292c5af1eb59d7c50330333883f548c6dbeb8c0a229b77586394be2e146da93d40 +6b6e868de4dcd4b8ad35ad54c7e46245b10181d9215056105db870415c341782e8ef478eca91c5d7e58967fe196c95fd4f9efbdbb27ceaab8fc837bef7a46861 +f5f2f2c9624194dcef72ee89d67d6a208e827b64cfaa952c7d0fcdeba7baaf988268c742b1ac206a2dc881a8d0282d9486f547fafa829e6466886cfb86984ace +d77332ecab780aede93126ebe4481095096c71b0ace23c3981300cd646a622c984a4b322218c54f02f0aac198e965c9f3367fb431007f9ea3e9b6bc114449314 +252759a25c41341490d9d9a15828da1ff28ceb8cd117f66b656f9202f0a2d7cbf6a1fe3181ad1a970ed310987902650491d6e3f4fbc1af320e9adaaaba65f6c6 +ea9bf2ed1ffe21cc082d9e58936f7dff77f299af3f2a7f39bc1cd60e9d79fd8d624114ffe264ff621c662232844fbcd2633344f1175e26b8f73af8864c2c882a +09c5b282c812329aad49048dfd69c8114423e7c719292b8b94125c5186282f3ba45dbb1144450b6cbe5fc5798afa89606a46274c18a818b1ab87edb198d900db +bee9c046ba2db5ad633b79aeb8a8efbeb7534194d4129518f3204b16090963eb2d99550ebbe4bad4f4a30c4ed17a16bd9f7783095fafd8477dcb8565087845a0 +ac203a7dfab4b8682e04d1d1c52579e3cd7559f8ca2fe5535f7b241443777ff73772f5daf55008bdb9b636a120cac8fc8f8b275971a7e81e9a64e9ddbb4f2c88 +2a09c5260ba20459bc0db747021d3672ec9220daa1f3940d909110ea7532b68b261644519a3356e145998512e2c2b53bef6ccb6c308a41b6c6caa4995b572369 +612b33167f4847446f4e46309afca0df8c0c5d460dd14886a870cbcc985b37deea1bbe168ae4a27574bd48d88380a704ca0822fd0afba953a79c34b5553543f4 +8f7ffe4bce077f76e4a78f1d924f7fed51f9ecddbf923f1d5c4a9e4174eedcb9f282c8de1548848b75af8cb7ccfa63eeb7a9ac937d0fcdb9f73af0ab58105512 +8aa6204a6d4b0dea77863544e9adb1bcd777bc65569881d2f1d42988b202546e60cb5bd41ce749edb78ed9324bd57d44856c59b520136f99e5386fde9c735f77 +e0b53926d2df322b57543d3435989f5904dd0a6a84e2adb7cca2ea54a1a059543d7cbe51f675e60422ae66c630eeb78c58495d97f75ca5348b915a34d347c766 +9bea5b3b2c4360d6099411449a753971e28493a6b6aa0aa27fbdfa5a90adea0745d5ebf2b3c79e93eee32f0485d5576423f826dc850b1bb2be7e7e0241a42b68 +de6bcc5fc4b3efc7e6fd31b9df5abf4c97bef73a70a0581055128aa9ed2aa3203a101f7b5245d5198228984366917490c71914430702a674517596fd74517552 +4f64b17393211aa41a86df162a0a6c13394fec50460175bc7d65aa694bfca48ba9ed406c7ddbc8b667414a396f5e81b7212232598436336a9a1c38f3e45fbb77 +d0292620000108e8adbfe08fbbaa78511173fcf871ab3d2277b6ee9447c2d7f37eb6af391edaaa2a88e287106ab6499f4cad85d4fab3fd70c2797b0e5125a168 +7db36c163f1cee0451a3665f8ff068d4148dc120889aba328c0b02fe132823882e5fbe2c4b4b4b4e9adaaa228826fd3315feafa0840fa034c5e0c44231fc7657 +f4cdb01906e69f20d2fa976061865fb59fe1d5293974045149509c0601083827502488f40fb1ae0545cafa0ca2c5c5c54a4d6da8ad9dfe7157e793f7c4e0a422 +d1d7cc997f82c813079d641a08a24968712e0420e092409120dab76f9f3c186420de7aeb2dd1ec4e95a636d496dae480806b020822d74477c19e0aa2f5e01b13 +1c10800004a64940ef3b458248c7f3c0030f84591dddeaaad2d486dae280401d04104475509db2cdeded0fe4ecfa7b3418e003f8c0d47d40ef3f1c10f0810082 +c88755640e108000042000010854228020aa848f8b2100010840000210f0810082c88755640e108000042000010854228020aa848f8b2100010840000210f081 +0082c88755640e108000042000010854228020aa84af1917afacaec9a1175e92a79e7e9606037c001fc007f081c6fb80c62c8d5d4d3a10444d5a8d1d8e85e710 +ed101c974100021080c0ae1028fb0cab690e0e41344dda35f5c593aa6b028b590840000210a88d4099877ad6d679866104d13469d7d41782a826b09885000420 +0081da0820886a433bbf861144f3bbf6cc1c021080c0ac124010cdeaca3578dca6206ab7bbd26ff058191a0420000108404009cc8720ea7765ee03f31419140a +a2298e858f39042000010840a00c81f912442e02b10b1be6cab8b697b7ea79fdd4d07fa1202ae3999c03010840000210982281f912442ec0d620205c0cabd0c6 +14c79d16441de9b45bd26a69eb482fcc4b4619bbe8df6e277ebf259df0040e084000021080c07409f82b8834d88641386a5acb920ac471a00e8274eadcb67493 +a2979e740c1b9d5e5fba71708f6b6352d79a01df10024694ef05c1bf3dec606271a0d727730ac6169a0ee765cc27901de9710f45c888f83099b48cb987f38afe +3f964f3467c36f5382281e633884b6b474c0a93e0d113445d136dd8f19bd410002108040d309782a8806c225d121bd8eb46c4194047f3dd71202a1d8b16c8422 +2338af67d623a5cf4905fc9498884583dab004441571902966c68cdb102776964635a029d692b9841cb2f8e4bb76ee965928ac22016aae476c0a41d4f4fb05e3 +83000420e02d013f05911d58ad2d9a2453a4cb6a6792c28c902d7c8cf5376d17f5135da6422314672accec3d217b6c45e2605ce62b9e4fd637bbca8c3539c710 +41797cc67c756cac201ac9d419df424310797ba36162108000049a4e004114672dec952a53845c4664a8dd4808f53ae6765cd4e1448228ca52c56224ebda32e3 +368553eafc48089959b03c3e633c3bbd6536cc88656e9999e20d41d4f4fb05e383000420e02d013f0591b5dd1506e2dccc84b5c59408808a5b66a92c4d54d333 +2e739327ae52ae676db9d95b81e1b965c61d65c632b6ad425641966c58e794c727ff3361d710a5eab872c59831266f3f6e4c0c02108000049a4ac053411405d7 +a4a0ba3d780e515e362655843caea83a4cf74405cb4601b559b86d067c63d5478aa9e3f726ca104585c979c5e2497ff945d5c94ed7b87ecde2ead0a669cfe633 +bea8baa98ecfb82000010840000226017f0551a3d639a398ba51e3733b18fe74875b9e58830004200081fa092088ea66acdb5aa92da8ba3bdc7dfb08a2dd5f03 +46000108400002931140104dc68bb34b1040109580c4291080000420d0280208a2462d871f835141b4beb1e9c76498050420000108784f40631682c8fb659efe +04b7b73f90b3ebefd160800fe003f8003e30333ea0b1ab49c7f2cadb23c369d9af649dd4a449301608400002108000042050850082a80a3dae85000420000108 +40c00b0208222f969149400002108000042050850082a80a3dae8500042000010840c00b0208222f969149400002108000042050850082a80abd865cbbb2ba26 +875e78499e7afa591a0cf0017c001fc0071aef031ab3347635e940103569357638169e43b443705c060108400002bb42a0ec73887eff8f33f285fdcfcb877ff8 +e74a4d6da8ad71078268575cc16da73ca9da2d4fac410002108040fd048a1eccf8db57fa72fbc32fc91daf6ec9c2a91b959ada505b6a33ef4010d5bfe6b5f780 +20aa1d311d40000210808063024582e8f3dd4372c76b5b72cfebd7e4d2a54b959ada505b6a1341e478219b640e41d4a4d5602c10800004205086409120d26db2 +85ffdca824844c21a5b6d42682a8cceacce8392382a8d79176d74a0bf6bbd26e77253f5938a39367d81080000420309304ca0aa2adad2d71d19a278808ccce1d +d71444dd764b5aada899026852ee939eef7c56188400042000019f099415449b9b9be2a2f92388cc004db04e7d465219a2203bd4eaf4a4d76949f0cff09894d9 +a4e7fbfca9656e1080000420e09c401941f4c993d7e5e2c58b4e9ada6ad696d94e03ed4eaf73be84cd3358aa8628e4d7914e9241ea48ac97543c2559a520bbd4 +e9f525c934b1cdd6bc056744108000043c20504610dd71f29a6c6c6c38696a6b2a82a8df6d274135a95fd1201c6fdfb4da1296b5d8991efbfd70917bd2495ecf +08d0b936a2201fbddf3502fd305ba2b68762c0039f92d28228143b831987eb954a21452462b608501f5c833940000210682c81528268f99a5cb87021b71df9d1 +ad72eb8f8e8c3d27befe8ec0d614049121324211a48243b30c91081a44e041516f126873de0faf33b77bd47660a7671405a76c6404f9488825f1def3e05e5a10 +d93545b1304c09d7205b945aa7c67e9618180420000108cc30813282e863c7b603ddd0cf6dcfffe043f2a11f3c3ff69cf87ab535054134dc62c9ce0ec55b3286 +b0b183709811b2848fb9d0593544b6d0c9cb6e2088d2993953a086d9b871c275863f6d0c1d02108000041a4ba0ac203a7dfab4d8edc05de9528fb0ece3ae0323 +e799d74d49100d790fea51820c519229b2d6c2142d595b5779e2054194ebd4a5334406efe19699b585a845d964881a7b036160108000047c215046107df4d865 +3975ea546e3b787f9021baffe0d873e2ebd556fd19a250fcc45986782bccdafa8a0552ce7657b8a5966cb539d832abf295f319f3b6f18228123c59db62d13ccd +faaf506587ece23a2ebfeaad666c69192e042000016f09941144b7fffb929c387122b7f5f6de22b7eced8d3d27be5e6dd52f8882e5ca2caa4e154767145567bd +1f2ebd5d546dbe16659f62c163067af3b55c4134a745d5de7ea498180420000108cc2281b282e8f8f1e3e2a24d4d10cde262f832e6525b66be4c967940000210 +80801704ca08a2db8e6ec9d2d29293a6b6a69221f2627566741208a2195d38860d010840608e09140922fd43acb7bdbc2e5f3a7a5e1617172b35b5a1b6f8e3ae +9e3b1c82c8f305667a108000043c245024887efb4a5f3ebcff45f9c82bebf291a39bd55a60436da9cdbc6379e5ed91b75af62b592779b836333b251544eb1b9b +333b7e060e0108400002f345406356912052224fbc7c5a3ef7f3e7c2adae2a4d6da8ad710782c8031fdcdefe40ceaebf4783013e800fe003f8c0ccf880c6ae26 +1d08a226ad06638100042000010840605708941244376fde14b6cd76657de81402108000042000819a09a8c651ad631f2335447a422c8af4221a0cf0017c001f +c007f0017cc0171fc81243aa7d320551cde20cf3108000042000010840a0510410448d5a0e060301084000021080c06e104010ed0675fa8400042000010840a05104fe0f9c108489c1f680bd0000000049454e44ae426082}}{\nonshppict +{\pict\picscalex74\picscaley74\piccropl0\piccropr0\piccropt0\piccropb0\picw15348\pich2275\picwgoal8701\pichgoal1290\wmetafile8\bliptag-1350385587\blipupi95{\*\blipuid af82c04d624ccb83612fe808581f0552} +010009000003b663000000008d63000000000400000003010800050000000b0200000000050000000c0257004502030000001e00040000000701040004000000 +070104008d630000410b2000cc005600440200000000560044020000000028000000440200005600000001000800000000000000000000000000000000000000 +00000000000000000000ffffff00e5dfd500e2e0df00c2bdbb00b3adab00eae3e200f0ece900e6dfdb009393930077777700707070008a8a890091919100e8e8 +e800fcfcfc0075757500eaeaea00fafafa00f2f2f2008f8f8e00f4f4f400f8f8f800f9f9f900f6f6f600b6ffff00903a6600ffffdb0090dbff00903a3a00fbfb +fb00f1f1f100b9b3ae00d0ccc900c0a79d00ab867700e4dfdc00f5f5f50074bfff009c480000ffffe0003a90db00ffb6660090dbdb00f0f0f000d5cfcb00d6d0 +cc00f1eeed009d6a5700925a4400d0bfb9009ce0ff009c484800ededed00d6d1cd00e6e2e000cfb8af00925a4500a5776500e8e7e7000000660066006600ffff +b600db903a0000003a003a000000ffdb9000663a3a00003a6600660000003a909000903a000000669000ececec00ddd9d500e5e2df00dcd8d500f4f3f200a171 +5e00945c4700d6c3bc00dcdcdb0090dbb600bf7400000074bf00ffbf74007448000000487400489ce000e0ffff0000489c0074bfe000bfffff0000007400dbb6 +6600003a9000b66600000066b600dbffff003a006600b6ffdb0066003a00dbffb6003a3a90003a003a0066b6ff00dbffdb00ebebeb00cdc9c500ddcfc900c8ae +a300eeeeed00d5c1ba00965e4900a5766400d6d5d50090b6900048000000ffe09c00e09c4800dbdbdb00e1e0de00aa7f6e00e2d4cf00a778670097604b00d5bf +b700dedddc00dadada00d1cfcd00e9e1de00955d4800965f4900a4736100faf9f800e2e2e10074000000ffffbf003a66b600b6b66600dbdb900090906600d8d8 +d800cac8c600f0ecea00bb998b00975f4a0098614c00d1b9b000e6e6e600b6db9000740074003a3a0000d4d4d400cccbca00dbdada00e9e2df00ba998c00bd9d +9000f6f3f200ededec00ecebeb00eae9e9000074740074bfbf00d2d2d20096d2d20054005400d2d29600f3f3f300d1d1d100e2e2e200cfcfcf008a8a8a008f8f +8f00e4e4e40088888800f7f4f400efe9e300b6ffb600dcc6a800bc915800b17f3c00dbc4a600c2943f00f1cb4600fbd84800bb905500f1cc4600f9dd6a00fbd7 +4800fad64700f9d64600f9d546003584c900c9843500f4d04100317bbc00bc7b310000579c009c570000f3d04000317ab900b97a3100f2ce3f003077b600b677 +3000f1cd3e00e9c33e00eacd5b00c0913c00e9c43d00f0cd3d00dac3a300ba8e5300000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010f02020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020f0101010101010101010f02010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101020f010101010101010102010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101020101010101010101020101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101b1b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b1010101010101 +01010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010607010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010107080101 +010101010101d5d6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6d6d50101010101010102010101010101010102010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010106010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010801010101010101b7d2d3d4d4d4d4d4d4d4d4d4d4d4d4d4d4d4d4d3d2b7010101010101020101010101010101020101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101060101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010801010101010101bbd0d1acacacacacacacacacacacacacacacacd1d0bb0101010101010201010101010101010201010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010601010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010801010101010101b6cfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacfb601010101010102010101010101010102010101010101010129 +00003f01193c0041421c1d1b193c00414201193c00002a193c45521d1b1c4000471b1c1d1b011c1d1b193d3e0101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010106010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010801010101010101b6cca5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5ccb6010101010101020101010101010101020101010101 +01011c684262678c5f2a011c65521d6a5f2a011c65665f2a011963741d1b1c1d6a5f2a0129601c1d1b011c1d1b01010101010101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010106010101010101193d52400000471b012900000047643c453e0101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010801010101010101b6cc99999999999999cdce999999999999999999ccb60101010101010201010101010101010201 +010101010101010101614552653e0101011c1d2b653e0101011c1d1b0101011c1d1b1c1d2b1d1b011c1d2b1d1b011c1d1b010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010601010101010101011c653e012960193d3e0169472b1d1b0101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101010801010101010101b6c98e8e8e8e8e8e8ecacb8e8e8e8e8e8e8e8e8ec9b601010101010102010101010101 +01010201010101010101625f003f011c4000000041741d2b4000000041741d1b0101011c1d1b1c1d2b1d1b011c1d2b1d1b011c1d1b0101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010101010101010101010601010101010101011c1d1b011c1d646342011c1d2b +1d1b0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101010101010101010801010101010101b6c48080808080c700000000c880808080808080c4b6010101010101020101 +0101010101010201010101010101193d3e1c65666742011c1d2b1d6a6742011c1d6a5f2a011963741d1b1c1d6a5f2a0129601c402a011c1d1b01010101010101 +010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010601010101010101011c1d1b011c653e1c40 +0000472b1d1b01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010801010101010101b6c478787878787878c5c6787878787878787878c4b60101010101 +010201010101010101010201010101010101012900003f011c400041421c1d1b1c4000414201193c00005e5f00472b1d1b1c4000453e1c1d4800002a01193d3e +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010601010101010101011c402a0129 +60010101011c1d2b1d1b010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010801010101010101b6c16b6b6b6b6b6b6bc2c36b6b6b6b6b6b6b6b6bc1b601 +0101010101020101010101010101020101010101010101010101010101010101011c1d1b01010101010101010101011c1d1b0101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010601010101010101011c +434400453e01610000005e5f00471b01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101b6c04949494949494949494949494949494949 +49c0b6010101010101020101010101010101020101010101010101010101010101010101011c1d1b01010101010101010101011c1d1b1c1d1b01010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101060101696061 +2a01011c1d1b0101010101010101011c1d1b01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101b6bf35353535353535353535353535 +3535353535bfb6010101010101020101010101010101020101010101010101010101010101010101011c1d1b0101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010601 +015f0000471b011c1d1b0101010101010101011c1d1b010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101b6be2c2c2c2c2c2c2c2c2c +2c2c2c2c2c2c2c2c2cbeb60101010101010201010101010101010201010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010106010101693f0101011c1d1b0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101b6be1f1f1f1f1f +1f1f1f1f1f1f1f1f1f1f1f1f1fbeb601010101010102010101010101010102010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010106010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101b6be13 +1313131313131313131313131313131313beb6010101010101020101010101010101020101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101060101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101 +01bbbcbd13131313131313131313131313131313bdbcbb0101010101010201010101010101010201010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010601010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101080101 +0101010101b7b8b9babababababababababababababababab9b8b701010101010102010101010101010102010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010106070101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +07080101010101010101b4b5b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b5b401010101010101020101010101010101020101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101030405050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505040301010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101020101010101010101020101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102010101010101 +01010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101020101 +01010101010102010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101b1b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b101010101010101010101010101010101010101010101010101010101010101010101 +01020101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010607010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010708010101010101010101010101010101010101010101010101010101010101 +01010101010201010101010101010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010106010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101080101010101010101010101010101010101010101010101010101 +0101010101010101010201010101010101010201010101010101010101010101010101010101010101010101010101010101010101010101010101010169003f +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101060101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101010101010101010101010101010101 +01010101010101010101010101020101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101193d3e0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010601 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101010101010101010101010101 +01010101010101010101010101010101010201010101010101010201010101010101011c4000981d2b1d2b1d1b01193c00414201193c00002a193c453e1c4000 +471b1c1d1b0101613f010101011c1d2b1d1b011c1d1b01010129000000472b1d1b01193c00002a1c1d1b011c1d2b1d1b011c68420101193c00414201193d3e01 +01010601010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101080101010101010101010101010101 +0101010101010101010101010101010101010101010201010101010101010201010101010101625f2a0129472b1d2b1d1b625f2a011c65665f2a011963741d1b +625f2a0129601c1d1b01193c471b0101011c1d2b1d1b011c1d1b0101193d3e0169472b1d1b625f2a011963741d1b011c1d2b1d1b0129003f01625f2a011c653e +010101010101060101400000471b1c1d2b1d1b011c1d1b0101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101010101 +0101010101010101010101010101010101010101010101010102010101010101010102010101010101011c1d1b011c1d2b1d2b1d1b1c653e0101011c1d1b0101 +011c1d1b1c1d1b011c1d2b1d1b0169608a420101011c1d2b1d1b011c1d1b0101196342011c1d2b1d1b1c1d1b0101011c1d1b011c1d2b1d1b6267741d1b1c653e +01010101010101010101060101653e0129601c1d2b1d1b011c1d1b01010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101 +010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101011c1d1b011c1d2b1d2b1d1b1c400000004174 +1d1b0101011c1d1b1c1d1b011c1d2b1d1b01612a69600101011c1d2b1d1b011c1d1b0101011c400000472b1d1b1c1d1b0101011c1d1b011c1d2b1d1b1c1d6a67 +421c4000000041420101010101010601011d1b011c1d2b1d2b1d1b011c1d1b010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101080101 +0101010101010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101625f2a0169472b1d2b6842626742 +011c1d6a5f2a011963741d1b625f2a0129601c68421c653e193d3e01011c1d2b402a011c1d1b0101010101011c1d2b6842625f2a01196374402a011c1d2b1d1b +613f012960626742011c1d1b0101010101010601011d1b011c65521d2b1d1b011c1d1b0101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010801010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101011c400000472b1d2b43 +4445524000414201193c00005e5f00471b1c4000453e1c434400600101613f01011c1d2b1d4800002a01010101610000002a1c434445b33c00002a1c1d480000 +2a1c1d2b6842011c68421c4000414201193d3e010101060101402a0129601c1d2b402a011c1d1b01010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010801010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101010101011c1d +1b010101010101010101010101010101011c1d1b010101010101010101010101010101010101010101010101010101010101010101010101010101010101011c +1d1b010101010101010101010101010101010101010101010101060101434400453e1c1d2b1d4800002a01010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010108010101010101010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101010101 +01011c1d2b1d1b01010101010101010101010101011c1d1b01010101010101010101010101010101011c1d1b0101010101010101010101010101010101010101 +0101011c1d1b0101011c1d1b0101010101010101010101010101010101010601011d1b0101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101080101010101010101010101010101010101010101010101010101010101010101010101020101010101010101020101010101 +0101010101011c1d1b01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101011c1d1b0101010101010101010101010101010101010101010101010601011d1b0101011c1d1b01010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010801010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010601011d1b010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010108010101010101010101010101010101010101010101010101010101010101010101010102010101010101 +01010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010106010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101080101010101010101010101010101010101010101010101010101010101010101010101020101 +01010101010102010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101060101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010801010101010101010101010101010101010101010101010101010101010101010101 +01020101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010601010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010108010101010101010101010101010101010101010101010101010101010101 +01010101010201010101010101010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010106070101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010107080101010101010101010101010101010101010101010101010101 +01010101010101010102010101010101010102010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101030405050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505040301010101010101010101010101010101010101010101 +01010101010101010101010101020101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010201010101010101010201010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010102010101010101010102010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101020101010101010101020101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101b1b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2 +b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101020101010101010101020101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101060701010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010107080101010101010101b0 +100b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b10b0010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010601010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101080101010101 +0101adaeafa9a9a9a9a9a9a9a9a9a9a9a9a9a9a9a9afaead01010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010169003f01010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010106010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010801 +01010101010110ab49acacacacacacacacacacacacacacacac49ab10010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101011414141414141414141414141401010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101020101010101010101020101010101 +0101010101010101010101010101010101010101010101010101010101010101010101010101193d3e0101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101060101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010108010101010101010ba9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90b0101010101010101010101010114141414141414141414141414010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010114151515251716251515151514 +01010126007701010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201 +010101010101011c4000981d2b1d2b1d1b01193c00414201193c00002a193c453e1c4000471b1c1d1b0101613f01010101193c453e1c4000471b010101012900 +0000471b1c4000981d1b1c4000981d1b193d3e010101010101010101010101010101010101010601010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010108010101010101010b15a5a5a5a5a6a7a8a6a7a8a6a7a8a5a5a5a5a5150b01010101010101010101010101141515152517162515151515140101 +0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010114159a9b9c9d9e9fa0 +a1a21514010101012653010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102010101010101 +01010201010101010101625f2a0129472b1d2b1d1b625f2a011c65665f2a011963741d1b625f2a0129601c1d1b01193c471b0101011c1d1b625f2a0129600101 +01193d3e0169476a5f2a0129476a5f2a0129471b01010101010101010101010101010101010101010101060101193c00002a01193d3e010101193d460000981d +1b2900003f01193c0041421c1d1b012900003f01010101193d524000981d2b1d2b1d1b011c1d1b1c4000471b01010101193c000000471b1c1d2b1d1b011c1d1b +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010108010101010101010b15999999999999999999999999999999999999150b0101010101010101010101010114159a9b9c9d9e9fa0a1a2 +151401010101011c1d1b01193c00414201193c00002a01290000981d2b1d1b012900003f01193c004142010101010101010101010101010101010114158f9091 +929394171895151401010101262728595a0088a3552627280154550158000053015c5d88a427280158000053012627280154555c5d0000770101010101020101 +01010101010102010101010101011c1d1b011c1d2b1d2b1d1b1c653e0101011c1d1b0101011c1d1b1c1d1b011c1d2b1d1b0169608a420101011c1d1b1c1d1b01 +1c1d1b0101196342011c1d2b1d1b011c1d2b1d1b011c1d1b010101010101010101010101010101010101010101010601015f2a01196342010101010101298b3d +3e0169472b684262678c5f2a011c65521d1b1c6842626742010101295e5f2a0129472b1d2b1d1b011c1d6a5f2a01296001010101298d653e0129601c1d2b1d1b +011c1d1b010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010108010101010101010b258e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e8e250b0101010101010101010101010114158f90919293 +94171895151401010101011c1d1b625f2a011c65665f2a011963963d3e0169472b1d1b1c684262678c5f2a011c653e0101010101010101010101010101010114 +15818283847d858615871514010101012627283334285c5d552627280154552627280154773334282627282627280154772627280154555477015c9789010101 +0102010101010101010102010101010101011c1d1b011c1d2b1d2b1d1b1c4000000041741d1b0101011c1d1b1c1d1b011c1d2b1d1b01612a69600101011c1d1b +1c1d1b011c1d1b0101011c400000472b1d1b011c1d2b1d1b011c1d1b010101010101010101010101010101010101010101010601011d1b010101010101010101 +191a2b1d1b011c1d1b0101614552653e0101011c1d1b01010161453e0101191a2b1d1b011c1d2b1d2b1d1b011c1d2b1d1b011c1d1b0101191a2b1d1b011c1d2b +1d2b1d1b011c1d1b0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010108010101010101010b18808080808080808080808080808080808080180b01010101010101010101010101141581 +8283847d85861587151401010101011c1d1b1c653e0101011c1d1b0101011c1d1b011c1d2b1d1b010101614552653e0101010101010101010101010101010101 +0101011415797a4f7b7c7d7e187f1514010101012627282653010154552627280154555477010101013334282627285477010126532627280154550101595a88 +89010101010201010101010101010201010101010101625f2a0169472b1d2b6842626742011c1d6a5f2a011963741d1b625f2a0129601c68421c653e193d3e01 +011c1d1b625f2a012960010101010101011c1d6a5f2a0169476a5f2a0169471b010101010101010101010101010101010101010101010601011d1b0101010101 +01010101292a1c1d1b011c1d6a5f003f011c4000000041741d1b625f003f01010101292a1c1d1b011c1d2b1d2b1d1b011c1d2b1d1b011c1d1b0101292a1c1d1b +011c65521d2b1d1b011c1d1b01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101010108010101010101010b18787878787878787878787878787878787878180b010101010101010101010101 +011415797a4f7b7c7d7e187f151401010101011c1d1b1c4000000041741d1b0101011c1d1b011c1d2b1d1b625f003f011c400000004142010101010101010101 +0101010101010114156c6d6e6f707172167315140101010126272826530101545526272801545554770101010133342826272854770101265326272801545526 +0000550101010101010201010101010101010201010101010101011c400000472b1d2b434445524000414201193c00005e5f00471b1c4000453e1c4344006001 +01613f01625f00471b1c4000453e01010101610000002a011c400000471b1c400000471b193d3e010101010101010101010101010101010101010601015f2a01 +19634201010101191a1b1c1d1b011c1d643d3e1c65666742011c1d2b6842193d3e1c653e01191a1b625f2a0169472b1d2b402a011c1d6a5f2a0129600101191a +1b1c402a0129601c1d2b402a011c1d1b010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101010101010101010108010101010101010b126b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b120b0101010101010101 +010101010114156c6d6e6f7071721673151401010101011c6842626742011c1d6a5f2a011963741d1b011c1d2b6842193d3e1c65666742011c1d1b0101010101 +01010101010101010101011415204a4b4c4d4e4f5051151401010101262728265301015455267576015455262728015477333428262728262728015477267576 +015455587701333428010101010201010101010101010201010101010101010101011c1d1b010101010101010101010101010101011c1d1b0101010101010101 +0101010101010101011c1d1b010101010101010101010101010101010101011c1d1b0101011c1d1b010101010101010101010101010101010101010101010601 +01193c00002a01193d3e01292a011c1d1b011c1d1b2900003f011c400041421c4344454600003f0101292a01011c400000472b1d2b1d4800002a011c4000453e +0101292a011c434400453e1c1d2b1d4800002a010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010108010101010101010b12494949494949494949494949494949494949120b01010101 +0101010101010101011415204a4b4c4d4e4f5051151401010101011c434445524000414201193c00002a1c1d1b011c1d2b4344454600003f011c400041420101 +0101010101010101010101010101011415202d2d363738393a3b1514010101012627282653010154552656570027280158000053595a00275b27280158000053 +012656570027285c5d00005501010101010201010101010101010201010101010101010101011c1d2b1d1b01010101010101010101010101011c1d1b01010101 +010101010101010101010101011c1d1b010101010101010101010101010101010101011c1d1b0101011c1d1b0101010101010101010101010101010101010101 +0101060101010101010101010101191a1b010101010101010101010101010101010101010101010101010101191a1b01010101011c1d1b010101010101010101 +0101010101191a1b011c1d1b01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010108010101010101010b12353535353535353535353535353535353535120b +010101010101010101010101011415202d2d363738393a3b15140101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101011415202d2d2d2e2f30313218140101010101010101010101010101010101010101010101010133342801010101 +0101010101010101010101010101010101010101010201010101010101010201010101010101010101011c1d1b01010101010101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010101010101011c1d1b0101011c1d1b01010101010101010101010101010101 +010101010101060101010101010101010101292a01010101010101010101010101010101010101010101010101010101292a0101010101011c1d2b1d1b010101 +010101010101010101292a01011c1d1b0101011c1d1b010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101010b1e2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c2c +2c2c1e0b010101010101010101010101011415202d2d2d2e2f303132181401010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101011415202020202021222324251401010101010101010101010101010101010101010101010101333428 +01010101010101010101010101010101010101010101010101020101010101010101020101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +010101010101010101010601010101010101010101191a1b010101010101010101010101010101010101010101010101010101191a1b0101010101011c1d1b01 +010101010101010101010101191a1b01011c1d1b0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101010b1e1f1f1f1f1f1f1f1f1f1f1f1f +1f1f1f1f1f1f1e0b0101010101010101010101010114152020202020212223242514010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010114151515151515151617181514010101012627280101010101010101010101010101010101 +01010101262728010101010101010101010101010101010101010101010201010101010101010201010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010601010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101010b0f1313131313131313 +131313131313131313130f0b01010101010101010101010101141515151515151516171815140101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101141414141414141414141414140101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010106010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010801010101010101101112131313 +13131313131313131313131313121110010101010101010101010101011414141414141414141414141401010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101020101010101010101020101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101060101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010108010101010101010c0d +0e0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0e0d0c0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010607010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010107080101010101 +010101090a0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0a090101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102010101010101010102010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010103040505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505 +05050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505040301 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101020101010101010101020101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010201010101010101010201 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102010101010101 +01010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101020101 +01010101010102010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01020101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010201010101010101010102010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010201010101010101010101010202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 +02020202020202020202020201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101 +01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101040000002701ffff030000000000}}}{\rtlch\fcs1 \af0 \ltrch\fcs0 +\insrsid14842421 +\par Specify directories and file name patterns, then click the + button to add those files. You can also tell the tool whether to recurse a directory (select files from subdirectories) and whether to traverse junctions in the filesystem. Also specify the \'93 +directory in zip\'94 for those files. +\par The middle group box of settings lets you specify how to add those files into the zip file you are creating. Here you specify encryption, encoding, compression level, whether to create a self-extracting archive, split zips +, and so on. You can also specify zipfile comments and other zip settings. +\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid7564013\charrsid16080314 {\*\shppict{\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLockAspectRatio}{\sv 1}}{\sp{\sn fLockPosition}{\sv 0}}{\sp{\sn fLockAgainstSelect}{\sv 0}}{\sp{\sn fLockAgainstGrouping}{\sv 0}}{\sp{\sn pictureGray}{\sv 0}}{\sp{\sn pictureBiLevel}{\sv 0}}{\sp{\sn fFilled}{\sv 0}} +{\sp{\sn fNoFillHitTest}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn wzName}{\sv Picture 2}}{\sp{\sn dhgt}{\sv 251658240}}{\sp{\sn fHidden}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0 +\picw15401\pich5530\picwgoal8731\pichgoal3135\pngblip\bliptag-1110965009{\*\blipuid bdc804ef0a5456ddb70cd6ce02bece53}89504e470d0a1a0a0000000d4948445200000246000000d1080600000029217dbe000000017352474200aece1ce90000000467414d410000b18f0bfc61050000 +00097048597300000ec300000ec301c76fa8640000393e49444154785eed7d6d8f25479656fdaefa0c825df8b81212825d56828b84d468101acc37beb4d06010 +7387815956ad910ac16a252c8fb97855bb9e76bb29afd765bbddb2cb74d95e5f97ababaa5fdcefd5ddd5dd6edb526c9ec88cc8139111999179236fbe3d574ad5 +adcc7839f1c489134f9e7332ef86c0070800012000048000100002404022b0011c800010000240000800012000045204408ca0094000080001200004800010c8 +100031822a0001200004800010000240a08a18ed1fde1438800174003a001d800e4007a00363d2812a06e8f4181100f80001200004800010000240606c085471 +9c0231aaaa303680301e200004800010000240605a0894711d10a369e902460b0480001000024060f20880184d5e050000100002400008000120a01000311a91 +2e1c5e3f16172fbd2b5e7bfd4d1cc0003a001d800e40077aaf03b467d1de55f5f9e52f7f295e79e515f1939ffc64a583daa0b6ca3e204655b331a0ebc72777c5 +9dfba7039218a2020120000480c09411a03d6b7978ab1482fff0eaabe217bff885f8f6db6fc58f3ffeb8d2416d505bd4a6ef036234228d2462840f1000024000 +080081212150458c7efad39f8abb77ef8aefbfff5e3c79f264a583daa0b6a84d10a32169494359418c1a02876a400008000120d0190255c488c267e4295a9514 +a9fad416b50962d4d994afaf6310a3f5618d9e800010000240200e0221c4e8871f7e108f1f3f8e72505b204671e6aef7add42346db62b63917cbb58f2aa0dfe5 +5c6cae24db3afa583b7056870163ec5a44f40f0480001008402094189d9e9e8a18c7da89d1f66c436c6c6c88d97686c6ca9b5c00aa282211a8478c8458ce37f3 +795a238695fd2a9d59417782fb58e3b86b751530f6c21803ea3865a8aa5775bd6a60abd6af6a1fd781001018340221c48872831e3c7810e5a0b6d6e8314aee62 +37664272a2269b5b5f0d685fe5b296425d62249299eaa5d7280ade15638bd2478bb628483e6b8c41751c3237add7e2f0d134100002d341209418ddbf7f5fc438 +d64b8c5c06b68ed1ad53769d3ad357b94a891191d4d47b6778f0880c29f22af92bf31ad9e364ff5339d5d6e63c0bc0d175ddc7a690a7659d5942b8a8df9998bb +ead9fd2a22cde4dda0509a45aee79937b2e091d4f53252ae9d959647cc9037914f85eb8cf3bc0d07863e8c8c716f88cdf9b6984b0ce87b155e73618e6da9eb2a +199df81b3816ebc8b9b0e727ab93cf652ea7ea4b797dd332091ec63ca8b9cdae39d6e1aaf5d7b9b4d117100002dd23104a8ceeddbb27621c6b24467c13b18d69 +96cbe231d4e9b454197673d35353e9da304cc39c85f564dfd9e6ad3762b6993b3690fa7299a463ddeac63d46b429eb70a624436cec8660ccebe0254696275012 +2b9a2f0b4f4566745fae7aaa73eeed48e75ecbbb3d4b490bdf909de159b39ed4857cd04947017d647aa7aae56d5832290cb7adfc274346ae4f9c2892fe97e1e5 +083d1b731188a351c7d31f27c6724db0b56a29acc6c2354645b00cbccd0656adbfeef583fe800010e806811062f4fcf9f3644f482c698483da5a5f288d1b66eb +6edfbb31f0792818f67cc3286e7a54b16cc3d06e039dc84b8449ddbd9b1ba063835f49ae6e948b13a33ac9cbda6be425463969757b3f94672ac1d1200e8e7a0c +9aca7e0b3a64cd6989878b1367b977977a7a5812baafcfbc413331dc55deb70eb8474c7eb7f162723ad682e17daac2d1f68ea9fe12a3e2f464d9c9ee8a34a99b +084e543916ccfb6868fdaaf5bb5942e8150800810e100825465f7df5958871f48718790db561e1f34d2760d3e35e26bd612b436e8765b881e777efadc8d58166 +255d362546dab3128079ea8dcbbc0cae4dd16e238342d733a0c93c3a55a4a5eaba8fb4c8f3817dd86d78c61144b0bcc4c8e1f50c1d5b5d1c3931f1a8a3319706 +31b2bc655504b5d0feaaf5bb593fe8150800816e10082146cf9e3d135f7ef9659483daea87c728c0501b9b4ec026cda730df78adb0912bbcc0bd1a2dcbb54e35 +6b164a4b254cbd3756289087b474784c85681c9b9f1d9691d82a6f9c15dac98049fb7584c41c3946fad5027a4eab42697c6c9e3eea86d2962518f19ca5c2f700 +bc3879b7c955088e731ee62be9cf6ecb0a0f16bcb39c1859f96966e832c7db385fb3fe3ad70cfa020240a07b044288d1d9d999b876ed5a9483daea0731b236a0 +3431d4ba8376840f8ab91f6c129d1baf67e3621bb11992f06c205c57eacad5919e994fa585255fe7a2a6b8f164e98d24874885e4dcc9bfbc0f3ba7866d9299f7 +cef0eae98eb3f9e29e3bd56f88a7c2a8e77b2f53491f8a8c280fa3e1397163c8b1d018b9bc449ce8c8f156e395df1ca8b2e91af1255f9bf3a7429a6a5d39fa73 +b6c5fb62b97e76b84f8e31d1092f562af72c4ffa37c285a5f53b5a34e816080081ce110825469f7df699308f5f89dfdbf83df12b79def7ddaef399e81131f26c +0cc694989b81f1548de7857fae0dc3d8b8c888f3ba0699529dbb3790e2a6c35e4550ba3974a367f51fd7ef464ef43a50047ce1c5d0e1ac5a3fb41f9403024060 +50088410a3a74f9f8abdbdbd2807b5b53e8fd1a0a6627cc282188d6f4e7b35a25589cdaaf57b05068401024020160255c4887ef0f5f8f858bec3e8934f3e59e9 +a036a82dfc886cacd9eb793b20463d9f2088070480001000020504aa88d1abafbe2a7efef39f8b1b376e08f2f6ac72501bd416b5e9fbec1fdef45edbb0af9415 +c65c778f008851f7730009800010000240a01e0255c4885afbd9cf7e26bd3c14025be5a036a8adb20f8851bdf9eb7569224677ee9ff65a460807048000100002 +404021407b5608315a27622046eb44bbe5becece5e88933b8f700003e80074003a001d188c0ed0ded5a70f88519f6603b2000120000480001000029d220062d4 +29fce81c080001200004800010e8130220467d9a0dc802048000100002400008748a008851a7f0a373200004800010000240a04f088018f569365694e5f0fab1 +b878e95df1daeb6fe298100634e734f7f8344300eb66dcf602eba3d9ba98722d10a311cd3e1ed71fd164d6184a1f1f77ad217ee745b16e3a9f825605c0fa6815 +de51360e6234a269c50b1e4734993587d2b7f780d414bfd3e258379dc2bf96ceb13ed602f3683a01311acd540a01033fa2c9ac391418fe9a80b1e25837cdb11b +4a4dac8fa1cc543fe40431eac73c449102063e0a8c836c0486bff9b461dd34c76e2835b13e863253fd9013c4a81ff310458a68067e9dbf82eeeb6b7b26363636 +8ac76c3b0a56636b0486bff98c3ad78dd4bf4d315f66edae734d341f0a6a7a1088b93efe73f203a4750f4cccb010884e8cb667e966369bcfc5e6e65c28bb322c +5886292d37f02b61af3601fb2fc1127b83086e6f5bcca0575ec58c69f88d4eca082a9f3bfa6e115983c3f2761ce496ecc6a6662142283b22c971cb64d8458ca8 +ffd96c96cb14aca7c3b41d63973ae6fa2052747676e63dbefbee3bf1f2e54bf1fcf9735986cae3332c04221323dabc6642ded3c390ac5d13a21323358236e732 +b06d7be35c3bb83def30a6e12f1f6a46506991dbc488df0819f3caea24d50a7399912a458c96f34d46869662be999094161d854562447d921d4be456630ad4d3 +9eabc964c58bb93e1431facd9b6f09fbf8f0e34fc5affff4ff8957fefd6be2ebc31be2d9b3673d2446c53525d79cdabba596986b36587146b24ee212a3324319 +8c2c0a3645801b7879a74d465dcec92c31f0e4c94bfe661e3d15a6d21b8e7dc75fa8cbdbcb3c81461d9310cf593faa0fc30b40de1f7b73f50c5c2e5a7b8332c6 +958eadc5bdb3e994acad5e4cc35f26b4416a4ad73bbb49226f91d77b4c467a33d1cb4dc363c465a0f9e7dea4d8a01688118d2b554e299b7464a9b14acf97d235 +3646b991a4655d7a2ecf3176a7704c37a4d4cbdee618636336b4f662ae0f4e8cae7cb22fd4f1f1a79f8b070f1f8b7ff02f7e2dfed63ffc2fe2adcb9f4aaf91d7 +63d4e17e69aea954cf3795ae2bc706e9795da253b77c4f152922314a1966bac84d40bd1ba21dc357ff7b37dc7c8397777313df0c6d9d727a8c24962c57c2dc71 +b270a77507a136b2d2509a5947dfe5677367102ed7a6e86adbb548647b8cf4f07a6c5ca697a1a7abada658ce1cab6c8dd94dc534fc3e310d82aa8ca7cfa3c20c +64e9dc90ae25cae2273f5ccfda59f33631225994fe6ab9f4781859cac283a504dfd0579b50591e76d8b35a2ba4abf5e1224657f73e17d78f6f8937fee213f1b7 +1352f4cf5ef91371fbf6b7e5a1b42e498471b3927a46b7f90d48b62e6b4d886d136a57ee4f8588c488dd559501c49481df7de6c6b36cc3f56cf0fdc1b35349bc +c4c80e71f05c10ed1962f960366971ddd9d88bda4774ecba557d1b08e677e1fa74593f23dc585cc6dfc91f0f6fb5ab7b364175112323c7285fab925c50be8eba +ae59734e0c7cc4c8f6b4b431489318a5f6c7c0dd5a2332ff2871286d275eaef976e65d4a3612edf171795f13c155bde44be63dcafb82b7a8d9cc76b13e3831da +ffeb0371787c53ec7ff9b578f2f44cfcfebffa1fe2effca3ff2adefecbcfc5f2ebaf4b8811d333ae5f96277c73beadf5d1ad5fe63a2b7a1f7d3713964797145a +7b4ae96be6a5b5ecad2b1220ebd9765d7b9d98b384ce05785cfbe0455d0f312a034e6eda0e97b55a27a19e8566eb6a54b5aa89914534aac84c99c7a836310aec +9bcd8833afa84ae651cd683a186efcbdde9c56899183a056798c98a0a6a729bff1e164c8498c4a4370f126da20466c73487bc86c13112075832149d03ccb3fca +efb653bee7d173b529248524a1b29e4a49bdead30e07379dd175af0f458cfeeac3abe2c34f0ec4fffccd074908eda1f8edcebef89ddfff95f8a7ffe64f042560 +efef7f1eee317279c2b9b7dfe5b134d6605def63bee7e61e529553e7d88fbd91004fb441ae9b3c37d0747c64faeff4b8d61d4753ad29afb706625462285c4627 +74c36d078f41b71a468c98f1d51b8f43890b77312caf48935987e2fbe6cf0e7ddae13a0b796ff8c5199a48ef70da7e7aa94be520e35ff6693394e64d7c777912 +5d42726f0a510d79379adf09f38d8d7b4edace2d52a2f275e3ea537bbcb4e7354d1b50b29aa4c6ba43b743162af74f6d6a3a1ccc36a32e156da07daf737d2862 +f4cdf523f12fffddff961ea24fae1d8b7ffe6fff54fcbd7ff247e2cf2fefcbdca2af0fbe69468c5ce169c3eed9af3121a251dffb981222ae77eabbe321aad07d +39e0c6b5dce35a7f1c6da8ec9a88916b33ceeec7b2e4c3dc209684d2f0f87fa90e70039fe67b1593e7b89b5227686b239d2d389988a712b78910a9fc31ab3dee +090ccd35090aa539c219aa9e215b22a73e3fed5743b4458c4a096728313248b1fb29b3759120d70232d78d235caff45cdb1fc75d324bacf6ae31f22759af25e8 +43d8a08d8da56f6dc65c1f8a185dfd644f7c737447fcdd7ffcdfc4effcc1af2429fac37ffdbfc4772fbf9784e8e8f8b8256254ee590cf63eca902ee5ede6b653 +92257ad54e9e6467ed05d9cc561120ef0db25c04251ed75c7382c7d182b2ad81186577f3ae1864e1ae89816e6f7836d048be2ea843b4173cb6a068d19b2ce843 +f41e06d5604cc39f0fbc84a0aa9c84d0c7d92bde63e4f5d41831a7f5245fb737f1edc8df9ebce36939e6fa50c4e8fd0f3e1277ef9f8afff8c717c5effec11f89 +bfff87ff5dfc9fb7f6f43b8c6eddba159f185921aa34bf27bb61aded7dcc6e78f9bb30b2756ae43395e5a1ba4266651105a952251e571e3ee429366b56c5b8c4 +68cdc2a33b130110a3e96a444cc33f3514d7b26eec0d676a20773cde98eb4311a38fae7c2cbefa6a99245fdf11ffe98f7f2be6bfbe9424603f17f71f3c10f7ee +dd1777eedcad78c1a3c313eff3c21a3782fc09f0a6c9d7d22b21f380ccc4ffc05c505b4edba3af9d1e2a0ac13dfae11ed7ae1e4a0031ea78c1c6ec7e2d063ea6 +c0682b1a02310d7f34a106d210d6cd40266a053163ae0ffbcdd7f412477ad335255cd377fbadd878f3f50a13d7515510a38e806fa35b18f836501d469b310dff +30461c4f4aac9b7858f6b5a598eba3eeefa48118f5552bfc7281180d6fcebc12c3c08f68326b0e25a6e1afd9f5e08b63dd0c7e0a2b0780f55109110a3004408c +46a40e64e0ef24c980f84c0b019a7318fee6738e75d31cbb21d4c4fa18c22cf54b4610a37ecdc74ad29c9dbd1027771ee198200634f7f8344300eb66fc3603eb +a3d9da986a2d10a3a9ce3cc60d0480001000024000081410003182520001200004800010000240204300c408aa0004800010000240000800011023e800100002 +40000800012000044c04e0311a91461c5e3f16172fbd2b5e7bfd4d1c13c280e69ce61e9f660860dd8cdb5e607d345b1753ae056234a2d9c763c7239acc1a43c1 +e3c835c07214c5ba590dbfbed78ebd3ef082c7becff8eaf28118ad8e616f5ac08bea7a33156b1704ef316a0e39d64d73ec865233e6fab07f12c4fe0910fc24c8 +50b4c22f2788d1f0e7508f00067e4493597328310d7fcdae075f1ceb66f05358398098eb4311a3dfbcf996701d6ffcd96fc59fbd75495c7c67a7e247642bc56e +b100fd58ec2cf99d7bfe719d6b51841e370d62d4e3c9a92b1a0c7c5dc4c6533ea6e11f0f2a6123c1ba09c369c8a562ae0f4e8cae7cb22ff8f1e9ffff52ec7ff9 +b5581e1c8a9dbffcab726264ff42fd26ff05fab6d16e408cb8bc6d8bd771fb20461d4f40ccee0d034f4abcb12136d831336f0f9c5d6fcfd23a21658d0626b468 +62ce59acb6621afe58320da59de2bad914f325931eba3d94a9f4ca19737db888d1d5bdcfc567fb5f892f97df8883c323717c7243bcbffb4138315a3bc20d88d1 +da65ecae4310a3eeb08fde73c1c01b77204b31dfac223c2bb852d5e6814d24fabc863418d3f087f437a632ce1b0abe76a0d3839fee98eb8313a3ab7b5f884faf +fdb5b8f6c5527a898e8e4fc4cd5bb7c4b7df7e2b3ebe7ab58418a5f658deb892ae19f6732666d9b5cdf9b62eb7a9d8ba71d39b93f8e57c53df08ebb249b0ac18 +32a3e92c2146992cf3ec2659df28f3f36a7d64b2d4be91eeb94681188dc8e89513a34413abc65a75bd4c99418c3a5dea310d7fa703e19daf29d4e05a37b42968 +63bfcabae80d98d31624e6fa50c4e8fffef9db326cf6d5d787e2fad1892443f7efdf170f1e3c90c7b5fdcfc33d46dc7e6e646447920ef65d92112254cca3a975 +93111d59cfce1fb2e7bf8218f1a881c3b653644191b6b19122420ac46844f6a29218f1bb84c25d072d14157a4b17950aaba9709c5c00f626e1b9d391774123c2 +b6ef438969f87b33d6351112e7baf1913263dd649b8fef0e9b80f4dcddf706e3890812737d2862f417172fcbb0d98d9b37c5ddbb77c5a3478fc493274ff4f1f5 +c137cd8811f7c6d8df1d29121b923ce51ea8dc5b5436b9d51e236dbf9d37bdd97e314656d40e31e21bac75d7656dbce9265be236b4ae6f28166c9c4f8c530dd7 +62c1dd681b40a78c7351702b4a9d5b21f4d48241aa2646ea6ec373d751b611f93c42f6f9356d662dc0d7bb26797e98fddd1636a6e137da76adad322220d7449e +db9693e97c9d6f30632aef3c6733c30ea4ebdc136a28908d007252b14e7deb8664336f06cc70b4b4255420c3a8e861f2ddddf74ed506295057eb4311a3b72fbf +2b4e6edc1477eedc911e222245f4a8feb367cfe4dfa3e3e3968851b93728bda1adf21859baa9d6150feb29ad70d97e6517467a031cd96364e7b19091ccd9ac32 +1ca64129711b7257a2bcf9e28648b913ebb8161dee46bd91d7357afdb325d5c4281bbfefae639b882af3f4d8e542160d885154c570197f5707ed10a31202ed72 +b5676426e73dd9fa27bd32c203ca68737db4722514e128dc3dc75fa7fe7593c857c8ffb0d647d59ab01e8048efeea3aac8a41beb627d2862f4ee7bef6b52747a +7a2a49d0f3e7cff5712bc935a27354def9717925cb3c953a94663b1c9473c0b3277a3444137f757d7b96137d578e9d63af4c436ae353e8b8c4c8b72996865f32 +4353a524fa4e3153022bf9cb5c203ed7a2c3dd18ea09b1d9730fcd512531e26375dd5118f3a4486d36d0509c408ca26b06d76d5fe3ad10a33a04da45103c6b46 +1be432434cfa196a13cac849c06c94ad1bba194b3d5a2c41b6ec4edabef3aebc730f1010454a1158f7fa50c4e8a32b1f8b6bd7f693c4e9af931ca32371ebf66d +71f7de3d712fc933ba77ef7e429aee56bcc748795799ae57122382827b659b265f4b45cd13c0551238d75fa79e679e5f7df793ca323672343c62641b2869bceb +bb16b5bb3174c31f3c31e277da96674f615820460c57dac42419b5c287eabc0f4718f5280890f12ffbb4478c1c6b2be446870b6b97cf08d1f6cc4e2c2d21e12d +aed3f21b8a6c1372dcad1b1e6ce7536c9e75164523d00847609deb036fbe1ebfeec525463e577a9618e60ca555269ae586d96d884a3679edb6ce4202dca5afb2 +fb75f8a8c4453f904777ebbdc7c871d7616d603c1f4b3f564af719ecb1d08de40909f36e9add058d7ffdf46684ad10237b3d3b09b454882c04eb09a5db215a75 +c76b787d2bd67948c8bbe13aadf2b44a7d7779a85db6ab70c7edbebbef8de24c449098eb03bf95367ea5894c8c6c379f27f9ba8c0cd9ae68da78559cde67886a +b8168393af838d5e5592dbfa94086ff05d1fd67deb29a6e137c7564da0cd27157dc9d7e6538a466e82243d8e75aed77549f83cc23ac5bae99b36c797a7bdf511 +5f56b4d83d022d10a3888342be4a2d3061e06bc135aac2c332fc5638b6e3758e7533aaa5e01cccb0d6c7f8e7a3ef230431eafb0cd5900f06be0658232b3a18c3 +4ff94576b22688d1c8b4b17fc319ccfae81f749394a8dfc4689253d27cd02046cdb11b7a4d18fee6338875d31cbba1d4c4fa18ca4cf5434e10a37ecc43142960 +e0a3c038c84660f89b4f1bd64d73ec865213eb632833d50f39418cfa310f51a420037fe7fe6994b6d0c87010a03987e16f3e5f5837cdb11b424dac8f21cc52bf +640431ead77cac24cdd9d90b7172e7118e096240738f4f3304b06ec66f33b03e9aad8da9d602319aeacc63dc4000080001200004804001011023280510000240 +000800012000043204408ca00a40000800012000048000100031820e0001200004800010000240c044001ea31169c4e1f56371f1d2bbe2b5d7dfc431210c68ce +69eef16986c0c1c18178e38d3770f410039a9b297f60d3e3ed6575ec2488d188561d1e3b1ed164d6180a1e47ae0196a32891a2939393d51a41ede808d09cd0dc +4cf9039b1e6ff6ebd84910a378b877de125e54d7f914742600de63d41c7ab5f99e9e9e0a1cfdc18066d4458c168b85a87b34d78e6e6bc2a6c7c53fd44e8218c5 +c5bdd3d6b0883a85bfd3ce43177ca742f6b47310a3fe90214e4ccb88918fc03e7efc583c79f2443c7dfa549c9d9d8967cf9e491235d40f6c7adc990bb5932046 +7171efb4352ca24ee1efb4f3d005dfa9903ded1cc4681cc44891a22fbef8425cb97245922210a39e2eba8ec40ab59320461d4d501bddb6468c027efd7c7bb621 +7f357db65d7364016da72d6e8bd9c64c6cf3f2f43de993fa4d8f4d315f66fdab6b86404b31df4cca6dce852aa6a425f93775e5a4b76c3c7c4ccbf926eb8bf79b +c85573d8b18b872ef8d8fd8ea13d10a3e112a3870f1f0a7e90b7686767475cbc78513c7ffe5c1ef0188d6195c61943a89d1c36310ade54e380daf7564a89d12a +5855d6cd484b138054db157d1029911ca7408c1829b1af6d6e8a4d4e821459b28951765e13a3ed19234f2563a37a241495afcd089b80e5af13bae0e3f6daa3d6 +4ef7920d704f34f9a54010a371102322458787879214edeeee8aefbefb4e1e9d11a34abb59bd7e5abbd9adee7a942542ede438885104051c8316b4b688aaf0ad +ba5e066e103162e4a48c1829af12f597959bcf98172921309bb3e4308811799112d29594e31ea35ce4f43a7326e94bdbba6d2ad3add72874c18f41cf9d630031 +1a5de238cdb32ff99ac266743c7af448fea59c230a9bbdf7de7be2d2a54be2c68d1be2e5cb97f2e89c1805d938f7ca6ccda68fd610940f2cd44e8e83184d7492 +ed61f345c443411b3c042517e94ccc28a424c34f9e0ddd0e532932619c27c240a4c56ccbec3b0bafd9e4c930164c1e4798cbf0c8d4f218252133224319ab9144 +669bc6cf426999b7873c524e6224c7ebc0c81a0f8db94ba751e8821fed5201319a143152c9d5b76fdf16cbe55292222243efbcf38ef4161121fafefbefe5d139 +31528baec10da49318e99bbe3c9caf6d8f619f33bb155cde7d0338269b116a27e313a3c2c6c9efde1d1329eff20327587902785e096d7216239f3bf243a407c1 +ae27677c853050cf34c6b588645e0cad1a8e11cbc5d1d78db1a4b9387ab1e9d092e53d09b913f295b1cf97180d83b4148851498e11d70d9a67e37f73ee5dc448 +e514b9088f0eed65b87989d50a3a92e74ef131a6dfed4fe882af258e241b3b6267b125b6b6e8d811475903473bea5cfa7727bb70bab7c8ca6e89c55e1ad82a9c +3bda616d1d891ddd2e7d5f08598dfa967db27e0d7912598c3249391d4ae36d568f18a1b4e185d2d413671f7ef8a178fbedb7c5bd7bf7c4071f7c202e5fbe2c09 +9222456d10239e6b286fa67c379b95377fd57b8f9718f17c4e6d134dbb6dd87e6f792b2fd375635abd843a2dd1869d8c4c8c4a36ce80894c490a4d9467829394 +59e7866d6cfa6c43f7288c91a7d2e994c6edbcb088b8b7a38ca0d81e9132ef8e91ec9c253cdb5e1817092df5183172eb80a49c18716f8e2be49685b9541e1093 +83b7eb273696ce79c8741bc488ba722d7a97d6b4468c145151044731202e84f6d6304222490b1129d7b953b1973c422d0990244919b1d2edd0758b6c51bfb2cd +ac5e924dc4cbc8769063342aaf11a9982f944649d52f5ebc90a134f212d141a4e8fdf7dfd721b4763c46968d51de78d7cd668d9b3fdf4ee08c02b872270b377d +498b2137a52e7b9e703dedf5efd20d5e637b8c6d27e312237b43544f0ab9364ed7442a20aa3651bb5c8802d849b80364c6557a6212236b43afc288375e4a8caa +c24a8adc6a574a1abaaa9ad3c61e232e0f23e63601a23c2223793b7b42cd320cae709a4d7a7cde25778e52d5ac555fe78bde57ba3562c4c986263bb64747796b +52b2424447798b1236e338477c28253e473b09d1394a084ffa4f5acf0e8ba9fff9795f996a380b25e0311a9ec7884811255693e7687f7f5f13a3e3e363f1c30f +3f488f11fda5236e282db71b7abdbb6c5b217da1fce62f8418e93255b6d4b73fbacefb52291aaca3aeabc4b4932d10a3aa8db384c98218ada45b9c1815426486 +572d9fa390509a2c2389a4836cd98fd0dba1491d86b3dcc6ea7c48388e3ff55508a5594fa5a985ee2be72160b6f7287fcaccf618b993b1dbce317285cf0c2e7b +786b25dd7156f6920f16f2a28a8efc9e34d49687dea898714e92a0bd244c474f9225ed257f8f92309c744881188dcaf3d3f46de2a4333e8f1191229e4774edda +3549901419e27fe312a37ca5a45e15eb152274d9e7292ab9f98b428c2cfb5c48a328ecaf1e7b1edf92acadc55876322e310ada3899e2d8e56b86d2f4865de90d +f1784fd6365debe9881323f9be1efe7e1fe5b593582589c6ea9acf73c6bd7f86eb96e78465f1696bc117def793f5619c576deabaaa5d573278d9536966fe8d91 +84e81a5b0031a2d9e209e48627c8f968fe489f4ae31e22c95792fc21c95cac1c1e15c62a84ba326f9011fe52a1306a23f72c9944aa2494a63d588e3208a58d8a +509511234e8a54c8cc458aa27b8ca45d547939d94d12d956e67971e6759645484ab687b2e46bfd2eb6c24d606613f90333de8889c39eaf67bbeaa49750cf7a64 +6224b714964cedde38cd1c9f80e46bd7bb686863b737579f8b51b1f809265f17b4afc15d4b271a6c756a273bf741262dc358df63243d37c9ef52a92468463c78 +42b54c90ceae05255f4be01c39423c7f892756ab7e5d9e242d1bfd7e967a8f1192af9b7a69fa54af8c1875f95b69eee46bc7cd66e186ddbef96b987cdd2be337 +2c613a24460300aa071b591b2805bdf362a0c4a8bf4f0f561bb736e6da6e3374c1d792658547e06bf5d37161e4180d2bc7a863752976dfa24d0db2e9bd03a4bf +0285dac9163c467d04c5f44a193f1dd147711bca8445d410b811540b5df0b5860a6234aad0549fbc4121b2f83c46b574781d85418cd68172943e42ede4448851 +144c7bdf088851efa7a8350143177c6b020cb861788ce031eaabfac2a6c79d99503b09621417f74e5bc322ea14fe4e3b0f5df09d0ad9d3ce89189d9c9cf454ba +e98a4573e27a2a6d4a88c0a6c79ded503b09621417f74e5ba34574e77e939fd1ec546c74be220234e7a10b7ec5ae4659fde0e0406ec038fa8701cdcd943fb0e9 +f166bf8e9d04318a877be72d9d9dbd1027771ee198200634f7f8000120302e0460d3e3ee67a17612c4685ceb08a301024000080001200004564000c46805f050 +150800012000048000101817022046e39a4f8c0608000120000480001058010110a315c04355200004800010000240605c0880188d683e0faf1f8b8b97de15af +bdfe260e60001d800e4007a003bdd701dab368efead307c4a84fb3b1a22c78b4734500511d080001200004d68a409dc7e8d7251888d1ba905e433f7819d81a40 +4617400008000120101581bebd870dc428eaf476db188851b7f8a377200004800010a88f0088517dcc5023100110a340a0500c0800012000047a830088516fa6 +627c82b44f8c5e8aebfb4b71f9ea52ec3fccf07bf1407c74f5b6b83b3e38f3114d618c639e3f8c0d0800815e230062d4ebe919b6704d88d1dd6f12a2f3cdd3a0 +819fdd3e121fdd7e29cbaa7afc5c50233d2e4463716131a631f6187e88060480c044110031ea72e29773b1b93917cb2e6568b1ef26c4285c1cf2161d89ebc64f +72b9ce85b7d8af92beb18c698cfd421cd20001200004080110a32ef560d2c4280f835128ec3285bf548848fe4d4364f2d87f20cef83c3dbc9d5fb3eba9b27619 +d73c5bfde8701cafabda2b947d2af633f964bdaaebd4bf4b267bac5713b2f7908ddf1e3b954f08618e0f238795ed271887e0d2e59a40df40000800818e119800 +31da16b38d0db1911db3ed0c712225fafc4cc8d392a8ccc46c332dbf39df1673fd3df1eb545d576de87637c59cdc4119019acfb81c4bddf686f61a91ac992c1d +2b468ceec33c464430d2cd5d8588cc10527e9dcbc4c349bc9e0cadd1e6cfc2711466532137dd069561a443f7699c376553e565d82ecb63a2ef448c64fdac3dd7 +759f4cbc1ec9c6db2bc89c5c97e5590e952a5fdabec222049718138f368000100002034660e4c428251f9a0c25f467b64164c53cbf9c6f8a0d2a24c9122333fc +3b9197aaeb49506cbe99d5d7444bd56372284fd1c43c462961c84985109cf4a810914d845ca1232aa312ac793d3a977b72b4c7892767cbc5ea265b42d87da97e +f879fe3df4ba4f266a8b278adb63b12d0b1f375de3e599874d7bb26c595d65b2fc2c635e066cd1203a10000240604504c64d8c7cc4c33eef222abc4c9debcc3b +957aa912a2b46de5124d941899ba6a9113e5cdb0bc1ab62744b6c1cbd8f52c4f90737dd87da842765d554e86afb2701eff1e7add27932d876abb4c3e9e98cecb +db21371a932dababcc8a0604d58100100002634300c4c8f6eca8b0566362e408858510b1b16956321e7f28ade8b151212133ece5f6ece8f051d207af27737d2c +12e27ccacd154623d250124653f947aebe29bc5576dd27136f8ba65f8ddd3eaf54c357ded73e972b089711ea20860404800010a88bc0b889910c6dd50ca5ad42 +8cecfe64e82d214a20464c2feda4eb24ffe79bdbd9bb875222f451f66e229e4ba31be0eff03192b579682d0f19e9846a63659832e4b93c3ce495b5e7ea4f7963 +78e2373f677f97212f4b26fb5d44fa7fc7bb990aed65de20239c58d1be4b86bad602e58100100002134060e4c488663020f9ba8c0cd5f1284985e1fd99c9d7fa +b17c4d945459e5659a62f2355b65be10d20416228608048000100002fd406002c4a81f404f518ab0a7d21432a9a7c4ede199227a183310000240000874810088 +5117a84fa4cf7ac46822a06098400008000120d06b04408c7a3d3dc3160ec468d8f307e98100100002534400c4688ab3bea6311331ba73ff744dbda11b200004 +8000100002ab21407b1688d16a18a276090267672fc4c99d4738800174003a001d800e0c460768efead367fff0a6579c0dfb4a59e13e0d0ab200012000048000 +10000240a0090220464d50431d20000480001000024060940880188d725a3128200004800010000240a0090220464d50431d2000048000100002406094088018 +8d685a0f0e0ec41b6fbc8103184007a003d001e8c0607480f6ae3e7d408cfa341b2bca42a4e8e4e464c556501d08000120000480c07a10a03d8bf6ae3e7d408c +fa341b2bcaa294ebf4f454e00006d001e80074003ad0771da06d0fc468c5cd1fd5fd088018c108f6dd08423ee82874003ac07500c408aca65504408c6070b0e9 +4007a003d08121e9008851abb4008dd72646cb85387fee82d8f586de966271fe9c3877ee9cb8b05bd3d854b65db3bd758607872cfb3a71425f08594307a0032b +eac0f488d1e99e582cf644d9af771ded6c89adad2db1735493d804b45db3c5f5156f49f6bac468b9382fce2f96de855d75bdecae44d5a5bfe72eecae643c62b4 +41b286b6a364dfbd9090c29ec83ea43b40c8da63d2bfe22686b9c5dcc6d60110a302f538123b5b3ba22e2792cd2872118364c46883cb5445b162cacefaaa478c +c81b745e2c96be855e75bdcc40a8baabb4a1da8fd106b515da4e68b9100319b3ad90fe5026b6d1467bd029e840bb3a00626413865508494c72b18a1c7c4ca1ed +8496ab2258d6f54a622443446968ec5c428ace9f5f8825dd41ee5e48cfc92309add9ff9fee8a0bfa3a0badd92127f53fef47f695f5c3ef560b7d9c0ae9a171ca +949db7db75c9447d58e52e2cf8b81db2b870718ec5854d663442fae46356e3b4eae51ebc2c8cb9a2c70a46bd5da30e7c812f7460351d980631a24d3f098d5178 +4c1e2a94669c5f88bd53f216a972a9d74885d5545d195eb34984418876c4cec2eac7262aba0fea33ebc3295326ab6c5fb59bfccd427d864cb20f2e3f85024fc5 +5eb02cbcaf24d468f57924dbaeef492b2546b42933824224446ec2749e6dbeea7c5918cd578687cfa86d6f1b9e3e534293918f4c56de465928cc180f1ba7aa53 +2a8b03176728d027b785adb34fa30c11cdd45bc7c7648fb52ccc0963bc9a31067ec00f3ad00f1d9800314ac981ce173adac988119d4f89497018cce711b2cf7b +bd2f9e3e3302b6d83bca65e56d4802c764757a84ac714a2293d439f2e5547970e163f1f559c36b641323e981915e15f20ef1b0990af1143d4169a2359de749d9 +7912b66a6fb17495a13ed479fbba5a84be3e55b88b7b98781b7658ca27932b3ce893c5d526d5778502cbb0aaead3ee47c9639ed7c488086246d6f2392c4b92ef +8781c3468379800e4007eaeac0f889519977877b91e477079170799b4a3d46cadbe248f0b6db527d4a7296797b1483b389114f180f914991171f496b3a861aa4 +882b5741312d4f87f4ccd0c66b793a743d5e5e7a71d8c6cfebf2308f7ddeee5385d17c7df2909e6ad796c3083f05c8c4fb7485a4ca70a1f28ca048cf9a2f2458 +d5b65d57f5cbdbcf92c3cf2f7693dc2f90a0bac615e5b121430786a9031327468ed090411832af4b955729d46324098d271ca5c80e0fa9b9be2b4f50954c4320 +467a534f3d1f3a8c66859128ac465e0af578be19824abd34ae30990a65a9babc0dc36039427a3294a7ceb3bc255b8e2a996cf222c354c9f8166c3c7e59725c54 +bf545fbfa6a04aee8c8439fb2c09a3f1d720c8ba4d5e8d80278d567aea111bea303754ccdb38e66dfcc42879309f87d24ef7162c94c6426c8ab414881123323a +0c67e5dba8f395c9d756f84a13a5fc3ce5342d28bee7f51879fab6c6997aa0c243691a97ca31d47319f9738cec3090f24898e128b949db09d5469274969c5d48 +d8ceceebba65ef3fb2fbccfed7044d912ff29c6489de32799a79517c32c927cf54f830237fec5cf15d4c0e5c8ca46b7f38316f2ba44fde4fd6a6e35d49a1af13 +c086308e0d01f38879840ea45e87f1ff24080f3d251b5afe1e239eac9ce5f058212649181c89dbc679d5a6aeabda757987ec3eb304e93c094a26802ff6f6b244 +f0a48d40998ac9d73c21dbe31dd309e9192e5e62d442f235bc0afdf62a586135184c6c9ad001e8c01474601ac4a89e9303a5232250f9b83ec8510fc991f23821 +af680a9b00c608b2031d307500c428220940534504408c60746174a103d001e8c0907400c4086ca65504408c6010876410212bf4153a001d00316a9516a07122 +46272727000208000120000480c02010a03d6bfcc9d783988a710a79707020150c0730800e4007a003d081a1e800ed5d7dfaec1fdef48ab3615f292bdca74141 +162000048000100002400008344100c4a8096aa8030480001000024000088c120110a3514e2b0605048000100002400008344100c4a8096aa803048000100002 +4000088c120110a3114d2b92af916c3994644bc8095d850e4007940e20f97a4444a46f43c1e3fa7d9b11c8030480001000026508e0717de847ab08e0058f7859 +1a5e98071d800e400786a403b429e23d46ad528369370e6204833824830859a1afd001e80088d1b4794beba307318291c146031d800e400786a4032046ad5383 +6977303a62b45c88f3e7ac5f9d779d3b8521d48610f888216d0a90156b77ea3a00623405de72ba27168b3d71dac158c7468c968bf3e2fc62696c74eadcee8573 +e2dc85dd9536416a6bd536da366a75657461d6b68c681f9b3b74003ad05407408c3a200b6bef12c46825b2922faea5589c3f2f164b6e705ce79a1aa4986d3595 +a1aa5e5d19eb96afea1fd79b1a7bd483ee4007c27400c468ed2ca5830efb4c8c649825f1b464c785dd4c71772fe873e7ce2fc492425385b2bbe202af5775fd34 +2f6ff467d53b778e911f7e2d2145e7952c2a5446d7e99c0a1795b5c5c7e40cc76538a83e5c18d8213a479bd27365b52171f5f5ef9a033bfc658fcb25a33d2635 +67849b9e6386ad4b1ea39f2464598619c29591087fd866814d15384d4507a6418c88186c6d892d792cc45e12533ada49beabf052767de72881c351b640658c32 +3b82aac97a497b7bd46ed6976c8f7f6c82a2fef7d595e777c4ce42b599f595b429e5d763da12795f4762c73e6ff49b5dd7a135fa3f6f37366d2b0da5d1a6c788 +860ed118e789cca49ba9bc9e95979b7fb611d377daf8abaedb8b9aea51588cd7a332aa3d4924987caa3c6f478589f85fbb8e26252ccc56d6966cdf838131062a +e36a53911ade86afac670eecf0973d4e2d63c098d43c15b075d435c2743e9941884088a003d08116756002c4e854ec2d5232243f8c2410b958ec1d25d715b1f0 +97cd090395c989c8e9de426c112be1e4caea47d72d23460999d1e48613a68cc8a54d667dd9ec45b76bca96d0a784f424633f523946d9ff6b4c36b289514a68d4 +6187a5e88ecc0ebd1031a264677e9e7f0fbdaedab6fba7b67832b56adb96c31512b2fbf6b555f4541106da3b2617b86aab0c037ec75ad626c9c1bc460e4f59da +7f4e3a4dd2c865e1f2f0f375c764b7c3e721fd7e61d79e57579994b8a63a6425c1b76828a772a78c71c22b041d4837c871bfc7c8f0ee985ea3943824e7142329 +2d5b245606d1f2919e1a1e23cd572c4f92715e79776c59c903e40b99f1b20537566c1f91d99ed763647903f462b43c18d273429e0515b2d2e1992cbc56e7ba1d +22236f902d87eac7779e6fbeaa8cfdd70eb3d963726de0bc3f1f0676df76584f5d57e127e591f1f55f36073c89dc8549dd31f179f3d5e5731cd23e8810bc06d0 +01e8400b3a301162e4091529c26084d42ac24a15e1b002b9894d8ca4ac96e7c747a454df729c342edba3d42e29e2ca55b80b7185701451d11bbe1946531e161d +ea62612f0ac1545dcf9f264b3d2af43f6f4b857a64b942282b2dcfc7a1eada7f55191d2e7384e4ec27cf0c3942c36856984fb6a9eaf21c215fff9e39d8b59ebc +53e3f0cb987971ac27f2c2b0cdebf239748531fbfeb41eeeb4e16d810e8c4307c64f8c6c32e0200969488d288d451c745983ddf84369fc9178a7f7c6cae739da +49f39c4a436c3951cb43699e760ac4c70ea565a1c416738a6caae5cf31cac23d59582d271d3c4493854af826effa5e755de5ecb0246f1986712618abf08c1d2a +f2bcbbc848ba66658cb6cdb19a213433c4975e736050b82bb2dbb4c36739f94bc3938e0477ebbc9e03e571d278a950a60a7915c39285319562eb90a7f0aea32a +ccc66180b191621ea103fdd3810910231a224f48a67ca39400e9105a763d2547765987578587a6b8b7a992186579422a393ac97d92ef172af542256574f9fc5d +449224b1246b9d486ec89fe52d59eda77555de5587c9d72db8406164fa676430279813e8007460483a301162d47ec8a8951e7c3943ad74d64ea3637bc1e39016 +3764c566041d800e4007eaeb0088513b7c204eab2046482c84570d3a001d800e4007d6aa03204671280c5af120008f51fdbb15dce10133e80074003ad09d0e80 +1881d2b48a0011a393939356fb40e340000800012000046221407bd6b8df63140b29b4d30881838303a96038800174003a001d800e0c450768efead367fff0a6 +579c0dfb4a59e13e0d0ab20001200004800010000240a0090220464d50431d20000480001000024060940880188d725a3128200004800010000240a009022046 +4d50431d20000480001000024060940880188d725a3128200004800010000240a0090220464d50431d20000480001000024060940880188d725a312820000480 +0010000240a0090220464d50eb699d85fca1dc7a474f8702b18000100002400008748200885127b0b7d3299122dfabed1f3f7e2c9e3c79229e3e7d2acececec4 +b367cf2489c207080001200004800010c81100311a9136f8889122455f7cf185b872e58a24452046239a780c05080001200004a22130196274b4b325b6b6b6c4 +ce5186dde95ee231d913a7d1a0ecbe214e8c1e3e7c28f841dea29d9d1d71f1e245f1fcf97379c063d4fd9c4102200004800010e817021321464762676b47484e +a408d184881191a2c3c343498a767777c577df7d270f10a37e2d464803048000100002dd23300d62e422412325461436a3e3d1a347f22fe51c51d8ecbdf7de13 +972e5d12376edc102f5fbe94078851f70b101200012000048040bf10884b8c24d9d8113b0b0a5b251e1afa3f095f51086b6b6b21f6286e6594d9128bbd23b127 +cbd3f72cb065d4639e1ed586f2fcf036ed7e34cee42d5232643251088d1323979c52d445263b932df13b69ef53bfe652121d955c7dfbf66db15c2e25292232f4 +ce3bef486f1111a2efbfff5e1e20463d9b4088030480001000029d23109f1869f2729a109e8c0cd9212c83d070c244393f542fcf0592e4244b0ca23c21459ef2 +f39e7e38b43609328891afbe157e53a1b8cea7cc2f00111df5c4d9871f7e28de7efb6d71efde3df1c1071f88cb972f4b82a4481188518f2712a2010120000480 +406708c427462aa1d9f0c230afd1114b7a2e252c1926ae32923c3142a53d4296774ac15ad68f4fce240455f06475364d611d1331a2a4ea172f5ec8501a7989e8 +2052f4fefbefeb101a3c466178a2141000024000084c0f819689511606abf2ded81e25feb498910b9411229b5c5579732a8991434e2673fa445b79993ea80e11 +23224594584d9ea3fdfd7d4d8c8e8f8fc50f3ffc203d46f4970e84d2fa306b9001080001200004fa84407bc4c80a89c9dc229577c4bd4a85effe505aca9fd2bc +1f9d8fe4eba78a8c69b264f667c8e90b0bf66906992c44748814f13ca26bd7ae4982a4c810ff0b62d4d3898458400008000120d019022d12231a134f7cb67389 +24cbc9df25e44b86b6df35240916cb5d92d039fa092646fefa434cbee6a44885cc5ca4081ea3ced61c3a060240000800811e23109718f578a05310adeeefa4c1 +633405adc018810010000240a00e02204675d0425920000480001000024060d40880188d7a7a3138200004800010000240a00e02204675d04259200004800010 +00024060d40880188d7a7a3138200004800010000240a00e02204675d0425920000480001000024060d40880188d7a7a3138200004800010000240a00e022046 +75d0425920000480001000024060d408d422463ffef8a328ab306aa4303820000480001000024060d40810c721aee3fb6cb82e28724495710003e80074003a00 +1d800e4007c6a20365a488389193188d9a2a62704000080001200004800010f020006204d500024000080001200004804086008811540108000120000480001000022046d00120000480001000024000089808fc0d1ba230eba2ca5bca0000000049454e44ae426082}}{\nonshppict +{\pict\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw15401\pich5530\picwgoal8731\pichgoal3135\wmetafile8\bliptag-1110965009\blipupi95{\*\blipuid bdc804ef0a5456ddb70cd6ce02bece53} +010009000003d4c902000000abc9020000000400000003010800050000000b0200000000050000000c02d2004702030000001e00040000000701040004000000 +07010400abc90200410b2000cc00d100460200000000d1004602000000002800000046020000d100000001001800000000001493050000000000000000000000 +000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffe7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7deffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffe7e7d6ffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffb5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffd6f7ffd6b5b5fffff7ffffffe7ffffa5a5c6a5a5a5b5a5a5fff7d6d6f7ffd6b5b5fffff7d6f7ffd6b5b5fffff7d6f7ffd6b5b5fffff7d6f7ffa5a5b5a5a5 +a5d6b5a5fffff7ffffffffffffd6f7ffb5a5b5fff7d6ffffffffffffe7ffffa5a5c6a5a5a5b5a5a5fff7d6ffffffffffffffffffd6f7ffd6b5b5fffff7d6f7ff +d6b5b5d6f7f7d6b5b5fffff7e7ffffa5a5c6a5a5a5b5a5a5fff7d6ffffffb5d6f7a5a5a5a5a5a5f7d6b5ffffffe7ffffc6a5c6ffffe7ffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffdef7ffd6b5b5fffff7f7ffffa5bddeffe7c6ffffffd6f7ffcea5bdd6f7e7d6b5b5fffff7def7ffd6b5b5 +fffff7d6f7ffdebdbdf7fff7a5b5d6ffe7c6ffffffb5d6f7e7c6a5ffffffffffffb5d6f7a5a5a5f7d6b5fffffff7ffffa5b5d6ffe7c6ffffffd6f7ffc6a5b5ff +ffe7ffffffffffffd6f7ffd6b5b5fffff7d6f7ffd6b5b5d6f7f7debdbdf7fff7a5b5d6ffe7c6ffffffd6f7ffc6a5b5d6f7e7bda5bdfff7d6f7ffffb5b5d6fff7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdbdbdffffffffffffff +ffffffffffd6d6d6dededeffffffffffffffffffffffffffffffbdbdbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7d6f7ffc6a5b5ffffe7ffffffff +ffffffffffd6f7ffd6b5b5fffff7d6f7ffd6b5b5fffff7d6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5fffff7f7ffffb5b5d6d6e7d6d6b5b5ffff +f7d6f7ffc6a5b5ffffe7ffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7d6f7ffd6b5b5d6f7f7d6b5b5d6f7f7c6a5b5ffffe7ffffffffffff +ffffffffffffffffffffffffa5c6e7c6a5a5ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffb5b5b5ffffffffffffffffffd6d6d6c6c6c6c6c6c6e7e7e7ffffffffffffffffffffffffb5b5b5ffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffd6f7 +ffd6b5b5fffff7d6f7ffa5a5b5a5a5a5a5a5a5a5a5a5b5a5a5d6e7d6debdbdfffff7d6f7ffd6b5b5fffff7d6f7ffd6b5b5d6f7f7debdbdfffff7ffffffd6f7ff +debdbdfffff7d6f7ffd6b5b5f7fff7b5b5d6fff7d6d6f7ffa5a5bda5a5a5a5a5a5a5a5a5bda5a5fff7d6ffffffffffffdef7ffd6b5b5fffff7d6f7ffdebdbdd6 +f7f7d6b5b5d6f7f7a5a5bda5a5a5a5a5a5a5a5a5bda5a5f7f7d6a5b5d6a5a5a5f7debdffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffffffffff7f7f7c6c6c6c6c6c6c6c6c6cececeffffffffffffffffffff +ffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffd6f7ffb5a5b5fff7d6f7ffffb5b5d6fff7d6ffffffd6f7ffd6b5b5d6f7f7b5a5b5fff7d6d6f7ffb5a5b5fff7d6d6 +f7ffd6b5b5f7fff7a5b5d6ffe7c6ffffffb5d6f7e7c6a5ffffffa5c6e7f7d6b5ffffffb5d6f7e7c6a5f7ffffb5b5d6fff7d6ffffffd6f7ffd6b5b5fffff7ffff +ffffffffd6f7ffd6b5b5fffff7d6f7ffd6b5b5d6f7f7d6b5b5f7fff7b5b5d6fff7d6ffffffd6f7ffd6b5b5e7fff7c6a5c6ffffe7d6f7ffc6a5b5ffffe7ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7cececebdbd +bdf7f7f7cececec6c6c6e7e7e7ffffffffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffdef7ffc6b5b5a5b5c6c6a5a5def7efa5a5b5a5a5a5b5a5a5fff7 +ded6f7ffc6b5b5a5b5c6a5a5a5e7d6b5a5b5d6a5a5a5f7debdffffffd6f7ffa5a5b5a5a5a5c6a5a5ffffe7d6f7ffbda5bdfff7d6ffffffd6f7ffbda5bdfff7d6 +d6f7ffa5a5b5a5a5a5b5a5a5fff7d6ffffffffffffe7ffffa5a5c6a5a5a5cea5a5d6f7e7d6b5b5d6f7f7debdbdfffff7d6f7ffa5a5b5a5a5a5b5a5a5fff7d6ff +ffffbddef7a5a5a5a5a5a5f7d6b5ffffffe7ffffc6a5c6ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffbdbdbdf7f7f7ffffffefefefe7e7e7ffffffefefefc6c6c6cececeffffffffffffffffffbdbdbdffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffd6f7ffd6b5 +b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7cececebdbdbdefefefffffffffffffb5b5 +b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +efffffc6a5c6ffffe7d6f7ffdebdbdd6f7f7d6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +ffffffe7e7e7c6c6c6cececeffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffa5c6e7a5a5a5ffe7c6ffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffb5b5b5f7f7f7f7f7f7f7f7f7efefeff7f7f7efefeff7f7f7c6c6c6c6c6c6f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffbdbdbdf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7dededecececefffffff7f7f7bdbdbdffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5 +b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7e7b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5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b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5e7e7e7ffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5efefefffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7e7b5 +b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffe7ffffa5a5c6a5a5a5b5a5a5f7f7d6a5b5d6e7c6a5ffffffe7ffff +a5a5c6f7d6b5e7ffffa5a5c6a5a5a5b5a5a5fff7d6ffffffffffffffffffffffffd6f7ffa5a5b5a5a5a5d6b5a5fffff7d6f7ffd6b5b5fffff7ffffffd6f7ffd6 +b5b5fffff7ffffffffffffffffffb5d6f7a5a5a5a5a5a5b5b5a5d6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7b5b5b5a5a5b5a5a5a5d6b5a5ffff +f7ffffffb5d6f7a5a5a5a5a5a5a5a5a5d6b5a5fffff7e7ffffa5a5c6a5a5a5a5a5a5ffe7c6d6f7ffd6b5b5fffff7ffffffb5d6f7b5a5a5fff7d6e7ffffc6a5c6 +ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f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ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7defffffffffffffffffffffffffffffffffffffffffff7ffffa5b5d6ffe7c6ff +ffffdef7ffc6a5b5f7ffe7a5b5d6ffefcea5c6e7f7d6b5f7ffffa5bddeffe7c6ffffffd6f7ffcea5bdffffe7fffffffffffff7ffffa5b5d6ffe7c6ffffffbdde +f7e7c6a5d6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5fffff7ffffffffffffe7ffffcea5ceffffe7ffffffc6e7ffdebda5d6f7f7d6b5b5fffff7ffffffd6f7ff +d6b5b5d6f7f7cea5bdffffe7ffffffb5d6f7efcea5e7ffffc6a5c6ffffe7ffffffc6e7ffd6b5a5f7fff7a5bddeffe7c6ffffffe7ffffbda5ced6e7d6d6b5b5ff +fff7def7ffc6a5b5ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7e7f7f76b84b5737373737373e7b58cf7f7f7cef7f773739c +7373739c6b6bf7f7ceb5def7a5738cf7f7cebde7f79c7384f7f7ceb5def7a5738cb5decea5738cf7f7cebde7f79c7384f7f7ceb5def7a5738cf7f7cea5cef76b +6b6b737373737373a57373b5decea5738cf7f7cef7f7f7b5def7a5738cf7f7cecef7f76b6b9c737373737373a57373f7f7cef7f7f7f7f7f7b5e7f79c6b84bde7 +ce9c7384b5e7ce9c6b84f7f7cef7f7f7b5e7f79c6b84f7f7cedef7f7738cb56b6b6b737373f7ce9cf7f7f7f7f7f7f7f7f7def7f7738cb56b6b6bf7cea5cef7f7 +7373a56b6b6ba57373f7f7cef7f7f7f7f7f7f7f7f7f7f7f7e7f7f76b84b5737373737373e7cea56b84b5bd8c73f7f7dee7f7f76b84b5e7bd8cdef7f7738cb56b +6b6b737373f7ce9cf7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffd6f7ffc6a5b5ffffe7ffffffffffffffffffffffffd6f7ffa5a5b5d6b5a5fffff7d6f7ffc6a5b5ffffe7ffffffffffffffffffffffff +ffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5fffff7ffffffffffffd6f7ffd6b5b5fffff7ffffffd6 +f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5e7fff7b5a5c6fff7d6ffffffd6f7ffd6b5b5d6f7f7d6b5 +b5fffff7ffffffffffffffffffd6f7ffc6a5b5f7ffe7a5b5d6ffe7c6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f79ccef7b5 +8c73f7f7def7f7f784b5deb58c739cc6deb58c73f7f7decef7f7846b9cf7deb584b5def7cea5f7f7f7739ccef7ce9cf7f7f76b9cc6f7ce9c84b5def7cea5f7f7 +f7739ccef7ce9cf7f7f76b9cc6f7ce9c84b5dee7b58cf7f7f7def7f76b84b5e7b58c6b9cc6f7ce9cf7f7f7f7f7f76b9cc6deb58c9ccef7b58c73f7f7decef7f7 +6b6b9ce7b58cf7f7f7f7f7f7f7f7f773a5cef7c69c739ccef7ce9c73a5cef7c69cf7f7f7f7f7f773a5cedeb5849ccef7b5846bf7f7e7f7f7f7739ccece9c6bf7 +f7f7f7f7f7f7f7f76b9ccef7cea5f7f7f79ccef7b5846bf7f7e7c6f7f78c739cf7deb5f7f7f7f7f7f7f7f7f79ccef7b58c73f7f7def7f7f76b9ccecea5739cc6 +f7b58c73b5dedea5738cf7f7c69ccef7b5846bf7f7e7f7f7f7739ccece9c6ba5cef7b5846bf7f7def7f7f78c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f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffd6f7ffa5a5b5a5a5a5a5a5a5a5a5a5b5a5a5fff7dee7ffffa5a5c6e7c6a5ffffffd6 +f7ffa5a5b5a5a5a5a5a5a5a5a5a5b5a5a5fff7d6ffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5def7f7d6b5b5fffff7ffffffdef7ffd6b5b5ffff +f7ffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7debdbdfffff7ffffffd6f7ffdebdbdd6f7f7d6b5b5fffff7ffffffd6f7ffc6a5b5ffffe7 +def7ffa5a5b5a5a5a5a5a5a5debda5d6f7f7d6b5b5fffff7ffffffffffffffffffd6f7ffa5a5bda5a5a5e7c6a5ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5 +b5fffffff7f7f7f7f7f7f7f7f7f7f7f7a5cef7ce9c73f7f7f7f7f7f7f7f7f7f7f7f7a5cef7b5846bf7f7e7f7f7f7a5cef7ce9c6bbde7f7b58484f7f7e7b5def7 +bd8c8cf7f7dea5cef7ce9c6bbde7f7b58484f7f7e7b5def7bd8c8cf7f7dea5cef7ce9c6bbde7f7847384f7e7b5f7f7f7bde7f7b58484a5cee7ce9c6bf7f7f7f7 +f7f7b5e7f7b58484a5cee7ce9c73f7f7f7f7f7f7bde7f7b58484f7f7e7f7f7f7f7f7f79ccef7cea5739ccef7cea5739ccef7cea573f7f7f7f7f7f7b5def7b58c +8c9ccedebd8c73f7f7def7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7a5cef7ce9c73f7f7f79ccef7bd8c73f7f7def7f7f79ccef7cea573f7f7f7f7f7f7f7f7f7 +a5cef7b58473f7f7e7f7f7f7f7f7f7f7f7f7f7f7f79ccef7737373ce9c73f7f7f79ccef7bd8c73f7f7def7f7f7f7f7f7f7f7f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ffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6fffffffffffffffffffffffffffffffffffffffffff7ffffb5b5d6fff7d6ffffffd6f7 +ffd6b5b5fffff7a5c6e7e7d6b5a5b5d6ffe7c6f7ffffb5b5d6fff7d6ffffffd6f7ffd6b5b5fffff7fffffffffffff7ffffa5b5d6ffe7c6ffffffb5d6f7e7c6a5 +d6f7ffa5a5b5ffe7c6ffffffd6f7ffd6b5b5fffff7ffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7a5a5b5ffe7c6ffffffd6f7ffd6b5b5d6 +f7f7b5a5b5fff7d6ffffffb5d6f7e7c6a5ffffffffffffffffffffffffd6f7ffd6b5b5f7fff7a5b5d6ffe7c6ffffffe7ffffb5a5c6d6e7d6d6b5b5e7fff7b5a5 +c6fff7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f76b9cce7373736b6b6b8c7373f7deb5f7f7f7f7f7f7f7f7f7def7f78c8cb5f7deb5f7 +f7f7cef7f7a573a5def7c68c8cb5f7deb5e7f7f78484b5f7deb5cef7f7a573a5def7c68c8cb5f7deb5e7f7f78484b5f7deb5cef7f7a573a5f7f7c6def7f76b84 +b57373736b6b6b8c7373dedeb5a58cb5f7f7c6f7f7f7def7f78c8cb5dedeb58c8cb5f7deb5f7f7f7def7f78c8cb5f7deb5f7f7f7f7f7f7cef7f79c6b9ce7f7ce +8484b5dedeb59c84b5f7f7cef7f7f7def7f78484b5cee7b56b6b9c7373736b6b6b7373736b6b6bf7ce9cf7f7f7f7f7f7c6f7f79c739cf7f7cee7f7f78484b5f7 +deb5f7f7f7cef7f79c6b9cf7f7cef7f7f7f7f7f7c6f7f773739c6b6b6b7373736b6b6b737373f7ce9ce7f7f76b84b5b58c73f7f7decef7f76b6b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ffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffd6f7ffa5a5b5a5a5a5bda5a5fff7d6a5c6e7d6b5a5fffff7d6f7ffa5a5b5ffe7c6def7ffa5a5b5a5a5a5b5a5a5fff7deffffffffffffff +ffffffffffd6f7ffa5a5b5a5a5a5cea5a5ffffe7d6f7ffd6b5b5a5cedea5a5a5a5a5a5ffe7c6ffffffffffffffffffd6f7ffdebdbdfffff7ffffffd6f7ffdebd +bdd6f7f7d6b5b5a5c6d6a5a5a5a5a5a5ffe7c6d6f7ffcebdbda5b5c6a5a5a5c6a5a5ffffefffffffa5c6e7a5a5a5a5a5a5a5a5a5ffe7c6ffffffefffffa5a5c6 +a5a5a5a5a5a5ffefced6f7ffd6b5b5fffff7efffffa5a5c6d6b5a5fffff7efffffc6a5c6ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f79ccef7bd8c +73f7f7def7f7f784b5decea5739ccef7b58c73f7f7decef7f784739cf7e7b584b5debd8c73f7f7de73a5ce9c6b6bf7f7ce739ccef7cea584b5debd8c73f7f7de +73a5ce9c6b6bf7f7ce739ccef7cea5f7f7f7f7f7f7f7f7f7f7f7f76b9ccee7bd8c84b5deb58c73f7f7def7f7f7739ccef7cea59ccef7bd8c73f7f7def7f7f76b +9ccee7bd8cf7f7f7f7f7f7f7f7f78cbde7deb5848cb5e7deb5848cbde7b58473f7f7e7f7f7f773a5cef7ce9ca5cef7ce9c6bf7f7f7f7f7f773a5cedeb584f7f7 +f7f7f7f7f7f7f784b5dee7bd8cf7f7f7a5cef7b5846bf7f7e7cef7f78c73a5f7deb5f7f7f7f7f7f7f7f7f79ccef7cea573f7f7f7f7f7f76b9ccee7bd8cb5def7 +a5738c9ccecebd8c73f7f7dea5c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ff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadffffff +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7b5def773738c6b6b6b737373f7c69cf7f7f79ccef77373736b6b6bb58c73f7f7deb5e7f76b6b847373736b6b6bce +cea56b6b9c737373f7ce9cb5e7f76b6b847373736b6b6bcecea56b6b9c737373f7ce9ccef7f76b6b9c7373736b6b6b737373f7c69cb5def76b6b847373736b6b +6b8c7373f7deb5f7f7f7b5def773738c6b6b6b8c8c73b58484f7f7def7f7f7f7f7f7b5def7b58c8cb5dedea5738cb5dec673738c6b6b6b737373846b6bf7deb5 +f7f7f7a5cef76b6b6b7373739c6b6bf7f7cef7f7f7f7f7f7b5def773738c6b6b6bb58c73f7f7dea5cef76b6b6b737373b5846bf7f7e7f7f7f7f7f7f7f7f7f7f7 +f7f79cc6f77373736b6b6ba57373f7f7c6739cceb5846bf7f7e79cc6f7737373f7ce9ca5cef76b6b6b7373739c6b6bf7f7cef7f7f7b5def76b6b847373736b6b +6bf7ce9cb5def7a5738cf7f7c6f7f7f7b5def773738c6b6b6b737373b5846bf7f7e79cc6f77373736b6b6ba57373f7f7c6f7f7f7f7f7f7f7f7f7b5def78c8c8c +6b6b84737373846b6bf7deb5f7f7f7a5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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffdebdbdfffff7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7def7f78c8cb5f7deb5f7f7f7f7f7f7e7f7f78484b5f7e7bdf7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7def7f78c8cb5f7deb5f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7e7f7f78484b5f7e7bdf7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7e7f7f78484b5f7e7bdf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f784b5 +dee7b58cf7f7f7f7f7f7f7f7f78cb5e7deb584739ccece9c6bf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f784b5decea573f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f78cb5e7c69c6bf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f78cb5e7deb584f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7bde7f79c7384f7f7cef7f7f7f7f7f7b5def7a5738cf7f7cef7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7b5def7a5738cf7 +f7cef7f7f7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f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5 +b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffb5b5b5e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffefefefb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffdededeb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5e7e7e7ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7 +e7b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b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5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffb5b5b5efefefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7e7b5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadffffff +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffd6f7ffa5a5b5a5a5a5b5b5a5d6b5b5fffff7e7ffffa5a5c6a5a5a5b5a5a5fff7d6d6f7ffd6b5b5fffff7ffffffb5d6f7a5a5a5a5a5a5a5a5a5d6b5 +a5fffff7b5d6f7a5a5a5a5a5a5b5b5a5d6b5b5d6f7f7d6b5b5e7fff7a5a5c6c6a5a5ffffe7ffffffffffffffffffe7ffffa5a5c6a5a5a5b5a5a5f7f7d6a5b5d6 +e7c6a5ffffffe7ffffa5a5c6d6d6b5a5a5c6c6a5a5d6f7e7d6b5b5fffff7ffffffb5d6f7a5a5a5a5a5a5a5a5a5d6b5a5fffff7e7ffffa5a5c6a5a5a5a5a5a5ff +e7c6e7ffffa5a5c6c6a5a5ffffe7ffffffffffffffffffd6f7ffa5a5b5a5a5a5b5b5a5d6b5b5d6f7f7d6b5b5d6f7f7d6b5b5fffff7ffffffe7ffffc6a5c6ffff +e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7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7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +defffffffffffffffffffffffffffffffffffffffffff7ffffa5b5d6ffe7c6ffffffbddef7d6b5a5f7fff7a5b5d6ffefceffffffd6f7ffc6a5b5def7efd6b5b5 +fffff7e7ffffcea5ceffffe7ffffffc6e7ffdebda5e7fff7c6a5c6ffffe7ffffffc6e7ffd6b5a5d6f7f7debdbdd6f7f7d6b5b5fffff7fffffffffffffffffff7 +ffffa5bddeffe7c6ffffffd6f7ffcea5bdf7ffe7a5b5d6ffe7c6a5ceeff7d6b5d6f7ffd6b5b5fffff7d6f7ffd6b5b5fffff7efffffc6a5c6ffffe7ffffffceef +ffd6b5a5f7fff7a5b5d6ffefceffffffe7ffffb5a5c6deefded6b5b5fffff7fffffffffffffffffff7ffffa5b5d6ffefceffffffb5d6f7d6b5a5def7f7d6b5b5 +d6f7f7d6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7 +f7f7f7f7f7f7f7f7cef7f76b6b9c737373737373a57373f7f7cee7f7f77384b57373736b6b6bf7cea5b5def7a5738cf7f7cef7f7f79ccef77373736b6b6b7373 +739c7373f7f7ce9ccef77373737373737373739c6b6bbde7ce9c7384e7f7ce6b84b5737373f7ce9cf7f7f7f7f7f7f7f7f7def7f7738cb56b6b6b737373dece9c +738cb5b5846bf7f7e7def7f7738cb5ceb584738cbd737373b5b5a59c6b84f7f7cef7f7f7a5cef76b6b6b737373737373a57373f7f7cee7f7f77384b57373736b +6b6be7bd8cdef7f7738cb56b6b6bf7cea5f7f7f7f7f7f7f7f7f7cef7f773739c7373736b6b6ba57373b5decea5738cb5decea5738cf7f7cef7f7f7def7f7738c +bd737373737373f7ce9cf7f7f7def7f7738cb56b6b6b737373deb584e7f7f76b84b5737373f7ce9ccef7f76b6b9c7373739c7373f7f7ceb5def7a5738cf7f7ce +f7f7f7f7f7f78cbde7ce9c73f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7c6 +a5b5ffffe7ffffffffffffffffffd6f7ffd6b5b5fffff7e7ffffb5a5c6fff7d6ffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7d6b5 +b5d6f7f7d6b5b5fffff7ffffffffffffffffffd6f7ffc6a5b5ffffe7ffffffffffffffffffffffffd6f7ffa5a5b5d6b5a5fffff7d6f7ffd6b5b5fffff7d6f7ff +d6b5b5fffff7e7ffffb5a5c6fff7d6ffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffd6f7ffd6 +b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7d6b5b5d6f7f7d6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f79ccef7b58c73f7f7decef7f76b6b9ce7b58c9cc6f7b58c73f7f7def7f7f76b9cc6ce9c73 +6b9ccef7cea5f7f7f78cb5dedeb584f7f7f7def7f7738cb5deb5848cb5e7deb584f7f7f7f7f7f773a5cedeb584739ccef7ce9c73a5cef7c69cf7f7f7f7f7f7f7 +f7f7f7f7f79ccef7b5846bf7f7e7f7f7f7739ccece9c6ba5cef7b5846bb5dede9c6b84f7f7ce6b9cc6f7ce9cf7f7f78cb5e7f7c69cf7f7f784b5dee7b58cf7f7 +f7def7f76b84b5e7b58c9cc6f7b58c73f7f7def7f7f784b5deb58c736b9cb5f7cea5f7f7f7f7f7f7f7f7f7f7f7f79cc6f7b58c73f7f7decef7f76b6b9cdeb58c +6b9ccef7cea584b5def7ce9cf7f7f7a5cef7b5846bf7f7def7f7f773a5cec69c6b9ccef7b5846bf7f7e7f7f7f78cb5deb5846b73a5b5f7c69cf7f7f79ccef7b5 +8c73f7f7decef7f7846b9cf7e7b584b5def7ce9cf7f7f7f7f7f784b5de737373f7ce9cf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffd6f7 +ffd6b5b5fffff7ffffffd6f7ffd6b5b5def7f7a5a5b5a5a5a5a5a5a5a5a5a5b5a5a5d6e7d6d6b5b5fffff7ffffffd6f7ffa5a5b5a5a5a5a5a5a5d6b5a5d6f7f7 +debdbdfffff7ffffffd6f7ffdebdbdd6f7f7d6b5b5d6f7f7debdbdfffff7ffffffffffffffffffd6f7ffa5a5b5a5a5a5a5a5a5a5a5a5b5a5a5fff7d6efffffa5 +a5c6e7c6a5ffffffdef7ffd6b5b5fffff7d6f7ffdebdbdfffff7ffffffd6f7ffa5a5bda5a5a5a5a5a5d6b5a5def7f7d6b5b5fffff7ffffffffffffffffffd6f7 +ffd6b5b5fffff7ffffffffffffffffffdef7ffd6b5b5fffff7ffffffdef7ffd6b5b5d6f7f7d6b5b5def7f7d6b5b5fffff7ffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7a5cef7ce9c73f7f7f7f7f7f7bde7f7b5 +8484a5cee7b5846bf7f7e7f7f7f7f7f7f7f7f7f7a5cef7ce9c73f7f7f7b5def78c738cf7deb5f7f7f7b5def7bd8c8c9ccedecea573f7f7f7f7f7f7b5def7b58c +8c9ccedecea5739ccef7cea573f7f7f7f7f7f7f7f7f7f7f7f79ccef7bd8c73f7f7def7f7f7f7f7f7f7f7f7f7f7f7a5cef76b6b6bcea573f7f7f7a5cef7ce9c6b +f7f7f7b5def7b58c8cf7f7debde7f7847384f7e7b5f7f7f7bde7f7b58484a5cee7ce9c6bf7f7f7f7f7f7f7f7f7f7f7f7a5cef7ce9c73f7f7f7f7f7f7f7f7f7f7 +f7f7a5cef7ce9c6bf7f7f7f7f7f7b5e7f7b58484a5cee7ce9c73b5e7f7b58484f7f7e79ccef7b58c73f7f7def7f7f7f7f7f7f7f7f79ccef7cea573f7f7f7f7f7 +f7f7f7f7f7f7f79ccef7cea573f7f7f7a5cef7b58473f7f7e7f7f7f7a5cef7ce9c73b5e7f7b58484f7f7e7f7f7f78cb5e7ceb584a58cbdf7f7cef7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +fffffffffffffffffffffffffffffffffffff7ffffa5b5d6ffe7c6ffffffc6e7ffd6b5a5f7fff7b5b5d6fff7d6ffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ff +ffffffffffffffffffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7d6b5b5d6f7f7d6b5b5fffff7fffffffffffffffffff7ffffb5b5 +d6fff7d6ffffffd6f7ffd6b5b5fffff7a5c6e7e7d6b5a5b5d6ffe7c6d6f7ffd6b5b5fffff7d6f7ffb5a5b5fff7d6ffffffffffffffffffffffffd6f7ffd6b5b5 +f7fff7a5b5d6ffe7c6ffffffe7ffffb5a5c6d6e7d6d6b5b5fffff7fffffffffffffffffff7ffffa5b5d6ffe7c6ffffffc6e7ffd6b5a5d6f7f7d6b5b5d6f7f7b5 +a5b5fff7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f76b9c +ce737373846b6b8c8c8cf7deb5f7f7f7def7f78c8cb5cedeb57373a56b6b6b7373736b6b6b737373c6c69c9c739cf7f7cef7f7f7def7f7738cb56b6b6b737373 +846b6bcedeb59c6b9cf7f7cef7f7f7def7f78484b5cee7b59c6b9ccef7ce9c6b9cf7f7cef7f7f7f7f7f7f7f7f7cef7f76b6b9c7373736b6b6b7373736b6b6bf7 +ce9cdef7f7738cb5b5846bf7f7decef7f7a573a5f7f7c6def7f78484b5f7e7b5f7f7f7def7f76b84b57373736b6b6b8c7373cedeb58c73a5f7deb5f7f7f7f7f7 +f7f7f7f7c6f7f79c739cf7f7cef7f7f7f7f7f7f7f7f7def7f78c8cb5f7deb5f7f7f7def7f78c8cb5dedeb58c8cb5dedeb58c8cb5f7deb5cef7f76b6b9c737373 +6b6b6b7373736b6b6bcecea5846b9cf7deb5f7f7f7f7f7f7f7f7f7cef7f79c6b9cf7f7cedef7f78c8cb5f7deb5f7f7f7c6f7f79c739cdef7ce8c8cb5f7deb5f7 +f7f784b5dee7b58cb5def7b58c8cf7f7de73a5ce6b6b6b9c7373f7f7cef7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5 +b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffa5a5b5a5a5a5a5a5a5d6b5a5fffff7d6f7ffa5a5 +bda5a5a5b5a5a5e7f7d6a5a5cea5a5a5c6a5a5ffffe7a5ceefa5a5a5a5a5a5a5a5a5ffefced6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7cebdbda5b5c6 +a5a5a5d6b5a5fffff7ffffffffffffffffffdef7ffa5a5b5a5a5a5b5a5a5fff7dea5c6e7d6b5a5fffff7def7ffa5a5b5a5a5a5a5a5a5debda5d6f7f7c6b5b5a5 +b5c6cea5a5a5c6c6a5a5a5a5a5a5a5a5a5ffe7c6ffffffe7ffffa5a5cea5a5a5a5a5a5f7e7c6a5bddea5a5a5d6b5a5fffff7ffffffffffffffffffd6f7ffa5a5 +bda5a5a5a5a5a5d6b5a5def7f7d6b5b5d6f7f7c6b5b5a5bdcec6a5a5e7ffe7c6a5c6ffffefffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f79ccef7bd8c73f7f7def7f7f76b9ccee7bd8c9ccef7cea573f7f7f7f7f7f7739ccee7b58c84 +b5dee7bd8cf7f7f7f7f7f7f7f7f7f7f7f7f7f7f773a5cedeb5848cbde7deb584f7f7f7f7f7f78cbde7deb5848cb5e7deb5848cbde7deb584f7f7f7f7f7f7f7f7 +f7f7f7f7a5cef7ce9c6bf7f7f7f7f7f773a5cedeb584bde7f79c7384a5ceceb5846bf7f7e784b5dee7b58cf7f7f78cbde7ce9c73f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f76b9ccee7bd8c9ccef7b58c73f7f7def7f7f784b5decea57384b5dee7bd8cf7f7f7f7f7f7f7f7f7f7f7f79ccef7b58c73f7f7def7f7f7739ccee7b58c84 +b5dee7bd8c84b5decea573f7f7f7a5cef7ce9c73f7f7f7f7f7f773a5cedeb584a5cef7b5846bf7f7e7f7f7f78cb5e7ce9c6b8cbde7deb584f7f7f79ccef7bd8c +73f7f7decef7f7846b9cf7e7bd84b5decea573f7f7f78cbde7deb584f7f7f784b5dee7bd8cf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5 +fffff7ffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7b5def773738c6b6b6b8c8c73b584 +84f7f7de9ccef77373736b6b6b9c73739ccece7373736b6b6b9c7373cef7ce7373a56b6b6b7373736b6b6bf7cea5b5def79c738cf7f7cef7f7f7b5def79c738c +b5dece73738c6b6b6b737373b5846bf7f7e7f7f7f7f7f7f7f7f7f7a5cef76b6b6b7373739c6b6bf7f7ce6b9cc6b58c73f7f7dea5cef76b6b6b7373736b6b6bb5 +8c73b5dede73738c6b6b6b7373736b6b6b7373736b6b6b737373f7c69cf7f7f7b5def773738c6b6b6b737373b5b59c73738c6b6b6bb58c73f7f7def7f7f7f7f7 +f7f7f7f7b5def773738c6b6b6b8c8c73b58484b5e7e79c6b84b5dece6b6b847373739c6b6b9ccece6b6b6b7373739c6b6bf7f7cef7f7f7b5e7f76b6b84737373 +6b6b6bb5b5a56b6b84737373b5846bf7f7e79cc6f77373736b6b6bb58c73f7f7deb5def76b6b847373736b6b6bdeb58cf7f7f7e7f7f76b84b5ce9c73f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffe7ffffc6a5c6ffffefffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5d6f7f7debdbdfffff7ffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffdef7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffdef7ffd6b5b5d6f7f7d6b5b5fffff7ffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7def7f78c8cb5f7deb5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7def7f78c8cb5f7deb5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7e7f7f78484b5e7e7b58484b5f7e7bdf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7def7f78c8cbdf7deb5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7def7f78c8cb5f7deb5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7def7f78c8cbdf7deb5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7e7f7f78484b5f7e7bdf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffff +ffffffffffffffffffa5c6e7a5a5a5ffe7c6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +d6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f784b5dee7b58cf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f784b5 +dee7b58cf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f78cb5dedeb5848cb5e7c69c6bf7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f784b5dece9c73f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f784b5decea573f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f784b5dedeb58c6b9c +cecea573f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f78cb5e7c69c6bf7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7bde7f79c7384 +f7f7cef7f7f7f7f7f7f7f7f7f7f7f7f7f7f7e7f7f77384b5737373f7ce9cf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7b5 +def7a5738cf7f7cef7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7b5e7f79c6b84f7f7cef7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f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7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5 +b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7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f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7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f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5e7e7e7ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefefb5b5b5ffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdededeb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5 +b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5 +b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adad +adb5b5b5b5b5b5e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7effff7f7ffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7f7f7efffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefef +e7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffe7dee7fff7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffbdffff000063000000000000ffbd6bffffff94deff000039000000 +943900ffffde94deff943939ffffde94deff943939ffffe794deff94393994dede943939ffffde94deff943939ffffe794deff943939ffffdebdffff00006300 +0000390000ffe79494deff943939ffffdeffffff94deff943939b5ffde00006b630000ffffbdb5ffff6b006bffffb5ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefffffe7c6ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffe7ffff003994ffbd6bff +ffffbdffff39006be7e794003994ffbd6bffffff4294e7bd6b0094e7ff943939ffffe794deff944242ffffde94e7ff94393994e7e7943939ffffe794deff9442 +42ffffde94e7ff943939e7ffe7003994ffbd6bffffff94e7ff6b003994e7bd943939ffffe7ffffff94e7ff94393994e7e7943939ffffe7ffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffe7dee7decec6e7d6c6ded6c6efe7d6efcecefffff7e7d6de +e7ded6decec6efd6c6ffffeffffffffffffffffffff7ffffefd6d6ffffeff7ffffefd6cef7fff7efcecefffff7ffffffe7dee7decec6e7d6c6fff7deffffffff +ffffffffffffffffffffffded6e7e7d6c6ded6c6ffefd6ffffffffffffded6dee7d6c6efcec6fffff7f7ffffefd6d6ffffeff7ffffefd6cefffff7efffffefd6 +d6f7ffefefd6d6ffffeff7ffffefd6cefffff7efffffefd6d6ffffefffffffded6e7e7d6c6ded6c6fff7deefffffefd6d6ffffefffffffefffffefd6d6ffffef +e7dee7decec6fff7deffffffffffffefffffefd6d6ffffefffffffefffffefd6d6ffffefffffffded6e7e7d6c6ded6c6fff7deefffffefd6d6ffffefffffffff +ffffe7dee7ded6c6e7d6c6fff7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffff94deff943939ffffdeffffffffffffffffff94deff943939ffffdeffffff94deff94393994dede943939ffffde94e7ff943939ffffde +94deff94393994dede943939ffffde94e7ff943939ffffde94deff94393994dede6b0039ffffb5ffffffffffffffffff94deff943939ffffdeffffff94deff94 +393994dede943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7fffffffffffffffffffffffffffffff7ffffe7 +d6defff7e7ffffffffffffe7e7efffefd6dee7efffefcefffffff7ffffe7d6deffffe7ffffffffffffffffffdedeeffff7deffffffdee7efffefd6e7e7efffef +d6eff7ffefd6c6ffffffffffffdee7eff7dec6ffffffffffffffffffefeffff7dec6fffff7ffffffe7eff7f7dec6e7eff7f7dec6fffff7ffffffe7ced6ffffe7 +e7eff7fff7deffffffdee7efffefd6ffffffdedeeffff7dee7eff7fff7deffffffdee7efffefd6ffffffdedeeffff7deefeffff7dec6fffff7ffffffdedeefff +e7c6dedeeffff7deffffffffffffdedeefffefcededeeffff7deffffffffffffffffffffffffdedeeffff7deffffffffffffdedeefffefceefeffff7dec6ffff +f7ffffffdedeefffe7c6e7e7f7fff7deffffffeff7ffefd6bdffffffffffffe7e7eff7debdffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffff94e7ff943939ffffe7ffffff94e7ff94 +393994e7e7943939ffffe794deff944242ffffde94e7ff94393994e7e7943939ffffe794deff944242ffffde94e7ff94393994e7e70000390000000000000000 +0039000094bd94943939ffffe7ffffff94e7ff94393994e7e7943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ef +effffffffffffffffffffffffffffffffffffff7ffffe7d6deffffe7ffffffeff7ffffe7c6eff7ffffe7c6ffffffffffffeff7ffffe7c6ffffffffffffffffff +eff7fff7e7c6ffffffeff7ffffe7c6eff7ffffe7c6eff7fff7dec6fffff7ffffffffffffffffffffffffffffffffffffeff7fff7e7c6ffffffffffffffffffff +ffffeff7ffefd6c6ffffffffffffeff7fff7e7c6f7fffff7deceffffffeffffff7ded6fffff7eff7fff7e7c6f7fffff7deceffffffeffffff7ded6fffff7eff7 +fff7e7c6eff7fff7dec6ffffffffffffffffffffffffeff7fff7e7c6fffffffffffff7ffffefd6ceeff7fff7e7c6ffffffffffffffffffffffffeff7fff7e7c6 +fffffffffffff7ffffefd6ceeff7fff7dec6fffffffffffffffffffffffff7ffffefd6ceffffffeff7fff7dec6fffff7ffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffdeffff003994ffb563ffffffb5ff +ff39006bdede94003994ffb563ffffff3994debd6b0094deff390039ffde9494deff390039ffe79494deff94393994dede390039ffde9494deff390039ffe794 +94deff943939deffde393994ffde94ffffff94deff94393994dede000039ffb563ffffff94deff94393994dede943939ffffdeffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffdedeefe7d6c6e7cebdffffeff7ffffe7d6defff7e7ffffffe7d6e7ffffe7e7ced6ff +ffe7ffffffffffffe7d6e7ffffe7fffffffffffff7ffffefd6deffffefffffffe7d6e7f7ffe7efced6ffffefdeced6ded6c6decec6e7d6c6decebdfff7deffff +fffffffff7ffffe7d6deffffe7ffffffffffffffffffffffffe7dee7fff7e7fffffff7ffffefd6deffffefe7dee7ffffe7ffffffe7d6e7ffffe7f7ffffefd6de +ffffefe7dee7ffffe7ffffffe7d6e7ffffe7f7ffffefd6def7ffefded6dedecec6e7d6c6decebdded6c6ffefd6efdee7ffffefffffffffffffe7dee7f7f7e7ef +d6deffffeffffffffffffffffffff7ffffefd6deffffefffffffffffffe7dee7f7f7e7ded6dedecec6e7d6c6decebdded6c6ffefd6e7dee7fff7e7f7ffffdece +d6e7d6c6decebdded6c6decec6fff7dededeefded6c6efcec6ffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffbdffff00006b000000000000ffbd6bffffff94deff0000420000006b0000ffffbd94e7ff6b393900426b000000bd9442003994000000de +943994e7ff6b393900426b000000bd9442003994000000de9439ffffff94deff000042000000420000ffde9494e7ff943939006b94000000000000debd6b0042 +94000000944200ffffdebdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffff +fff7ffffe7d6deffffe7efefffffefcee7effff7e7c6fffffff7ffffe7d6deffffe7ffffffffffffffffffe7eff7ffefd6ffffffe7efffffefceefefffffefce +eff7fff7e7c6ffffffffffffe7e7f7ffefceffffffffffffffffffeff7fff7dec6fffff7ffffffe7eff7ffe7c6eff7fff7dec6fffff7ffffffe7d6deffffe7e7 +eff7f7dec6fffff7e7e7f7efcec6fffff7dee7effff7dee7eff7f7dec6fffff7e7e7f7efcec6fffff7dee7effff7deeff7ffffe7c6ffffffffffffdee7efffef +d6e7eff7f7dec6fffff7ffffffdee7effff7dee7eff7ffefd6ffffffffffffffffffffffffe7eff7efd6c6ffffefffffffdee7effff7deeff7ffffe7c6ffffff +ffffffdee7efffefd6e7eff7ffe7c6ffffffeff7fff7e7c6ffffffffffffe7e7f7ffefceffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffff +ffffffffffffffffffffffffffffffffffffded6e7ded6c6decec6efd6c6eff7efefd6ceefffefe7d6cedecebdded6c6efd6c6ffffffffffffffffffefefffe7 +d6c6decebdefd6c6efffefefd6ceeff7eff7decefffff7eff7ffdecebdded6c6efcec6ffffefffffffffffffffffffffffffeff7ffded6cedecec6e7d6c6ffef +d6ffffffefefffe7d6c6decebdf7dec6fffff7f7ffffdececeded6c6decec6fff7dedeced6ded6c6ffefd6f7ffffdececeded6c6decec6fff7dedeced6ded6c6 +ffefd6ffffffe7efffded6c6decec6efd6c6ffffeff7ffffdececee7d6c6decebde7d6c6efefe7e7d6cedecebdf7dec6fffff7fffffffffffff7ffffe7d6cee7 +d6cedecebde7d6c6ffffe7ffffffe7efffded6c6decec6efd6c6ffffeff7ffffdececee7d6c6e7cebdeff7efdecec6e7d6c6e7cebdffffefffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffe7dee7ffffe7ffffffffffffffffffe7d6e7ffffe7ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7de +e7ffffe7ffffffffffffffffffffffffefdee7ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffe7e7eff7debdffffffffffffffffffffffffffffffffffffffffffffffffffffffe7eff7ffefceffffffdee7eff7dec6e7efffffe7ceff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffe7eff7ffe7c6ffffffffffffffffffffffffe7e7f7ffefceffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffdedee7e7d6c6fff7d6fffffff7ffffefd6d6ffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ffffefceceffff +f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffef +e7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efeff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffff7f7efefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7dec6c6bdb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbd +b5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbd +b5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbd +b5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbd +b5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbd +b5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbd +b5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5ad +adb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5ad +b5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adc6bdbde7e7e7ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7effff7f7ffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7 +f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7 +efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7ef +eff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffefe7e7f7f7efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffff7efefefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdededeb5 +b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5 +b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5 +adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5 +b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5 +b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5b5b5b5adadadb5b5b5b5b5b5e7e7e7ffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe7f7efefffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefefe7e7ffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffb5b5b5e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefefefb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff00006b000000000000420000ffde94ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +63b5ffbd6b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffff94e7ff +943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffbdffff630063ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff630063ff +ffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffff +ffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff94 +3939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffefefe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7 +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffbdffff00006b000000420000ffde9494e7ff943939ffffe7ffffff94e7ff943939ffffe7bdffff +00006b000000000000ffbd6bffffff94deff000042000000944200ffffdeffffff94deff00004200000042420094393994e7e794393994e7e7943939ffffe7ff +ffff94e7ff943939ffffe794deff000042000000000000943900ffffe7bdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffff +ffffffffffffffffffffffffffffffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffff3994deffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff6bbdffbd6b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdef7ffb5b5b5a5a5b5a5a5a5debd +a5fffff7ffffffb5d6f7a5a5a5a5a5a5a5a5a5d6b5a5fffff7b5d6f7a5a5a5a5a5a5f7debdffffffb5d6f7a5a5a5a5a5a5f7d6b5fffffff7ffffa5bddeffe7c6 +ffffffc6e7ffefcea5ffffffffffffd6f7ffa5a5bda5a5a5d6b5a5fffff7def7ffd6b5b5fffff7ffffffdef7ffa5a5b5a5a5a5b5b5a5debdbdfffff7e7ffffc6 +a5c6ffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5 +b5b5bdbdbdb5b5b5b5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffff4294e7000000000000de943994e7ff393939000042000000944200ffffde94e7ff94393994e7e7943939bdffe700006b6b0000ffffbdbdffff6b006b +ffffbdffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffdeffff003994ffb563ffffff94deff6b003994deb594 +3939ffffdeffffff94deff943939deffde003994ffb563ffffffb5ffff39006bdede94003994ffb563ffffff3994debd6b00deffff003994ffb563ffffff3994 +de94390094dede94393994dede943939ffffdeffffff94deff943939deffde003994ffb563ffffff94deff943939ffffdeffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffefe7e7ffffffffffff00399400000000000039000094bd9494393994dede393939000039000000943900ffffdeffffffffffffffffff +ffffff94e7ff000039000000393900943939ffffdebdffff000063000000390000ffde9494deff943939ffffdeffffff3994de000000000000000000943900ff +ffe73994de00000000000039390094393994dede943939bdffe70000636b0000ffffb5ffffffffffffffffffb5ffff6b006bffffb594deff943939ffffe794de +ff000039000000000000000000ffbd6bffffff94e7ff943939ffffdeffffffffffffffffff94deff943939ffffe7ffffffffffffffffff3994e7de9439ffffff +ffffff006bbd000000000000de9439ffffffffffff6bbdffb56300ffffffffffffffffffdeffff6b3994ffffb5ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffd6f7ffc6a5b5ffffe7ffffffb5d6f7e7c6a5e7ffffc6a5c6ffffe7ffffffc6e7ffd6b5a5d6f7f7b5a5b5fff7d6f7ffffb5b5d6d6e7d6b5a5b5ff +f7d6f7ffffb5b5d6fff7d6e7ffffa5a5c6f7d6b5ffffffa5c6e7c6a5a5ffffe7f7ffffa5b5d6ffe7c6ffffffb5d6f7e7c6a5d6f7ffd6b5b5fffff7f7ffffa5b5 +d6ffe7c6ffffffb5d6f7d6b5a5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5ffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffff94deff390039ffe794deffff39399494b5946b0039ffffb5ffffff3994debd6b0094deff94393994dede94 +393994dede943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffff94deff943939ffff +deffffff94deff943939ffffde94deff000039000000943900ffffde94deff943939ffffdeffffff94deff943939ffffdebdffff000063000000390000ffde94 +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7 +ff6b0039ffffbdffffffffffffffffff94e7ff943939ffffe7ffffff94e7ff94393994e7e7943939ffffe7ffffffffffffffffff94e7ff943939ffffe7ffffff +94e7ff94393994e7e7943939ffffe7ffffff94e7ff94393994e7e794393994e7e7943939ffffe7ffffff94e7ff94393994e7e7943939ffffe7ffffff94e7ff94 +3939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff3994debd6b00ffffffffffff94deff94424294dede6b0042ff +ffbdffffff3994debd6b00ffffffffffffffffffe7ffff003994ffbd6bffffff4294e7943900e7ffe7003994ffbd6bffffff94e7ff6b003994e7bd943939ffff +e7bdffff6b006bffffbdffffff6bbdff944200bdffde6b006bffffbdffffff6bbdff94420094dede94424294dede944242ffffdeffffffffffffffffffffffff +6bbdffbd6b00ffffff94deff944242ffffde94e7ff6b0039ffffbdffffff94e7ff6b0039ffffbd94deff944242ffffde94e7ff6b0039ffffbd94deff944242ff +ffdeffffffffffffffffff3994dee79442ffffff4294e7bd6b00ffffffdeffff004294ffbd6bffffffdeffff424294ffde94ffffffffffffffffff006bbdffbd +6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffff000000ffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5effff7b5a5c6fff7d6ffffffdef7ffd6b5b5ffff +f7ffffffffffffa5c6e7c6a5a5ffffe7ffffffffffffa5c6e7c6a5a5ffffefc6e7ffd6d6b5d6b5c6effff7d6b5c6b5d6e7ffe7c6def7ffd6b5b5fffff7ffffff +def7ffd6b5b5d6f7f7d6b5b5fffff7d6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5 +ffffffffffffffffffffffffbdbdbdffffffffffffffffffffffffd6d6d6dededeffffffffffffffffffffffffffffffbdbdbdffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006bbd6b000094e7bd943939ffff +e7ffffff94e7ff94393994e7e794393994e7e794393994e7e7943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7 +ffffffffffffffffffffffff94e7ff943939ffffe7ffffff94e7ff943939e7ffe7003994ffbd6bffffff4294e7bd6b0094e7ff943939ffffe7ffffff94e7ff94 +3939e7ffe7003994ffbd6bffffff94e7ff6b0039ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffefe7deffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffff94deff00003900000000000000000039000094b594943939ffffdeffffff94deff94393994dede943939ffffdeff +ffffffffffffffff94deff943939ffffdeffffff94deff94393994dede943939ffffdeffffff94deff94393994dede94393994dede943939ffffdeffffff94de +ff94393994dede943939ffffdeffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffdeffff0039 +94ffbd6bffffff94deff94393994e7e7943939ffffdeffffff94e7ff943939ffffdeffffffffffff94deff943939ffffdeffffff94deff94393994dede6b0039 +ffffb5ffffffffffffffffff94deff943939ffffdebdffff390063ffde94ffffff94e7ff94393994dede943939ffffe7ffffff94deff94393994e7e794393994 +dede943939ffffe7ffffffffffffffffffffffff3994dede9439ffffff94e7ff943939ffffde94deff6b0039ffffb5ffffffdeffff393994ffde9494deff9439 +39ffffe73994de393939ffb56394e7ff943939deffde003994000000000000000000000000e79439ffffffffffffffffffffffff3994dede9439ffffffffffff +3994dede9439ffffffffffffffffff3994dede9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffd6f7ffc6a5b5 +ffffe7d6f7ffa5a5b5a5a5a5a5a5a5d6b5a5f7fff7a5b5d6a5a5a5f7d6b5fffffff7ffffa5b5d6a5a5a5f7d6b5ffffffffffffa5c6e7ffe7c6b5c6e7d6e7d6e7 +c6b5c6e7fff7d6b5d6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5d6f7f7d6b5b5fffff7d6f7ffd6b5b5fffff7ffffffd6f7ffd6b5b5fffff7ffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5ffffffffffffffffffd6d6d6c6c6c6c6c6c6e7e7e7ffffffffffffffff +ffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffff +003994000000de9439ffffff94deff943939ffffdeffffff94deff6b003994deb594393994dede94393994dede943939ffffdeffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffefefe7ffffffffffffffffffffffff94deff943939ffffdeffffff94deff94393994dede943939ffffdeffffff94de +ff94393994dede943939ffffdeffffff94deff94393994dede6b0039ffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffff +ffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffe7ffff393994ffe794ffffff94e7ff94393994e7e7000039ffbd +6bffffff94e7ff943939e7ffe7003994ffbd6bffffffbdffff39006be7e794003994ffbd6bffffff4294e7bd6b00e7ffff003994ffbd6bffffff6bbdff943900 +94e7e794393994e7e7000039ffbd6bffffff94e7ff943939e7ffe7003994ffbd6bffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efefffffffffffffffffff94e7ff6b0039ffffbd94deff94424294dede944242ffffdeffffff94deff6b0042ffffbdffffffffffff94e7ff94 +3939ffffe7ffffff94e7ff94393994e7e700003900000000000000000039000094bd94943939ffffe7ffffff94e7ff00003900000000000094420094dede9442 +42ffffdeffffff94deff94424294dede94424294dede944242ffffdeffffffffffffffffffffffff4294e7de9439ffffff94deff944242ffffde94e7ff6b0039 +ffffbdffffffbdffff6b006bffffbd94deff944242deffde6b42946bbdbdbd6b0094deff944242ffffde4294e7de9439ffffff3994dee79442ffffffffffffff +ffffffffffdeffff004294ffbd6bffffffffffffbdffff6b006bffffbdffffffffffff3994dee79442ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000ffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffdef7ffb5a5b5fff7d6ffffffbddef7e7c6a5ffffffffffffffffffffffffd6f7ffd6b5b5effff7c6a5c6ffffe7d6f7ffcea5bde7ffe7c6a5c6ffffe7def7 +ffc6a5b5f7ffe7b5b5d6fff7dec6e7ffa5a5a5ffe7c6def7ffd6b5b5f7fff7a5b5d6ffefceffffffb5d6f7e7c6a5def7ffb5a5b5fff7d6f7ffffa5bddeffe7c6 +ffffffc6e7ffdebda5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5fffffffffffff7f7f7 +c6c6c6c6c6c6c6c6c6cececeffffffffffffffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffbdffff6b006bffffbd94e7ff6b003994e7bd390039ffe794ffffff4294e7bd6b0094e7ff94393994e7e794393994e7 +e7943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff006bbd000000424200943939ffffe7ffffff +94e7ff94393994e7e7943939ffffe7ffffff94e7ff94393994e7e7943939ffffe7ffffff94e7ff94393994e7e7000039000000000000000000390000ffe79400 +6bbd000000bd6b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffff000000000000000000000000000000ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffff94deff +000039000000390000ffde9494deff943939006394000000000000ffbd6bffffffbdffff000063000000000000ffbd6bffffff94e7ff000039000000630000ff +ffbdffffff94deff00003900000000000094390094dede94393994dede943939006394000000000000ffbd6bffffff94e7ff000039000000000000943900ffff +debdffff630063ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffff3994deb5630094e7ff94393994dede390039ffe794ffff +ff3994deb56300ffffffffffffffffffdeffff003994ffb563ffffff63b5ff943900deffde393994ffde94ffffff94deff94393994dede943939ffffdeffffff +ffffffffffffffffff94deff94393994e7e7943939ffffdeffffff94e7ff94393994dede94393994e7e7943939ffffdeffffffffffffffffffffffff3994dee7 +9439ffffff94deff943939ffffe794deff000039000000000000390000ffde94ffffff94e7ff94393994dede943939bdffe794396394dede943939ffffe7b5ff +ff6b006bffffb53994e7de9439ffffffffffffffffff3994de000000ffb563ffffffffffffffffffffffff3994e7ffb563ffffffffffff3994e7de9439ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000 +0000000000000000000000ffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffd6f7ffc6b5b5a5b5c6a5a5a5c6a5a5ffffe7ffffffa5c6e7a5a5a5a5a5a5a5a5a5ffe7c6ffffffb5d6f7 +a5a5a5a5a5a5f7d6b5ffffffb5d6f7a5a5a5a5a5a5f7d6b5c6e7ffc6a5a5ffffe7e7ffffc6a5c6ffffe7e7ffffb5a5c6fff7d6d6f7ffa5a5b5a5a5a5c6a5a5ff +ffe7d6f7ffc6b5b5a5b5c6c6a5a5d6f7e7a5a5b5a5a5a5a5a5a5d6b5a5fffff7e7ffffc6a5c6ffffe7ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffff +ffffffffffffffffb5b5b5fffffff7f7f7cececebdbdbdf7f7f7cececec6c6c6e7e7e7ffffffffffffffffffb5b5b5ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3994de000000000000de943994deff6b3939003963000000 +630000ffffbd94deff94393994dede6b3939003963000000943900ffffe7b5ffff6b006bffffb5ffffffffffffffffffffffffffffffffffffefe7e7ffffffff +ffffffffffffffff94deff000039ffb563ffffff94deff943939deffde003994ffb563ffffff3994debd6b0094deff000039ffb563ffffff94deff943939deff +de393994ffde94ffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000ffffffffffffffffffffffffefe7deffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff006bbd000000000000 +6b000094debd94424294dede6b424200396b0000006b0000ffffbdffffffffffffffffffffffff94deff000042000000000000943900ffffe794deff00004200 +0000420000bdde9400006b0000006b0000ffffbd006bbd000000000000000000ffbd6b94deff944242ffffdeffffff94deff94424294dede6b424200396b0000 +00943900ffffe7ffffffffffffffffff6bbdffbd6b00ffffff94deff944242ffffde94e7ff6b0039ffffbdffffff94e7ff943939ffffe794deff9442426bbdde +e79442ffffff426bbd94bd94944242ffffdeffffff6bbdffbd6b003994dee79442ffffffffffffffffffffffff94deff6b0042ffffbdffffffffffffffffff94 +deff944242ffffdeffffff006bbdffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6f7ffd6b5b5fffff7ffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffbdbdbdf7f7f7ffffffefefefe7e7e7ffffffefefefc6c6c6cececeffffffffffffffffff +bdbdbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffff94e7ff943939006b94000000000000ffbd6bffffff94deff0000420000006b0000ffffbd +94e7ff943939006b94000000000000ffbd6bffffff94deff000042000000420000ffde94ffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff94393994dede94 +3939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffff94deff943939ffffdeffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffff94e7ff94393994dede943939ffffe7ffffffffffffffffffffffffb5ffff6b006bffffb594e7ff943939ffffde94deff6b0039ffffb5ff +ffffb5ffff6b006bffffb594deff943939396b94ffde94ffffff63b5ff6b6b39943939ffffdeffffffe7ffff393994396b6bde9439ffffffffffffffffffffff +ffe7ffff393994ffde94ffffffffffffffffffffffff3963b5ffe794deffff6b3994ffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffef +e7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6 +f7ffd6b5b5fffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadfffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7cececebdbdbdefefefffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff94393994dede94393994dede943939 +ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffff94deff944242ffffdeffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffbdffff6b006bffffbdffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff94424294dede944242ffffdeffffffffffffffffffffffffffffff3994deffbd +6b94deff944242ffffde94e7ff6b0039ffffbdffffff94e7ff943939ffffe794deff424242943939ffffe7ffffff94e7ff000039944200ffffdeffffffffffff +94e7ff000039e79442ffffff6bbdff943900ffffe7bdffff6b006bffffbdffffffffffffffffffffffff94e7ffbd6b396bbdffbd6b00ffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffd6f7ffdebdbdfffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +b5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffff +ffffffffb5b5b5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffe7e7e7c6c6c6cececeffffffffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffff +ffffffffffffff006bbd000000ffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffe7ffffffffffff +ffffffffffffffffffffffffffffffbdffff63006394debd943939ffffe794deff000039000000000000390000ffde94ffffff94e7ff000039bd6b00ffffffff +ffffdeffff003994943900ffffe7ffffffffffffffffff006bbdde9439ffffffffffff006bbd000000000000ffb563ffffff3994de0000000000000000000000 +00000000630000ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5f7f7f7f7f7f7f7f7f7efefeff7f7f7efefeff7f7f7c6c6c6c6c6c6f7f7f7ffffffb5b5b5ff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ef +efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffbdbdbdf7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7dededecececefffffff7f7f7bdbdbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffadadadff +fffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffff +b5b5b5f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffffb5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe7ffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffb5b5b5fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7ffffffb5b5b5ffffffffffffffffffffffffb5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5b5b5b5bdbdbdb5b5b5b5b5b5ffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7f7f7ef +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefefe7e7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5b5b5efefefffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffe7e7e7b5b5b5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7f7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffff7efefefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffefe7e7c6bdbdbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5 +b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adad +bdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5 +b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5 +b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adad +bdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5 +b5adbdb5b5b5adadcec6c6e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7e7b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5 +b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5dededeffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7e7cec6c6b5b5adbdb5b5b5adadbdb5b5b5 +b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5 +b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adad +bdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5 +b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adcec6c6e7e7e7ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7efefefefe7f7efe7f7ef +e7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efef +efefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7 +efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7ef +e7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efef +efefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7 +efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efef +efefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7 +efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7ef +e7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efef +efefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7 +efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7ef +e7f7efefefefe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efeff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +f7f7efefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efeff7efefffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffff7f7efefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffef +e7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bbdff +000000de9439ffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffbdffff6b006bffffbdffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +f7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffbdffff000063000000000000ffbd6bffffff94e7ff000039000000943900ffffe794deff943939ffffde94e7ff943939ffffde +94deff94393994dede393939000039000000943900ffffde94deff943939ffffdeffffffb5ffff00006b000000390000ffde94ffffff3994de000000000000e7 +9439ffffff3994de000000000000de943994deff943939ffffe794deff000039000000943900ffffde94deff943939ffffe7ffffff94deff943939ffffe7b5ff +ff6b006bffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff000063000000390000ffde9494deff943939ffff +deffffff94deff943939ffffdebdffff000063000000000000ffbd6b94deff943939ffffdeffffffffffff006bbdde9439ffffff94deff393939000039000000 +943900ffffe7b5ffff00006b63000094e7bd943939ffffde94deff000039000000943900ffffde94e7ff943939ffffdeffffff94e7ff943939ffffdeb5ffff6b +006bffffb5ffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffef +e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffe7ffff003994ffbd6bffffffbdffff39006be7e794003994ffbd6bffffff4294e7bd +6b0094e7ff943939ffffe794deff944242ffffde94e7ff94393994e7e76b0039ffffbdffffff4294e7bd6b0094e7ff943939ffffe7deffff004294ffbd6bffff +ff94deff6b004294debd420042ffde94e7ffff39399494bd94390039ffe794deffff42429494bd94944242deffde004294ffbd6bffffff3994debd6b0094deff +944242ffffdeffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ef +efffffffffffff94deff000042000000000000000000ffbd6bffffffffffffbdffff00006b000000420000ffde9494e7ff943939ffffe7ffffff4294e7000000 +000000000000944200ffffde4294e700000000000039390094424294dede944242bdffde00006b6b0000ffffbdffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffff003994 +ffbd6bffffff94e7ff6b003994e7bd943939ffffe7ffffff94e7ff943939e7ffe7003994ffbd6bffffffbdffff39006b94bd94943939ffffe7ffffffbdffff00 +006b944200ffffde94e7ff6b0039ffffbdffffff4294e7bd6b0094e7ff943939ffffe794deff944242deffde004294ffbd6bffffff3994debd6b0094deff9442 +42ffffdeffffff94deff944242ffffdefffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff94deff944242ffffdeffffffffffff +4294e7943900ffffe794deff000042000000944200ffffde94e7ff943939ffffe7ffffff94e7ff943939ffffe7bdffff00006b000000420000ffde94ffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffff949494949494949494949494949494949494949494949494949494949494949494949494949494ffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffff +ffffffff94deff943939ffffdeffffff94deff94393994dede943939ffffde94deff943939ffffe794deff94393994dede943939ffffdeffffff94deff943939 +94dede943939ffffde94e7ff630039ffffbdffffffffffffffffffffffffffffffffffff0063b56b0000ffffb5ffffffffffff006bbd63000094e7bd94393994 +dede943939ffffe7ffffff94deff94393994e7e7943939ffffdeffffff94e7ff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff94deff943939ffffe7ffffffdeffff003994ffbd6bdeffff003994ffb563ffffff94deff6b +003994deb5943939ffffdebdffff630063ffffbdffffff6bbdff943900bdffe7630063ffffbdffffff6bbdff94390094dede94393994e7e7943939ffffdeffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff +ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffff94deff6b0039ffffb5ffffffffffffffffff94deff943939ffffdeffffff94deff94393994dede943939ffffdeffffffffff +ffffffff94deff943939ffffdeffffff63b5ffbd6b003963b5ffe79494deff943939ffffdeffffff94deff94393994dede943939ffffde94deff94393994e7e7 +943939ffffdeffffff94e7ff94393994dede943939ffffe7ffffff94deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ff +ffffffffff94e7ff943939ffffdeffffffbdffff000063943900deffde003994ffb563ffffff3994debd6b0094deff943939ffffdeffffff94deff943939deff +de003994ffb563ffffff94deff6b0039ffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c8c8cfffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7 +f7ffffff8c8c8cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffff94e7ff943939ffffe7ffffffffffffffffff94e7ff943939ffffe7ffffff94e7ff94393994e7e7943939ffffe794deff944242ffffde94e7ff94 +393994e7e7943939ffffe7ffffff94e7ff6b003994e7bd943939ffffe794deff000042000000000000000000420000dede94004294000000e79442ffffffe7ff +ff003994000000de9439ffffff94deff94424294dede944242ffffdeffffff94deff94424294dede944242ffffdeffffff94deff944242ffffdeffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff94deff944242ffffdeffffffffffff94e7 +ff94393994e7e76b0039ffffbdffffffffffffffffff94e7ff943939ffffe7bdffff42006bffde94ffffff94deff94424294dede944242ffffdeffffff94deff +94424294dede94424294dede944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff00003900000000000000000039000094bd94943939ffffe7ffffff +94e7ff94393994e7e7943939ffffe7ffffffffffffffffff94e7ff943939ffffe7ffffff006bbdffbd6b6bbdffbd6b0094e7ff943939ffffe7ffffff94e7ff6b +003994e7bd943939ffffe794deff94424294dede944242ffffdeffffff94deff94424294dede944242ffffdeffffff94deff944242ffffdeffffffffffffffff +fffffffffffffffffffffffffffffffff7efefffffffffffff94deff944242ffffdeffffff3994de6b6b4294393994e7e7943939ffffe7ffffff94e7ff943939 +94e7e7943939ffffe7ffffff94e7ff94393994e7e76b0039ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff949494f7f7f7d6d6d6ded6d6 +e7e7e7e7e7e7efefefefefeff7f7f7efefeff7f7f7f7f7f7949494ffffffffffffffffffffffffffffffbdffff00006b6b000094debd94424294dede944242ff +ffde94e7ff943939ffffe794deff944242ffffdebdffff00006b000000390000ffe794ffffff4294e7000000000000de9439ffffffbdffff6b006bffffbdffff +ffffffffffffffffffffe7ffff003994000000000000944200ffffde94e7ff943939ffffe7ffffff94e7ff94393994e7e76b393900426bbd6b00ffffffbdffff +00006bde9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffdeffff003994ffb563ffffffb5ffff39006bdede94003994ffb563ffffff3994debd6b0094de +ff390039ffde9494e7ff390039ffde9494deff94393994dede390039ffde94ffffff3994debd6b0094deff390039ffde94deffff393994ffe794ffffff94deff +943939bdffe7630063ffffbd94deff6b0039b5ffb56b006bffffb594e7ff63003994debd943939e7ffe7003994ffbd6bffffff3994e7b5630094deff000039ff +bd6bffffff94deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffff +ffffff94e7ff943939ffffdeffffffffffffb5ffff6b006b94deb500003900000000000000000039000094b594943939ffffdeffffff94deff00003900000000 +000094390094dede943939ffffe7ffffff94deff94393994e7e794393994dede943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000ffffffffffffffffffffffffffffffefe7e7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeffff393994ffde94ff +ffff94deff94393994dede000039ffb563ffffff94deff943939deffde003994ffb563ffffffb5ffff39006b94b594390039ffde9494deff630039ffffbdb5ff +ff6b006b94deb5390039ffde94ffffff3994debd6b0094deff943939ffffde94e7ff943939deffde003994ffbd6bffffff3994deb5630094e7ff000039ffbd6b +ffffff94e7ff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff94deff943939ffffe7b5ffff94396b94dede94 +393994dede943939ffffdeffffff94deff94393994dede943939ffffdeffffff94deff94393994dede000039000000000000000000390000ffde94ffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000 +ffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffff94948cffffffc6c6c6efefefefefeff7f7f7f7f7f7fffffff7f7f7ffffffe7e7e7ffffff94948cffffffffffffffffffffffffffffff94de +ff943939ffffde94e7ff94393994dede943939ffffe794deff943939ffffde94e7ff943939deffde003994ffbd6bffffff94deff63003994e7bd390039ffde94 +deffff393994ffde94ffffffffffffffffffffffffffffffffffffffffff0063b5ffbd6bffffffffffff63b5ffbd6b0094deff943939ffffdeffffff94deff94 +393994dede943939deffde003994ffb563006bbdde9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffbdffff00006b000000000000ffbd6b +ffffff94deff0000420000006b0000ffffbd94e7ff6b393900426b000000bd9442003994000000de943994e7ff6b393900426b0000006b0000ffffbd94e7ff6b +393900426b6b000094e7bd000039000000390000ffe794ffffff4294e7000000000000de9439ffffff3994de000000000000e7944294deff944242ffffde94e7 +ff0000390000006b0000ffffbd94deff944242006b94000000000000ffbd6bffffffbdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffff7efefffffffffffff94deff944242ffffdeffffffffffffe7ffff393994e7e794393994ffe794ffffff94e7ff94393994e7 +e7943939ffffe7ffffffffffffffffffffffff94deff94424294dede944242ffffdeffffff94deff94424294dede94424294dede944242ffffdeffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000ff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffff94deff000042000000420000ffde9494e7ff943939006b94000000000000ffbd6bffffffbdffff00006b000000000000ffbd6b +94e7ff6b393900426b000000bd6b00ffffffffffff006bbd6b6b426b393900426b0000006b0000deffbd00429400000094420094dede944242ffffde94e7ff00 +00390000006b0000ffffbd94deff944242006b94000000000000ffbd6bffffffbdffff6b006bffffbdfffffffffffffffffffffffffffffff7efefffffffffff +ff94deff944242ffffde006bbdffbd6b94e7ff943939e7ffe7003994ffbd6bffffff4294e7bd6b0094e7ff000039ffbd6bffffff94e7ff943939e7ffe7393994 +ffe794ffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffff000000000000000000000000000000000000000000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffff949494f7f7f7cec6c6e7e7e7f7f7f7f7f7f7fffffff7f7f7fffffff7f7f7efefe7f7f7f7 +949494ffffffffffffffffffffffffffffff94e7ff943939ffffe794deff94424294dede944242ffffde94e7ff943939ffffe794deff94424294dede6b0042ff +ffbdffffffffffffffffffffffffffffffffffff006bbd6b0000ffffbdffffffffffffffffffffffffffffffffffffdeffff424294ffde94ffffffffffff94e7 +ff94393994e7e7943939ffffe7ffffff94e7ff94393994e7e7943939ffffe794deff000042943900ffffe7ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff94deff943939ffffe7ffffffffffffb5ffff6b006b +ffffb594deff000039000000390000bdde94000063000000630000ffffbd0063b5000000000000000000ffb56394e7ff943939ffffdeffffff94e7ff94393994 +dede63393900396b000000943900ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94de +ff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffefe7e7ffffffffffff94e7ff94393994dede943939ffffe794deff943939ffffde94e7ff000039000000630000ffffbd94deff94 +3939006394000000000000ffbd6bffffff94e7ff000039000000390000ffe794ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c8c8cffffffc6bdbde7e7e7e7e7e7ef +efeff7f7f7f7f7f7f7f7f7f7f7f7dededeffffff8c8c8cffffffffffffffffffffffffffffff94deff943939ffffde94deff94393994e7e7943939ffffde94de +ff943939ffffde94deff94393994e7e7000039000000000000000000390000dede94003994000000de9439ffffffffffffffffffffffffffffffffffffffffff +ffffffbdffff630063ffffbdffffffffffffb5ffff6b006b94deb5943939ffffdeffffff94deff94393994dede943939ffffdebdffff000063bd6b00ffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff94 +deff944242ffffdeffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffff94deff94424294dede944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff94deff944242006b94ffbd6bffffff94e7ff943939ffff +e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffff949494f7f7f7c6bdbddededee7e7e7e7e7e7efefefefefeff7f7f7efefefdededef7f7f7949494ffffffffffffffffffffffffffffff94e7ff943939 +ffffe794deff94424294dede420042ffde9494e7ff390039ffe79494deff944242deffde424294ffde94ffffff94deff944242bdffde6b006bffffbd94e7ff6b +0039ffffbdffffffffffffffffffffffffffffffffffffbdffff6b006bffffbdffffffffffffbdffff6b006b94e7bd000039ffbd6bffffff94e7ff94393994e7 +e7943939ffffe7006bbdbd9442003994ffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffefe7e7ffffffffffff94e7ff943939ffffdeffffffe7ffff003994ffbd6bffffffffffffffffffffffffffffffffffffb5ffff6b006b +ffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff94393994dede943939ffffe7ffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff94deff +000039943900ffffdeffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffff94948cffffffbdb5added6d6ded6d6e7dededededee7e7e7e7e7e7efefefcececeffffff94948cff +ffffffffffffffffffffffe7ffff00399400000094390094e7e794393994dede63393900396b000000bd9439003994000000de9439ffffff94deff0000390000 +00390000ffde94ffffff3994de000000000000e79439ffffffbdffff630063ffffbdffffffffffffffffffbdffff630063ffffbdffffffffffffb5ffff6b006b +94deb5943939006394000000000000ffbd6b94deff943939006394943900ffffde94deff000039ffbd6bffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff94deff000042000000000000000000ffbd6bffffffffffffff +ffffffffffffffffffffffffffffffffff006bbd000000ffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff9442 +42ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffff7efefffffffffffff94deff420042ffde94ffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff949494f7f7f7bdbdb5d6d6ceded6d6ded6d6e7de +dee7dedeefe7e7e7e7e7cececef7f7f7949494ffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbd +ffff6b006bffffbdffffffffffffbdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +8c8c8cffffffbdb5added6d6d6ceceded6ced6d6cededed6deded6e7e7dec6c6c6ffffff8c8c8cffffffffffffffffffffffffffffff94deff943939ffffde94 +deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffbdffff630063ffffbdffffffffffffb5ffff6b006bffffb5ffffffffffffffffffffffffffffff94deff943939 +ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffff949494f7f7f7c6bdb5bdb5b5bdbdb5bdb5b5c6bdb5bdb5b5c6bdb5bdbdb5cec6c6f7f7f7949494ffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff6b006bffffbdffffffffffffbdffff6b006bffffbdff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94948cfffffff7f7f7fffffff7f7f7fffffff7f7f7ffffff +f7f7f7fffffff7f7f7ffffff94948cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efeff7efefffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7efe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffff7efeff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +f7f7f7efe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94949494 +9494949494949494949494949494949494949494949494949494949494949494949494ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffe7e7e7c6c6c6b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5ad +adbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5 +b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5 +b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5ad +adbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5 +b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5c6bdbde7 +e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7dec6c6bdb5adadbdb5b5b5adadb5b5adb5ad +adbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5 +b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5 +b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5ad +adbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5 +b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5b5adadb5 +b5adb5adadbdb5b5b5adadb5b5adb5adadbdb5b5c6bdbde7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7 +eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7 +f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7 +efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7 +eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7 +f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7 +efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeffff7f7ffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7 +f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7 +efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7 +eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7 +f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7 +efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeff7efe7f7f7eff7efe7f7efeffff7f7ffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7f7f7ef +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefefe7e7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7f7f7efffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffff7efefefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c8c8c94949494948c9494948c8c8c94 +949494948c9494948c8c8c94949494948c9494948c8c8cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffff949494f7f7f7fffffff7f7f7fffffffffffffffffffffffffffffff7f7f7fffffff7f7f7949494ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff9439 +39ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6b +bdff000000de9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffff94948cffffffcececedededeefe7e7bd9c94bd9c94fff7f7efefeff7f7f7efefefffffff94948cff +ffffffffffffffffffffffffffffb5ffff00006b63000094e7bd94393994dede943939ffffe794deff943939ffffde94e7ff943939ffffdeb5ffff00006b0000 +00390000ffde94ffffff3994de000000000000e79439ffffffbdffff630063ffffbdffffffffffffffffffffffffdeffff003994de9439ffffffffffffbdffff +390063ffe794ffffff94deff94393994e7e7943939ffffdeffffff94e7ff943939ffffde94deff000039000000393900943939ffffe794deff00003900000094 +3900ffffdeffffffdeffff003994ffb563ffffff63b5ffbd6b00ffffffffffff3994de000000000000de9439ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7 +ff943939ffffe794deff944242ffffde4294e7000000000000000000944200ffffdeffffff94deff420042ffde94ffffffffffff94e7ff000039000000943900 +ffffe794deff944242ffffdeffffffbdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffe7ffff003994000000000000000000000000000000bd6b0094e7ff943939ffffe794deff9442 +42ffffdeffffffffffffffffffffffffffffff6bbdff000000000000bd6b00ffffffffffffffffffffffff3994dee79442ffffffffffffffffff4294e7de9439 +ffffffffffffbdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffbdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff949494f7f7f7d6cecef7efefc6a5949c634a9c63 +52d6bdb5ffffffffffffefefeff7f7f7949494ffffffffffffffffffffffffffffff94e7ff943939ffffe794deff94424294dede944242ffffde94e7ff943939 +ffffe794deff944242deffde004294ffbd6bffffff94deff6b004294debd420042ffde94e7ffff393994ffe794ffffffffffffffffffffffffffffffffffffff +ffffbdffff00006bbd6b00ffffffffffff6bbdff000000de9439ffffff94deff94424294dede944242ffffdeffffff94deff944242deffde004294ffbd6bffff +ff3994de944200deffde004294ffbd6bffffff3994debd6b00ffffffbdffff00006be79442ffffff006bbd6b0000ffffbd94deff420042ffde94e7ffff393994 +ffe794ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffff94deff943939ffffde94deff943939bdffe7630063ffffbdffffff6bbdff943900ffffdeffffff3994e7000000de +9439ffffffe7ffff003994ffbd6bffffff3994e7b5630094deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff00006b6300 +0094e7bd943939ffffdeffffff3994e7000000000000000000943900ffffde94deff00003900000039390094393994dede943939b5ffde00006b63000094e7bd +943939ffffde94deff000039000000943900ffffde94e7ff943939ffffdeffffff94e7ff943939ffffde3994de00000000000000000094390094e7e7943939ff +ffdeffffffffffffdeffff00399400000000000000000000000000000039390094393994dede393939000039000000943900ffffdeffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3994e7b56300ffffffffffffffffff +ffffffffffff94deff943939ffffde94deff943939ffffe7ffffffffffffffffffffffffb5ffff6b006bffffb5e7ffff003994ffbd6bffffffffffffffffff39 +94dede9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff39006bffde94ffffffffffffffffff94deff000039943900ffffe7 +deffff003994ffb563ffffff63b5ffbd6b00ffffffffffff3994de000000000000000000943900ffffdeffffff006bbdde9439ffffffffffff3994e700000000 +0000de9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +8c8c8cffffffd6d6ceefe7e7945a4a9c634a9c634aad7b63ffffffffffffe7e7e7ffffff8c8c8cffffffffffffffffffffffffffffff94deff943939ffffde94 +deff94393994e7e7943939ffffde94deff943939ffffde94deff94393994e7e7630039ffffbdffffffffffffffffffffffffffffffffffff0063b56b0000ffff +b5ffffffffffffffffffffffffffffffffffffffffff63b5ff6b6b00943963ffffdeffffff3994e7949463bd6b39ffffff94e7ff94393994dede943939ffffe7 +ffffff94deff94393994e7e7943939ffffdeffffff94e7ff94393994dede943939ffffe7ffffff94deff943939ffffe763b5ff949439943963bdffe794396339 +94bdffb563ffffffffffffffffff0063b56b0000ffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794deff944242bdffde42006bffde94ffff +ff94deff944242ffffdee7ffff39399494bd94943939ffffe794deff944242ffffdeffffff94deff94424294dede944242ffffdeffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efefffffffffffff943939ffffe794deff944242ffffdebdffff6b006bffffbdffffff6bbdff943900e7ffe7003994ffbd6bffffff4294e794 +390094e7e794393994e7e7943939ffffe794deff944242deffde004294ffbd6bffffff3994debd6b0094deff944242ffffdeffffff94deff944242bdffde6b00 +6bffffbdffffff6bbdff94420094dede944242ffffdeffffffffffffffffff3994debd6b00ffffffffffffffffffffffff94deff94424294dede6b0042ffffbd +ffffff3994debd6b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffff006bbdde9439ffffffffffffffffffffffff94e7ff943939ffffe794deff944242ffffdeffffffffffffffffffffffff6bbdffde9439ffff +ffffffff4294e7bd9439004294000000000000000000000000de9439ffffffffffff4294e7de9439ffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff3994dee79442ff +ffffffffffffffff4294e76b6b39944242ffffdebdffff00006be79442ffffff006bbd6b0000ffffbdbdffff6b006bffffbdffffff6bbdff944200ffffdebdff +ff00006b944200ffffde94e7ff390039ffe794deffff424294ffde94ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffff000000ffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffff949494f7f7f7efe7e7ad84739c634ae7d6d6ad7b6b9c634adec6bdffffffe7e7e7f7f7f7949494ffffffffff +ffffffffffffffffffff94e7ff943939ffffe794deff94424294dede944242ffffde94e7ff943939ffffe794deff94424294dede000042000000000000000000 +420000dede94004294000000e79442ffffffffffffffffffffffffffffffffffffffffffffffffffffff4294e7debd6b424294ffde94e7ffff393994bde7946b +006bffffbd94deff94424294dede944242ffffdeffffff94deff94424294dede944242ffffdeffffff94deff94424294dede944242ffffdeffffff94deff9442 +42ffffde006bbdffbd6b426bbd94bd94bd6b426bbdffe79442deffff004294000000e79442ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffff94deff943939 +ffffde94e7ff943939ffffde94deff000039000000000000943900ffffe794deff943939deffde393994ffde9494deff943939ffffe7ffffff94deff94393994 +e7e7943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff943939ffffde94deff943939ffffe7b5ffff39006bffde94ffffff94de +ff94393994dede943939ffffdeffffff94deff94393994dede94393994dede943939ffffde94deff94393994e7e7943939ffffdeffffff94e7ff94393994dede +943939ffffe7ffffff94deff943939bdffe7390063ffde94ffffff94e7ff94393994dede943939ffffe7ffffffffffffffffffffffff0063b5de9439ffffffff +ffffffffff94deff94393994e7e7943939ffffdeffffff94e7ff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000 +0000000000ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5ffff39006bffde94ffffffffffffffffff94deff943939ffffde94e7ff943939ffffde +ffffffffffffffffffffffff3994de943900ffffdedeffff003994ffbd6b3994dede9439ffffff3994e7de9439ffffffffffffffffff63b5ff943900ffffdeff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffefe7e7ffffffffffff94deffb56339ffffffffffffdeffff39399494bd94943939ffffde63b5ff949439943963bdffde9439633994bdffb563bdffff +390063ffe794ffffff94deff943939ffffe763b5ffbd6b003963b5ffe794ffffffffffffffffff006bbd630000ffffbdffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94948cffffffcecec6e7d6ceceada5f7f7f7d6c6bd9c634a +a57363ffffffd6d6d6ffffff94948cffffffffffffffffffffffffffffff94deff943939ffffde94e7ff94393994dede390039ffe79494deff390039ffde9494 +e7ff943939deffde393994ffe794ffffff94deff943939bdffe7630063ffffbd94deff6b0039ffffb5ffffffffffffffffffffffffffffffffffffe7ffff3939 +94ffde943994deffbd6bb5ffff94396bdeffde393994ffde9494deff94393994e7e7000039ffbd6bffffff94e7ff943939deffde003994ffbd6bffffff6bbdff +943900e7ffe7003994ffbd6bffffff3994e7b56300deffff393994ffe79463b5ff000000ffb56394e7ff943939bdffde630063ffffbd94deff6b0039ffffb5ff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffff94e7ff943939ffffe794deff944242ffffdeffffffffffffffffff94deff944242ffffde006bbdde9439ffffff3994debd6b +00deffff004294ffbd6bffffff3994debd6b0094deff420042ffde94ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff943939ffffe794deff +944242ffffdeffffff94deff00004200000000000094390094e7e7943939ffffe7ffffff94e7ff94393994e7e794393994e7e7943939ffffe794deff94424294 +dede944242ffffdeffffff94deff94424294dede944242ffffdeffffff94deff944242ffffde94e7ff00003900000000000094420094dede944242ffffdeffff +ffffffffffffffffffffbdffff39006bffe794ffffffffffff94deff94424294dede944242ffffdeffffff94deff6b0042ffffbdffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffff000000000000000000000000000000ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff6b0042ffffbdffffffff +ffff94e7ff943939ffffe794deff000042000000000000390000ffe794ffffff4294e76b6b39000042000000bd6b00ffffffbdffff6b006bffffbd3994dee794 +42ffffffffffffffffffffffff006bbdbd6b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffdeffff00429400000000000000000094420094dede944242ffffde006bbdff +bd6b426bbd94bd94bd6b426bbdffe79442ffffff94e7ff000039000000000000944200ffffde006bbdffbd6b6bbdffbd6b00e7ffff003994000000de9439ffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000ffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff949494f7 +f7f7bdbdb5deded6efefe7dededeffffffa573639c634adec6bde7e7e7f7f7f7949494ffffffffffffffffffffffffdeffff00429400000094420094dede9442 +4294dede6b424200396b000000bd9439004294000000e79442ffffff94e7ff000039000000390000ffe794ffffff4294e7000000000000de9439ffffffbdffff +6b006bffffbdffffffffffffffffffbdffff6b006bffffbd6bbdffbd6b0094e7ffbd6b39ffffff3994dee7944294deff94424294dede944242006b9400000000 +0000ffbd6bffffff94e7ff000039000000000000944200ffffde94e7ff0000390000006b0000ffffbd6bbdff6b0000ffffbdbdffff6b006bffffbdbdffff4200 +6bffde944294e7000000000000de9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffbdffff00006300000063000094debd943939ffffe70063b5000000000000000000 +ffb56394deff390039ffe794ffffff94deff390039ffe79494deff0000390000006b0000ffffb594deff63393900396b630000bdffbd630063ffffbdffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefe7e7ffffffffffff943939ffffde94e7ff390039ffde94ffffffffffffffffffffffff94deff943939deffde003994ffb563ffffff63b5ff94390094de +de94393994dede943939ffffde94e7ff943939deffde003994ffbd6bffffff3994deb5630094e7ff000039ffbd6bffffff94e7ff943939ffffdeffffffffffff +ffffff94deff94393994e7e7943939ffffdeffffffffffffffffffffffffffffff94e7ff630039ffffbdffffff94e7ff94393994dede390039ffe794ffffff39 +94deb56300ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000ffffffffffffffffffffffffef +e7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffff3994de943900ffffdeffffff94deff943939ffffde94deff943939ffffe7ffffff94deff943939ffffe73994debd6b00ffffffffffff +ffffffffffffffffff6bbdffb563003994dede9439ffffffffffffffffffffffffe7ffff003994ffbd6bb5ffff6b006bffffb5ffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffff3994deffbd6bffff +ff3994e7de943994deff943939e7ffe7393994ffde9463b5ff000000ffb56394deff943939ffffe7ffffffffffffffffff94e7ff94393994dede630039ffffbd +b5ffff6b006bb5ffb56b006bffffb594deff630039ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000 +0000000000000000000000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff8c8c8cffffffbdb5added6d6d6ceceded6d6e7e7e7d6bdb5945a42ad7b6befefefffffff8c8c8cffffffffffffffffff +ffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bbdff943900ffffe7b5ffff94396b3994b5e79439ffffff6bbdffb563 +00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffdeffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794 +deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff00000094420094dede6b424200396b6b0000006b6b000000000000000000ffbd6b +ffffff94deff00004200000000000094390094e7e76b393900426b00000094420094dede944242ffffde94e7ff0000390000006b0000ffffbd94deff94424200 +6b94000000000000ffbd6bffffff006bbd000000000000000000ffbd6b94deff944242ffffdeffffffffffffffffffffffffffffffffffff4294e7943900ffff +e794deff94424294dede6b424200396b0000006b0000ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006bbde79442ffffff94e7ff943939ffffe794deff944242ffffdeffffffbd +ffff6b006bffffbd6bbdff943900ffffe7ffffffffffffffffffffffffdeffff424294396b6be79442ffffffffffffffffffffffffffffff4294e7de9439ffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +f7efefffffffffffffffffff94e7ffbd6b39e7ffff393994ffe79494deff9442426bbdde6b0000ffffbdbdffff6b006bffffbdbdffff42006bffde94006bbd00 +0000000000000000ffbd6b006bbdbd6b00ffffffffffff006bbde794423994de000000000000e79442ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff949494f7f7f7c6bdb5ded6ceded6d6d6d6ceded6d6f7f7f7a5735a94 +5a42d6c6c6ffffff949494ffffffffffffffffffffffffffffff94e7ff943939ffffe794deff944242ffffdeffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3994dee79442ffffff +e7ffff393994424242ffde94ffffff94deff6b004294debd944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff944242ff +ffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffb5ffff6b006bffffb594e7ff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff943939ffffdeffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffff94deff943939ffffdeffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffe7ffffffffffff +ffffffffffffffffffffffffffffff006bbdde9439ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff000063ffbd6b94de +ff943939ffffde94e7ff943939ffffdeffffff94e7ff943939ffffdeb5ffff00006bffb563ffffff0063b5e79439ffffffffffff94deff000039de9439ffffff +3994debd6b00ffffffdeffff003994ffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffdeffff6b3994b5ffb594396bffffde94e7ff943939ffffdeffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffef +e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94948cffffffbdb5 +adbdb5b5bdb5adbdbdb5bdb5add6d6cec6ad9cb58c7be7dedeffffff94948cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffdeffff003994ffb563ffffffffffff3994e7630000ffffbdffffffbdffff000063ffbd6bffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffff94deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffff006bbd00000094946b944242ffffdeffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ef +efffffffffffff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff94393994e7e7943939 +94e7e7943939ffffe794deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffbdffff00006b94946b944242ffffdeffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bbdff +000000000000000000000000000000bd6b0094e7ff943939ffffe794deff000042000000000000000000ffbd6bffffffffffff6bbdff000000000000bd6b00ff +ffffffffffffffffffffff006bbde79442ffffffffffff006bbd000000000000bd6b00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffff006bbd6b6b6bde9439 +ffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffff949494f7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffffffffffffffff7f7f7949494ffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffdeffffffffffffffffff6bbdff000000000000000000000000000000bd6b00 +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ff +ffffffffffffffffffffff6bbdff390000ffe794ffffff94deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c8c8c94949494948c9494948c8c8c94949494948c9494948c8c8c9494949494 +8c9494948c8c8cffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7f7f7efffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffefe7e7f7f7efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefefe7deffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7c6c6bdbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adcec6c6e7e7e7ffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7c6bdbdbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adcec6c6e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7 +efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7 +efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7 +efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7 +efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7 +efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7 +efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefef +e7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7 +f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7f7efefefefe7f7efe7f7efe7ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efeff7efefffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7f7efe7deffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffff8c8c8c7b7b7b73737373737373737373737373737373 +73737373737373737373737373737373737373737373737373737373737373737373738c8c8cffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff8c8c8c9494 +94e7e7e7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7efefef949494949494ffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff +ffffffffffffffffffffffffffffff7b7b7be7e7e7f7f7f7d6d6d6d6d6d6cececed6d6d6d6d6d6d6d6d6cececed6d6d6d6d6d6d6d6d6cececed6d6d6d6d6d6d6 +d6d6cececed6d6d6efefefe7e7e7737373ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794deff94424294dede944242ffffdebdffff00006b00000039 +0000ffe794ffffffffffffffffffbdffff00006b6b0000ffffbd94e7ff000039000000943900ffffe7ffffffffffffffffffffffff3994de000000000000e794 +42ffffff4294e7000000000000000000944200ffffdeffffff94deff420042ffde94ffffffffffffbdffff00006b000000390000ffe794ffffffffffffffffff +bdffff00006b6b0000ffffbd94e7ff000039000000943900ffffe7ffffffbdffff6b006bffffbdffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7ef +efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff737373ffffffd6d6d6dededed6d6d6d6d6d6d6d6d6dededed6d6d6d6d6 +d6d6d6d6dededed6d6d6d6d6d6d6d6d6dededed6d6d6d6d6d6d6d6d6dededef7f7f7737373ffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffff94deff943939ffffde94deff9439 +3994e7e7943939deffde003994ffbd6bffffff94deff630039ffffbdffffffffffff94deff943939ffffdedeffff003994ffbd6bffffff3994deb56300ffffff +ffffffffffff94deff390039ffde94deffff393994bde794630063ffffbdffffff6bbdff943900ffffdeffffff3994e7000000de9439ffffffe7ffff003994ff +bd6bffffff94e7ff630039ffffbdffffffffffff94deff943939ffffdee7ffff003994ffbd6bffffff3994e7b56300ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffbdffff000063000000000000ffbd6bffffffbdffff630063ffffbdffffffffffffffffffbd +ffff630063399494000000000000393900943939ffffde3994de000000000000de9439ffffffb5ffff00006b000000390000ffde9494e7ff943939ffffdeffff +ff3994e7000000000000de9439ffffffffffffffffffffffffbdffff63006394debd00003900000039390094393994dede94393994dede943939ffffdeffffff +94deff943939ffffde94e7ff000039000000943900ffffe7ffffffffffffffffffffffffb5ffff6b006b94deb5000039000000393900943939ffffe794deff00 +0039000000943900ffffdeffffffb5ffff00006b000000000000ffb563ffffff3994de00000000000039390094393994dede943939ffffe794deff943939ffff +de94e7ff943939ffffdeb5ffff00006b000000390000ffde9494e7ff943939ffffdeffffff94e7ff943939bdffde0000636b0000ffffb53994de000000000000 +de9439ffffffffffffffffffffffffbdffff000063000000630000ffffbdb5ffff00006b000000390000ffde94ffffff3994de000000000000e79439b5ffff00 +006b630000e7ffbd00399400000000000039000094b59494393994dede393939000039000000943900ffffe7ffffffbdffff630063e7ffbd0039940000000000 +0039000094b59494393994dede393939000039000000943900ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff737373f7f7f7d6d6d6 +d6d6d6d6d6d6d6d6d69cd6d6520052d6d69c94d6d65a005ad6d6949cd6d6520052d6d69cd6d6d6d6d6d6d6d6d6d6d6d6d6d6d6ffffff737373ffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffff +ffffffffffff94e7ff943939ffffe794deff94424294dede94424294dede6b0042ffffbdffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794 +deff944242ffffdeffffff94deff944242ffffdeffffffffffffffffffffffffffffff006bbd6b0000bdffbd42006bffde94ffffff94deff944242ffffdee7ff +ff39399494bd94943939ffffe794deff6b0042ffffbdffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794deff944242ffffdeffffff94deff +944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffff003994ffbd6bffffffbdffff39006bffe7 +94ffffffffffffffffffffffffffffffffffff3994debdbd6b6b006bffffbdffffff6bbdff94390094e7e7390039ffe794deffff424294dede94004294ffbd6b +ffffff94deff6b004294debd944242ffffde94e7ff390039ffe794deffff424294ffde94ffffffffffffffffff3994dee7bd6b003994ffbd6bffffff4294e794 +390094e7e794393994e7e7943939ffffe7ffffff94e7ff943939e7ffe7003994ffbd6bffffff4294e7bd6b00ffffffffffffffffffffffff4294e7debd6b0042 +94ffbd6bffffff3994de944200deffde004294ffbd6bffffff3994debd6b00deffff004294ffbd6bffffffbdffff42006bbdde946b006bffffbdffffff6bbdff +94420094dede944242ffffde94e7ff943939ffffe794deff944242deffde004294ffbd6bffffff94deff6b004294debd944242ffffdeffffff94deff94424294 +dede944242ffffde94e7ff390039ffe794deffff424294ffde94ffffffffffffffffff3994de94946b943939ffffe7deffff004294ffbd6bffffff94deff6b00 +4294debd420042ffde94e7ffff39399494bd94943939ffffe7ffffff4294e7bd6b00ffffffffffff94e7ff94393994e7e76b0039ffffbdffffff4294e7bd6b00 +ffffffffffffffffffffffff4294e7bd6b00ffffffffffff94e7ff94393994e7e76b0039ffffbdffffff4294e7bd6b00ffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffffffffff737373ffffffd6d6d6dededed6d6d6dededed6d6d6dededed6d6d6dededed6d6d6dededed6d6d6dededed6d6d6dededed6d6d6dede +ded6d6d6dededef7f7f7737373ffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffe7ded6ffffffffffffffffffffffffffffffffffffffffff94deff943939ffffde94e7ff94393994dede94393994e7e70000390000000000000000003900 +00ffde94ffffffffffff94deff943939ffffde94e7ff943939ffffdeffffff94e7ff943939ffffdeffffffffffffdeffff003994000000e79439ffffffffffff +94deff000039000000000000943900ffffe794deff943939deffde393994ffde9494deff000039000000000000000000390000ffe794ffffffffffff94deff94 +3939ffffde94deff943939ffffe7ffffff94deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffff +ffffff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffb5ffff94396b94dede943939ffffdeffffff94deff943939ffffdeff +ffffffffff006bbd63000094e7bd630039ffffbdffffffffffffffffff94deff943939ffffe7ffffffffffffffffff006bbd630000ffffbdffffffffffffb5ff +ff94396b94dede943939ffffdeffffff94deff94393994dede94393994dede943939ffffdeffffff94deff94393994dede943939ffffdeffffff94deff943939 +ffffdeffffffffffffbdffff94396394e7e7943939ffffdeffffff94e7ff94393994dede943939ffffe7ffffff94deff94393994e7e7943939ffffdeffffffff +ffffffffff94deff943939ffffe7ffffff94deff94393994e7e7943939ffffde94deff943939ffffde94deff94393994e7e7630039ffffbdffffffffffffffff +ff94deff943939ffffe7ffffff94deff94393994e7e7943939ffffdeffffffffffffffffff006bbd630000ffffbdffffffffffffb5ffff94396b94dede943939 +ffffde94e7ff630039ffffbdffffffffffffffffffffffffffffffffffff0063b56b000094deb5943939ffffdeffffffdeffff003994ffb563ffffff94deff94 +393994dede943939ffffdeffffff94deff943939ffffdeffffffffffffffffffdeffff003994ffb563ffffff94deff94393994dede943939ffffdeffffff94de +ff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffff737373f7f7f7dedededededededededededededededededededededededededede +dededededededededededededededededededededededededededeffffff737373ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe794deff94424294dede +944242deffde424294ffde94ffffff94deff944242ffffdeffffffffffff94e7ff943939ffffe7deffff004294ffbd6bffffff3994debd6b00ffffffffffffff +ffffbdffff6b006bffffbd94deff6b0042ffffbdffffffffffffffffff94deff944242ffffde006bbdde9439ffffff3994debd6b00deffff424294ffde94ffff +ff94deff944242ffffdeffffffffffff94e7ff943939ffffe7deffff004294ffbd6bffffff3994debd6b00ffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffff7efefffffffffffff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffff4294e7ffbd6b94e7 +ff943939ffffe7ffffff94e7ff943939e7ffe7003994000000de9439ffffff94deff00004200000000000000000042000094bd94944242ffffdee7ffff003994 +000000de9439ffffffffffffffffffffffff4294e7ffbd6b94e7ff943939ffffe7ffffff94e7ff94393994e7e794393994e7e7943939ffffe7ffffff94e7ff94 +393994e7e7943939ffffe7ffffff94e7ff943939ffffe7ffffffffffff3994deffbd6b94deff944242ffffdeffffff94deff94424294dede944242ffffdeffff +ff94deff94424294dede944242ffffdeffffffffffffffffff94deff944242ffffdeffffff94deff94424294dede944242ffffde94e7ff943939ffffe794deff +94424294dede00004200000000000000000042000094bd94944242ffffdeffffff94deff94424294dede944242ffffdee7ffff003994000000de9439ffffffff +ffffffffffffffff4294e7ffbd6b94e7ff943939ffffe794deff000042000000000000000000420000dede94004294000000e79442ffffff94e7ff943939ffff +e7ffffffffffff94deff6b0042ffffbd94e7ff94393994e7e7943939ffffe7ffffff94e7ff6b0039ffffbdffffffffffffffffffffffff94deff6b0042ffffbd +94e7ff94393994e7e7943939ffffe7ffffff94e7ff6b0039ffffbdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff737373ffffffdededee7e7e7de +dedee7e7e7dededee7e7e7dededee7e7e7dededee7e7e7dededee7e7e7dededee7e7e7dededee7e7e7dededee7e7e7ffffff737373ffffffffffffffffffffff +ffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffbd +ffff00006300000063000094debd94393994e7e7943939ffffde94deff000039000000390000ffde94ffffffffffffdeffff003994000000943900ffffde94de +ff0000390000006b0000ffffb5ffffffffffffffffffffffff3994e7000000000000de9439ffffff0063b5000000000000000000ffb56394deff390039ffe794 +ffffff94deff390039ffe79494deff000039000000390000ffde94ffffffffffffe7ffff003994000000943900ffffe794deff0000390000006b0000ffffb5ff +ffffb5ffff6b006bffffb5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffff003994ffb563ffffffb5ffff39006bffde94ffffff +ffffffffffffffffffbdffff943963ffffde94deff943939ffffdeffffff94deff943939b5ffde6b006bffffb594e7ff630039deffbd393994ffe794ffffff94 +deff94393994e7e7390039ffde94b5ffff6b006bffffb594deff630039ffffbdffffffbdffff943963ffffe7deffff003994ffb563ffffff63b5ff94390094de +de94393994dede000039ffb563ffffff94deff943939deffde003994ffb563ffffff3994debd6b00ffffffffffffb5ffff94396bffffdedeffff003994ffbd6b +ffffff6bbdff943900e7ffe7003994ffbd6bffffff3994e7b56300deffff003994ffbd6bffffffbdffff39006394bd94943939ffffdeffffff94e7ff94393994 +dede390039ffe79494deff390039ffde9494e7ff943939deffde393994ffe794ffffff94deff94393994e7e7000039ffbd6bffffff94e7ff94393994dede9439 +39ffffe7b5ffff6b006bffffb594e7ff630039ffffbdffffffbdffff943963ffffde94deff943939ffffdedeffff393994ffe794ffffff94deff943939bdffe7 +630063ffffbd94deff6b003994deb5943939ffffdeffffffffffffffffff3994debd6b0094deff94393994dede390039ffde94ffffff3994debd6b00ffffffff +ffffffffffffffffffffffffffff3994debd6b0094deff94393994dede390039ffde94ffffff3994debd6b00ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffff +ffffffffffffff737373f7f7f7e7e7e7dededededededededee7e7e7dededededededededee7e7e7dededededededededee7e7e7dededededededededee7e7e7 +dededeffffff737373ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7 +deffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffff +ffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffff +e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffbd +ffff00006b000000000000ffbd6bffffffbdffff6b006bffffbdffffff3994deffbd6bffffff94e7ff943939ffffe7ffffff94e7ff943939ffffe73994de0000 +00000000e79442ffffff94e7ff000039000000390000ffe79494deff6b424200396b6b0000399494000000000000e79442ffffffffffff3994deffbd6bffffff +ffffff94deff00004200000000000094390094e7e794393994e7e7943939006b94000000000000ffbd6bffffff94deff0000420000006b0000ffffbdffffffff +ffff4294e7ffbd6bffffffffffff94e7ff000039000000000000944200ffffde94e7ff0000390000006b0000ffffbdffffffbdffff00006b000000000000ffbd +6b94deff944242ffffdeffffff94deff94424294dede6b424200396b000000bd9439004294000000e79442ffffff94e7ff000039000000390000ffe79494deff +944242006b94000000000000e7bd6b003994000000943900ffffe73994de000000000000e79442ffffffffffff3994deffbd6bdeffff004294000000944200ff +ffde94e7ff000039000000390000ffe794ffffff4294e7000000000000bd9439004294000000944200ffffde006bbd0000000000006b000094e7bd94393994e7 +e76b393900426b0000006b0000ffffbdffffffffffffffffffffffff006bbd0000000000006b000094e7bd94393994e7e76b393900426b0000006b0000ffffbd +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffffffffff737373ffffffefefeff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7ef +efeff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7ffffff737373ffffffffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffb5ffff6b006bffffb594e7ff94393994dede943939ff +ffe7ffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5ffff94396bffffdeffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffb5ffff94396bffffdeffffffffffffffffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffbdffff943963ffffdeffffffffffffffffffffffffffffff94e7ff943939ffffdeffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94e7ff943939ffffdeffffffffffffffffffffffffffffffffffffb5ff +ff94396bffffdeffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff943939ffffdeffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffff737373fffffff7f7f7efefeff7f7f7efef +eff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7efefeff7f7f7efefefffffff737373ffffffffffffffffffffffffffffff +ffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffff +ff006bbd000000ffbd6bffffff94deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffff4294e7ffbd6bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffff4294e7ffbd6bffffffffffffffffffffffffffffffffffff94e7ff94393994e7e7943939 +ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3994deffbd6bffffffffffffffffffffffffffffffffffff94 +deff944242ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94deff944242ffffde +ffffffffffffffffffffffffffffffffffff4294e7ffbd6bffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff94e7ff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +ffffff737373ffffffefefeff7f7f7f7f7f7f7f7f7efefeff7f7f7f7f7f7f7f7f7efefeff7f7f7f7f7f7f7f7f7efefeff7f7f7f7f7f7f7f7f7efefeff7f7f7ff +ffff737373ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffbdffff943963ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff943963ffffdeffffffffffffffffffff +ffffffffffffffff94deff943939ffffdeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb5ffff94396bffff +deffffffffffffffffffffffffffffffffffff94deff943939ffffe7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbdffff943963ffffe7ffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffef +e7deffffffffffffffffffffffffffffffffffffffffff737373fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7 +f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffff737373ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff +0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffff7efefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff737373fffffff7f7f7f7f7f7f7f7f7fffffff7f7f7 +f7f7f7f7f7f7fffffff7f7f7f7f7f7f7f7f7fffffff7f7f7f7f7f7f7f7f7fffffff7f7f7f7f7f7ffffff737373ffffffffffffffffffffffffffffffffffffe7 +e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7e7ffffffffffffffffffffffffffffffffffffffffff73 +7373fffffff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7ffffff7373 +73ffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7efefffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffffffffff7b7b7bf7f7f7fffffffffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7fffffff7f7f7 +fffffff7f7f7fffffff7f7f7ffffffefefef7b7b7bffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffff +ffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffefe7e7f7f7efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffffffffff7efefefe7deffffffffffffffffffffffffffffffffffffffffff8c8c8c949494efefefffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefef9494948c8c8cffffffffffffffffffffffffffffffffffffefe7deffff +ffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffefe7e7c6c6bdbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5 +b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5ad +bdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5 +adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adbdb5b5b5adadbdb5b5b5b5adcec6c6e7e7e7ffffffffffffffffffffffffffffffffffffffffffffffff9c9c +9c7b7b7b7373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737b7b7b949494ffffffffffff +ffffffffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffe7ded6ffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffff +ffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffff +ffffffffffffffffffffffff0000ffffffffffffffffffffffffe7e7d6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffefe7deffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffff +ffffffffffffffffe7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6ef +e7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7de +d6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7de +e7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7dee7e7d6efe7dee7ded6efe7deffffffffffffffffffffffffffffffff +ffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000040000002701ffff030000000000}}}{\rtlch\fcs1 \af0 \ltrch\fcs0 +\insrsid14842421 +\par The files you\rquote ve provisionally added into the zip appear in a listbox below. You can edit this list, and change the path or filename used in the zipfile for any entry. +\par Click \'93Zip it!\'94 to create the zip with the given specifications. +\par }\pard\plain \ltrpar\s3\ql \li0\ri0\sb200\sl276\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid13582222 \rtlch\fcs1 \ab\af0\afs22\alang1025 \ltrch\fcs0 +\b\fs22\cf18\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid13582222 \hich\af31502\dbch\af31501\loch\f31502 Drag and Drop}{\rtlch\fcs1 \af0 \ltrch\fcs0 +\insrsid14842421\charrsid14842421 +\par }\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid6951347 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid13582222 You can also drag-and-drop into the zip tool. If you drag a .zip file onto the listview that appears at the bottom of the Read tab, that will open the given zip file and read it. }{\rtlch\fcs1 \af0 +\ltrch\fcs0 \insrsid6951347 +\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid13582222 Drag a set of fen to the listview that appears at the bottom of the Create tab to add that set of files to the zip file you are creating.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid13582222\charrsid6951347 + +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f +7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 +615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad +79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b +5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab +999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 +699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 +8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 +0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f +9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be +15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 +3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d +32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a +f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 +e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90 +fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2 +ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae +a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1 +399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5 +4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84 +0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b +c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7 +689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20 +5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0 +aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d +316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840 +545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a +c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100 +0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7 +8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89 +d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500 +1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f +bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6 +a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a +0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021 +0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008 +00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000009009 +81e1502bcc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/dotNetZip/Tools/WinFormsApp/Extensions.cs b/dotNetZip/Tools/WinFormsApp/Extensions.cs new file mode 100644 index 0000000..efb08a8 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Extensions.cs @@ -0,0 +1,55 @@ +// Extensions.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// + +using System; +using System.Collections.Generic; + +namespace Ionic.Zip.Forms +{ + public static class Extensions + { + public static string XmlEscapeIexcl(this String s) + { + while (s.Contains("")) + { + s = s.Replace("", "¡"); + } + return s; + } + public static string XmlUnescapeIexcl(this String s) + { + while (s.Contains("¡")) + { + s = s.Replace("¡", ""); + } + return s; + } + + public static List ToList(this System.Windows.Forms.AutoCompleteStringCollection coll) + { + var list = new List(); + foreach (string item in coll) + { + list.Add(item); + } + return list; + } + + } + + +} \ No newline at end of file diff --git a/dotNetZip/Tools/WinFormsApp/Form.DragDrop.cs b/dotNetZip/Tools/WinFormsApp/Form.DragDrop.cs new file mode 100644 index 0000000..bacef0c --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Form.DragDrop.cs @@ -0,0 +1,175 @@ +// Form.DragDrop.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// + + +namespace Ionic.Zip.Forms +{ + using System; + using System.Drawing; + using System.Windows.Forms; + using DragDropLib; + using ComIDataObject = System.Runtime.InteropServices.ComTypes.IDataObject; + + public partial class ZipForm : System.Windows.Forms.Form + { + partial void SetDragDrop() + { + this.listView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.control_OnDragDrop); + this.listView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.control_OnDragEnter); + this.listView2.DragOver += new System.Windows.Forms.DragEventHandler(this.control_OnDragOver); + this.listView2.DragLeave += new System.EventHandler(this.control_OnDragLeave); + + this.listView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.control_OnDragDrop); + this.listView1.DragEnter += new System.Windows.Forms.DragEventHandler(this.control_OnDragEnter); + this.listView1.DragOver += new System.Windows.Forms.DragEventHandler(this.control_OnDragOver); + this.listView1.DragLeave += new System.EventHandler(this.control_OnDragLeave); + } + + protected void control_OnDragEnter(object sender, DragEventArgs e) + { + e.Effect = DragDropEffects.Copy; + Point p = Cursor.Position; + Win32Point wp; + wp.x = p.X; + wp.y = p.Y; + IDropTargetHelper dropHelper = (IDropTargetHelper)new DragDropHelper(); + dropHelper.DragEnter(IntPtr.Zero, (ComIDataObject)e.Data, ref wp, (int)e.Effect); + } + + protected void control_OnDragOver(object sender, DragEventArgs e) + { + e.Effect = DragDropEffects.Copy; + Point p = Cursor.Position; + Win32Point wp; + wp.x = p.X; + wp.y = p.Y; + IDropTargetHelper dropHelper = (IDropTargetHelper)new DragDropHelper(); + dropHelper.DragOver(ref wp, (int)e.Effect); + } + + protected void control_OnDragLeave(object sender, EventArgs e) + { + IDropTargetHelper dropHelper = (IDropTargetHelper)new DragDropHelper(); + dropHelper.DragLeave(); + } + + protected void control_OnDragDrop(object sender, DragEventArgs e) + { + e.Effect = DragDropEffects.Copy; + Point p = Cursor.Position; + Win32Point wp; + wp.x = p.X; + wp.y = p.Y; + IDropTargetHelper dropHelper = (IDropTargetHelper)new DragDropHelper(); + dropHelper.Drop((ComIDataObject)e.Data, ref wp, (int)e.Effect); + } + + } + +} + + + + + +namespace DragDropLib +{ + + using System; + using System.Runtime.InteropServices; + using System.Runtime.InteropServices.ComTypes; + using System.Collections.Generic; + + [ComImport] + [Guid("4657278A-411B-11d2-839A-00C04FD918D0")] + public class DragDropHelper { } + + + + [ComVisible(true)] + [ComImport] + [Guid("4657278B-411B-11D2-839A-00C04FD918D0")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IDropTargetHelper + { + void DragEnter( + [In] IntPtr hwndTarget, + [In, MarshalAs(UnmanagedType.Interface)] IDataObject dataObject, + [In] ref Win32Point pt, + [In] int effect); + + void DragLeave(); + + void DragOver( + [In] ref Win32Point pt, + [In] int effect); + + void Drop( + [In, MarshalAs(UnmanagedType.Interface)] IDataObject dataObject, + [In] ref Win32Point pt, + [In] int effect); + + void Show( + [In] bool show); + } + + + + [StructLayout(LayoutKind.Sequential)] + public struct Win32Point + { + public int x; + public int y; + } + + [StructLayout(LayoutKind.Sequential)] + public struct Win32Size + { + public int cx; + public int cy; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ShDragImage + { + public Win32Size sizeDragImage; + public Win32Point ptOffset; + public IntPtr hbmpDragImage; + public int crColorKey; + } + + + + [ComVisible(true)] + [ComImport] + [Guid("DE5BF786-477A-11D2-839D-00C04FD918D0")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IDragSourceHelper + { + void InitializeFromBitmap( + [In, MarshalAs(UnmanagedType.Struct)] ref ShDragImage dragImage, + [In, MarshalAs(UnmanagedType.Interface)] IDataObject dataObject); + + void InitializeFromWindow( + [In] IntPtr hwnd, + [In] ref Win32Point pt, + [In, MarshalAs(UnmanagedType.Interface)] IDataObject dataObject); + } + +} + + diff --git a/dotNetZip/Tools/WinFormsApp/Form.State.cs b/dotNetZip/Tools/WinFormsApp/Form.State.cs new file mode 100644 index 0000000..23d0c32 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Form.State.cs @@ -0,0 +1,308 @@ +// Form.State.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Windows.Forms; +using Ionic.Zip; + +namespace Ionic.Zip.Forms +{ + public partial class ZipForm + { + /// This app uses the windows registry to store config data for itself. + /// - creates a registry key for this DotNetZip Winforms app, if one does not exist + /// - stores and retrieves the most recent settings. + /// - this is done on a per user basis. (HKEY_CURRENT_USER) + private void FillFormFromRegistry() + { + if (!stateLoaded) + { + if (AppCuKey != null) + { + var s = (string)AppCuKey.GetValue(_rvn_DirectoryToZip); + if (s != null) + { + this.tbDirectoryToZip.Text = s; + this.tbDirectoryInArchive.Text = System.IO.Path.GetFileName(this.tbDirectoryToZip.Text); + } + + s = (string)AppCuKey.GetValue(_rvn_SelectionToZip); + if (s != null) this.tbSelectionToZip.Text = s; + + s = (string)AppCuKey.GetValue(_rvn_SelectionToExtract); + if (s != null) this.tbSelectionToExtract.Text = s; + + s = (string)AppCuKey.GetValue(_rvn_ZipTarget); + if (s != null) this.tbZipToCreate.Text = s; + + s = (string)AppCuKey.GetValue(_rvn_ZipToOpen); + if (s != null) this.tbZipToOpen.Text = s; + + s = (string)AppCuKey.GetValue(_rvn_ExtractLoc); + if (s != null) this.tbExtractDir.Text = s; + else + this.tbExtractDir.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + + s = (string)AppCuKey.GetValue(_rvn_Encoding); + if (s != null) + SelectNamedEncoding(s); + + s = (string)AppCuKey.GetValue(_rvn_EncodingUsage); + if (s != null) + SelectNamedEncodingUsage(s); + + s = (string)AppCuKey.GetValue(_rvn_CompLevel); + if (s != null) + { + SelectNamedCompressionLevel(s); + } + else SelectNamedCompressionLevel("Default"); + + s = (string)AppCuKey.GetValue(_rvn_CompMethod); + if (s != null) + { + SelectNamedCompressionMethod(s); + } + else SelectNamedCompressionMethod("Deflate"); + + s = (string)AppCuKey.GetValue(_rvn_Encryption); + if (s != null) + { + SelectNamedEncryption(s); + this.tbPassword.Text = ""; + } + + int x = (Int32)AppCuKey.GetValue(_rvn_ZipFlavor, 0); + if (x >= 0 && x <= 2) + this.comboFlavor.SelectedIndex = x; + + x = (Int32)AppCuKey.GetValue(_rvn_Zip64Option, 0); + if (x >= 0 && x <= 2) + this.comboZip64.SelectedIndex = x; + + x = (Int32)AppCuKey.GetValue(_rvn_ExtractExistingFileAction, 0); + if (x >= 0 && x <= comboExistingFileAction.Items.Count) + this.comboExistingFileAction.SelectedIndex = x; + + x = (Int32)AppCuKey.GetValue(_rvn_FormTab, 1); + if (x == 0 || x == 1) + this.tabControl1.SelectedIndex = x; + + x = (Int32)AppCuKey.GetValue(_rvn_HidePassword, 1); + this.chkHidePassword.Checked = (x != 0); + + x = (Int32)AppCuKey.GetValue(_rvn_OpenExplorer, 1); + this.chkOpenExplorer.Checked = (x != 0); + + x = (Int32)AppCuKey.GetValue(_rvn_TraverseJunctions, 1); + this.chkTraverseJunctions.Checked = (x != 0); + + x = (Int32)AppCuKey.GetValue(_rvn_RecurseDirs, 1); + this.chkRecurse.Checked = (x != 0); + + x = (Int32)AppCuKey.GetValue(_rvn_RemoveFiles, 1); + this.chkRemoveFiles.Checked = (x != 0); + + numRuns = (Int32)AppCuKey.GetValue(_rvn_Runs, 0); + + // get the MRU list of selection expressions + _selectionCompletions = new System.Windows.Forms.AutoCompleteStringCollection(); + string history = (string)AppCuKey.GetValue(_rvn_SelectionCompletions, ""); + if (!String.IsNullOrEmpty(history)) + { + string[] items = history.Split(''); + if (items != null && items.Length > 0) + { + foreach (string item in items) + _selectionCompletions.Add(item.XmlUnescapeIexcl()); + } + } + + + + // set the geometry of the form + s = (string)AppCuKey.GetValue(_rvn_Geometry); + if (!String.IsNullOrEmpty(s)) + { + int[] p = Array.ConvertAll(s.Split(','), + new Converter((t) => { return Int32.Parse(t); })); + if (p != null && p.Length == 5) + { + this.Bounds = ConstrainToScreen(new System.Drawing.Rectangle(p[0], p[1], p[2], p[3])); + + // Starting a window minimized is confusing... + //this.WindowState = (FormWindowState)p[4]; + } + } + + AppCuKey.Close(); + AppCuKey = null; + + tbPassword_TextChanged(null, null); + + stateLoaded = true; + } + } + } + + + + private void SaveFormToRegistry() + { + if (this.tbExtractDir.InvokeRequired) return; // skip it + + if (AppCuKey != null) + { + AppCuKey.SetValue(_rvn_DirectoryToZip, this.tbDirectoryToZip.Text); + AppCuKey.SetValue(_rvn_SelectionToZip, this.tbSelectionToZip.Text); + AppCuKey.SetValue(_rvn_SelectionToExtract, this.tbSelectionToExtract.Text); + AppCuKey.SetValue(_rvn_ZipTarget, this.tbZipToCreate.Text); + AppCuKey.SetValue(_rvn_ZipToOpen, this.tbZipToOpen.Text); + AppCuKey.SetValue(_rvn_Encoding, this.comboEncoding.SelectedItem.ToString()); + AppCuKey.SetValue(_rvn_EncodingUsage, this.comboEncodingUsage.SelectedItem.ToString()); + AppCuKey.SetValue(_rvn_CompLevel, this.comboCompLevel.SelectedItem.ToString()); + AppCuKey.SetValue(_rvn_CompMethod, this.comboCompMethod.SelectedItem.ToString()); + if (this.tbPassword.Text == "") + { + if (!String.IsNullOrEmpty(_mostRecentEncryption)) + AppCuKey.SetValue(_rvn_Encryption, _mostRecentEncryption); + } + else + AppCuKey.SetValue(_rvn_Encryption, this.comboEncryption.SelectedItem.ToString()); + + AppCuKey.SetValue(_rvn_ExtractLoc, this.tbExtractDir.Text); + + int x = this.comboFlavor.SelectedIndex; + AppCuKey.SetValue(_rvn_ZipFlavor, x); + + x = this.comboZip64.SelectedIndex; + AppCuKey.SetValue(_rvn_Zip64Option, x); + + x = this.comboExistingFileAction.SelectedIndex; + AppCuKey.SetValue(_rvn_ExtractExistingFileAction, x); + + AppCuKey.SetValue(_rvn_FormTab, this.tabControl1.SelectedIndex); + + AppCuKey.SetValue(_rvn_LastRun, System.DateTime.Now.ToString("yyyy MMM dd HH:mm:ss")); + x = (Int32)AppCuKey.GetValue(_rvn_Runs, 0); + x++; + AppCuKey.SetValue(_rvn_Runs, x); + + AppCuKey.SetValue(_rvn_HidePassword, this.chkHidePassword.Checked ? 1 : 0); + AppCuKey.SetValue(_rvn_OpenExplorer, this.chkOpenExplorer.Checked ? 1 : 0); + AppCuKey.SetValue(_rvn_TraverseJunctions, this.chkTraverseJunctions.Checked ? 1 : 0); + AppCuKey.SetValue(_rvn_RecurseDirs, this.chkRecurse.Checked ? 1 : 0); + AppCuKey.SetValue(_rvn_RemoveFiles, this.chkRemoveFiles.Checked ? 1 : 0); + + // the selection completion list + var converted = _selectionCompletions.ToList().ConvertAll(z => z.XmlEscapeIexcl()); + string history = String.Join("", converted.ToArray()); + AppCuKey.SetValue(_rvn_SelectionCompletions, history); + + + // store the size of the form + int w = 0, h = 0, left = 0, top = 0; + if (this.Bounds.Width < this.MinimumSize.Width || this.Bounds.Height < this.MinimumSize.Height) + { + // RestoreBounds is the size of the window prior to last minimize action. + // But the form may have been resized since then! + w = this.RestoreBounds.Width; + h = this.RestoreBounds.Height; + left = this.RestoreBounds.Location.X; + top = this.RestoreBounds.Location.Y; + } + else + { + w = this.Bounds.Width; + h = this.Bounds.Height; + left = this.Location.X; + top = this.Location.Y; + } + AppCuKey.SetValue(_rvn_Geometry, + String.Format("{0},{1},{2},{3},{4}", + left, top, w, h, (int)this.WindowState)); + + AppCuKey.Close(); + } + } + + + private System.Drawing.Rectangle ConstrainToScreen(System.Drawing.Rectangle bounds) + { + Screen screen = Screen.FromRectangle(bounds); + System.Drawing.Rectangle workingArea = screen.WorkingArea; + int width = Math.Min(bounds.Width, workingArea.Width); + int height = Math.Min(bounds.Height, workingArea.Height); + // mmm....minimax + int left = Math.Min(workingArea.Right - width, Math.Max(bounds.Left, workingArea.Left)); + int top = Math.Min(workingArea.Bottom - height, Math.Max(bounds.Top, workingArea.Top)); + return new System.Drawing.Rectangle(left, top, width, height); + } + + + + public Microsoft.Win32.RegistryKey AppCuKey + { + get + { + if (_appCuKey == null) + { + _appCuKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(_AppRegyPath, true); + if (_appCuKey == null) + _appCuKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(_AppRegyPath); + } + return _appCuKey; + } + set { _appCuKey = null; } + } + + private int numRuns; + + private Microsoft.Win32.RegistryKey _appCuKey; + private static string _AppRegyPath = "Software\\Dino Chiesa\\DotNetZip Winforms Tool"; + private static string _rvn_FormTab = "FormTab"; + private static string _rvn_Geometry = "Geometry"; + private static string _rvn_TraverseJunctions = "TraverseJunctions"; + private static string _rvn_RecurseDirs = "RecurseDirs"; + private static string _rvn_RemoveFiles = "RemoveFiles"; + private static string _rvn_HidePassword = "HidePassword"; + private static string _rvn_ExtractExistingFileAction = "ExtractExistingFileAction"; + private static string _rvn_OpenExplorer = "OpenExplorer"; + private static string _rvn_ExtractLoc = "ExtractLoc"; + private static string _rvn_DirectoryToZip = "DirectoryToZip"; + private static string _rvn_SelectionToZip = "SelectionToZip"; + private static string _rvn_SelectionToExtract = "SelectionToExtract"; + private static string _rvn_SelectionCompletions= "SelectionCompletions"; + private static string _rvn_ZipTarget = "ZipTarget"; + private static string _rvn_ZipToOpen = "ZipToOpen"; + private static string _rvn_Encoding = "Encoding"; + private static string _rvn_EncodingUsage = "EncodingUsage"; + private static string _rvn_CompLevel = "CompressionLevel"; + private static string _rvn_CompMethod = "CompressionMethod"; + private static string _rvn_Encryption = "Encryption"; + private static string _rvn_ZipFlavor = "ZipFlavor"; + private static string _rvn_Zip64Option = "Zip64Option"; + private static string _rvn_LastRun = "LastRun"; + private static string _rvn_Runs = "Runs"; + + private readonly int _MaxMruListSize = 14; + private System.Windows.Forms.AutoCompleteStringCollection _selectionCompletions; + private bool stateLoaded; + } +} \ No newline at end of file diff --git a/dotNetZip/Tools/WinFormsApp/GetIcon.cmd b/dotNetZip/Tools/WinFormsApp/GetIcon.cmd new file mode 100644 index 0000000..9e93e84 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/GetIcon.cmd @@ -0,0 +1,27 @@ +REM @echo off +goto START + +------------------------------------------------------- + GetIcon.cmd + + Copy icon from "Zip Partial DLL\Resources" to this dir. + This script assumes it will be run by Visual Studio, as a prebuild script, starting with the + current directory of C:\dinoch\dev\dotnet\zip\DotNetZip\Tools\WinFormsApp\bin\Debug + + Sat, 07 Jun 2008 10:39 + +------------------------------------------------------- + + +:START +setlocal + +cd ..\..\..\.. +copy /y "Zip Partial DLL\Resources\zippedFile.ico" Tools\WinFormsApp\zippedFile.ico + + +endlocal +:END + + + diff --git a/dotNetZip/Tools/WinFormsApp/Icon2.res b/dotNetZip/Tools/WinFormsApp/Icon2.res new file mode 100644 index 0000000..b55846f Binary files /dev/null and b/dotNetZip/Tools/WinFormsApp/Icon2.res differ diff --git a/dotNetZip/Tools/WinFormsApp/ListViewEx.cs b/dotNetZip/Tools/WinFormsApp/ListViewEx.cs new file mode 100644 index 0000000..f21d468 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/ListViewEx.cs @@ -0,0 +1,466 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +// A ListView that allows edit of subitems (items in columns beyond 0) + +// From http://www.codeproject.com/KB/list/ListViewCellEditors.aspx . + + + +// disable compile-time warning: "XXX is never is assigned and will always have its default value" +#pragma warning disable 649 + +namespace ListViewEx +{ + /// + /// Inherited ListView to allow in-place editing of subitems + /// + public class ListViewEx : System.Windows.Forms.ListView + { + #region Interop structs, imports and constants + /// + /// MessageHeader for WM_NOTIFY + /// + private struct NMHDR + { + public IntPtr hwndFrom; + public Int32 idFrom; + public Int32 code; + } + + + [DllImport("user32.dll")] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wPar, IntPtr lPar); + [DllImport("user32.dll", CharSet=CharSet.Ansi)] + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, int len, ref int [] order); + + // ListView messages + private const int LVM_FIRST = 0x1000; + private const int LVM_GETCOLUMNORDERARRAY = (LVM_FIRST + 59); + + // Windows Messages that will abort editing + private const int WM_HSCROLL = 0x114; + private const int WM_VSCROLL = 0x115; + private const int WM_SIZE = 0x05; + private const int WM_NOTIFY = 0x4E; + + private const int HDN_FIRST = -300; + private const int HDN_BEGINDRAG = (HDN_FIRST-10); + private const int HDN_ITEMCHANGINGA = (HDN_FIRST-0); + private const int HDN_ITEMCHANGINGW = (HDN_FIRST-20); + #endregion + + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + + public event SubItemEventHandler SubItemClicked; + public event SubItemEventHandler SubItemBeginEditing; + public event SubItemEndEditingEventHandler SubItemEndEditing; + + public ListViewEx() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + + base.FullRowSelect = true; + base.View = View.Details; + base.AllowColumnReorder = true; + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if( components != null ) + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion + + private bool _doubleClickActivation = false; + /// + /// Is a double click required to start editing a cell? + /// + public bool DoubleClickActivation + { + get { return _doubleClickActivation; } + set { _doubleClickActivation = value; } + } + + + /// + /// Retrieve the order in which columns appear + /// + /// Current display order of column indices + public int[] GetColumnOrder() + { + IntPtr lPar = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * Columns.Count); + + IntPtr res = SendMessage(Handle, LVM_GETCOLUMNORDERARRAY, new IntPtr(Columns.Count), lPar); + if (res.ToInt32() == 0) // Something went wrong + { + Marshal.FreeHGlobal(lPar); + return null; + } + + int [] order = new int[Columns.Count]; + Marshal.Copy(lPar, order, 0, Columns.Count); + + Marshal.FreeHGlobal(lPar); + + return order; + } + + + /// + /// Find ListViewItem and SubItem Index at position (x,y) + /// + /// relative to ListView + /// relative to ListView + /// Item at position (x,y) + /// SubItem index + public int GetSubItemAt(int x, int y, out ListViewItem item) + { + item = this.GetItemAt(x, y); + + if (item != null) + { + int[] order = GetColumnOrder(); + Rectangle lviBounds; + int subItemX; + + lviBounds = item.GetBounds(ItemBoundsPortion.Entire); + subItemX = lviBounds.Left; + for (int i=0; i + /// Get bounds for a SubItem + /// + /// Target ListViewItem + /// Target SubItem index + /// Bounds of SubItem (relative to ListView) + public Rectangle GetSubItemBounds(ListViewItem Item, int SubItem) + { + int[] order = GetColumnOrder(); + + Rectangle subItemRect = Rectangle.Empty; + if (SubItem >= order.Length) + throw new IndexOutOfRangeException("SubItem "+SubItem+" out of range"); + + if (Item == null) + throw new ArgumentNullException("Item"); + + Rectangle lviBounds = Item.GetBounds(ItemBoundsPortion.Entire); + int subItemX = lviBounds.Left; + + ColumnHeader col; + int i; + for (i=0; i + /// Fire SubItemClicked + /// + ///Point of click/doubleclick + private void EditSubitemAt(Point p) + { + ListViewItem item; + int idx = GetSubItemAt(p.X, p.Y, out item); + if (idx >= 0) + { + OnSubItemClicked(new SubItemEventArgs(item, idx)); + } + } + + #endregion + + #region In-place editing functions + // The control performing the actual editing + private Control _editingControl; + // The LVI being edited + private ListViewItem _editItem; + // The SubItem being edited + private int _editSubItem; + + protected void OnSubItemBeginEditing(SubItemEventArgs e) + { + if (SubItemBeginEditing != null) + SubItemBeginEditing(this, e); + } + protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e) + { + if (SubItemEndEditing != null) + SubItemEndEditing(this, e); + } + protected void OnSubItemClicked(SubItemEventArgs e) + { + if (SubItemClicked != null) + SubItemClicked(this, e); + } + + + /// + /// Begin in-place editing of given cell + /// + /// Control used as cell editor + /// ListViewItem to edit + /// SubItem index to edit + public void StartEditing(Control c, ListViewItem Item, int SubItem) + { + OnSubItemBeginEditing(new SubItemEventArgs(Item, SubItem)); + + Rectangle rcSubItem = GetSubItemBounds(Item, SubItem); + + if (rcSubItem.X < 0) + { + // Left edge of SubItem not visible - adjust rectangle position and width + rcSubItem.Width += rcSubItem.X; + rcSubItem.X=0; + } + if (rcSubItem.X+rcSubItem.Width > this.Width) + { + // Right edge of SubItem not visible - adjust rectangle width + rcSubItem.Width = this.Width-rcSubItem.Left; + } + + // Subitem bounds are relative to the location of the ListView! + rcSubItem.Offset(Left, Top); + + // In case the editing control and the listview are on different parents, + // account for different origins + Point origin = new Point(0,0); + Point lvOrigin = this.Parent.PointToScreen(origin); + Point ctlOrigin = c.Parent.PointToScreen(origin); + + rcSubItem.Offset(lvOrigin.X-ctlOrigin.X, lvOrigin.Y-ctlOrigin.Y); + + // Position and show editor + c.Bounds = rcSubItem; + c.Text = Item.SubItems[SubItem].Text; + c.Visible = true; + c.BringToFront(); + c.Focus(); + + _editingControl = c; + _editingControl.Leave += new EventHandler(_editControl_Leave); + _editingControl.KeyPress += new KeyPressEventHandler(_editControl_KeyPress); + + _editItem = Item; + _editSubItem = SubItem; + } + + + private void _editControl_Leave(object sender, EventArgs e) + { + // cell editor losing focus + EndEditing(true); + } + + private void _editControl_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) + { + switch (e.KeyChar) + { + case (char)(int)Keys.Escape: + { + EndEditing(false); + break; + } + + case (char)(int)Keys.Enter: + { + EndEditing(true); + break; + } + } + } + + /// + /// Accept or discard current value of cell editor control + /// + /// Use the _editingControl's Text as new SubItem text or discard changes? + public void EndEditing(bool AcceptChanges) + { + if (_editingControl == null) + return; + + SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs( + _editItem, // The item being edited + _editSubItem, // The subitem index being edited + AcceptChanges ? + _editingControl.Text : // Use editControl text if changes are accepted + _editItem.SubItems[_editSubItem].Text, // or the original subitem's text, if changes are discarded + !AcceptChanges // Cancel? + ); + + OnSubItemEndEditing(e); + + if (_editItem != null && _editItem.SubItems[_editSubItem]!= null) + _editItem.SubItems[_editSubItem].Text = e.DisplayText; + + _editingControl.Leave -= new EventHandler(_editControl_Leave); + _editingControl.KeyPress -= new KeyPressEventHandler(_editControl_KeyPress); + + _editingControl.Visible = false; + + _editingControl = null; + _editItem = null; + _editSubItem = -1; + } + #endregion + } + + /// + /// Event Handler for SubItem events + /// + public delegate void SubItemEventHandler(object sender, SubItemEventArgs e); + /// + /// Event Handler for SubItemEndEditing events + /// + public delegate void SubItemEndEditingEventHandler(object sender, SubItemEndEditingEventArgs e); + + /// + /// Event Args for SubItemClicked event + /// + public class SubItemEventArgs : EventArgs + { + public SubItemEventArgs(ListViewItem item, int subItem) + { + _subItemIndex = subItem; + _item = item; + } + private int _subItemIndex = -1; + private ListViewItem _item = null; + public int SubItem + { + get { return _subItemIndex; } + } + public ListViewItem Item + { + get { return _item; } + } + } + + + /// + /// Event Args for SubItemEndEditingClicked event + /// + public class SubItemEndEditingEventArgs : SubItemEventArgs + { + private string _text = string.Empty; + private bool _cancel = true; + + public SubItemEndEditingEventArgs(ListViewItem item, int subItem, string display, bool cancel) : + base(item, subItem) + { + _text = display; + _cancel = cancel; + } + public string DisplayText + { + get { return _text; } + set { _text = value; } + } + public bool Cancel + { + get { return _cancel; } + set { _cancel = value; } + } + } + + +} diff --git a/dotNetZip/Tools/WinFormsApp/ListViewEx.resx b/dotNetZip/Tools/WinFormsApp/ListViewEx.resx new file mode 100644 index 0000000..7e32396 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/ListViewEx.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3102.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/dotNetZip/Tools/WinFormsApp/Program.cs b/dotNetZip/Tools/WinFormsApp/Program.cs new file mode 100644 index 0000000..62e5a55 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace Ionic.Zip.Forms +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new ZipForm(args)); + } + } +} diff --git a/dotNetZip/Tools/WinFormsApp/Properties/AssemblyInfo.cs b/dotNetZip/Tools/WinFormsApp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7cef1e1 Binary files /dev/null and b/dotNetZip/Tools/WinFormsApp/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Tools/WinFormsApp/Properties/Resources.Designer.cs b/dotNetZip/Tools/WinFormsApp/Properties/Resources.Designer.cs new file mode 100644 index 0000000..699615e --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Properties/Resources.Designer.cs @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.225 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ionic.Zip.Forms.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ionic.Zip.Forms.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon ZIP_Folder { + get { + object obj = ResourceManager.GetObject("ZIP_Folder", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + internal static System.Drawing.Bitmap zippedFile { + get { + object obj = ResourceManager.GetObject("zippedFile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/dotNetZip/Tools/WinFormsApp/Properties/Resources.resx b/dotNetZip/Tools/WinFormsApp/Properties/Resources.resx new file mode 100644 index 0000000..77b7afc --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Properties/Resources.resx @@ -0,0 +1,1415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAkAMDAAAAAACACoDgAAlgAAACAgAAAAAAgAqAgAAD4PAAAYGAAAAAAIAMgGAADmFwAAEBAAAAAA + CABoBQAArh4AAA0NAAAAAAAN+MQAABYk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f+/5Dn/v+R5f7/juf+/47n/v+P5f7/juX+/37H2v9kj5r/XIOR/0Fy + h+4AAAAAAAAAAAAAAAAMPFB0kuj+/5Lo/v+S6v7/kur+/5Do/v+Q6v7/kOr+/5Do/v+Q6P7/kOj+/5Do + /v9LiqTjAAAAAAAAAAAAAAAADDxQaZPq/v+T6v7/k+r+/5Pq/v+R6v7/ker+/5Hq/v+R6v7/ker+/5Hq + /v+R6v7/VJaw4QAAAAAAAAAAAAAAAAw8UF+T6v7/k+r+/5Pq/v+T6v7/ker+/5Hq/v+R6v7/ker+/5Hq + /v+R6v7/ker+/1yhv+IAAAAAAAAAAAAAAAAMPFArDDxQUww8UFIMPFBSDDxQUgw8UFIMPFBSDDxQUww8 + UFIMPFBSDDxQUgw8UFIMPFArAAAAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAB + AAAAAwAAAAMAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAA== + + + + + ..\Resources\zippedFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/dotNetZip/Tools/WinFormsApp/Properties/Settings.Designer.cs b/dotNetZip/Tools/WinFormsApp/Properties/Settings.Designer.cs new file mode 100644 index 0000000..5ab7228 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.225 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ionic.Zip.Forms.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/dotNetZip/Tools/WinFormsApp/Properties/Settings.settings b/dotNetZip/Tools/WinFormsApp/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotNetZip/Tools/WinFormsApp/Resources/zippedFile.png b/dotNetZip/Tools/WinFormsApp/Resources/zippedFile.png new file mode 100644 index 0000000..697c050 Binary files /dev/null and b/dotNetZip/Tools/WinFormsApp/Resources/zippedFile.png differ diff --git a/dotNetZip/Tools/WinFormsApp/Win Forms App.csproj b/dotNetZip/Tools/WinFormsApp/Win Forms App.csproj new file mode 100644 index 0000000..b1fd17b --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/Win Forms App.csproj @@ -0,0 +1,179 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6BCCF138-2EFB-464C-B872-E3079F0A4708} + WinExe + Properties + Ionic.Zip.Forms + DotNetZip-WinFormsTool + v3.5 + 512 + SAK + SAK + SAK + SAK + + + Icon2.res + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + 3.5 + + + + + + + + + + FolderBrowserDialogEx.cs + Component + + + PasswordDialog.cs + Form + + + PasswordDialog.designer.cs + PasswordDialog.cs + + + Form + + + ZipForm.cs + + + + Form + + + Form + + + Component + + + + + Properties\SolutionInfo.cs + + + PasswordDialog.resx + PasswordDialog.cs + + + ZipForm.cs + Designer + + + ListViewEx.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + ..\..\GetIcon.cmd + + + + \ No newline at end of file diff --git a/dotNetZip/Tools/WinFormsApp/ZipForm.Designer.cs b/dotNetZip/Tools/WinFormsApp/ZipForm.Designer.cs new file mode 100644 index 0000000..254c77f --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/ZipForm.Designer.cs @@ -0,0 +1,1215 @@ +namespace Ionic.Zip.Forms +{ + partial class ZipForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ZipForm)); + this.tbDirectoryToZip = new System.Windows.Forms.TextBox(); + this.tbZipToCreate = new System.Windows.Forms.TextBox(); + this.btnZipupDirBrowse = new System.Windows.Forms.Button(); + this.btnZipUp = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.progressBar2 = new System.Windows.Forms.ProgressBar(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.comboEncoding = new System.Windows.Forms.ComboBox(); + this.tbComment = new System.Windows.Forms.TextBox(); + this.lblStatus = new System.Windows.Forms.Label(); + this.comboCompLevel = new System.Windows.Forms.ComboBox(); + this.comboEncryption = new System.Windows.Forms.ComboBox(); + this.tbPassword = new System.Windows.Forms.TextBox(); + this.chkHidePassword = new System.Windows.Forms.CheckBox(); + this.listView1 = new System.Windows.Forms.ListView(); + this.btnOpenZip = new System.Windows.Forms.Button(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.label20 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.comboExistingFileAction = new System.Windows.Forms.ComboBox(); + this.tbSelectionToExtract = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.chkOpenExplorer = new System.Windows.Forms.CheckBox(); + this.btnExtractDirBrowse = new System.Windows.Forms.Button(); + this.tbExtractDir = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.btnExtract = new System.Windows.Forms.Button(); + this.btnReadZipBrowse = new System.Windows.Forms.Button(); + this.tbZipToOpen = new System.Windows.Forms.TextBox(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label21 = new System.Windows.Forms.Label(); + this.comboEncodingUsage = new System.Windows.Forms.ComboBox(); + this.label18 = new System.Windows.Forms.Label(); + this.chkRemoveFiles = new System.Windows.Forms.CheckBox(); + this.label17 = new System.Windows.Forms.Label(); + this.comboSplit = new System.Windows.Forms.ComboBox(); + this.chkUnixTime = new System.Windows.Forms.CheckBox(); + this.chkWindowsTime = new System.Windows.Forms.CheckBox(); + this.label16 = new System.Windows.Forms.Label(); + this.tbExeOnUnpack = new System.Windows.Forms.TextBox(); + this.label15 = new System.Windows.Forms.Label(); + this.tbDefaultExtractDirectory = new System.Windows.Forms.TextBox(); + this.comboZip64 = new System.Windows.Forms.ComboBox(); + this.comboCompMethod = new System.Windows.Forms.ComboBox(); + this.comboFlavor = new System.Windows.Forms.ComboBox(); + this.btnCreateZipBrowse = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.chkRecurse = new System.Windows.Forms.CheckBox(); + this.chkTraverseJunctions = new System.Windows.Forms.CheckBox(); + this.tbDirectoryInArchive = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.label14 = new System.Windows.Forms.Label(); + this.tbSelectionToZip = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.btnClearItemsToZip = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.listView2 = new ListViewEx.ListViewEx(); + this.chCheckbox = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tabPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // tbDirectoryToZip + // + this.tbDirectoryToZip.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbDirectoryToZip.Location = new System.Drawing.Point(104, 13); + this.tbDirectoryToZip.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbDirectoryToZip.Name = "tbDirectoryToZip"; + this.tbDirectoryToZip.Size = new System.Drawing.Size(289, 20); + this.tbDirectoryToZip.TabIndex = 10; + this.tbDirectoryToZip.Leave += new System.EventHandler(this.tbDirectoryToZip_Leave); + // + // tbZipToCreate + // + this.tbZipToCreate.AcceptsReturn = true; + this.tbZipToCreate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbZipToCreate.Location = new System.Drawing.Point(104, 11); + this.tbZipToCreate.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbZipToCreate.Name = "tbZipToCreate"; + this.tbZipToCreate.Size = new System.Drawing.Size(432, 20); + this.tbZipToCreate.TabIndex = 30; + // + // btnZipupDirBrowse + // + this.btnZipupDirBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnZipupDirBrowse.Location = new System.Drawing.Point(399, 13); + this.btnZipupDirBrowse.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnZipupDirBrowse.Name = "btnZipupDirBrowse"; + this.btnZipupDirBrowse.Size = new System.Drawing.Size(24, 20); + this.btnZipupDirBrowse.TabIndex = 11; + this.btnZipupDirBrowse.Text = "..."; + this.toolTip1.SetToolTip(this.btnZipupDirBrowse, "Browse for a directory to search in"); + this.btnZipupDirBrowse.UseVisualStyleBackColor = true; + this.btnZipupDirBrowse.Click += new System.EventHandler(this.btnDirBrowse_Click); + // + // btnZipUp + // + this.btnZipUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnZipUp.Location = new System.Drawing.Point(512, 460); + this.btnZipUp.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnZipUp.Name = "btnZipUp"; + this.btnZipUp.Size = new System.Drawing.Size(66, 26); + this.btnZipUp.TabIndex = 140; + this.btnZipUp.Text = "Zip All"; + this.toolTip1.SetToolTip(this.btnZipUp, "actually save the Zip file. "); + this.btnZipUp.UseVisualStyleBackColor = true; + this.btnZipUp.Click += new System.EventHandler(this.btnZipup_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.Enabled = false; + this.btnCancel.Location = new System.Drawing.Point(512, 489); + this.btnCancel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(66, 26); + this.btnCancel.TabIndex = 90; + this.btnCancel.Text = "Cancel"; + this.toolTip1.SetToolTip(this.btnCancel, "cancel the currently running operation"); + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(6, 490); + this.progressBar1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(496, 10); + this.progressBar1.TabIndex = 4; + // + // progressBar2 + // + this.progressBar2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar2.Location = new System.Drawing.Point(6, 503); + this.progressBar2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.progressBar2.Name = "progressBar2"; + this.progressBar2.Size = new System.Drawing.Size(496, 10); + this.progressBar2.TabIndex = 17; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 17); + this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(86, 13); + this.label1.TabIndex = 0; + this.label1.Text = "directory to add: "; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 15); + this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(73, 13); + this.label2.TabIndex = 1; + this.label2.Text = "file to save to:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(6, 39); + this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(36, 13); + this.label3.TabIndex = 2; + this.label3.Text = "flavor:"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(250, 64); + this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(45, 13); + this.label4.TabIndex = 3; + this.label4.Text = "level:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(6, 89); + this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(54, 13); + this.label5.TabIndex = 4; + this.label5.Text = "encoding:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(6, 139); + this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(53, 13); + this.label6.TabIndex = 6; + this.label6.Text = "comment:"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 64); + this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(55, 13); + this.label7.TabIndex = 5; + this.label7.Text = "ZIP64?:"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(250, 89); + this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(59, 13); + this.label8.TabIndex = 91; + this.label8.Text = "encryption:"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(250, 114); + this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(55, 13); + this.label9.TabIndex = 93; + this.label9.Text = "password:"; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(250, 39); + this.label22.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(59, 13); + this.label22.TabIndex = 94; + this.label22.Text = "method:"; + // + // comboEncoding + // + this.comboEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboEncoding.FormattingEnabled = true; + this.comboEncoding.Location = new System.Drawing.Point(104, 85); + this.comboEncoding.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboEncoding.Name = "comboEncoding"; + this.comboEncoding.Size = new System.Drawing.Size(128, 21); + this.comboEncoding.TabIndex = 60; + this.toolTip1.SetToolTip(this.comboEncoding, "use this encoding when saving the file"); + this.comboEncoding.SelectedIndexChanged += new System.EventHandler(this.comboEncoding_SelectedIndexChanged); + // + // tbComment + // + this.tbComment.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbComment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbComment.ForeColor = System.Drawing.SystemColors.InactiveCaption; + this.tbComment.Location = new System.Drawing.Point(104, 133); + this.tbComment.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbComment.Name = "tbComment"; + this.tbComment.Size = new System.Drawing.Size(432, 20); + this.tbComment.TabIndex = 100; + this.tbComment.Text = "-zip file comment here-"; + this.toolTip1.SetToolTip(this.tbComment, "a comment to embed in the zip file"); + this.tbComment.Enter += new System.EventHandler(this.tbComment_Enter); + this.tbComment.Leave += new System.EventHandler(this.tbComment_Leave); + // + // lblStatus + // + this.lblStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(12, 471); + this.lblStatus.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(0, 13); + this.lblStatus.TabIndex = 8; + // + // comboCompLevel + // + this.comboCompLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboCompLevel.FormattingEnabled = true; + this.comboCompLevel.Location = new System.Drawing.Point(310, 60); + this.comboCompLevel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboCompLevel.Name = "comboCompLevel"; + this.comboCompLevel.Size = new System.Drawing.Size(122, 21); + this.comboCompLevel.TabIndex = 50; + this.toolTip1.SetToolTip(this.comboCompLevel, "The compression level to use when creating the zip."); + // + // comboEncryption + // + this.comboEncryption.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboEncryption.FormattingEnabled = true; + this.comboEncryption.Location = new System.Drawing.Point(310, 85); + this.comboEncryption.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboEncryption.Name = "comboEncryption"; + this.comboEncryption.Size = new System.Drawing.Size(122, 21); + this.comboEncryption.TabIndex = 80; + this.toolTip1.SetToolTip(this.comboEncryption, "AES is not compatible with some other zip tools."); + this.comboEncryption.SelectedIndexChanged += new System.EventHandler(this.comboEncryption_SelectedIndexChanged); + // + // tbPassword + // + this.tbPassword.AcceptsReturn = true; + this.tbPassword.Location = new System.Drawing.Point(310, 110); + this.tbPassword.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbPassword.Name = "tbPassword"; + this.tbPassword.PasswordChar = '*'; + this.tbPassword.Size = new System.Drawing.Size(104, 20); + this.tbPassword.TabIndex = 90; + this.tbPassword.Text = "c:\\dinoch\\dev\\dotnet\\zip\\test\\U.zip"; + this.tbPassword.TextChanged += new System.EventHandler(this.tbPassword_TextChanged); + // + // chkHidePassword + // + this.chkHidePassword.AutoSize = true; + this.chkHidePassword.Checked = true; + this.chkHidePassword.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkHidePassword.Location = new System.Drawing.Point(418, 113); + this.chkHidePassword.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkHidePassword.Name = "chkHidePassword"; + this.chkHidePassword.Size = new System.Drawing.Size(15, 14); + this.chkHidePassword.TabIndex = 91; + this.toolTip1.SetToolTip(this.chkHidePassword, "check to hide password characters"); + this.chkHidePassword.UseVisualStyleBackColor = true; + this.chkHidePassword.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); + // + // listView1 + // + this.listView1.AllowDrop = true; + this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView1.GridLines = true; + this.listView1.Location = new System.Drawing.Point(6, 137); + this.listView1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(572, 327); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView1_ColumnClick); + this.listView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listView1_DragDrop); + this.listView1.DragEnter += new System.Windows.Forms.DragEventHandler(this.listView_DragEnter); + // + // btnOpenZip + // + this.btnOpenZip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnOpenZip.Location = new System.Drawing.Point(518, 27); + this.btnOpenZip.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnOpenZip.Name = "btnOpenZip"; + this.btnOpenZip.Size = new System.Drawing.Size(60, 24); + this.btnOpenZip.TabIndex = 14; + this.btnOpenZip.Text = "Open"; + this.toolTip1.SetToolTip(this.btnOpenZip, "open and read the zip file"); + this.btnOpenZip.UseVisualStyleBackColor = true; + this.btnOpenZip.Click += new System.EventHandler(this.btnOpen_Click); + // + // tabControl1 + // + this.tabControl1.AllowDrop = true; + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage3); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(592, 548); + this.tabControl1.TabIndex = 96; + this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); + this.tabControl1.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabControl1_Selecting); + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.label20); + this.tabPage1.Controls.Add(this.label19); + this.tabPage1.Controls.Add(this.comboExistingFileAction); + this.tabPage1.Controls.Add(this.tbSelectionToExtract); + this.tabPage1.Controls.Add(this.label13); + this.tabPage1.Controls.Add(this.chkOpenExplorer); + this.tabPage1.Controls.Add(this.btnExtractDirBrowse); + this.tabPage1.Controls.Add(this.tbExtractDir); + this.tabPage1.Controls.Add(this.label11); + this.tabPage1.Controls.Add(this.label10); + this.tabPage1.Controls.Add(this.btnExtract); + this.tabPage1.Controls.Add(this.btnReadZipBrowse); + this.tabPage1.Controls.Add(this.tbZipToOpen); + this.tabPage1.Controls.Add(this.listView1); + this.tabPage1.Controls.Add(this.btnOpenZip); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabPage1.Size = new System.Drawing.Size(584, 522); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Read/Extract"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(5, 33); + this.label20.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(54, 13); + this.label20.TabIndex = 43; + this.label20.Text = "encoding:"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(6, 114); + this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(108, 13); + this.label19.TabIndex = 42; + this.label19.Text = "action for existing file:"; + // + // comboExistingFileAction + // + this.comboExistingFileAction.FormattingEnabled = true; + this.comboExistingFileAction.Location = new System.Drawing.Point(114, 109); + this.comboExistingFileAction.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboExistingFileAction.Name = "comboExistingFileAction"; + this.comboExistingFileAction.Size = new System.Drawing.Size(104, 21); + this.comboExistingFileAction.TabIndex = 41; + this.toolTip1.SetToolTip(this.comboExistingFileAction, "What to do when extracting a file that already exists"); + // + // tbSelectionToExtract + // + this.tbSelectionToExtract.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbSelectionToExtract.Location = new System.Drawing.Point(60, 83); + this.tbSelectionToExtract.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbSelectionToExtract.Name = "tbSelectionToExtract"; + this.tbSelectionToExtract.Size = new System.Drawing.Size(489, 20); + this.tbSelectionToExtract.TabIndex = 24; + this.tbSelectionToExtract.Text = "*.*"; + this.toolTip1.SetToolTip(this.tbSelectionToExtract, "Selection criteria. eg, (name = *.* and size> 1000) etc. Also use atime/mtime/c" + + "time and attributes. (HRSA)"); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(6, 87); + this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(52, 13); + this.label13.TabIndex = 27; + this.label13.Text = "selection:"; + // + // chkOpenExplorer + // + this.chkOpenExplorer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkOpenExplorer.AutoSize = true; + this.chkOpenExplorer.Location = new System.Drawing.Point(236, 111); + this.chkOpenExplorer.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkOpenExplorer.Name = "chkOpenExplorer"; + this.chkOpenExplorer.Size = new System.Drawing.Size(91, 17); + this.chkOpenExplorer.TabIndex = 28; + this.chkOpenExplorer.Text = "open Explorer"; + this.toolTip1.SetToolTip(this.chkOpenExplorer, "open explorer after extraction"); + this.chkOpenExplorer.UseVisualStyleBackColor = true; + // + // btnExtractDirBrowse + // + this.btnExtractDirBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnExtractDirBrowse.Location = new System.Drawing.Point(554, 54); + this.btnExtractDirBrowse.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnExtractDirBrowse.Name = "btnExtractDirBrowse"; + this.btnExtractDirBrowse.Size = new System.Drawing.Size(24, 24); + this.btnExtractDirBrowse.TabIndex = 23; + this.btnExtractDirBrowse.Text = "..."; + this.btnExtractDirBrowse.UseVisualStyleBackColor = true; + this.btnExtractDirBrowse.Click += new System.EventHandler(this.btnExtractDirBrowse_Click); + // + // tbExtractDir + // + this.tbExtractDir.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbExtractDir.Location = new System.Drawing.Point(60, 57); + this.tbExtractDir.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbExtractDir.Name = "tbExtractDir"; + this.tbExtractDir.Size = new System.Drawing.Size(489, 20); + this.tbExtractDir.TabIndex = 22; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(6, 61); + this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(54, 13); + this.label11.TabIndex = 16; + this.label11.Text = "extract to:"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(6, 9); + this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(45, 13); + this.label10.TabIndex = 15; + this.label10.Text = "archive:"; + // + // btnExtract + // + this.btnExtract.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnExtract.Enabled = false; + this.btnExtract.Location = new System.Drawing.Point(518, 106); + this.btnExtract.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnExtract.Name = "btnExtract"; + this.btnExtract.Size = new System.Drawing.Size(60, 24); + this.btnExtract.TabIndex = 24; + this.btnExtract.Text = "Extract"; + this.btnExtract.UseVisualStyleBackColor = true; + this.btnExtract.Click += new System.EventHandler(this.btnExtract_Click); + // + // btnReadZipBrowse + // + this.btnReadZipBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnReadZipBrowse.Location = new System.Drawing.Point(554, 3); + this.btnReadZipBrowse.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnReadZipBrowse.Name = "btnReadZipBrowse"; + this.btnReadZipBrowse.Size = new System.Drawing.Size(24, 24); + this.btnReadZipBrowse.TabIndex = 13; + this.btnReadZipBrowse.Text = "..."; + this.btnReadZipBrowse.UseVisualStyleBackColor = true; + this.btnReadZipBrowse.Click += new System.EventHandler(this.btnZipBrowse_Click); + // + // tbZipToOpen + // + this.tbZipToOpen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbZipToOpen.Location = new System.Drawing.Point(60, 5); + this.tbZipToOpen.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbZipToOpen.Name = "tbZipToOpen"; + this.tbZipToOpen.Size = new System.Drawing.Size(489, 20); + this.tbZipToOpen.TabIndex = 12; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.groupBox2); + this.tabPage2.Controls.Add(this.groupBox1); + this.tabPage2.Controls.Add(this.checkBox1); + this.tabPage2.Controls.Add(this.btnClearItemsToZip); + this.tabPage2.Controls.Add(this.textBox1); + this.tabPage2.Controls.Add(this.listView2); + this.tabPage2.Controls.Add(this.progressBar2); + this.tabPage2.Controls.Add(this.lblStatus); + this.tabPage2.Controls.Add(this.btnCancel); + this.tabPage2.Controls.Add(this.progressBar1); + this.tabPage2.Controls.Add(this.btnZipUp); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabPage2.Size = new System.Drawing.Size(584, 522); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Create"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.label21); + this.groupBox2.Controls.Add(this.comboEncodingUsage); + this.groupBox2.Controls.Add(this.label18); + this.groupBox2.Controls.Add(this.chkRemoveFiles); + this.groupBox2.Controls.Add(this.label17); + this.groupBox2.Controls.Add(this.comboSplit); + this.groupBox2.Controls.Add(this.chkUnixTime); + this.groupBox2.Controls.Add(this.chkWindowsTime); + this.groupBox2.Controls.Add(this.label16); + this.groupBox2.Controls.Add(this.tbExeOnUnpack); + this.groupBox2.Controls.Add(this.label15); + this.groupBox2.Controls.Add(this.tbDefaultExtractDirectory); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Controls.Add(this.tbZipToCreate); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.comboEncoding); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Controls.Add(this.tbComment); + this.groupBox2.Controls.Add(this.comboZip64); + this.groupBox2.Controls.Add(this.comboCompLevel); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.comboFlavor); + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.btnCreateZipBrowse); + this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.chkHidePassword); + this.groupBox2.Controls.Add(this.comboCompMethod); + this.groupBox2.Controls.Add(this.tbPassword); + this.groupBox2.Controls.Add(this.label8); + this.groupBox2.Controls.Add(this.label9); + this.groupBox2.Controls.Add(this.label22); + this.groupBox2.Controls.Add(this.comboEncryption); + this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.groupBox2.Location = new System.Drawing.Point(6, 84); + this.groupBox2.Margin = new System.Windows.Forms.Padding(0); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Padding = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.groupBox2.Size = new System.Drawing.Size(572, 230); + this.groupBox2.TabIndex = 104; + this.groupBox2.TabStop = false; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(6, 112); + this.label21.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(86, 13); + this.label21.TabIndex = 127; + this.label21.Text = "encoding usage:"; + // + // comboEncodingUsage + // + this.comboEncodingUsage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboEncodingUsage.FormattingEnabled = true; + this.comboEncodingUsage.Location = new System.Drawing.Point(104, 108); + this.comboEncodingUsage.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboEncodingUsage.Name = "comboEncodingUsage"; + this.comboEncodingUsage.Size = new System.Drawing.Size(128, 21); + this.comboEncodingUsage.TabIndex = 128; + this.toolTip1.SetToolTip(this.comboEncodingUsage, "use this encoding when saving the file"); + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(6, 209); + this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(66, 13); + this.label18.TabIndex = 126; + this.label18.Text = "remove files:"; + // + // chkRemoveFiles + // + this.chkRemoveFiles.AutoSize = true; + this.chkRemoveFiles.Location = new System.Drawing.Point(104, 208); + this.chkRemoveFiles.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkRemoveFiles.Name = "chkRemoveFiles"; + this.chkRemoveFiles.Size = new System.Drawing.Size(15, 14); + this.chkRemoveFiles.TabIndex = 125; + this.toolTip1.SetToolTip(this.chkRemoveFiles, "remove files after running post-extract command"); + this.chkRemoveFiles.UseVisualStyleBackColor = true; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(447, 89); + this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(28, 13); + this.label17.TabIndex = 124; + this.label17.Text = "split:"; + // + // comboSplit + // + this.comboSplit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboSplit.FormattingEnabled = true; + this.comboSplit.Location = new System.Drawing.Point(477, 85); + this.comboSplit.Name = "comboSplit"; + this.comboSplit.Size = new System.Drawing.Size(85, 21); + this.comboSplit.TabIndex = 123; + this.toolTip1.SetToolTip(this.comboSplit, "segment size when creating a spanned archive"); + this.comboSplit.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.comboBox1_DrawItem); + // + // chkUnixTime + // + this.chkUnixTime.AutoSize = true; + this.chkUnixTime.Location = new System.Drawing.Point(450, 60); + this.chkUnixTime.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkUnixTime.Name = "chkUnixTime"; + this.chkUnixTime.Size = new System.Drawing.Size(77, 17); + this.chkUnixTime.TabIndex = 122; + this.chkUnixTime.Text = "times: Unix"; + this.toolTip1.SetToolTip(this.chkUnixTime, "store extended times in Unix format"); + this.chkUnixTime.UseVisualStyleBackColor = true; + // + // chkWindowsTime + // + this.chkWindowsTime.AutoSize = true; + this.chkWindowsTime.Checked = true; + this.chkWindowsTime.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkWindowsTime.Location = new System.Drawing.Point(450, 39); + this.chkWindowsTime.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkWindowsTime.Name = "chkWindowsTime"; + this.chkWindowsTime.Size = new System.Drawing.Size(100, 17); + this.chkWindowsTime.TabIndex = 121; + this.chkWindowsTime.Text = "times: Windows"; + this.toolTip1.SetToolTip(this.chkWindowsTime, "store extended times in Windows format"); + this.chkWindowsTime.UseVisualStyleBackColor = true; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(6, 185); + this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(81, 13); + this.label16.TabIndex = 100; + this.label16.Text = "exe on unpack:"; + // + // tbExeOnUnpack + // + this.tbExeOnUnpack.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbExeOnUnpack.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbExeOnUnpack.ForeColor = System.Drawing.SystemColors.InactiveCaption; + this.tbExeOnUnpack.Location = new System.Drawing.Point(104, 181); + this.tbExeOnUnpack.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbExeOnUnpack.Name = "tbExeOnUnpack"; + this.tbExeOnUnpack.Size = new System.Drawing.Size(432, 20); + this.tbExeOnUnpack.TabIndex = 120; + this.tbExeOnUnpack.Text = "-command line to execute here-"; + this.toolTip1.SetToolTip(this.tbExeOnUnpack, "command to run upon successful extract of SFX"); + this.tbExeOnUnpack.TextChanged += new System.EventHandler(this.tbExeOnUnpack_TextChanged); + this.tbExeOnUnpack.Enter += new System.EventHandler(this.tbExeOnUnpack_Enter); + this.tbExeOnUnpack.Leave += new System.EventHandler(this.tbExeOnUnpack_Leave); + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(6, 161); + this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(91, 13); + this.label15.TabIndex = 98; + this.label15.Text = "default extract dir:"; + // + // tbDefaultExtractDirectory + // + this.tbDefaultExtractDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbDefaultExtractDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbDefaultExtractDirectory.ForeColor = System.Drawing.SystemColors.InactiveCaption; + this.tbDefaultExtractDirectory.Location = new System.Drawing.Point(104, 157); + this.tbDefaultExtractDirectory.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbDefaultExtractDirectory.Name = "tbDefaultExtractDirectory"; + this.tbDefaultExtractDirectory.Size = new System.Drawing.Size(432, 20); + this.tbDefaultExtractDirectory.TabIndex = 110; + this.tbDefaultExtractDirectory.Tag = "b"; + this.tbDefaultExtractDirectory.Text = "-default extract directory-"; + this.toolTip1.SetToolTip(this.tbDefaultExtractDirectory, "optional default extraction directory for SFX"); + this.tbDefaultExtractDirectory.Enter += new System.EventHandler(this.tbDefaultExtractDirectory_Enter); + this.tbDefaultExtractDirectory.Leave += new System.EventHandler(this.tbDefaultExtractDirectory_Leave); + // + // comboZip64 + // + this.comboZip64.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboZip64.FormattingEnabled = true; + this.comboZip64.Location = new System.Drawing.Point(104, 60); + this.comboZip64.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboZip64.Name = "comboZip64"; + this.comboZip64.Size = new System.Drawing.Size(128, 21); + this.comboZip64.TabIndex = 70; + this.toolTip1.SetToolTip(this.comboZip64, "ZIP64 is not compatible with some other zip tools."); + // + // comboCompMethod + // + this.comboCompMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboCompMethod.FormattingEnabled = true; + this.comboCompMethod.Location = new System.Drawing.Point(310, 35); + this.comboCompMethod.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboCompMethod.Name = "comboCompMethod"; + this.comboCompMethod.Size = new System.Drawing.Size(122, 21); + this.comboCompMethod.TabIndex = 71; + this.comboCompMethod.SelectedIndexChanged += new System.EventHandler(this.comboCompMethod_SelectedIndexChanged); + + this.toolTip1.SetToolTip(this.comboCompMethod, "BZip2 is not compatible with some other zip tools."); + // + // comboFlavor + // + this.comboFlavor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboFlavor.FormattingEnabled = true; + this.comboFlavor.Location = new System.Drawing.Point(104, 35); + this.comboFlavor.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.comboFlavor.Name = "comboFlavor"; + this.comboFlavor.Size = new System.Drawing.Size(128, 21); + this.comboFlavor.TabIndex = 40; + this.comboFlavor.SelectedIndexChanged += new System.EventHandler(this.comboFlavor_SelectedIndexChanged); + // + // btnCreateZipBrowse + // + this.btnCreateZipBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCreateZipBrowse.Location = new System.Drawing.Point(542, 10); + this.btnCreateZipBrowse.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnCreateZipBrowse.Name = "btnCreateZipBrowse"; + this.btnCreateZipBrowse.Size = new System.Drawing.Size(24, 20); + this.btnCreateZipBrowse.TabIndex = 31; + this.btnCreateZipBrowse.Text = "..."; + this.toolTip1.SetToolTip(this.btnCreateZipBrowse, "browse for a file to save to"); + this.btnCreateZipBrowse.UseVisualStyleBackColor = true; + this.btnCreateZipBrowse.Click += new System.EventHandler(this.btnCreateZipBrowse_Click); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.chkRecurse); + this.groupBox1.Controls.Add(this.chkTraverseJunctions); + this.groupBox1.Controls.Add(this.tbDirectoryToZip); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.btnZipupDirBrowse); + this.groupBox1.Controls.Add(this.tbDirectoryInArchive); + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Controls.Add(this.label14); + this.groupBox1.Controls.Add(this.tbSelectionToZip); + this.groupBox1.Controls.Add(this.label12); + this.groupBox1.Location = new System.Drawing.Point(6, -2); + this.groupBox1.Margin = new System.Windows.Forms.Padding(0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.groupBox1.Size = new System.Drawing.Size(572, 87); + this.groupBox1.TabIndex = 103; + this.groupBox1.TabStop = false; + // + // chkRecurse + // + this.chkRecurse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkRecurse.AutoSize = true; + this.chkRecurse.Checked = true; + this.chkRecurse.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkRecurse.Location = new System.Drawing.Point(435, 15); + this.chkRecurse.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkRecurse.Name = "chkRecurse"; + this.chkRecurse.Size = new System.Drawing.Size(61, 17); + this.chkRecurse.TabIndex = 126; + this.chkRecurse.Text = "recurse"; + this.toolTip1.SetToolTip(this.chkRecurse, "recurse directories when adding"); + this.chkRecurse.UseVisualStyleBackColor = true; + // + // chkTraverseJunctions + // + this.chkTraverseJunctions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkTraverseJunctions.AutoSize = true; + this.chkTraverseJunctions.Checked = true; + this.chkTraverseJunctions.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkTraverseJunctions.Location = new System.Drawing.Point(505, 15); + this.chkTraverseJunctions.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.chkTraverseJunctions.Name = "chkTraverseJunctions"; + this.chkTraverseJunctions.Size = new System.Drawing.Size(68, 18); + this.chkTraverseJunctions.TabIndex = 125; + this.chkTraverseJunctions.Text = "junctions"; + this.toolTip1.SetToolTip(this.chkTraverseJunctions, "traverse directory junctions and \r\nsymlinks when adding"); + this.chkTraverseJunctions.UseCompatibleTextRendering = true; + this.chkTraverseJunctions.UseVisualStyleBackColor = true; + // + // tbDirectoryInArchive + // + this.tbDirectoryInArchive.AcceptsReturn = true; + this.tbDirectoryInArchive.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbDirectoryInArchive.Location = new System.Drawing.Point(104, 38); + this.tbDirectoryInArchive.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbDirectoryInArchive.Name = "tbDirectoryInArchive"; + this.tbDirectoryInArchive.Size = new System.Drawing.Size(432, 20); + this.tbDirectoryInArchive.TabIndex = 14; + this.toolTip1.SetToolTip(this.tbDirectoryInArchive, "the directory to use within the archive."); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(542, 63); + this.button1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(24, 20); + this.button1.TabIndex = 21; + this.button1.Text = "+"; + this.toolTip1.SetToolTip(this.button1, "Add Selected files to the list of files to Save in the Zip"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(6, 42); + this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(99, 13); + this.label14.TabIndex = 16; + this.label14.Text = "directory in archive:"; + // + // tbSelectionToZip + // + this.tbSelectionToZip.AcceptsReturn = true; + this.tbSelectionToZip.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbSelectionToZip.Location = new System.Drawing.Point(104, 63); + this.tbSelectionToZip.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tbSelectionToZip.Name = "tbSelectionToZip"; + this.tbSelectionToZip.Size = new System.Drawing.Size(432, 20); + this.tbSelectionToZip.TabIndex = 20; + this.tbSelectionToZip.Text = "*.*"; + this.toolTip1.SetToolTip(this.tbSelectionToZip, resources.GetString("tbSelectionToZip.ToolTip")); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(6, 67); + this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(52, 13); + this.label12.TabIndex = 95; + this.label12.Text = "selection:"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(12, 322); + this.checkBox1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(15, 14); + this.checkBox1.TabIndex = 102; + this.checkBox1.TabStop = false; + this.toolTip1.SetToolTip(this.checkBox1, "select ALL"); + this.checkBox1.UseVisualStyleBackColor = true; + this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged_1); + // + // btnClearItemsToZip + // + this.btnClearItemsToZip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnClearItemsToZip.Location = new System.Drawing.Point(398, 460); + this.btnClearItemsToZip.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.btnClearItemsToZip.Name = "btnClearItemsToZip"; + this.btnClearItemsToZip.Size = new System.Drawing.Size(102, 26); + this.btnClearItemsToZip.TabIndex = 130; + this.btnClearItemsToZip.Text = "Remove Checked"; + this.toolTip1.SetToolTip(this.btnClearItemsToZip, "remove any checked files from the list of files to save in the zip"); + this.btnClearItemsToZip.UseVisualStyleBackColor = true; + this.btnClearItemsToZip.Click += new System.EventHandler(this.btnClearItemsToZip_Click); + // + // textBox1 + // + this.textBox1.AcceptsReturn = true; + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.textBox1.Location = new System.Drawing.Point(362, 463); + this.textBox1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 100; + this.toolTip1.SetToolTip(this.textBox1, "edit the value"); + this.textBox1.Visible = false; + this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); + // + // listView2 + // + this.listView2.AllowColumnReorder = true; + this.listView2.AllowDrop = true; + this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView2.CheckBoxes = true; + this.listView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chCheckbox, + this.columnHeader1, + this.columnHeader2, + this.columnHeader3}); + this.listView2.DoubleClickActivation = false; + this.listView2.FullRowSelect = true; + this.listView2.GridLines = true; + this.listView2.Location = new System.Drawing.Point(6, 316); + this.listView2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.listView2.MultiSelect = false; + this.listView2.Name = "listView2"; + this.listView2.Size = new System.Drawing.Size(572, 142); + this.listView2.TabIndex = 98; + this.listView2.UseCompatibleStateImageBehavior = false; + this.listView2.View = System.Windows.Forms.View.Details; + this.listView2.BeforeLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listView2_BeforeLabelEdit); + this.listView2.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listView2_ItemChecked); + this.listView2.DragDrop += new System.Windows.Forms.DragEventHandler(this.listView2_DragDrop); + this.listView2.DragEnter += new System.Windows.Forms.DragEventHandler(this.listView_DragEnter); + // + // chCheckbox + // + this.chCheckbox.Text = "?"; + this.chCheckbox.Width = 24; + // + // columnHeader1 + // + this.columnHeader1.Text = "File Name"; + // + // columnHeader2 + // + this.columnHeader2.Text = "Directory In Archive"; + // + // columnHeader3 + // + this.columnHeader3.Text = "File name in Archive"; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.richTextBox1); + this.tabPage3.Controls.Add(this.pictureBox1); + this.tabPage3.Location = new System.Drawing.Point(4, 22); + this.tabPage3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.tabPage3.Size = new System.Drawing.Size(584, 522); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "About"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // richTextBox1 + // + this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.richTextBox1.Location = new System.Drawing.Point(54, 20); + this.richTextBox1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(518, 497); + this.richTextBox1.TabIndex = 2; + this.richTextBox1.Text = "Placeholder only. "; + this.richTextBox1.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBox1_LinkClicked); + // + // pictureBox1 + // + this.pictureBox1.Image = global::Ionic.Zip.Forms.Properties.Resources.zippedFile; + this.pictureBox1.Location = new System.Drawing.Point(6, 20); + this.pictureBox1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(42, 52); + this.pictureBox1.TabIndex = 1; + this.pictureBox1.TabStop = false; + // + // ZipForm + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(592, 548); + this.Controls.Add(this.tabControl1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0); + this.MinimumSize = new System.Drawing.Size(598, 458); + this.Name = "ZipForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "DotNetZip Tool"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ZipForm_FormClosing); + this.Load += new System.EventHandler(this.ZipForm_Load); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.tabPage3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Button btnZipupDirBrowse; + private System.Windows.Forms.Button btnZipUp; + private System.Windows.Forms.Button btnOpenZip; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.ProgressBar progressBar2; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.TextBox tbDirectoryToZip; + private System.Windows.Forms.TextBox tbZipToCreate; + private System.Windows.Forms.TextBox tbComment; + private System.Windows.Forms.ComboBox comboEncoding; + private System.Windows.Forms.ComboBox comboCompLevel; + private System.Windows.Forms.ComboBox comboEncryption; + private System.Windows.Forms.TextBox tbPassword; + private System.Windows.Forms.CheckBox chkHidePassword; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.Button btnReadZipBrowse; + private System.Windows.Forms.TextBox tbZipToOpen; + private System.Windows.Forms.Button btnExtract; + private System.Windows.Forms.Button btnCreateZipBrowse; + private System.Windows.Forms.Button btnExtractDirBrowse; + private System.Windows.Forms.TextBox tbExtractDir; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.CheckBox chkOpenExplorer; + private System.Windows.Forms.TextBox tbSelectionToZip; + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.TextBox tbSelectionToExtract; + private System.Windows.Forms.TextBox tbDirectoryInArchive; + //private System.Windows.Forms.ListViewEx listView2; + //this.listView2 = new System.Windows.Forms.ListView(); + private ListViewEx.ListViewEx listView2; + private System.Windows.Forms.ComboBox comboZip64; + private System.Windows.Forms.ComboBox comboCompMethod; + private System.Windows.Forms.ComboBox comboFlavor; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button btnClearItemsToZip; + private System.Windows.Forms.ColumnHeader chCheckbox; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.ColumnHeader columnHeader3; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox tbDefaultExtractDirectory; + private System.Windows.Forms.TextBox tbExeOnUnpack; + private System.Windows.Forms.CheckBox chkUnixTime; + private System.Windows.Forms.CheckBox chkWindowsTime; + private System.Windows.Forms.ComboBox comboSplit; + private System.Windows.Forms.CheckBox chkTraverseJunctions; + private System.Windows.Forms.CheckBox chkRecurse; + private System.Windows.Forms.CheckBox chkRemoveFiles; + private System.Windows.Forms.ComboBox comboExistingFileAction; + private System.Windows.Forms.ComboBox comboEncodingUsage; + } +} + diff --git a/dotNetZip/Tools/WinFormsApp/ZipForm.cs b/dotNetZip/Tools/WinFormsApp/ZipForm.cs new file mode 100644 index 0000000..9bc1c19 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/ZipForm.cs @@ -0,0 +1,2154 @@ +// ZipForm.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Windows.Forms; +using Ionic.Zip; + +namespace Ionic.Zip.Forms +{ + public partial class ZipForm : Form + { + delegate void ZipProgress(ZipProgressEventArgs e); + delegate void ButtonClick(object sender, EventArgs e); + HiResTimer _hrt; + + public ZipForm() + { + InitializeComponent(); + + InitializeListboxes(); + FixTitle(); + FillFormFromRegistry(); + AdoptProgressBars(); + SetListView2(); + SetTextBoxes(); + + // first run only + if (numRuns == 0) + this.tabControl1.SelectedIndex = 2; // help/about tab + } + + // This constructor works to load zips from the command line. + // It also works to allow "open With..." from Windows Explorer. + public ZipForm(string[] args) + : this() + { + if (args != null && args.Length >= 1 && args[0] != null) + _initialFileToLoad = args[0]; + } + + // in ZipForm.DragDrop.cs + partial void SetDragDrop(); + + private void SetTextBoxes() + { + this.tbComment.Text= TB_COMMENT_NOTE; + this.tbDefaultExtractDirectory.Text= TB_EXTRACT_DIR_NOTE; + this.tbExeOnUnpack.Text= TB_EXE_ON_UNPACK_NOTE; + + // set autocomplete on a few textboxes + this.tbDirectoryToZip.AutoCompleteMode = AutoCompleteMode.Suggest; + this.tbDirectoryToZip.AutoCompleteSource = AutoCompleteSource.FileSystemDirectories; + + this.tbExtractDir.AutoCompleteMode = AutoCompleteMode.Suggest; + this.tbExtractDir.AutoCompleteSource = AutoCompleteSource.FileSystemDirectories; + + this.tbZipToOpen.AutoCompleteMode = AutoCompleteMode.Suggest; + this.tbZipToOpen.AutoCompleteSource = AutoCompleteSource.FileSystem; + + this.tbZipToCreate.AutoCompleteMode = AutoCompleteMode.Suggest; + this.tbZipToCreate.AutoCompleteSource = AutoCompleteSource.FileSystem; + + this.tbSelectionToExtract.AutoCompleteMode = AutoCompleteMode.Suggest; + this.tbSelectionToExtract.AutoCompleteSource = AutoCompleteSource.CustomSource; + this.tbSelectionToExtract.AutoCompleteCustomSource = _selectionCompletions; + + this.tbSelectionToZip.AutoCompleteMode = AutoCompleteMode.Suggest; + this.tbSelectionToZip.AutoCompleteSource = AutoCompleteSource.CustomSource; + this.tbSelectionToZip.AutoCompleteCustomSource = _selectionCompletions; + + tbExeOnUnpack_TextChanged(null, null); + } + + private void SetListView2() + { + // The listview2 is a ListViewEx control, an extension of + // System.Windows.Forms.ListView that allows editing of subitems using arbitrary + // controls. You can have a textbox, a datepicker, or other controls. + // I want the user to be able to modify the directory-in-archive value in the + // list, which is why ListViewEx is interesting. + + // I also want a checkbox associated to each list item, but I don't want the + // checkbox attached to the first subitem, as it normally is in a ListView. So I + // put an empty string as the main ListView item (subitem #0), and then the + // filename and directory-in-archive value in the 2nd and 3rd columns (subitems 1 + // and 2). This way, the checkbox gets its own column. + + // Next twist is I want the checkbox label to be uneditable, which is easy + // by just installing a listView2_BeforeLabelEdit method and always cancelling + // it. (e.CancelEdit = true). + + // And then there is a "master checkbox" at the column header that indicates + // whether the state of all checkboxes in the list is the same. With the "check + // change" of any item in the list I want to see if the master should be checked + // or unchecked. + + // The final thing is I want the checkbox for each item to change state only if I + // click on the checkbox itself, rather than "anywhere in the item row". + + this.listView2.SubItemClicked += new ListViewEx.SubItemEventHandler(listView2_SubItemClicked); + this.listView2.SubItemEndEditing += new ListViewEx.SubItemEndEditingEventHandler(listView2_SubItemEndEditing); + this.listView2.DoubleClickActivation = true; + SetDragDrop(); + } + + + + private void AdoptProgressBars() + { + tabControl1_SelectedIndexChanged(null, null); + } + + private void FixTitle() + { + this.Text = String.Format("DotNetZip Tool v{0}", + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + } + + private void InitializeListboxes() + { + InitEncodingsList(); + InitFlavorList(); + InitZip64List(); + InitCompMethodList(); + InitCompressionLevelList(); + InitEncryptionList(); + InitSplitBox(); + InitExtractExistingFileList(); + } + + private void InitSplitBox() + { + string[] values = { "-none-", "64kb", "128kb", "256kb", "512kb", "1mb", "2mb", "4mb", "8mb", "16mb", "32mb", "64mb", "128mb", "256mb", "512mb", "1gb" }; + foreach (var value in values) + this.comboSplit.Items.Add(value); + this.comboSplit.SelectedIndex = 0; + + this.comboSplit.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + //this.comboSplit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + } + + private void InitEncryptionList() + { + List _EncryptionNames = new List(Enum.GetNames(typeof(Ionic.Zip.EncryptionAlgorithm))); + foreach (var name in _EncryptionNames) + { + if (name != "Unsupported") + comboEncryption.Items.Add(name); + } + + // select the first item: + comboEncryption.SelectedIndex = 0; + this.tbPassword.Text = ""; + } + + + private void InitExtractExistingFileList() + { + List _ExtractActionNames = new List(Enum.GetNames(typeof(Ionic.Zip.ExtractExistingFileAction))); + foreach (var name in _ExtractActionNames) + { + if (!name.StartsWith("Invoke")) + { + if (name.StartsWith("Throw")) + comboExistingFileAction.Items.Add("Stop"); + else + comboExistingFileAction.Items.Add(name); + } + } + + // select the first item: + comboExistingFileAction.SelectedIndex = 0; + } + + + private void InitEncodingsList() + { + List _EncodingNames = new List(); + var e = System.Text.Encoding.GetEncodings(); + foreach (var e1 in e) + { + if (!_EncodingNames.Contains(e1.Name)) + if (!_EncodingNames.Contains(e1.Name.ToUpper())) + if (!_EncodingNames.Contains(e1.Name.ToLower())) + if (e1.Name != "IBM437" && e1.Name != "utf-8") + _EncodingNames.Add(e1.Name); + } + _EncodingNames.Sort(); + comboEncoding.Items.Add("zip default (IBM437)"); + comboEncoding.Items.Add("utf-8"); + foreach (var name in _EncodingNames) + { + comboEncoding.Items.Add(name); + } + + // select the first item: + comboEncoding.SelectedIndex = 0; + + // also set the encoding usage + List _UsageNames = new List(Enum.GetNames(typeof(Ionic.Zip.ZipOption))); + _UsageNames.Sort(); + foreach (var name in _UsageNames) + { + if (!name.StartsWith("Default")) + comboEncodingUsage.Items.Add(name); + } + + // select the first item: + comboEncodingUsage.SelectedIndex = 0; + } + + + private void InitCompressionLevelList() + { + List _CompressionLevelNames = new List(Enum.GetNames(typeof(Ionic.Zlib.CompressionLevel))); + _CompressionLevelNames.Sort(); + foreach (var name in _CompressionLevelNames) + { + if (!name.StartsWith("Level")) + { + comboCompLevel.Items.Add(name); + } + } + + // select the 2nd item, "Default": + comboCompLevel.SelectedIndex = 2; + } + + private void InitFlavorList() + { + this.comboFlavor.Items.Add("traditional Zip"); + this.comboFlavor.Items.Add("Self-extractor (GUI)"); + this.comboFlavor.Items.Add("Self-extractor (CMD)"); + // select the first item: + comboFlavor.SelectedIndex = 0; + } + + private void InitZip64List() + { + var _Names = new List(Enum.GetNames(typeof(Ionic.Zip.Zip64Option))); + _Names.Sort(); + foreach (var name in _Names) + { + if (!name.StartsWith("Default")) + comboZip64.Items.Add(name); + } + + // select the first item: + comboZip64.SelectedIndex = 0; + } + + + private void InitCompMethodList() + { + var _Names = new List(Enum.GetNames(typeof(Ionic.Zip.CompressionMethod))); + _Names.Sort(); + foreach (var name in _Names) + { + if (!name.StartsWith("Default")) + comboCompMethod.Items.Add(name); + } + + // select DEFLATE: + comboCompMethod.SelectedIndex = 1; + } + + + + private void KickoffZipup() + { + if (String.IsNullOrEmpty(this.tbDirectoryToZip.Text)) return; + if (!System.IO.Directory.Exists(this.tbDirectoryToZip.Text)) + { + var dlgResult = MessageBox.Show(String.Format("The directory you have specified ({0}) does not exist.", this.tbZipToCreate.Text), + "Not gonna happen", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + if (this.tbZipToCreate.Text == null || this.tbZipToCreate.Text == "") return; + + // check for existence of the zip file: + if (System.IO.File.Exists(this.tbZipToCreate.Text)) + { + var dlgResult = MessageBox.Show(String.Format("The file you have specified ({0}) already exists. Do you want to overwrite this file?", this.tbZipToCreate.Text), "Confirmation is Required", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (dlgResult != DialogResult.Yes) return; + System.IO.File.Delete(this.tbZipToCreate.Text); + } + + + // check for a valid zip file name: + string extension = System.IO.Path.GetExtension(this.tbZipToCreate.Text); + if ((extension != ".exe" && (this.comboFlavor.SelectedIndex == 1 || this.comboFlavor.SelectedIndex == 2)) || + (extension != ".zip" && this.comboFlavor.SelectedIndex == 0)) + { + var dlgResult = MessageBox.Show(String.Format("The file you have specified ({0}) has a non-standard extension ({1}) for this zip flavor. Do you want to continue anyway?", + this.tbZipToCreate.Text, extension), "Hold on there, pardner!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (dlgResult != DialogResult.Yes) return; + System.IO.File.Delete(this.tbZipToCreate.Text); + } + + _hrt = new HiResTimer(); + _hrt.Start(); + + _working = true; + _operationCanceled = false; + _nFilesCompleted = 0; + _totalBytesAfterCompress = 0; + _totalBytesBeforeCompress = 0; + PauseUI("Zipping..."); + lblStatus.Text = "Zipping..."; + + var options = new SaveWorkerOptions + { + ZipName = this.tbZipToCreate.Text, + Selection = this.tbSelectionToZip.Text, + TraverseJunctions = this.chkTraverseJunctions.Checked, + Encoding = "ibm437", + //EncodingUsage = ZipOption.Always, + ZipFlavor = this.comboFlavor.SelectedIndex, + Password = this.tbPassword.Text, + WindowsTimes = this.chkWindowsTime.Checked, + UnixTimes = this.chkUnixTime.Checked, + RemoveFilesAfterExe = this.chkRemoveFiles.Checked, + ExtractExistingFile = this.comboExistingFileAction.SelectedIndex, + }; + + if (this.comboEncoding.SelectedIndex != 0) + options.Encoding = this.comboEncoding.SelectedItem.ToString(); + + options.Encryption = (EncryptionAlgorithm) Enum.Parse(typeof(EncryptionAlgorithm), + this.comboEncryption.SelectedItem.ToString()); + + options.CompressionLevel = (Ionic.Zlib.CompressionLevel) Enum.Parse(typeof(Ionic.Zlib.CompressionLevel), + this.comboCompLevel.SelectedItem.ToString()); + options.CompressionMethod = (Ionic.Zip.CompressionMethod) Enum.Parse(typeof(Ionic.Zip.CompressionMethod), + this.comboCompMethod.SelectedItem.ToString()); + + options.EncodingUsage = (Ionic.Zip.ZipOption) Enum.Parse(typeof(Ionic.Zip.ZipOption), + this.comboEncodingUsage.SelectedItem.ToString()); + + string arg = this.comboSplit.SelectedItem.ToString().ToUpper(); + + try + { + int multiplier = 1; + int suffixLength = 0; + if (arg.EndsWith("KB")) + { + multiplier = 1024; suffixLength = 2; + } + else if (arg.EndsWith("K")) + { + multiplier = 1024; suffixLength = 1; + } + else if (arg.EndsWith("MB")) + { + multiplier = 1024*1024; suffixLength = 2; + } + else if (arg.EndsWith("M")) + { + multiplier = 1024*1024; suffixLength = 1; + } + else if (arg.EndsWith("GB")) + { + multiplier = 1024*1024*1024; suffixLength = 2; + } + else if (arg.EndsWith("G")) + { + multiplier = 1024*1024*1024; suffixLength = 1; + } + + if (suffixLength > 0) + { + options.MaxSegmentSize = + Int32.Parse(arg.Substring(0,arg.Length-suffixLength)) * multiplier; + } + else + options.MaxSegmentSize = Int32.Parse(arg); + } + catch + { + // just reset to "none" + this.comboSplit.SelectedIndex = 0; + options.MaxSegmentSize = 0; + } + + options.Zip64 = (Zip64Option)Enum.Parse(typeof(Zip64Option), + this.comboZip64.SelectedItem.ToString()); + + //this.listView2.Items.ToList(); + var entriesList = new System.Collections.ArrayList(this.listView2.Items); + options.Entries = System.Array.ConvertAll((ListViewItem[])entriesList.ToArray(typeof(ListViewItem)), (item) => + { + return new ItemToAdd + { + LocalFileName = item.SubItems[1].Text, + DirectoryInArchive = item.SubItems[2].Text, + FileNameInArchive = item.SubItems[3].Text, + }; + } + ); + + string compress = (options.CompressionMethod == Ionic.Zip.CompressionMethod.Deflate) + ? "Deflate level" + options.CompressionLevel.ToString() + : options.CompressionMethod.ToString(); + + options.Comment = String.Format("Encoding:{0} || Compression:{1} || Encrypt:{2} || ZIP64:{3}\r\nCreated at {4} || {5}\r\n", + options.Encoding, + compress, + (this.tbPassword.Text == "") ? "None" : options.Encryption.ToString(), + options.Zip64.ToString(), + System.DateTime.Now.ToString("yyyy-MMM-dd HH:mm:ss"), + this.Text); + + if (this.tbComment.Text != TB_COMMENT_NOTE) + options.Comment += this.tbComment.Text; + + if (this.tbExeOnUnpack.Text != TB_EXE_ON_UNPACK_NOTE) + options.ExeOnUnpack = this.tbExeOnUnpack.Text; + + if (this.tbDefaultExtractDirectory.Text != TB_EXTRACT_DIR_NOTE) + options.ExtractDirectory = this.tbDefaultExtractDirectory.Text; + + _workerThread = new Thread(this.DoSave); + _workerThread.Name = "Zip Saver thread"; + _workerThread.Start(options); + this.Cursor = Cursors.WaitCursor; + } + + + private string FlavorToString(int p) + { + if (p == 2) return "SFX-CMD"; + if (p == 1) return "SFX-GUI"; + return "ZIP"; + } + + + private bool _firstFocusInCommentTextBox = true; + private void tbComment_Enter(object sender, EventArgs e) + { + if (_firstFocusInCommentTextBox) + { + tbComment.Text = ""; + tbComment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + tbComment.ForeColor = System.Drawing.SystemColors.WindowText; + _firstFocusInCommentTextBox = false; + } + } + + private void tbComment_Leave(object sender, EventArgs e) + { + string TextInTheBox = tbComment.Text; + + if ((TextInTheBox == null) || (TextInTheBox == "")) + { + this.tbComment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbComment.ForeColor = System.Drawing.SystemColors.InactiveCaption; + _firstFocusInCommentTextBox = true; + this.tbComment.Text = TB_COMMENT_NOTE; + } + } + + + private bool _firstFocusInExtractDirTextBox = true; + private void tbDefaultExtractDirectory_Enter(object sender, EventArgs e) + { + if (_firstFocusInExtractDirTextBox) + { + tbDefaultExtractDirectory.Text = ""; + tbDefaultExtractDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + tbDefaultExtractDirectory.ForeColor = System.Drawing.SystemColors.WindowText; + _firstFocusInExtractDirTextBox = false; + } + } + + private void tbDefaultExtractDirectory_Leave(object sender, EventArgs e) + { + string TextInTheBox = tbDefaultExtractDirectory.Text; + + if ((TextInTheBox == null) || (TextInTheBox == "")) + { + this.tbDefaultExtractDirectory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbDefaultExtractDirectory.ForeColor = System.Drawing.SystemColors.InactiveCaption; + _firstFocusInExtractDirTextBox = true; + this.tbDefaultExtractDirectory.Text = TB_EXTRACT_DIR_NOTE; + } + } + + + // I want the values in the combobox to be right-aligned. + private int delta = 0; + private void comboBox1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) + { + var rc = new System.Drawing.Rectangle(e.Bounds.X + delta, e.Bounds.Y + delta, + e.Bounds.Width - delta, e.Bounds.Height - delta); + + var sf = new System.Drawing.StringFormat + { + Alignment = System.Drawing.StringAlignment.Far + }; + + string str = (string)comboSplit.Items[e.Index]; + + if (e.State == (DrawItemState.Selected | DrawItemState.NoAccelerator + | DrawItemState.NoFocusRect) || + e.State == DrawItemState.Selected) + { + e.Graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.CornflowerBlue), rc); + e.Graphics.DrawString(str, this.comboSplit.Font, new System.Drawing.SolidBrush(System.Drawing.Color.Cyan), rc, sf); + } + else + { + e.Graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.White), rc); + e.Graphics.DrawString(str, this.comboSplit.Font, new System.Drawing.SolidBrush(System.Drawing.Color.Black), rc, sf); + } + } + + + private bool _firstFocusInExeTextBox = true; + private void tbExeOnUnpack_Enter(object sender, EventArgs e) + { + if (_firstFocusInExeTextBox) + { + tbExeOnUnpack.Text = ""; + tbExeOnUnpack.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + tbExeOnUnpack.ForeColor = System.Drawing.SystemColors.WindowText; + _firstFocusInExeTextBox = false; + } + } + + private void tbExeOnUnpack_Leave(object sender, EventArgs e) + { + string TextInTheBox = tbExeOnUnpack.Text; + + if ((TextInTheBox == null) || (TextInTheBox == "")) + { + this.tbExeOnUnpack.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tbExeOnUnpack.ForeColor = System.Drawing.SystemColors.InactiveCaption; + _firstFocusInExeTextBox = true; + this.tbExeOnUnpack.Text = TB_EXE_ON_UNPACK_NOTE; + this.label18.Enabled = false; + this.chkRemoveFiles.Enabled = false; + } + else + { + this.label18.Enabled = true; + this.chkRemoveFiles.Enabled = true; + } + } + + + private void tbExeOnUnpack_TextChanged(object sender, EventArgs e) + { + if (this.tbExeOnUnpack.Text != TB_EXE_ON_UNPACK_NOTE && this.tbExeOnUnpack.Text != "") + { + this.label18.Enabled = true; + this.chkRemoveFiles.Enabled = true; + } + else + { + this.label18.Enabled = false; + this.chkRemoveFiles.Enabled = false; + } + } + + + + private void SetProgressBars() + { + if (this.progressBar1.InvokeRequired) + { + this.progressBar1.Invoke(new MethodInvoker(this.SetProgressBars)); + //this.progressBar1.Invoke(new ProgressBarSetup(this.SetProgressBars), new object[] { count }); + } + else + { + this.progressBar1.Value = 0; + this.progressBar1.Maximum = _totalEntriesToProcess; + this.progressBar1.Minimum = 0; + this.progressBar1.Step = 1; + this.progressBar2.Value = 0; + this.progressBar2.Minimum = 0; + this.progressBar2.Maximum = 1; // will be set later, for each entry. + this.progressBar2.Step = 1; + } + } + + + private void DoSave(Object p) + { + SaveWorkerOptions options = p as SaveWorkerOptions; + try + { + using (var zip1 = new ZipFile()) + { + zip1.CompressionMethod = options.CompressionMethod; + zip1.CompressionLevel = options.CompressionLevel; + zip1.AlternateEncoding = System.Text.Encoding.GetEncoding(options.Encoding); + zip1.AlternateEncodingUsage = options.EncodingUsage; + zip1.Comment = options.Comment; + zip1.MaxOutputSegmentSize = options.MaxSegmentSize; + zip1.Password = (options.Password != "") ? options.Password : null; + zip1.Encryption = options.Encryption; + zip1.EmitTimesInWindowsFormatWhenSaving = options.WindowsTimes; + zip1.EmitTimesInUnixFormatWhenSaving = options.UnixTimes; + zip1.AddDirectoryWillTraverseReparsePoints = options.TraverseJunctions; + foreach (ItemToAdd item in options.Entries) + { + var e = zip1.AddItem(item.LocalFileName, item.DirectoryInArchive); + // use a different name in the archive if appropriate + if (!String.IsNullOrEmpty(item.FileNameInArchive) && item.FileNameInArchive != System.IO.Path.GetFileName(item.LocalFileName)) + e.FileName = item.FileNameInArchive; + } + + _totalEntriesToProcess = zip1.EntryFileNames.Count; + SetProgressBars(); + zip1.TempFileFolder = System.IO.Path.GetDirectoryName(options.ZipName); + zip1.SaveProgress += this.zip1_SaveProgress; + + zip1.UseZip64WhenSaving = options.Zip64; + + if (options.ZipFlavor == 2 || options.ZipFlavor == 1) + { + SelfExtractorSaveOptions sfxOptions = new SelfExtractorSaveOptions() + { + Flavor = (options.ZipFlavor == 1)?SelfExtractorFlavor.WinFormsApplication: + SelfExtractorFlavor.ConsoleApplication, + DefaultExtractDirectory = options.ExtractDirectory, + PostExtractCommandLine = options.ExeOnUnpack, + RemoveUnpackedFilesAfterExecute = options.RemoveFilesAfterExe, + ExtractExistingFile = (ExtractExistingFileAction) options.ExtractExistingFile, + }; + + zip1.SaveSelfExtractor(options.ZipName, sfxOptions); + } + else + zip1.Save(options.ZipName); + } + } + catch (System.Exception exc1) + { + MessageBox.Show(String.Format("Exception while zipping:\n{0}\n\n{1}", exc1.Message, exc1.StackTrace.ToString())); + btnCancel_Click(null, null); + } + } + + + + void zip1_SaveProgress(object sender, SaveProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Saving_AfterWriteEntry: + StepArchiveProgress(e); + break; + case ZipProgressEventType.Saving_EntryBytesRead: + StepEntryProgress(e); + break; + case ZipProgressEventType.Saving_Completed: + SaveCompleted(); + break; + case ZipProgressEventType.Saving_AfterSaveTempArchive: + TempArchiveSaved(); + break; + } + if (_operationCanceled) + e.Cancel = true; + } + + private void TempArchiveSaved() + { + if (this.lblStatus.InvokeRequired) + { + this.lblStatus.Invoke(new MethodInvoker(this.TempArchiveSaved)); + } + else + { + System.TimeSpan ts = new System.TimeSpan(0, 0, (int)_hrt.Seconds); + + lblStatus.Text = String.Format("Temp archive saved ({0})...{1}...", + ts.ToString(), + (this.comboFlavor.SelectedIndex == 0) + ? "finishing" + : "compiling SFX"); + } + } + + + + private void SaveCompleted() + { + if (this.lblStatus.InvokeRequired) + { + this.lblStatus.Invoke(new MethodInvoker(this.SaveCompleted)); + } + else + { + _hrt.Stop(); + System.TimeSpan ts = new System.TimeSpan(0, 0, (int)_hrt.Seconds); + lblStatus.Text = String.Format("Done, Compressed {0} files, {1:N0}% of original, time: {2}", + _nFilesCompleted, (100.00 * _totalBytesAfterCompress) / _totalBytesBeforeCompress, + ts.ToString()); + ResetUiState(); + } + } + + + + private void StepArchiveProgress(ZipProgressEventArgs e) + { + if (this.progressBar1.InvokeRequired) + { + this.progressBar1.Invoke(new ZipProgress(this.StepArchiveProgress), new object[] { e }); + } + else + { + if (!_operationCanceled) + { + _nFilesCompleted++; + this.progressBar1.PerformStep(); + _totalBytesAfterCompress += e.CurrentEntry.CompressedSize; + _totalBytesBeforeCompress += e.CurrentEntry.UncompressedSize; + + // reset the progress bar for the entry: + this.progressBar2.Value = this.progressBar2.Maximum = 1; + + this.Update(); + +#if NOT_SPEEDY + // Sleep here just to show the progress bar, when the number of files is small, + // or when all done. + // You may not want this for actual use! + if (this.progressBar2.Value == this.progressBar2.Maximum) + Thread.Sleep(350); + else if (_entriesToZip < 10) + Thread.Sleep(350); + else if (_entriesToZip < 20) + Thread.Sleep(200); + else if (_entriesToZip < 30) + Thread.Sleep(100); + else if (_entriesToZip < 45) + Thread.Sleep(80); + else if (_entriesToZip < 75) + Thread.Sleep(40); + // more than 75 entries, don't sleep at all. +#endif + + } + } + } + + + private void StepEntryProgress(ZipProgressEventArgs e) + { + if (this.progressBar2.InvokeRequired) + { + this.progressBar2.Invoke(new ZipProgress(this.StepEntryProgress), new object[] { e }); + } + else + { + if (!_operationCanceled) + { + if (this.progressBar2.Maximum == 1) + { + // reset + Int64 entryMax = e.TotalBytesToTransfer; + Int64 absoluteMax = System.Int32.MaxValue; + _progress2MaxFactor = 0; + while (entryMax > absoluteMax) + { + entryMax /= 2; + _progress2MaxFactor++; + } + if ((int)entryMax < 0) entryMax *= -1; + this.progressBar2.Maximum = (int)entryMax; + lblStatus.Text = String.Format("{0} of {1} files...({2})", + _nFilesCompleted + 1, _totalEntriesToProcess, e.CurrentEntry.FileName); + } + + // downcast is safe here because we have shifted e.BytesTransferred + int xferred = (int)(e.BytesTransferred >> _progress2MaxFactor); + + this.progressBar2.Value = (xferred >= this.progressBar2.Maximum) + ? this.progressBar2.Maximum + : xferred; + + this.Update(); + } + } + } + + + + private void btnDirBrowse_Click(object sender, EventArgs e) + { + var dlg1 = new Ionic.Utils.FolderBrowserDialogEx + { + Description = "Select a folder to zip up:", + ShowNewFolderButton = false, + ShowEditBox = true, + //NewStyle = false, + SelectedPath = this.tbDirectoryToZip.Text, + ShowFullPathInEditBox = true, + }; + dlg1.RootFolder = System.Environment.SpecialFolder.MyComputer; + + var result = dlg1.ShowDialog(); + + if (result == DialogResult.OK) + { + this.tbDirectoryToZip.Text = dlg1.SelectedPath; + this.tbDirectoryInArchive.Text = System.IO.Path.GetFileName(this.tbDirectoryToZip.Text); + } + } + + private void btnCreateZipBrowse_Click(object sender, EventArgs e) + { + var dlg1 = new SaveFileDialog + { + OverwritePrompt = false, + Title = "Where would you like to save the generated Zip file?", + Filter = "ZIP files|*.zip", + }; + + try + { + dlg1.FileName = System.IO.Path.GetFileName(this.tbZipToCreate.Text); + } + catch + { + dlg1.FileName = ""; + } + + try + { + dlg1.InitialDirectory = System.IO.Path.GetDirectoryName(this.tbZipToCreate.Text); + } + catch + { + dlg1.InitialDirectory = ""; + } + + var result = dlg1.ShowDialog(); + if (result == DialogResult.OK) + { + this.tbZipToCreate.Text = dlg1.FileName; + } + } + + + private void btnZipup_Click(object sender, EventArgs e) + { + // Do not start zipping while editing a textbox + // in listView2. + if (!textBox1.Visible) + KickoffZipup(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + if (this.lblStatus.InvokeRequired) + { + this.lblStatus.Invoke(new ButtonClick(this.btnCancel_Click), new object[] { sender, e }); + } + else + { + _operationCanceled = true; + lblStatus.Text = "Canceled..."; + ResetUiState(); + } + } + + private void comboFlavor_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.comboFlavor.SelectedIndex == 1 || this.comboFlavor.SelectedIndex == 2) + { + // intelligently change the name of the thing to create + // It's an SFX, swap out ZIP and insert EXE + if (this.tbZipToCreate.Text.ToUpper().EndsWith(".ZIP")) + { + tbZipToCreate.Text = System.Text.RegularExpressions.Regex.Replace(tbZipToCreate.Text, "(?i:)\\.zip$", ".exe"); + } + // enable/disable other dependent UI elements + this.label17.Enabled = false; + this.comboSplit.Enabled = false; + this.label15.Enabled = true; + this.tbDefaultExtractDirectory.Enabled = true; + this.label16.Enabled = true; + this.tbExeOnUnpack.Enabled = true; + + this.label18.Enabled = true; + this.chkRemoveFiles.Enabled = true; + + } + else if (this.comboFlavor.SelectedIndex == 0) + { + // intelligently change the name of the thing to create + // It's a regular ZIP, so swap out EXE and insert ZIP + if (this.tbZipToCreate.Text.ToUpper().EndsWith(".EXE")) + { + tbZipToCreate.Text = System.Text.RegularExpressions.Regex.Replace(tbZipToCreate.Text, "(?i:)\\.exe$", ".zip"); + } + + // enable/disable other dependent UI elements + this.label17.Enabled = true; + this.comboSplit.Enabled = true; + this.label15.Enabled = false; + this.tbDefaultExtractDirectory.Enabled = false; + this.label16.Enabled = false; + this.tbExeOnUnpack.Enabled = false; + this.label18.Enabled = false; + this.chkRemoveFiles.Enabled = false; + } + } + + + private void comboEncryption_SelectedIndexChanged(object sender, EventArgs e) + { + //this.tbPassword.Enabled = (this.comboBox3.SelectedItem.ToString() != "None"); + if (this.comboEncryption.SelectedIndex == 0) + { + this.label9.Enabled = false; + this.tbPassword.Enabled = false; + this.chkHidePassword.Enabled = false; + } + else + { + this.label9.Enabled = true; + this.tbPassword.Enabled = true; + this.chkHidePassword.Enabled = true; + } + } + + private void comboCompMethod_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.comboCompMethod.SelectedIndex == 1) // DEFLATE + { + this.label4.Enabled = true; + this.comboCompLevel.Enabled = true; + } + else + { + this.label4.Enabled = false; + this.comboCompLevel.Enabled = false; + } + } + + private void comboEncoding_SelectedIndexChanged(object sender, EventArgs e) + { + this.comboEncodingUsage.Enabled = (this.comboEncoding.SelectedIndex != 0); + } + + private void checkBox1_CheckedChanged(object sender, EventArgs e) + { + this.tbPassword.PasswordChar = (this.chkHidePassword.Checked) ? '*' : '\0'; + } + + private void ResetUiState() + { + this.btnZipUp.Text = "Zip it!"; + this.btnZipUp.Enabled = true; + this.btnCancel.Text = "Cancel"; + this.btnCancel.Enabled = false; + this.btnExtract.Text = "Extract"; + this.btnExtractDirBrowse.Enabled = true; + this.btnZipupDirBrowse.Enabled = true; + this.btnReadZipBrowse.Enabled = true; + this.btnClearItemsToZip.Enabled = true; + this.btnCreateZipBrowse.Enabled = true; + + this.progressBar1.Value = 0; + this.progressBar2.Value = 0; + this.Cursor = Cursors.Default; + if (_workerThread != null) + if (!_workerThread.IsAlive) + _workerThread.Join(); + + _working = false; + } + + + private void SelectNamedEncoding(string s) + { + _SelectComboBoxItem(this.comboEncoding, s); + } + + private void SelectNamedEncodingUsage(string s) + { + _SelectComboBoxItem(this.comboEncodingUsage, s); + } + + private void SelectNamedCompressionLevel(string s) + { + _SelectComboBoxItem(this.comboCompLevel, s); + } + + private void SelectNamedCompressionMethod(string s) + { + _SelectComboBoxItem(this.comboCompMethod, s); + } + + private void SelectNamedEncryption(string s) + { + _SelectComboBoxItem(this.comboEncryption, s); + //tbPassword.Text = ""; + comboEncryption_SelectedIndexChanged(null, null); + } + + private void _SelectComboBoxItem(ComboBox c, string s) + { + for (int i = 0; i < c.Items.Count; i++) + { + if (c.Items[i].ToString() == s) + { + c.SelectedIndex = i; + break; + } + } + } + + + private void ZipForm_FormClosing(object sender, FormClosingEventArgs e) + { + SaveFormToRegistry(); + } + + + + private void btnZipBrowse_Click(object sender, EventArgs e) + { + OpenFileDialog openFileDialog1 = new OpenFileDialog(); + + openFileDialog1.InitialDirectory = (System.IO.File.Exists(this.tbZipToOpen.Text) ? System.IO.Path.GetDirectoryName(this.tbZipToOpen.Text) : this.tbZipToOpen.Text); + openFileDialog1.Filter = "zip files|*.zip|EXE files|*.exe|All Files|*.*"; + openFileDialog1.FilterIndex = 1; + openFileDialog1.RestoreDirectory = true; + + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + this.tbZipToOpen.Text = openFileDialog1.FileName; + if (System.IO.File.Exists(this.tbZipToOpen.Text)) + btnOpen_Click(sender, e); + } + } + + + + string _DisplayedZip = null; + + private void btnOpen_Click(object sender, EventArgs e) + { + if (!System.IO.File.Exists(this.tbZipToOpen.Text)) return; + DisplayZipFile(this.tbZipToOpen.Text); + } + + + private void DisplayZipFile(string zipFile) + { + try + { + listView1.Clear(); + listView1.BeginUpdate(); + + string[] columnHeaders = new string[] { "n", "name", "lastmod", "original", "ratio", "compressed", "enc?", "CRC" }; + foreach (string label in columnHeaders) + { + SortableColumnHeader ch = new SortableColumnHeader(label); + if (label != "name" && label != "lastmod") + ch.TextAlign = HorizontalAlignment.Right; + listView1.Columns.Add(ch); + } + + int n = 1; + var readOptions = new ReadOptions + { + Encoding = (comboEncoding.SelectedIndex > 0) + ? System.Text.Encoding.GetEncoding(comboEncoding.SelectedItem.ToString()) + : System.Text.Encoding.GetEncoding("IBM437") + }; + + using (ZipFile zip = ZipFile.Read(zipFile, readOptions)) + { + foreach (ZipEntry entry in zip.EntriesSorted) + { + ListViewItem item = new ListViewItem(n.ToString()); + n++; + string[] subitems = new string[] { + entry.FileName.Replace("/","\\"), + entry.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + entry.UncompressedSize.ToString(), + String.Format("{0,5:F0}%", entry.CompressionRatio), + entry.CompressedSize.ToString(), + (entry.UsesEncryption) ? "Y" : "N", + String.Format("{0:X8}", entry.Crc)}; + + foreach (String s in subitems) + { + ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(); + subitem.Text = s; + item.SubItems.Add(subitem); + } + + this.listView1.Items.Add(item); + } + } + + this.btnExtract.Enabled = true; + _DisplayedZip = zipFile; + this.listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); + this.listView1.EndUpdate(); + + } + catch (Exception exc1) + { + this.listView1.Clear(); + this.listView1.EndUpdate(); + MessageBox.Show(String.Format("There was a problem opening that file! [file={0}, problem={1}]", + zipFile, exc1.Message), "Whoops!", MessageBoxButtons.OK); + } + + } + + + private void btnExtractDirBrowse_Click(object sender, EventArgs e) + { + // pop a dialog to ask where to extract + // Configure the "select folder" dialog box + //_folderName = tbDirName.Text; + //_folderName = (System.IO.Directory.Exists(_folderName)) ? _folderName : ""; + var dlg1 = new Ionic.Utils.FolderBrowserDialogEx + { + Description = "Select a folder to extract to:", + ShowNewFolderButton = true, + ShowEditBox = true, + //NewStyle = false, + SelectedPath = tbExtractDir.Text, + ShowFullPathInEditBox = true, + }; + dlg1.RootFolder = System.Environment.SpecialFolder.MyComputer; + + var result = dlg1.ShowDialog(); + + if (result == DialogResult.OK) + { + this.tbExtractDir.Text = dlg1.SelectedPath; + // actually extract the files + } + + + } + + + + private void btnExtract_Click(object sender, EventArgs e) + { + if (!System.IO.File.Exists(_DisplayedZip)) return; + KickoffExtract(); + } + + + private void KickoffExtract() + { + if (String.IsNullOrEmpty(this.tbExtractDir.Text)) return; + + _hrt = new HiResTimer(); + _hrt.Start(); + + _working = true; + _operationCanceled = false; + _nFilesCompleted = 0; + _totalBytesAfterCompress = 0; + _totalBytesBeforeCompress = 0; + PauseUI(null); + lblStatus.Text = "Extracting..."; + + var options = new ExtractWorkerOptions + { + ExtractLocation = this.tbExtractDir.Text, + Selection = this.tbSelectionToExtract.Text, + OpenExplorer = this.chkOpenExplorer.Checked, + ExtractExisting = (ExtractExistingFileAction) comboExistingFileAction.SelectedIndex, + }; + + _workerThread = new Thread(this.DoExtract); + _workerThread.Name = "Zip Extractor thread"; + _workerThread.Start(options); + this.Cursor = Cursors.WaitCursor; + } + + + private void PauseUI(string msg) + { + // this set for Zipping + if (msg != null) + this.btnZipUp.Text = msg; + this.btnZipUp.Enabled = false; + this.btnZipupDirBrowse.Enabled = false; + this.btnCreateZipBrowse.Enabled = false; + this.btnClearItemsToZip.Enabled = false; + this.btnCancel.Enabled = true; + + // this for Extract + this.btnExtract.Enabled = false; + this.btnExtract.Text = "working..."; + this.btnExtractDirBrowse.Enabled = false; + this.btnCancel.Enabled = true; + this.btnReadZipBrowse.Enabled = false; + } + + + private void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) + { + if (e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) + { + StepEntryProgress(e); + } + + else if (e.EventType == ZipProgressEventType.Extracting_AfterExtractEntry) + { + StepArchiveProgress(e); + } + if (_setCancel) + e.Cancel = true; + } + + + private void OnExtractDone() + { + if (this.lblStatus.InvokeRequired) + { + this.lblStatus.Invoke(new MethodInvoker(this.OnExtractDone)); + } + else + { + _hrt.Stop(); + System.TimeSpan ts = new System.TimeSpan(0, 0, (int)_hrt.Seconds); + lblStatus.Text = String.Format("Done, Extracted {0} files, time: {1}", + _nFilesCompleted, + ts.ToString()); + ResetUiState(); + + // remember the successful selection strings + if (!_selectionCompletions.Contains(this.tbSelectionToZip.Text)) + { + if (_selectionCompletions.Count >= _MaxMruListSize) + _selectionCompletions.RemoveAt(0); + _selectionCompletions.Add(this.tbSelectionToZip.Text); + } + } + } + + + bool _setCancel = false; + private void DoExtract(object p) + { + ExtractWorkerOptions options = p as ExtractWorkerOptions; + + bool extractCancelled = false; + _setCancel = false; + string currentPassword = ""; + + try + { + using (var zip = ZipFile.Read(_DisplayedZip)) + { + System.Collections.Generic.ICollection collection = null; + if (String.IsNullOrEmpty(options.Selection)) + collection = zip.Entries; + else + collection = zip.SelectEntries(options.Selection); + + _totalEntriesToProcess = collection.Count; + zip.ExtractProgress += zip_ExtractProgress; + SetProgressBars(); + foreach (global::Ionic.Zip.ZipEntry entry in collection) + { + if (_setCancel) { extractCancelled = true; break; } + if (entry.Encryption == global::Ionic.Zip.EncryptionAlgorithm.None) + { + try + { + entry.Extract(options.ExtractLocation, options.ExtractExisting); + } + catch (Exception ex1) + { + string msg = String.Format("Faisled to extract entry {0} -- {1}", + entry.FileName, + ex1.Message.ToString()); + DialogResult result = + MessageBox.Show(msg, + String.Format("Error Extracting {0}", entry.FileName), + MessageBoxButtons.OKCancel, + MessageBoxIcon.Exclamation, + MessageBoxDefaultButton.Button1); + + if (result == DialogResult.Cancel) + { + _setCancel = true; + extractCancelled = true; + break; + } + } + } + else + { + bool done = false; + while (!done) + { + if (currentPassword == "") + { + string t = PromptForPassword(entry.FileName); + if (t == "") + { + done = true; // escape ExtractWithPassword loop + continue; + } + currentPassword = t; + } + + if (currentPassword == null) // cancel all + { + _setCancel = true; + currentPassword = ""; + break; + } + + try + { + entry.ExtractWithPassword(options.ExtractLocation, options.ExtractExisting, currentPassword); + done = true; + } + catch (Exception ex2) + { + // Retry here in the case of bad password. + if (ex2 as Ionic.Zip.BadPasswordException != null) + { + currentPassword = ""; + continue; // loop around, ask for password again + } + else + { + string msg = + String.Format("Failed to extract the password-encrypted entry {0} -- {1}", + entry.FileName, ex2.Message.ToString()); + DialogResult result = + MessageBox.Show(msg, + String.Format("Error Extracting {0}", + entry.FileName), + MessageBoxButtons.OKCancel, + MessageBoxIcon.Exclamation, + MessageBoxDefaultButton.Button1); + + done = true; // done with this entry + if (result == DialogResult.Cancel) + { + _setCancel = true; + extractCancelled = true; + break; + } + } + } + } // while + } // else (encryption) + } // foreach + } // using + + + } + catch (Exception ex1) + { + MessageBox.Show(String.Format("There's been a problem extracting that zip file. {0}", ex1.Message), + "Error Extracting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); + Application.Exit(); + } + + OnExtractDone(); + + if (extractCancelled) return; + + if (options.OpenExplorer) + { + string w = System.IO.Path.GetDirectoryName(Environment.GetFolderPath(Environment.SpecialFolder.System)); + if (w == null) w = "c:\\windows"; + try + { + System.Diagnostics.Process.Start(System.IO.Path.Combine(w, "explorer.exe"), options.ExtractLocation); + } + catch { } + } + } + + + private string PromptForPassword(string entryName) + { + PasswordDialog dlg1 = new PasswordDialog(); + dlg1.EntryName = entryName; + + // ask for password in a loop until user enters a proper one, + // or clicks skip or cancel. + bool done = false; + do + { + dlg1.ShowDialog(); + done = (dlg1.Result != PasswordDialog.PasswordDialogResult.OK || + dlg1.Password != ""); + } while (!done); + + if (dlg1.Result == PasswordDialog.PasswordDialogResult.OK) + return dlg1.Password; + + else if (dlg1.Result == PasswordDialog.PasswordDialogResult.Skip) + return ""; + + // cancel + return null; + } + + + private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + { + // Recycle the progress bars the cancel button, and the status textbox. + // An alternative way to accomplish a similar thing is to visually place + // the progress bars OFF the tabs. + if (this.tabControl1.SelectedIndex == 0) + { + if (this.tabPage2.Controls.Contains(this.progressBar1)) + this.tabPage2.Controls.Remove(this.progressBar1); + if (this.tabPage2.Controls.Contains(this.progressBar2)) + this.tabPage2.Controls.Remove(this.progressBar2); + if (this.tabPage2.Controls.Contains(this.btnCancel)) + this.tabPage2.Controls.Remove(this.btnCancel); + if (this.tabPage2.Controls.Contains(this.lblStatus)) + this.tabPage2.Controls.Remove(this.lblStatus); + + if (!this.tabPage1.Controls.Contains(this.lblStatus)) + this.tabPage1.Controls.Add(this.lblStatus); + if (!this.tabPage1.Controls.Contains(this.progressBar1)) + this.tabPage1.Controls.Add(this.progressBar1); + if (!this.tabPage1.Controls.Contains(this.progressBar2)) + this.tabPage1.Controls.Add(this.progressBar2); + if (!this.tabPage1.Controls.Contains(this.btnCancel)) + this.tabPage1.Controls.Add(this.btnCancel); + + // swap the comboBox for Encoding to the selected panel + if (groupBox2.Controls.Contains(comboEncoding)) + { + groupBox2.Controls.Remove(comboEncoding); + tabPage1.Controls.Add(comboEncoding); + int xpos = this.tbZipToOpen.Location.X ; + this.comboEncoding.Location = new System.Drawing.Point(xpos, this.tbZipToOpen.Location.Y + this.comboEncoding.Height + 4); + } + this.toolTip1.SetToolTip(this.comboEncoding, "use this encoding to read the file"); + + } + else if (this.tabControl1.SelectedIndex == 1) + { + if (this.tabPage1.Controls.Contains(this.progressBar1)) + this.tabPage1.Controls.Remove(this.progressBar1); + if (this.tabPage1.Controls.Contains(this.progressBar2)) + this.tabPage1.Controls.Remove(this.progressBar2); + if (this.tabPage1.Controls.Contains(this.btnCancel)) + this.tabPage1.Controls.Remove(this.btnCancel); + if (this.tabPage1.Controls.Contains(this.lblStatus)) + this.tabPage1.Controls.Remove(this.lblStatus); + + if (!this.tabPage2.Controls.Contains(this.lblStatus)) + this.tabPage2.Controls.Add(this.lblStatus); + if (!this.tabPage2.Controls.Contains(this.progressBar1)) + this.tabPage2.Controls.Add(this.progressBar1); + if (!this.tabPage2.Controls.Contains(this.progressBar2)) + this.tabPage2.Controls.Add(this.progressBar2); + if (!this.tabPage2.Controls.Contains(this.btnCancel)) + this.tabPage2.Controls.Add(this.btnCancel); + + // swap the comboBox for Encoding to the selected panel + if (tabPage1.Controls.Contains(comboEncoding)) + { + tabPage1.Controls.Remove(comboEncoding); + groupBox2.Controls.Add(comboEncoding); + this.comboEncoding.Location = new System.Drawing.Point(104, 85); + this.comboEncoding.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); + } + this.toolTip1.SetToolTip(this.comboEncoding, "use this encoding when saving the file"); + + } + } + + private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) + { + // prevent switching TABs if working + if (_working) e.Cancel = true; + } + + + private void listView1_ColumnClick(object sender, ColumnClickEventArgs e) + { + // Create an instance of the ColHeader class. + SortableColumnHeader clickedCol = (SortableColumnHeader)this.listView1.Columns[e.Column]; + + // Set the ascending property to sort in the opposite order. + clickedCol.SortAscending = !clickedCol.SortAscending; + + // Get the number of items in the list. + int numItems = this.listView1.Items.Count; + + // Turn off display while data is repoplulated. + this.listView1.BeginUpdate(); + + // Populate an ArrayList with a SortWrapper of each list item. + List list = new List(); + for (int i = 0; i < numItems; i++) + { + list.Add(new ItemWrapper(this.listView1.Items[i], e.Column)); + } + + if (e.Column == 0 || e.Column == 3 || e.Column == 5) + list.Sort(new ItemWrapper.NumericComparer(clickedCol.SortAscending)); + else + list.Sort(new ItemWrapper.StringComparer(clickedCol.SortAscending)); + + // Clear the list, and repopulate with the sorted items. + this.listView1.Items.Clear(); + for (int i = 0; i < numItems; i++) + this.listView1.Items.Add(list[i].Item); + + // Turn display back on. + this.listView1.EndUpdate(); + } + + + private void tbPassword_TextChanged(object sender, EventArgs e) + { + if (this.tbPassword.Text == "") + { + if (_mostRecentEncryption == null && this.comboEncryption.SelectedItem.ToString() != "None") + { + _mostRecentEncryption = this.comboEncryption.SelectedItem.ToString(); + SelectNamedEncryption("None"); + } + } + else + { + if (_mostRecentEncryption != null && this.comboEncryption.SelectedItem.ToString() == "None") + { + SelectNamedEncryption(_mostRecentEncryption); + } + _mostRecentEncryption = null; + } + } + + + private void LoadAboutInfo() + { + var a = System.Reflection.Assembly.GetEntryAssembly(); + string[] resourceNames = a.GetManifestResourceNames(); + if (resourceNames != null && resourceNames.Length > 0) + { + String name = "Ionic.Zip.Forms.About.rtf"; + var s = a.GetManifestResourceStream(name); + var bytes = ReadAllBytes(s); + this.richTextBox1.Rtf = System.Text.Encoding.ASCII.GetString(bytes); + s.Close(); + } + } + + + + /// + /// Reads the contents of the stream into a byte array. + /// + /// + /// + /// Like File.ReadAllBytes(), but for a stream. + /// + /// + /// The stream to read. + /// A byte array containing the contents of the stream. + /// The stream does not support reading. + /// Methods were called after the stream was closed. + /// An I/O error occurs. + private byte[] ReadAllBytes(System.IO.Stream source) + { + long originalPosition = source.Position; + source.Position = 0; + + try + { + byte[] readBuffer = new byte[4096]; + + int totalBytesRead = 0; + int bytesRead; + + while ((bytesRead = source.Read(readBuffer, totalBytesRead, readBuffer.Length - totalBytesRead)) > 0) + { + totalBytesRead += bytesRead; + + if (totalBytesRead == readBuffer.Length) + { + int nextByte = source.ReadByte(); + if (nextByte != -1) + { + byte[] temp = new byte[readBuffer.Length * 2]; + Buffer.BlockCopy(readBuffer, 0, temp, 0, readBuffer.Length); + Buffer.SetByte(temp, totalBytesRead, (byte)nextByte); + readBuffer = temp; + totalBytesRead++; + } + } + } + + byte[] buffer = readBuffer; + if (readBuffer.Length != totalBytesRead) + { + buffer = new byte[totalBytesRead]; + Buffer.BlockCopy(readBuffer, 0, buffer, 0, totalBytesRead); + } + return buffer; + } + finally + { + source.Position = originalPosition; + } + } + + + + private void ZipForm_Load(object sender, EventArgs e) + { + if (_initialFileToLoad != null) + { + // select the page that opens zip files. + this.tabControl1.SelectedIndex = 0; + //this.tabPage1.Select(); + this.tbZipToOpen.Text = _initialFileToLoad; + btnOpen_Click(null, null); + } + LoadAboutInfo(); + } + + private void tbDirectoryToZip_Leave(object sender, EventArgs e) + { + this.tbDirectoryInArchive.Text = System.IO.Path.GetFileName(this.tbDirectoryToZip.Text); + } + + private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e) + { + System.Diagnostics.Process.Start(e.LinkText); + } + + + private void listView_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent("FileDrop") && (e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) + { + // Get the data. + var filePaths = (String[])e.Data.GetData("FileDrop"); + + // allow drop of one file on listView1, drop multiple files on listView2. + if (filePaths.Length == 1 || sender == this.listView2) + //A file is being dragged and it can be copied so provide feedback to the user. + e.Effect = DragDropEffects.Copy; + } + } + + private void listView1_DragDrop(object sender, DragEventArgs e) + { + // The data can only be dropped if it is a file list and it can be copied. + if (e.Data.GetDataPresent("FileDrop") && (e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) + { + // Get the data. + var filePaths = (String[])e.Data.GetData("FileDrop"); + + // The data is an array of file paths. + // If it is a single file and ends in .zip, then we know how to open it + // and display the contents. + // If it is more than one file, then we don't know what to do with it. + if (filePaths.Length == 1) + { + DisplayZipFile(filePaths[0]); + this.tbZipToOpen.Text = filePaths[0]; + this.tbExtractDir.Text = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(filePaths[0]), System.IO.Path.GetFileNameWithoutExtension(filePaths[0]) + "_files"); + } + } + } + + private void listView2_DragDrop(object sender, DragEventArgs e) + { + // The data can only be dropped if it is a file list and it can be copied. + if (e.Data.GetDataPresent("FileDrop") && (e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) + { + // Get the data. + var filePaths = (String[])e.Data.GetData("FileDrop"); + this.listView2.BeginUpdate(); + foreach (var f in filePaths) + { + var item = new ListViewItem(); + + // first subitem is the local filename on disk + var subitem = new ListViewItem.ListViewSubItem(); + subitem.Text = f; + item.SubItems.Add(subitem); + + // next subitem is the directory name to use in the archive + subitem = new ListViewItem.ListViewSubItem(); + //subitem.Text = String.IsNullOrEmpty(_lastDirectory) ? this.tbDirectoryInArchive.Text : _lastDirectory; + subitem.Text = String.IsNullOrEmpty(_lastDirectory) + ? System.IO.Path.GetFileName(System.IO.Path.GetDirectoryName(f)) + : _lastDirectory; + item.SubItems.Add(subitem); + + // additional subitem (to be added): new filename in archive, if any + subitem = new ListViewItem.ListViewSubItem(); + item.SubItems.Add(subitem); + + this.listView2.Items.Add(item); + } + + this.listView2.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); + this.listView2.EndUpdate(); + } + } + + private void listView2_SubItemClicked(object sender, ListViewEx.SubItemEventArgs e) + { + //this.AcceptButton = null; + + // Prevent editing the 0th column - it's the checkbox. We want the checkbox + // label to remain "". + if (e.SubItem == 0) return; + + this.listView2.StartEditing(this.textBox1, e.Item, e.SubItem); + //this.textBox1.Focus(); // to get the RETURN key? no. this did not work. + } + + + private void listView2_SubItemEndEditing(object sender, ListViewEx.SubItemEndEditingEventArgs e) + { + if (!e.Cancel) + { + e.DisplayText = textBox1.Text; + //this.AcceptButton = this.btnZipUp; + //this.listView2.Select(); + // this.listView2.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); + } + //this.listView2.EndEditing(true); + } + + private void textBox1_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == 13) + { + this.listView2.EndEditing(true); + e.Handled = true; + _lastDirectory = this.textBox1.Text; + } + } + + private void button1_Click(object sender, EventArgs e) + { + int nAdded = 0; + PauseUI(null); + try + { + // do file selection, add each item into the list box + var fs = new global::Ionic.FileSelector(this.tbSelectionToZip.Text,this.chkTraverseJunctions.Checked); + var files = fs.SelectFiles(this.tbDirectoryToZip.Text, this.chkRecurse.Checked); + this.listView2.BeginUpdate(); + foreach (String f in files) + { + var item = new ListViewItem(); + // first subitem is the filename + var subitem = new ListViewItem.ListViewSubItem(); + subitem.Text = f; + item.SubItems.Add(subitem); + // second subitem is the directory name in the archive. + subitem = new ListViewItem.ListViewSubItem(); + var dirInArchive = this.tbDirectoryInArchive.Text; + var subDir = System.IO.Path.GetDirectoryName(f.Replace(this.tbDirectoryToZip.Text, "")); + subDir = subDir.Substring(1); + subitem.Text = System.IO.Path.Combine(dirInArchive, subDir); + item.SubItems.Add(subitem); + + // third subitem is the filename in the archive, if ay + subitem = new ListViewItem.ListViewSubItem(); + item.SubItems.Add(subitem); + + this.listView2.Items.Add(item); + nAdded++; + } + + this.listView2.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); + this.listView2.EndUpdate(); + this.lblStatus.Text = String.Format("Added {0} entries; {1} total entries to save.", nAdded, this.listView2.Items.Count); + + + // remember the successful selection strings + if (!_selectionCompletions.Contains(this.tbSelectionToZip.Text)) + { + if (_selectionCompletions.Count >= _MaxMruListSize) + _selectionCompletions.RemoveAt(0); + _selectionCompletions.Add(this.tbSelectionToZip.Text); + } + + } + catch + { } + ResetUiState(); + //_disableMasterChecking = false; + } + + + private void btnClearItemsToZip_Click(object sender, EventArgs e) + { + int rCount=0; + foreach (ListViewItem item in this.listView2.Items) + { + if (item.Checked) + { + this.listView2.Items.Remove(item); + rCount++; + } + } + + // After removing all the checked items, all items are now unchecked. + // We can set the mast checkbox to unchecked. But, we have to protect + // against infinite recursion. + _disableMasterChecking = true; + this.checkBox1.Checked = false; + _disableMasterChecking = false; + this.lblStatus.Text = (rCount == 1) + ? String.Format("Cleared 1 entry. {1} remaining entries to save.", rCount, this.listView2.Items.Count) + : String.Format("Cleared {0} entries. {1} remaining entries to save.", rCount, this.listView2.Items.Count); + } + + + + bool _disableMasterChecking = false; + private void checkBox1_CheckedChanged_1(object sender, EventArgs e) + { + // prevent infinite recursion. + if (_disableMasterChecking) return; + + // if we have a mixed state, then it happened programmatically + if (this.checkBox1.CheckState == CheckState.Indeterminate) return; + + _disableListViewCheckedEvent = true; + _disableMasterChecking = true; + // change state of ALL items + foreach (ListViewItem item in this.listView2.Items) + { + item.Checked = this.checkBox1.Checked; + } + _disableMasterChecking = false; + _disableListViewCheckedEvent = false; + } + + + private bool _disableListViewCheckedEvent; + private void listView2_ItemChecked(object sender, ItemCheckedEventArgs e) + { + // prevent infinite recursion + if (_disableListViewCheckedEvent) return; + + System.Drawing.Point p = this.listView2.PointToClient(new System.Drawing.Point(Cursor.Position.X, Cursor.Position.Y)); + ListViewItem lvi; + int ix = this.listView2.GetSubItemAt(p.X, p.Y, out lvi); + + // lvi is null when the checkchange comes from a non-mouse event, like when + // a new item is being added to the list. + if (lvi == null) return; + + // ix is 0 when the checkbox is the thing that was tickled with the mouse. + if (ix == 0) + MaybeSetMasterCheckbox(); + else + { + // Revert the checkChange if it was due to a mouse click on a subitem other than the 0th one. + // The Checked property has already been changed (in ListView.WndProc?); we need to undo it. + // In order to avoid an endless recursion, set the disable flag, first. + _disableListViewCheckedEvent = true; + lvi.Checked = !lvi.Checked; + _disableListViewCheckedEvent = false; + } + } + + + private void MaybeSetMasterCheckbox() + { + if (_disableMasterChecking) return; + + bool uniform = true; + // check the state of all the items + for (int i = 1; i < this.listView2.Items.Count; i++) + { + if (this.listView2.Items[i].Checked != this.listView2.Items[i - 1].Checked) + { + uniform = false; + break; + } + } + + _disableMasterChecking = true; + if (uniform) + this.checkBox1.CheckState = (this.listView2.Items[0].Checked) ? CheckState.Checked : CheckState.Unchecked; + else + this.checkBox1.CheckState = CheckState.Indeterminate; + _disableMasterChecking = false; + } + + private void listView2_BeforeLabelEdit(object sender, LabelEditEventArgs e) + { + // never let the use edit the label associated to the main listview item, + // the label on the item checkbox. + e.CancelEdit = true; + } + + + private int _progress2MaxFactor; + private int _totalEntriesToProcess; + private bool _working; + private bool _operationCanceled; + private int _nFilesCompleted; + private long _totalBytesBeforeCompress; + private long _totalBytesAfterCompress; + private Thread _workerThread; + private static string TB_COMMENT_NOTE = "-zip file comment here-"; + private static string TB_EXTRACT_DIR_NOTE = "-default extract directory-"; + private static string TB_EXE_ON_UNPACK_NOTE = "-command line to execute here-"; + private String _mostRecentEncryption; + private string _initialFileToLoad; + private string _lastDirectory; + } + + + + // The ColHeader class is a ColumnHeader object with an + // added property for determining an ascending or descending sort. + // True specifies an ascending order, false specifies a descending order. + public class SortableColumnHeader : ColumnHeader + { + public bool SortAscending; + public SortableColumnHeader(string text) + { + this.Text = text; + this.SortAscending = true; + } + } + + + // An instance of the SortWrapper class is created for + // each item and added to the ArrayList for sorting. + public class ItemWrapper + { + internal ListViewItem Item; + internal int Column; + + // A SortWrapper requires the item and the index of the clicked column. + public ItemWrapper(ListViewItem item, int column) + { + Item = item; + Column = column; + } + + // Text property for getting the text of an item. + public string Text + { + get { return Item.SubItems[Column].Text; } + } + + // Implementation of the IComparer + public class StringComparer : IComparer + { + bool ascending; + + // Constructor requires the sort order; + // true if ascending, otherwise descending. + public StringComparer(bool asc) + { + this.ascending = asc; + } + + // Implemnentation of the IComparer:Compare + // method for comparing two objects. + public int Compare(ItemWrapper xItem, ItemWrapper yItem) + { + string xText = xItem.Item.SubItems[xItem.Column].Text; + string yText = yItem.Item.SubItems[yItem.Column].Text; + return xText.CompareTo(yText) * (this.ascending ? 1 : -1); + } + } + + public class NumericComparer : IComparer + { + bool ascending; + + // Constructor requires the sort order; + // true if ascending, otherwise descending. + public NumericComparer(bool asc) + { + this.ascending = asc; + } + + // Implementation of the IComparer:Compare + // method for comparing two objects. + public int Compare(ItemWrapper xItem, ItemWrapper yItem) + { + int x = 0, y = 0; + try + { + x = Int32.Parse(xItem.Item.SubItems[xItem.Column].Text); + y = Int32.Parse(yItem.Item.SubItems[yItem.Column].Text); + } + catch + { + try + { + // lop off one char for % + String trimmed = null; + trimmed = xItem.Item.SubItems[xItem.Column].Text; + trimmed = trimmed.Substring(0, trimmed.Length - 1); + x = Int32.Parse(trimmed); + trimmed = xItem.Item.SubItems[yItem.Column].Text; + trimmed = trimmed.Substring(0, trimmed.Length - 1); + y = Int32.Parse(trimmed); + } + catch { } + } + return (x - y) * (this.ascending ? 1 : -1); + } + } + } + public class ExtractWorkerOptions + { + public string ExtractLocation; + public Ionic.Zip.ExtractExistingFileAction ExtractExisting; + public bool OpenExplorer; + public String Selection; + } + + public class SaveWorkerOptions + { + public string ZipName; + public string Selection; + public bool TraverseJunctions; + public bool RemoveFilesAfterExe; + public string Encoding; + public Ionic.Zip.ZipOption EncodingUsage; + public string Comment; + public string Password; + public string ExeOnUnpack; + public string ExtractDirectory; + public int ExtractExistingFile; + public int ZipFlavor; + public int MaxSegmentSize; + public Ionic.Zlib.CompressionLevel CompressionLevel; + public Ionic.Zip.CompressionMethod CompressionMethod; + public Ionic.Zip.EncryptionAlgorithm Encryption; + public Zip64Option Zip64; + public bool WindowsTimes; + public bool UnixTimes; + public ItemToAdd[] Entries; + } + + public class ItemToAdd + { + public string LocalFileName; + public string DirectoryInArchive; + public string FileNameInArchive; + } + + + internal class HiResTimer + { + // usage: + // + // hrt= new HiResTimer(); + // hrt.Start(); + // ... do work ... + // hrt.Stop(); + // System.Console.WriteLine("elapsed time: {0:N4}", hrt.Seconds); + // + + [System.Runtime.InteropServices.DllImport("KERNEL32")] + private static extern bool QueryPerformanceCounter(ref long lpPerformanceCount); + + [System.Runtime.InteropServices.DllImport("KERNEL32")] + private static extern bool QueryPerformanceFrequency(ref long lpFrequency); + + private long m_TickCountAtStart = 0; + private long m_TickCountAtStop = 0; + private long m_ElapsedTicks = 0; + + public HiResTimer() + { + m_Frequency = 0; + QueryPerformanceFrequency(ref m_Frequency); + } + + public void Start() + { + m_TickCountAtStart = 0; + QueryPerformanceCounter(ref m_TickCountAtStart); + } + + public void Stop() + { + m_TickCountAtStop = 0; + QueryPerformanceCounter(ref m_TickCountAtStop); + m_ElapsedTicks = m_TickCountAtStop - m_TickCountAtStart; + } + + public void Reset() + { + m_TickCountAtStart = 0; + m_TickCountAtStop = 0; + m_ElapsedTicks = 0; + } + + public long Elapsed + { + get { return m_ElapsedTicks; } + } + + public float Seconds + { + get { return ((float)m_ElapsedTicks / (float)m_Frequency); } + } + + private long m_Frequency = 0; + public long Frequency + { + get { return m_Frequency; } + } + + } + +} diff --git a/dotNetZip/Tools/WinFormsApp/ZipForm.resx b/dotNetZip/Tools/WinFormsApp/ZipForm.resx new file mode 100644 index 0000000..4e58603 --- /dev/null +++ b/dotNetZip/Tools/WinFormsApp/ZipForm.resx @@ -0,0 +1,1139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 17, 17 + + + True + + + Selection criteria. some examples: +name = *.xml -- all xml files +name != *.doc -- any file not .doc +atime > 2009-07-02 -- also ctime and mtime +attributes = A -- possible attributes: (HRSA) +also logical conjunctions: +(name = *.xml and size> 1000) +(name != *.doc OR attrributes = A) + + + + + + AAABAAoAMDAQAAEABABoBgAApgAAACAgEAABAAQA6AIAAA4HAAAQEBAAAQAEACgBAAD2CQAAMDAAAAEA + CACoDgAAHgsAACAgAAABAAgAqAgAAMYZAAAQEAAAAQAIAGgFAABuIgAAAAAAAAEAIABJhgAA1icAADAw + AAABACAAqCUAAB+uAAAgIAAAAQAgAKgQAADH0wAAEBAAAAEAIABoBAAAb+QAACgAAAAwAAAAYAAAAAEA + BAAAAAAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDA + wAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIuIAAAAAAAAAAAAAAAAAAAAAA + AAAAB4uLiLgAAAAAAAAAAAAAAAAAAAAAAAiLiHeIuIuIgAAAAAAAAAAAAAAAAAAIi4uIiHi4uLiLgAAA + AAAAAAAAAAAACIi4iL+4t4e4i4iIgAAAAAAAAAAAAAiIi4v7i4iLiHeLiLiIsAAAAAAAAAAACIi4v4iL + +Li/eIiLi4iIgAAAAAAAAAAACL+Ii4v4uIi4h3OIuLj4sAAAAAAAAAAACIuL+IuL+4v7iIi4i4j4gAAA + AAAAAAAACIiIuIiIiIiIt3iLiLj7gAAAAAAAAAAACLi/i4uLi4uLiIe4uLj4gAAAAAAAAAAACPiL+IiI + iL+IiHiIi4j7gAAAAAAAAAAACLiIuLi4v4uLh4O4uLj/gAAAAAAAAAAACPuIiIiIi/i/iIeIi4iLgAAA + A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Af//AACAAAAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAA + AAH//wAAgAAAAf//AACAAAAB//8AAIAAAAH//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAA + AAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAA///8AAIAAH////wAAgAf/////AACD//////8AAP// + /////wAAKAAAACAAAABAAAAAAQAEAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACA + gACAAAAAgACAAICAAACAgIAAwMDAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAh4uIgAAAAAAAAAAAAAAI + i4eLi7gAAAAAAAAAAIiLi4iHeLh4gAAAAAAACIi4v4i4h7iLiIAAAAAACIuL+IuLi4h7iPuAAAAAAAiI + iLi/v4iHiLv4gAAAAAAIuL+IiIuLhziI+4AAAAAACPiLi4uIv3iLuPiAAAAAAAi4iIiIv4uHeIv4gAAA + AAAPi4uLi/uIh4uLiwAAAAAACIiIiIiIuIg4iIgAAAAAAAiL+/uLiIuHi4uAAAAAAAAIiIiIiIv4iHiL + gAAAAAAACIv7+/v4uIeL+LAAAAAAAAiIiIiIv4t4eLiAAAAAAAAIi/v7+Iv3eHv4sAAAAAAACIiIiL+I + h3d4iIAAAAAAAA+L+/iL+/iHeIuAAAAAAAAIiI+/iIiIiHv4sAAAAAAACIv4iL+/v/h4+IAAAAAAAA+I + iL/4iPj/ePuAAAAAAAAIi/j4v4v4iHv4sAAAAAAAD4iL+IiIi4Z4+IAAAAAAAAiL/7+L+I+FePuAAAAA + A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AAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAA + AAH//wAAgAAAAf//AACAAAAB//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAA + AAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAP///AACAAB////8AAIAH/////wAAg///////AAD///////8AACgA + AAAgAAAAQAAAAAEACAAAAAAAAAQAAAAAAAAAAAAAAAEAAAABAAAAAAAAWEpEAHBPQQBxY14AaWpqAHpt + ZQBhaXAAYnB7AJNtWwCFdWwAnYF5AJeIfwC2jnIAa3yIAHF/igBpgY4AZYSWAHeIkQBmlqgAaJaoAGeZ + qwBrmqsAfpmnAHecqwBvoLEAc6S2AHujswB9q7sAarHNAH25zgBayt8AYc3fAE/N6ABnzegAZ87vAHbL + 5QBzz+oAec3tAGPU7ABl1OwAa9btAGzX7gBx1+4AeNDrAHHZ7wB22e8Acc3xAHbO8QB50PIAfdHyAHzV + 8gB81fQAdNj1AHfe9wB62fUAfdv3AHne9wB83/cAf935AH/g9wB+4PkAj4WCAIuPkQCSj5EAjZCSAI+W + mACRkJIAlZaWAJSXmQCUmZkAlpqcAKKJgQC4loYAtZqNAKOenAC9oIkAv6mIAJueoQCIo6sAn6CgAJOl + rgCkq64Ava6iALesqQDKq5UA1babAM2zpgDZu68A5r+yAOLHpADlx7MA68u0AOLNvQCAr8EAiL3PAIS+ + 0gChvMYAhMDVAIPB2ACRxdgAtsPHALjEyQClxtEApMfUAKfL1wCvydMAqc7bAL/L0QCt098AtdDZALLU + 3QCIzeYAhM/rAIfX6wCF1uwAiNbrAIzW6wCI0ewAhtjsAIXd7gCJ2u0AjNvuAI7c7gCW0eYAn9P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y/y7Es/z0HocvPuHr7n + ZaCPE9I0JU1THMchjiVStqyhYD02zovuP4rlywThJMRzXIBicwNBFfRt7K+N+7oWdqkIDDmF3YHNazNl + ULT7ZypaVyNaV4axsb55v3rPyNVI/35Z35KfeaUV/EdlfXv6zbK3pGGLZ+StlCKOUw7GMa+//hpB4BN0 + OnR8n8FgQH+wQv/8l9A/+EdMpwmf/dyX+PyXfp7HnniRndvX+O4/+Ic8+sTT9Acj+oPMWSulptPplKXQ + 1gVS68dmuQrwuyA8tOMhgDu3x/idoIjoUgV/PVET4LZj270fezmlRUGr0zp1ZVIAs3C6Hq92boD/Dzfr + H5amJQ0rs9efy9wULPnWy5yFTGVmBVz/+Erm4HNdfN/H97OJQEHQYXXzPI9unGVtY4twOuW1117l8cce + 4ntf/0dcu/wo65vnWVnd/v/be/No2a76vvOz9xlrvPPwZr2neUKIwWCQ9ADZBjz0crq9ArFst0k3lpNO + YscYZwXhtbKyLLo72I693B0bMIG2jQ3dxCTGkMTGIxgxGIEQCKQn6c3TnW/dms64+49zqupU1Tl16456 + 0qvvWlV1hn323ufU+f6+vz0zPjlHeeIAhmHGqwEJZPdc4OnPo/2TJL8EqSGEzsaGQ63mUsoXAWXQ/a5m + PYws8vcaibTrrkvs7XwA0VZCfFXfC5lNjh4VTVQobln1M8m/16qflreeOPZB9ZPHlVJRRWAQks/l8X0P + z3NxHCeqkI179hmGxeJSBV0/HVX46RpHjxxkekJhiYs465epr0gWzlnk8mM0Fr/IbNHE0LUelm3yPIQA + ZDQwSeoIYdKohZz6zhXGJgoQjSPx2Vzhh91up5zYv269gn1aGKRro3u/i1zJ391W/c7x9PEAqZkerPqk + GbSsOFPi2IHq9+WjN46M5y6EQMafsfFJNC0aERgGHq7r4nkejuOiFHh+SKNRRamAMFT4nsf8bInpyWje + fyEESikMI6BknWasnMM0k8uBZak+icq+SPUROkIarK66nH1ukeLkIfKFJl5doWtGcGg2p11caGT1B9iu + Idhs/yWPvW8GpPdpDvNs91L1N4+HrHD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PT+/6v0/v/Pspz/npSM/4B4cv/VycX/g4+U/6Hu+/+l + 8f3/2/n+/+T7/v+W2fT/ne37/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvuf3/7X2//+X4/3/sPb//7L3//+y + 9///svf//7L3//+x9///sfb//7D2//+w9v//r/b//671/v+t9f7/rfX+/6fv+//Gqpv/wLq0/3xzcP+l + mZP/sJWL/7/s9f/s/P///////+T7/v+X2vT/ne77/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvuf3/7X2//+X + 4/3/sPb//7L3//+y9///svf//7L3//+y9///sff//7H2//+w9v//sPb//6/2//+v9f//r/X+/7fz/f/1 + 5dz/0c7L/2heWP+rnJD/vaed/9ru8//d+v//0fj+/7/2/v+Z2vT/nu/8/wAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAvuf3/7X2//+X4/3/sPb//7L3//+y9///svf//7L3//+y9///svf//7L3//+x9v//sfb//7D2//+v + 9v//uff//733/v+79Pz/5dzW/36CfP+hr7T/fJun/57h8v+k5vn/oeH3/57e9f+d4/f/nu/8lgAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAvuf3/7X2//+X4/3/sfb//7L3//+y9///svf//7P3//+z9///tPf//7P3//+y + 9///sff//7H1//+x8v3/sPD8/6/s+/+u6fn/oaqu/15xef9kjp3/f7jL9p7f896h5vm5n+j6hp7q+0Ge + 8P0PAAAA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AAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAD///////8AAP///////wAA////////AAD///////8AAP///////wAA///gAH//AAD/ + /4AAH/8AAP/4AAAP/wAA/8AAAAP/AAD8AAAAAf8AAMAAAAAB/wAAgAAAAAD/AACAAAAAAH8AAIAAAAAA + PwAAgAAAAAAPAACAAAAAAA8AAIAAAAAADwAAgAAAAAA/AACAAAAAAP8AAIAAAAAD/wAAgAAAAA//AACA + AAAAP/8AAIAAAAD//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf/ + /wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACA + AAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAA// + /wAAgAAH////AACAAf////8AAID//////wAA////////AAAoAAAAIAAAAEAAAAABACAAAAAAAIAQAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAF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z/nfP7///56//u3dj/mXhz/5fu+f+Z7vj/e8jn/wAAAAAA + AAAAAAAAAAAAAACAy+n/tPv//676/v+q+f7/p/j9/6T2/P+jqqf/blhU/5l4c/+e8Pr/oPH6/4DL6f8A + AAAAAAAAAAAAAAAAAAAAhM7r/7j8//+1+///sfr+/675/v+s+P3/7uri/7mVh/+ZeHP/pvT8/5Pd8v+E + zuv/AAAAAAAAAAAAAAAAAAAAAIfQ7f+H0O3/h9Dt/4fQ7f+H0O3/h9Dt/6LS5v90q8D/Z77e/4fQ7f+H + 0O3/X7rSdQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACA + AwAAgAcAAIAHAACABwAAgAcAAIAHAAD//wAA + + + \ No newline at end of file diff --git a/dotNetZip/Tools/ZipIt/Properties/AssemblyInfo.cs b/dotNetZip/Tools/ZipIt/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0e599a2 Binary files /dev/null and b/dotNetZip/Tools/ZipIt/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Tools/ZipIt/ZipIt.cs b/dotNetZip/Tools/ZipIt/ZipIt.cs new file mode 100644 index 0000000..df034e4 --- /dev/null +++ b/dotNetZip/Tools/ZipIt/ZipIt.cs @@ -0,0 +1,495 @@ +// ZipIt.cs +// +// ---------------------------------------------------------------------- +// Copyright (c) 2006-2011 Dino Chiesa. All rights reserved. +// +// This example is released under the Microsoft Permissive License of +// October 2006. See the license.txt file accompanying this release for +// full details. +// +// ---------------------------------------------------------------------- +// +// This utility zips up a set of files and directories specified on the command line. +// +// compile with: +// csc /debug+ /target:exe /r:Ionic.Zip.dll /out:ZipIt.exe ZipIt.cs +// +// Fri, 23 Feb 2007 11:51 +// + +using System; +using System.IO; +using Ionic.Zip; + +namespace Ionic.Zip.Examples +{ + public class ZipIt + { + private static void Usage() + { + string UsageMessage = + "Zipit.exe: zip up a directory, file, or a set of them, into a zipfile.\n" + + " Depends on Ionic's DotNetZip library. This is version {0} of the utility.\n" + + "usage:\n ZipIt.exe [arguments]\n" + + "\narguments: \n" + + " | - a directory or file to add to the archive.\n" + + " -64 - use ZIP64 extensions, for large files or large numbers of files.\n" + + " -aes - use WinZip-compatible AES 256-bit encryption for entries\n" + + " subsequently added to the archive. Requires a password.\n" + + " -cp - use the specified numeric codepage to encode entry filenames \n" + + " and comments, instead of the default IBM437 code page.\n" + + " (cannot be used with -utf8 option)\n" + + " -C bzip|deflate|none - use BZip2, Deflate, or No compression, for entries subsequently\n"+ + " added to the zip. The default is DEFLATE.\n"+ + " -d - use the given directory path in the archive for\n" + + " succeeding items added to the archive.\n" + + " -D - find files in the given directory on disk.\n" + + " -e[s|r|q|a] - when there is an error reading a file to be zipped, either skip\n" + + " the file, retry, quit, or ask the user what to do.\n"+ + " -E - a file selection expression. Examples: \n" + + " *.txt \n" + + " (name = *.txt) OR (name = *.xml) \n" + + " (attrs = H) OR (name != *.xml) \n" + + " (ctime < 2009/02/28-10:20:00) \n" + + " (size > 1g) AND (mtime < 2009-12-10) \n" + + " (ctime > 2009-04-29) AND (size < 10kb) \n" + + " Filenames can include full paths. You must surround a filename \n" + + " that includes spaces with single quotes.\n" + + " -j- - do not traverse NTFS junctions\n" + + " -j+ - traverse NTFS junctions (default)\n" + + " -L - compression level, 0..9 (Default is 6).\n" + + " This applies only if using DEFLATE compression, the default.\n" + + " -p - apply the specified password for all succeeding files added.\n" + + " use \"\" to reset the password to nil.\n" + + " -progress - emit progress reports (good when creating large zips)\n" + + " -r- - don't recurse directories (default).\n" + + " -r+ - recurse directories.\n" + + " -s 'string' - insert an entry of the given name into the \n" + + " archive, with the given string as its content.\n" + + " -sfx [w|c] - create a self-extracting archive, either a Windows or console app.\n" + + " (cannot be used with -split)\n"+ + " -split - produce a split zip, with the specified maximum size. You can\n" + + " optionally use kb or mb as a suffix to the size. \n" + + " (-split cannot be used with -sfx).\n" + + " -Tw+ - store Windows-format extended times (default).\n" + + " -Tw- - don't store Windows-format extended times.\n" + + " -Tu+ - store Unix-format extended times.\n" + + " -Tu- - don't store Unix-format extended times (default).\n" + + " -UTnow - use the same date/time, NOW, for all entries. \n" + + " -UTnewest - use the same date/time, same as newest entry, for all entries. \n" + + " -UToldest - use the same date/time, equal to oldest entry, for all entries. \n" + + " -UT - use the same date/time, as specified, for all entries. \n" + + " -utf8 - use UTF-8 encoding for entry filenames and comments,\n" + + " instead of the the default IBM437 code page.\n" + + " (cannot be used with -cp option)\n" + + " -zc - use the given comment for the archive.\n"; + + Console.WriteLine(UsageMessage, + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Environment.Exit(1); + } + + + static bool justHadByteUpdate= false; + static bool isCanceled= false; + static bool wantProgressReports = false; + + private static void SaveProgress(object sender, SaveProgressEventArgs e) + { + if (isCanceled) + { + e.Cancel = true; + return; + } + if (!wantProgressReports) return; + + switch(e.EventType) + { + case ZipProgressEventType.Saving_Started: + Console.WriteLine("Saving: {0}", e.ArchiveName); + break; + + case ZipProgressEventType.Saving_Completed: + justHadByteUpdate= false; + Console.WriteLine(); + Console.WriteLine("Done: {0}", e.ArchiveName); + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + if (justHadByteUpdate) + Console.WriteLine(); + Console.WriteLine(" Writing: {0} ({1}/{2})", + e.CurrentEntry.FileName, e.EntriesSaved+1, e.EntriesTotal); + justHadByteUpdate= false; + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + break; + + case ZipProgressEventType.Saving_EntryBytesRead: + if (justHadByteUpdate) + Console.SetCursorPosition(0, Console.CursorTop); + Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, + e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); + justHadByteUpdate= true; + break; + } + } + + + // Ask the user what he wants to do + public static void ZipError(object sender, ZipErrorEventArgs e) + { + Console.WriteLine("Error reading {0}...", e.FileName); + Console.WriteLine(" Exception: {0}...", e.Exception); + ZipEntry entry = e.CurrentEntry; + string response = null; + do + { + Console.Write("Retry, Skip, or Quit ? (R/S/Q) "); + response = Console.ReadLine(); + Console.WriteLine(); + + } while (response != null && + response[0]!='S' && response[0]!='s' && + response[0]!='R' && response[0]!='r' && + response[0]!='Q' && response[0]!='q'); + + + e.Cancel = (response[0]=='Q' || response[0]=='q'); + + if (response[0]=='S' || response[0]=='s') + entry.ZipErrorAction = ZipErrorAction.Skip; + else if (response[0]=='R' || response[0]=='r') + entry.ZipErrorAction = ZipErrorAction.Retry; + } + + + + static void CtrlC_Handler(object sender, ConsoleCancelEventArgs args) + { + isCanceled = true; + Console.WriteLine("\nCtrl-C"); + //cleanupCompleted.WaitOne(); + // prevent the process from exiting until cleanup is done: + args.Cancel = true; + } + + + public static void Main(String[] args) + { + bool saveToStdout = false; + if (args.Length < 2) Usage(); + + if (args[0]=="-") + { + saveToStdout = true; + } + else if (File.Exists(args[0])) + { + System.Console.WriteLine("That zip file ({0}) already exists.", args[0]); + } + + + // Because the comments and filenames on zip entries may be UTF-8 + // System.Console.OutputEncoding = new System.Text.UTF8Encoding(); + + Console.CancelKeyPress += CtrlC_Handler; + + try + { + Nullable flavor = null; + int codePage = 0; + ZipEntry e = null; + int _UseUniformTimestamp = 0; + DateTime _fixedTimestamp= System.DateTime.Now; + string entryDirectoryPathInArchive = ""; + string directoryOnDisk = null; + bool recurseDirectories = false; + bool wantRecurse = false; + string actualItem; + + // read/update an existing zip, or create a new one. + using (ZipFile zip = new ZipFile(args[0])) + { + zip.StatusMessageTextWriter = System.Console.Out; + zip.SaveProgress += SaveProgress; + for (int i = 1; i < args.Length; i++) + { + switch (args[i]) + { + case "-es": + zip.ZipErrorAction = ZipErrorAction.Skip; + break; + + case "-er": + zip.ZipErrorAction = ZipErrorAction.Retry; + break; + + case "-eq": + zip.ZipErrorAction = ZipErrorAction.Throw; + break; + + case "-ea": + zip.ZipError += ZipError; + break; + + case "-64": + zip.UseZip64WhenSaving = Zip64Option.Always; + break; + + case "-aes": + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + break; + + case "-C": + i++; + if (args.Length <= i) Usage(); + switch(args[i].ToLower()) + { + case "b": + case "bzip": + case "bzip2": + zip.CompressionMethod = CompressionMethod.BZip2; + break; + case "d": + case "deflate": + zip.CompressionMethod = CompressionMethod.Deflate; + break; + case "n": + case "none": + zip.CompressionMethod = CompressionMethod.None; + break; + default: + Usage(); + break; + } + break; + + case "-cp": + i++; + if (args.Length <= i) Usage(); + System.Int32.TryParse(args[i], out codePage); + if (codePage != 0) + { + zip.AlternateEncoding = System.Text.Encoding.GetEncoding(codePage); + zip.AlternateEncodingUsage = ZipOption.Always; + } + break; + + case "-d": + i++; + if (args.Length <= i) Usage(); + entryDirectoryPathInArchive = args[i]; + break; + + case "-D": + i++; + if (args.Length <= i) Usage(); + directoryOnDisk = args[i]; + break; + + case "-E": + i++; + if (args.Length <= i) Usage(); + wantRecurse = recurseDirectories || args[i].Contains("\\"); + // Console.WriteLine("spec({0})", args[i]); + // Console.WriteLine("dir({0})", directoryOnDisk); + // Console.WriteLine("dirInArc({0})", entryDirectoryPathInArchive); + // Console.WriteLine("recurse({0})", recurseDirectories); + zip.UpdateSelectedFiles(args[i], + directoryOnDisk, + entryDirectoryPathInArchive, + wantRecurse); + break; + + case "-j-": + zip.AddDirectoryWillTraverseReparsePoints = false; + break; + + case "-j+": + zip.AddDirectoryWillTraverseReparsePoints = true; + break; + + case "-L": + i++; + if (args.Length <= i) Usage(); + zip.CompressionLevel = (Ionic.Zlib.CompressionLevel) + System.Int32.Parse(args[i]); + break; + + case "-p": + i++; + if (args.Length <= i) Usage(); + zip.Password = (args[i] == "") ? null : args[i]; + break; + + case "-progress": + wantProgressReports = true; + break; + + case "-r-": + recurseDirectories = false; + break; + + case "-r+": + recurseDirectories = true; + break; + + case "-s": + i++; + if (args.Length <= i) Usage(); + string entryName = args[i]; + i++; + if (args.Length <= i) Usage(); + string content = args[i]; + e = zip.AddEntry(Path.Combine(entryDirectoryPathInArchive, entryName), content); + // if (entryComment != null) + // { + // e.Comment = entryComment; + // entryComment = null; + // } + break; + + case "-sfx": + i++; + if (args.Length <= i) Usage(); + if (args[i] != "w" && args[i] != "c") Usage(); + flavor = new Nullable + ((args[i] == "w") ? SelfExtractorFlavor.WinFormsApplication : SelfExtractorFlavor.ConsoleApplication); + break; + + case "-split": + i++; + if (args.Length <= i) Usage(); + if (args[i].EndsWith("K") || args[i].EndsWith("k")) + zip.MaxOutputSegmentSize = Int32.Parse(args[i].Substring(0, args[i].Length - 1)) * 1024; + else if (args[i].EndsWith("M") || args[i].EndsWith("m")) + zip.MaxOutputSegmentSize = Int32.Parse(args[i].Substring(0, args[i].Length - 1)) * 1024 * 1024; + else + zip.MaxOutputSegmentSize = Int32.Parse(args[i]); + break; + + case "-Tw+": + zip.EmitTimesInWindowsFormatWhenSaving = true; + break; + + case "-Tw-": + zip.EmitTimesInWindowsFormatWhenSaving = false; + break; + + case "-Tu+": + zip.EmitTimesInUnixFormatWhenSaving = true; + break; + + case "-Tu-": + zip.EmitTimesInUnixFormatWhenSaving = false; + break; + + case "-UTnow": + _UseUniformTimestamp = 1; + _fixedTimestamp = System.DateTime.UtcNow; + break; + + case "-UTnewest": + _UseUniformTimestamp = 2; + break; + + case "-UToldest": + _UseUniformTimestamp = 3; + break; + + case "-UT": + i++; + if (args.Length <= i) Usage(); + _UseUniformTimestamp = 4; + try + { + _fixedTimestamp= System.DateTime.Parse(args[i]); + } + catch + { + throw new ArgumentException("-UT"); + } + break; + + case "-utf8": + zip.AlternateEncoding = System.Text.Encoding.UTF8; + zip.AlternateEncodingUsage = ZipOption.Always; + break; + +#if NOT + case "-c": + i++; + if (args.Length <= i) Usage(); + entryComment = args[i]; // for the next entry + break; +#endif + + case "-zc": + i++; + if (args.Length <= i) Usage(); + zip.Comment = args[i]; + break; + + default: + // UpdateItem will add Files or Dirs, + // recurses subdirectories + actualItem = Path.Combine(directoryOnDisk ?? ".", args[i]); + zip.UpdateItem(actualItem, entryDirectoryPathInArchive); + break; + } + } + + if (_UseUniformTimestamp > 0) + { + if (_UseUniformTimestamp==2) + { + // newest + _fixedTimestamp = new System.DateTime(1601,1,1,0,0,0); + foreach(var entry in zip) + { + if (entry.LastModified > _fixedTimestamp) + _fixedTimestamp = entry.LastModified; + } + } + else if (_UseUniformTimestamp==3) + { + // oldest + foreach(var entry in zip) + { + if (entry.LastModified < _fixedTimestamp) + _fixedTimestamp = entry.LastModified; + } + } + + foreach(var entry in zip) + { + entry.LastModified = _fixedTimestamp; + } + } + + if (!flavor.HasValue) + { + if (saveToStdout) + zip.Save(Console.OpenStandardOutput()); + else + zip.Save(); + } + else + { + if (saveToStdout) + throw new Exception("Cannot save SFX to stdout, sorry! See http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7246"); + zip.SaveSelfExtractor(args[0], flavor.Value); + + } + + } + } + catch (System.Exception ex1) + { + System.Console.WriteLine("Exception: " + ex1); + } + } + } +} \ No newline at end of file diff --git a/dotNetZip/Tools/ZipIt/ZipIt.csproj b/dotNetZip/Tools/ZipIt/ZipIt.csproj new file mode 100644 index 0000000..3864776 --- /dev/null +++ b/dotNetZip/Tools/ZipIt/ZipIt.csproj @@ -0,0 +1,108 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {98008721-C4DD-4F34-B3AE-A3453E29BB65} + Exe + Properties + ZipIt + ZipIt + + + + + 3.5 + SAK + SAK + SAK + SAK + true + ..\..\Ionic.snk + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Zip CF/Properties/AssemblyInfo.cs b/dotNetZip/Zip CF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e79d0ad Binary files /dev/null and b/dotNetZip/Zip CF/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zip CF/Zip CF DLL.csproj b/dotNetZip/Zip CF/Zip CF DLL.csproj new file mode 100644 index 0000000..e8107e1 --- /dev/null +++ b/dotNetZip/Zip CF/Zip CF DLL.csproj @@ -0,0 +1,138 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {051C2B3B-8CDF-42CB-9EA2-027232BFC395} + Library + Properties + Ionic.Zip.CF + Ionic.Zip.CF + Smartphone + f27da329-3269-4191-98e0-c87d3d7f1db9 + 5.2 + Ionic.Zip.CF + v2.0 + Windows Mobile 6 Standard SDK + true + ..\Ionic.snk + + + SAK + SAK + SAK + SAK + + + 4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;Smartphone;NETCF;BZIP + true + true + prompt + 512 + 4 + Off + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE;Smartphone;NETCF;BZIP + true + true + prompt + 512 + 4 + Off + AllRules.ruleset + + + + + + + + + BZip2\%(FileName) + + + Zlib\%(FileName) + + + CRC32.cs + + + Iso8859Dash1Encoding.cs + + + + Properties\SolutionInfo.cs + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zip Full DLL/Zip Full DLL.csproj b/dotNetZip/Zip Full DLL/Zip Full DLL.csproj new file mode 100644 index 0000000..31e112a --- /dev/null +++ b/dotNetZip/Zip Full DLL/Zip Full DLL.csproj @@ -0,0 +1,178 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4F7A9BBE-5221-46C5-9E47-1E8B547CF258} + Library + Properties + Ionic.Zip + Ionic.Zip + v2.0 + 512 + + + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\Ionic.Zip.XML + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip Partial DLL + + + {9816BA86-9250-4C00-A912-25F07F8677D1} + Zlib DLL + + + {e2ce0d56-7af8-4404-bd0c-bc562cbd74d4} + BZip2 DLL + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + \ No newline at end of file diff --git a/dotNetZip/Zip Reduced/Properties/AssemblyInfo.cs b/dotNetZip/Zip Reduced/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2c4c94d Binary files /dev/null and b/dotNetZip/Zip Reduced/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zip Reduced/Zip Reduced.csproj b/dotNetZip/Zip Reduced/Zip Reduced.csproj new file mode 100644 index 0000000..b4d0ca1 --- /dev/null +++ b/dotNetZip/Zip Reduced/Zip Reduced.csproj @@ -0,0 +1,130 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {49A128D3-C3F2-46B1-8F7A-EECD209EA860} + Library + Properties + Zip_Reduced + Ionic.Zip.Reduced + v4.0 + 512 + + + SAK + SAK + SAK + SAK + false + cert.pfx + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + Client + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + bin\Debug\Ionic.Zip.Reduced.XML + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE;BZIP + prompt + 4 + AllRules.ruleset + + + true + bin\Full debug\ + TRACE;DEBUG + bin\Debug\Ionic.Zip.Reduced.XML + full + AnyCPU + bin\Debug\Ionic.Zip.Reduced.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + + + + Zip\%(FileName) + + + BZip2\%(FileName) + + + Zlib\%(FileName) + + + CRC32.cs + + + + Properties\SolutionInfo.cs + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zip SL/Properties/AssemblyInfo.cs b/dotNetZip/Zip SL/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f5735ae --- /dev/null +++ b/dotNetZip/Zip SL/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Security; +using System.Runtime.CompilerServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("Ionic's Zip Library for Silverlight")] + +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +[assembly: AssemblyDescription("a Silverlight library for handling zip archives. http://DotNetZip.codeplex.com/ (Flavor=Debug)")] +#else +[assembly: AssemblyConfiguration("Retail")] +[assembly: AssemblyDescription("a Silverlight library for handling zip archives. http://DotNetZip.codeplex.com/ (Flavor=Retail)")] +#endif + +[assembly: System.CLSCompliant(true)] + diff --git a/dotNetZip/Zip SL/Zip SL.csproj b/dotNetZip/Zip SL/Zip SL.csproj new file mode 100644 index 0000000..7e38675 --- /dev/null +++ b/dotNetZip/Zip SL/Zip SL.csproj @@ -0,0 +1,147 @@ + + + + v3.5 + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {1f27ca58-54bd-485a-bc24-3b9176f62ac3} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Ionic.Zip + Ionic.Zip + v3.0 + false + true + true + SAK + SAK + SAK + SAK + true + ..\Ionic.snk + Silverlight + $(TargetFrameworkVersion) + + + 4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + Bin\Debug\Ionic.Zip.XML + AllRules.ruleset + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + + Zip\%(FileName) + + + + BZip2\%(FileName) + + + Zlib\%(FileName) + + + CRC32.cs + + + Iso8859Dash1Encoding.cs + + + Properties\SolutionInfo.cs + + + + + + Ionic.snk + + + + + LICENSE.zlib.txt + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zip Tests/BasicTests.cs b/dotNetZip/Zip Tests/BasicTests.cs new file mode 100644 index 0000000..2292c0b --- /dev/null +++ b/dotNetZip/Zip Tests/BasicTests.cs @@ -0,0 +1,2451 @@ +// BasicTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-26 11:39:21> +// +// ------------------------------------------------------------------ +// +// This module defines basic unit tests for DotNetZip. +// +// ------------------------------------------------------------------ + +using System; +using System.Text; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using RE = System.Text.RegularExpressions; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + +namespace Ionic.Zip.Tests.Basic +{ + /// + /// Summary description for UnitTest1 + /// + [TestClass] + public class BasicTests : IonicTestClass + { + EncryptionAlgorithm[] crypto = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.PkzipWeak, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; + + + public BasicTests() : base() { } + + + [TestMethod] + public void CreateZip_AddItem_WithDirectory() + { + // select the name of the zip file + string zipFileToCreate = "CreateZip_AddItem.zip"; + + // create a bunch of files + string subdir = "files"; + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + //zip.StatusMessageTextWriter = System.Console.Out; + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + [TestMethod] + public void CreateZip_AddItem_NoDirectory() + { + string zipFileToCreate = "CreateZip_AddItem.zip"; + string[] filesToZip = TestUtilities.GenerateFilesFlat("."); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + foreach (var f in filesToZip) + zip1.AddItem(f); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void FileNotAvailableFails_wi10387() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "FileNotAvailableFails.zip"); + using (var zip1 = new ZipFile(zipFileToCreate)) { zip1.Save(); } + try + { + using (new FileStream(zipFileToCreate, FileMode.Open, + FileAccess.ReadWrite, + FileShare.None)) + { + using (new ZipFile(zipFileToCreate)) { } + } + } + finally + { + } + } + + + [TestMethod] + public void CreateZip_AddFile() + { + int i; + string zipFileToCreate = "CreateZip_AddFile.zip"; + string subdir = "files"; + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir); + + using (ZipFile zip1 = new ZipFile()) + { + for (i = 0; i < filesToZip.Length; i++) + zip1.AddFile(filesToZip[i], "files"); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + [TestMethod] + public void CreateZip_AddFile_CharCase_wi13481() + { + string zipFileToCreate = "AddFile.zip"; + string subdir = "files"; + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir); + Directory.SetCurrentDirectory(subdir); + Array.ForEach(filesToZip, x => { File.Move(Path.GetFileName(x),Path.GetFileName(x).ToUpper()); }); + Directory.SetCurrentDirectory(TopLevelDir); + filesToZip= Directory.GetFiles(subdir); + + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddFile(filesToZip[i], "files"); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + + int nEntries = 0; + // now, verify that we have not downcased the filenames + using (ZipFile zip2 = new ZipFile(zipFileToCreate)) + { + foreach (var entry in zip2.Entries) + { + var fname1 = Path.GetFileName(entry.FileName); + var fnameLower = fname1.ToLower(); + Assert.IsFalse(fname1.Equals(fnameLower), + "{0} is all lowercase.", fname1); + nEntries++; + } + } + Assert.IsFalse(nEntries < 2, "not enough entries"); + } + + + [TestMethod] + public void CreateZip_AddFileInDirectory() + { + string subdir = "fodder"; + TestUtilities.GenerateFilesFlat(subdir); + for (int m = 0; m < 2; m++) + { + string directoryName = ""; + for (int k = 0; k < 4; k++) + { + // select the name of the zip file + string zipFileToCreate = String.Format("CreateZip_AddFileInDirectory-trial{0}.{1}.zip", m, k); + TestContext.WriteLine("====================="); + TestContext.WriteLine("Trial {0}", k); + TestContext.WriteLine("Zipfile: {0}", zipFileToCreate); + + directoryName = Path.Combine(directoryName, + String.Format("{0:D2}", k)); + + string[] filesToSelectFrom = + Directory.GetFiles(subdir, "*.*", SearchOption.AllDirectories); + + TestContext.WriteLine("using dirname: {0}", directoryName); + + int n = _rnd.Next(filesToSelectFrom.Length / 2) + 2; + TestContext.WriteLine("Zipping {0} files", n); + + // Create the zip archive + var addedFiles = new List(); + using (ZipFile zip1 = new ZipFile()) + { + // add n files + int j=0; + for (int i = 0; i < n; i++) + { + // select files at random + while (addedFiles.Contains(filesToSelectFrom[j])) + j = _rnd.Next(filesToSelectFrom.Length); + zip1.AddFile(filesToSelectFrom[j], directoryName); + addedFiles.Add(filesToSelectFrom[j]); + } + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), n, + "Wrong number of entries in the zip file {0}", + zipFileToCreate); + + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip2) + { + TestContext.WriteLine("Check entry: {0}", e.FileName); + Assert.AreEqual(directoryName, + Path.GetDirectoryName(e.FileName), + "Wrong directory on zip entry {0}", + e.FileName); + } + } + } + + // add progressively more files to the fodder directory + TestUtilities.GenerateFilesFlat(subdir); + } + + } + + + [TestMethod] + public void CreateZip_AddFile_LeadingDot() + { + // select the name of the zip file + string zipFileToCreate = "CreateZip_AddFile_LeadingDot.zip"; + string[] filesToZip = TestUtilities.GenerateFilesFlat("."); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + { + zip1.AddFile(filesToZip[i]); + } + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + + + + [TestMethod] + public void CreateZip_AddFiles_LeadingDot_Array() + { + // select the name of the zip file + string zipFileToCreate = "CreateZip_AddFiles_LeadingDot_Array.zip"; + string[] filesToZip = TestUtilities.GenerateFilesFlat("."); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + + + [TestMethod] + public void CreateZip_AddFiles_PreserveDirHierarchy() + { + // select the name of the zip file + string zipFileToCreate = "CreateZip_AddFiles_PreserveDirHierarchy.zip"; + string dirToZip = "zipthis"; + + // create a bunch of files + int subdirCount; + int entries = TestUtilities.GenerateFilesOneLevelDeep(TestContext, "PreserveDirHierarchy", dirToZip, null, out subdirCount); + + string[] filesToZip = Directory.GetFiles(".", "*.*", SearchOption.AllDirectories); + + Assert.AreEqual(filesToZip.Length, entries); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip, true, ""); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + private bool ArraysAreEqual(byte[] b1, byte[] b2) + { + return (CompareArrays(b1, b2) == 0); + } + + + private int CompareArrays(byte[] b1, byte[] b2) + { + if (b1 == null && b2 == null) return 0; + if (b1 == null || b2 == null) return 0; + if (b1.Length > b2.Length) return 1; + if (b1.Length < b2.Length) return -1; + for (int i = 0; i < b1.Length; i++) + { + if (b1[i] > b2[i]) return 1; + if (b1[i] < b2[i]) return -1; + } + return 0; + } + + + [TestMethod] + public void CreateZip_AddEntry_ByteArray() + { + // select the name of the zip file + string zipFileToCreate = "CreateZip_AddEntry_ByteArray.zip"; + int entriesToCreate = _rnd.Next(42) + 12; + var dict = new Dictionary(); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < entriesToCreate; i++) + { + var b = new byte[_rnd.Next(1000) + 1000]; + _rnd.NextBytes(b); + string filename = String.Format("Filename{0:D3}.bin", i); + var e = zip1.AddEntry(Path.Combine("data", filename), b); + dict.Add(e.FileName, b); + } + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + entriesToCreate); + + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip1) + { + // extract to a stream + using (var ms1 = new MemoryStream()) + { + e.Extract(ms1); + Assert.IsTrue(ArraysAreEqual(ms1.ToArray(), dict[e.FileName])); + } + } + } + } + + + + + [TestMethod] + public void CreateZip_AddFile_AddItem() + { + string zipFileToCreate = "CreateZip_AddFile_AddItem.zip"; + string subdir = "files"; + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir); + + // use the parameterized ctor + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + for (int i = 0; i < filesToZip.Length; i++) + { + if (_rnd.Next(2) == 0) + zip1.AddFile(filesToZip[i], "files"); + else + zip1.AddItem(filesToZip[i], "files"); + } + zip1.Save(); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + + private void DumpZipFile(ZipFile z) + { + TestContext.WriteLine("found {0} entries", z.Entries.Count); + TestContext.WriteLine("RequiresZip64: '{0}'", z.RequiresZip64.HasValue ? z.RequiresZip64.Value.ToString() : "not set"); + TestContext.WriteLine("listing the entries in {0}...", String.IsNullOrEmpty(z.Name) ? "(zipfile)" : z.Name); + foreach (var e in z) + { + TestContext.WriteLine("{0}", e.FileName); + } + } + + + + [TestMethod] + public void CreateZip_ZeroEntries() + { + // select the name of the zip file + string zipFileToCreate = "CreateZip_ZeroEntries.zip"; + + using (ZipFile zip1 = new ZipFile()) + { + zip1.Save(zipFileToCreate); + DumpZipFile(zip1); + } + + // workitem 7685 + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + DumpZipFile(zip1); + } + + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + DumpZipFile(zip1); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 0); + } + + + + [TestMethod] + public void CreateZip_Basic_ParameterizedSave() + { + string zipFileToCreate = "CreateZip_Basic_ParameterizedSave.zip"; + string subdir = "files"; + int numFilesToCreate = _rnd.Next(23) + 14; + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir, numFilesToCreate); + + using (ZipFile zip1 = new ZipFile()) + { + //zip.StatusMessageTextWriter = System.Console.Out; + for (int i = 0; i < filesToZip.Length; i++) + { + if (_rnd.Next(2) == 0) + zip1.AddFile(filesToZip[i], "files"); + else + zip1.AddItem(filesToZip[i], "files"); + } + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + + [TestMethod] + public void CreateZip_AddFile_OnlyZeroLengthFiles() + { + _Internal_ZeroLengthFiles(_rnd.Next(33) + 3, "CreateZip_AddFile_OnlyZeroLengthFiles", null); + } + + [TestMethod] + public void CreateZip_AddFile_OnlyZeroLengthFiles_Password() + { + _Internal_ZeroLengthFiles(_rnd.Next(33) + 3, "CreateZip_AddFile_OnlyZeroLengthFiles", Path.GetRandomFileName()); + } + + [TestMethod] + public void CreateZip_AddFile_OneZeroLengthFile() + { + _Internal_ZeroLengthFiles(1, "CreateZip_AddFile_OneZeroLengthFile", null); + } + + + [TestMethod] + public void CreateZip_AddFile_OneZeroLengthFile_Password() + { + _Internal_ZeroLengthFiles(1, "CreateZip_AddFile_OneZeroLengthFile_Password", Path.GetRandomFileName()); + } + + + private void _Internal_ZeroLengthFiles(int fileCount, string nameStub, string password) + { + string zipFileToCreate = Path.Combine(TopLevelDir, nameStub + ".zip"); + + int i; + string[] filesToZip = new string[fileCount]; + for (i = 0; i < fileCount; i++) + filesToZip[i] = TestUtilities.CreateUniqueFile("zerolength", TopLevelDir); + + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + zip.Password = password; + for (i = 0; i < filesToZip.Length; i++) + zip.AddFile(filesToZip[i]); + zip.Save(zipFileToCreate); + } + + string status = sw.ToString(); + TestContext.WriteLine("save output: " + status); + + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "The zip file created has the wrong number of entries."); + } + + + [TestMethod] + public void CreateZip_UpdateDirectory() + { + int i, j; + + string zipFileToCreate = "CreateZip_UpdateDirectory.zip"; + string dirToZip = "zipthis"; + Directory.CreateDirectory(dirToZip); + + TestContext.WriteLine("\n------------\nCreating files ..."); + + int entries = 0; + int subdirCount = _rnd.Next(17) + 14; + //int subdirCount = _rnd.Next(3) + 2; + var FileCount = new Dictionary(); + var checksums = new Dictionary(); + + for (i = 0; i < subdirCount; i++) + { + string subdirShort = String.Format("dir{0:D4}", i); + string subdir = Path.Combine(dirToZip, subdirShort); + Directory.CreateDirectory(subdir); + + int filecount = _rnd.Next(11) + 17; + //int filecount = _rnd.Next(2) + 2; + FileCount[subdirShort] = filecount; + for (j = 0; j < filecount; j++) + { + string filename = String.Format("file{0:D4}.x", j); + string fqFilename = Path.Combine(subdir, filename); + TestUtilities.CreateAndFillFile(fqFilename, _rnd.Next(1000) + 100); + + var chk = TestUtilities.ComputeChecksum(fqFilename); + var t1 = Path.GetFileName(dirToZip); + var t2 = Path.Combine(t1, subdirShort); + var key = Path.Combine(t2, filename); + key = TestUtilities.TrimVolumeAndSwapSlashes(key); + TestContext.WriteLine("chk[{0}]= {1}", key, + TestUtilities.CheckSumToString(chk)); + checksums.Add(key, chk); + entries++; + } + } + + Directory.SetCurrentDirectory(TopLevelDir); + + TestContext.WriteLine("\n------------\nAdding files into the Zip..."); + + // add all the subdirectories into a new zip + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(dirToZip, "zipthis"); + zip1.Save(zipFileToCreate); + } + + TestContext.WriteLine("\n"); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, + "The Zip file has an unexpected number of entries."); + + TestContext.WriteLine("\n------------\nExtracting and validating checksums..."); + + // validate all the checksums + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + { + e.Extract("unpack"); + string pathToExtractedFile = Path.Combine("unpack", e.FileName); + + // if it is a file.... + if (checksums.ContainsKey(e.FileName)) + { + // verify the checksum of the file is correct + string expectedCheckString = TestUtilities.CheckSumToString(checksums[e.FileName]); + string actualCheckString = TestUtilities.GetCheckSumString(pathToExtractedFile); + Assert.AreEqual + (expectedCheckString, + actualCheckString, + "Unexpected checksum on extracted filesystem file ({0}).", + pathToExtractedFile); + } + } + } + + TestContext.WriteLine("\n------------\nCreating some new files ..."); + + // now, update some of the existing files + dirToZip = Path.Combine(TopLevelDir, "updates"); + Directory.CreateDirectory(dirToZip); + + for (i = 0; i < subdirCount; i++) + { + string subdirShort = String.Format("dir{0:D4}", i); + string subdir = Path.Combine(dirToZip, subdirShort); + Directory.CreateDirectory(subdir); + + int filecount = FileCount[subdirShort]; + for (j = 0; j < filecount; j++) + { + if (_rnd.Next(2) == 1) + { + string filename = String.Format("file{0:D4}.x", j); + TestUtilities.CreateAndFillFile(Path.Combine(subdir, filename), + _rnd.Next(1000) + 100); + string fqFilename = Path.Combine(subdir, filename); + + var chk = TestUtilities.ComputeChecksum(fqFilename); + //var t1 = Path.GetFileName(dirToZip); + var t2 = Path.Combine("zipthis", subdirShort); + var key = Path.Combine(t2, filename); + key = TestUtilities.TrimVolumeAndSwapSlashes(key); + + TestContext.WriteLine("chk[{0}]= {1}", key, + TestUtilities.CheckSumToString(chk)); + + checksums.Remove(key); + checksums.Add(key, chk); + } + } + } + + + TestContext.WriteLine("\n------------\nUpdating some of the files in the zip..."); + // add some new content + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + zip3.UpdateDirectory(dirToZip, "zipthis"); + //String[] dirs = Directory.GetDirectories(dirToZip); + + //foreach (String d in dirs) + //{ + // string dir = Path.Combine(Path.GetFileName(dirToZip), Path.GetFileName(d)); + // //string root = Path.Combine("zipthis", Path.GetFileName(d)); + // zip3.UpdateDirectory(dir, "zipthis"); + //} + zip3.Save(); + } + + TestContext.WriteLine("\n------------\nValidating the checksums for all of the files ..."); + + // validate all the checksums again + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip4) + TestContext.WriteLine("Found entry: {0}", e.FileName); + + foreach (ZipEntry e in zip4) + { + e.Extract("unpack2"); + if (!e.IsDirectory) + { + string pathToExtractedFile = Path.Combine("unpack2", e.FileName); + + // verify the checksum of the file is correct + string expectedCheckString = TestUtilities.CheckSumToString(checksums[e.FileName]); + string actualCheckString = TestUtilities.GetCheckSumString(pathToExtractedFile); + Assert.AreEqual + (expectedCheckString, + actualCheckString, + "Unexpected checksum on extracted filesystem file ({0}).", + pathToExtractedFile); + } + } + } + } + + + + [TestMethod] + public void CreateZip_AddDirectory_OnlyZeroLengthFiles() + { + string zipFileToCreate = "CreateZip_AddDirectory_OnlyZeroLengthFiles.zip"; + string dirToZip = "zipthis"; + Directory.CreateDirectory(dirToZip); + + int entries = 0; + int subdirCount = _rnd.Next(8) + 8; + for (int i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(dirToZip, "dir" + i); + Directory.CreateDirectory(subdir); + int n = _rnd.Next(6) + 2; + for (int j=0; j < n; j++) + { + TestUtilities.CreateUniqueFile("bin", subdir); + entries++; + } + } + + using (var zip = new ZipFile()) + { + zip.AddDirectory(Path.GetFileName(dirToZip)); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries); + } + + + + [TestMethod] + public void CreateZip_AddDirectory_OneZeroLengthFile() + { + string zipFileToCreate = "CreateZip_AddDirectory_OneZeroLengthFile.zip"; + string dirToZip = "zipthis"; + Directory.CreateDirectory(dirToZip); + + // one empty file + string file = TestUtilities.CreateUniqueFile("ZeroLengthFile.txt", dirToZip); + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(Path.GetFileName(dirToZip)); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 1); + } + + + [TestMethod] + public void CreateZip_AddDirectory_OnlyEmptyDirectories() + { + string zipFileToCreate = "CreateZip_AddDirectory_OnlyEmptyDirectories.zip"; + string dirToZip = "zipthis"; + Directory.CreateDirectory(dirToZip); + + int subdirCount = _rnd.Next(28) + 18; + for (int i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(dirToZip, "EmptyDir" + i); + Directory.CreateDirectory(subdir); + } + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(Path.GetFileName(dirToZip)); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 0); + } + + + [TestMethod] + public void CreateZip_AddDirectory_OneEmptyDirectory() + { + string zipFileToCreate = "CreateZip_AddDirectory_OneEmptyDirectory.zip"; + string dirToZip = "zipthis"; + Directory.CreateDirectory(dirToZip); + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(Path.GetFileName(dirToZip)); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 0); + BasicVerifyZip(zipFileToCreate); + } + + + [TestMethod] + public void CreateZip_WithEmptyDirectory() + { + string zipFileToCreate = "Create_WithEmptyDirectory.zip"; + string subdir = "EmptyDirectory"; + Directory.CreateDirectory(subdir); + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(subdir, ""); + zip.Save(zipFileToCreate); + } + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 0); + BasicVerifyZip(zipFileToCreate); + } + + + + [TestMethod] + public void CreateZip_AddDirectory_CheckStatusTextWriter() + { + string zipFileToCreate = "CreateZip_AddDirectory_CheckStatusTextWriter.zip"; + string dirToZip = "zipthis"; + Directory.CreateDirectory(dirToZip); + + int entries = 0; + int subdirCount = _rnd.Next(8) + 8; + for (int i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(dirToZip, "Dir" + i); + Directory.CreateDirectory(subdir); + // a few files per subdir + int fileCount = _rnd.Next(12) + 4; + for (int j = 0; j < fileCount; j++) + { + string file = Path.Combine(subdir, "File" + j); + TestUtilities.CreateAndFillFile(file, 1020); + entries++; + } + } + + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + zip.AddDirectory(Path.GetFileName(dirToZip)); + zip.Save(zipFileToCreate); + } + + string status = sw.ToString(); + TestContext.WriteLine("save output: " + status); + + Assert.IsTrue(status.Length > 24 * entries, "status messages? ({0}!>{1})", + status.Length, 24 * entries); + + int n = TestUtilities.CountEntries(zipFileToCreate); + Assert.AreEqual(n, entries, + "wrong number of entries. ({0}!={1})", n, entries); + + BasicVerifyZip(zipFileToCreate); + } + + + struct TestTrial + { + public string arg; + public string re; + } + + + [TestMethod] + public void CreateZip_AddDirectory() + { + TestTrial[] trials = { + new TestTrial { arg=null, re="^file(\\d+).ext$"}, + new TestTrial { arg="", re="^file(\\d+).ext$"}, + new TestTrial { arg=null, re="^file(\\d+).ext$"}, + new TestTrial { arg="Xabf", re="(?s)^Xabf/(file(\\d+).ext)?$"}, + new TestTrial { arg="AAAA/BBB", re="(?s)^AAAA/BBB/(file(\\d+).ext)?$"} + }; + + for (int k = 0; k < trials.Length; k++) + { + TestContext.WriteLine("\n--------------------------------\n\n\n"); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("CreateZip_AddDirectory-{0}.zip", k)); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The temporary zip file '{0}' already exists.", zipFileToCreate); + + string dirToZip = String.Format("DirectoryToZip.{0}.test", k); + Directory.CreateDirectory(dirToZip); + + int fileCount = _rnd.Next(5) + 4; + for (int i = 0; i < fileCount; i++) + { + String file = Path.Combine(dirToZip, String.Format("file{0:D3}.ext", i)); + TestUtilities.CreateAndFillFile(file, _rnd.Next(2000) + 500); + } + + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + if (k == 0) + zip.AddDirectory(dirToZip); + else + zip.AddDirectory(dirToZip, trials[k].arg); + zip.Save(zipFileToCreate); + } + TestContext.WriteLine(sw.ToString()); + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), fileCount, + String.Format("The zip file created in cycle {0} has the wrong number of entries.", k)); + + //TestContext.WriteLine(""); + // verify that the entries in the zip are in the top level directory!! + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + TestContext.WriteLine("found entry: {0}", e.FileName); + foreach (ZipEntry e in zip2) + { + //Assert.IsFalse(e.FileName.StartsWith("dir"), + // String.Format("The Zip entry '{0}' is not rooted in top level directory.", e.FileName)); + + // check the filename: + //RE.Match m0 = RE.Regex.Match(e.FileName, fnameRegex[k]); + // Assert.IsTrue(m0 != null, "No match"); + // Assert.AreEqual(m0.Groups.Count, 2, + // String.Format("In cycle {0}, Matching {1} against {2}, Wrong number of matches ({3})", + // k, e.FileName, fnameRegex[k], m0.Groups.Count)); + + Assert.IsTrue(RE.Regex.IsMatch(e.FileName, trials[k].re), + String.Format("In cycle {0}, Matching {1} against {2}", k, e.FileName, trials[k].re)); + } + } + } + } + + + [TestMethod] + public void CreateZip_AddDirectory_Nested() + { + // Each trial provides a directory name into which to add + // files, and a regex, used for verification after the zip + // is created, to match the names on any added entries. + TestTrial[] trials = { + new TestTrial { arg=null, re="^dir(\\d){3}/(file(\\d+).ext)?$"}, + new TestTrial { arg="", re="^dir(\\d){3}/(file(\\d+).ext)?$"}, + new TestTrial { arg=null, re="^dir(\\d){3}/(file(\\d+).ext)?$"}, + new TestTrial { arg="rtdha", re="(?s)^rtdha/(dir(\\d){3}/(file(\\d+).ext)?)?$"}, + new TestTrial { arg="sdfjk/BBB", re="(?s)^sdfjk/BBB/(dir(\\d){3}/(file(\\d+).ext)?)?$"} + }; + + for (int k = 0; k < trials.Length; k++) + { + TestContext.WriteLine("\n--------------------------------\n\n\n"); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("CreateZip_AddDirectory_Nested-{0}.zip", k)); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The temporary zip file '{0}' already exists.", zipFileToCreate); + + string dirToZip = String.Format("DirectoryToZip.{0}.test", k); + Directory.CreateDirectory(dirToZip); + + int i, j; + int entries = 0; + + int subdirCount = _rnd.Next(23) + 7; + for (i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(dirToZip, String.Format("dir{0:D3}", i)); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(8); // sometimes zero + for (j = 0; j < fileCount; j++) + { + String file = Path.Combine(subdir, String.Format("file{0:D3}.ext", j)); + TestUtilities.CreateAndFillFile(file, _rnd.Next(10750) + 50); + entries++; + } + } + + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + if (k == 0) + zip.AddDirectory(dirToZip); + else + zip.AddDirectory(dirToZip, trials[k].arg); + zip.Save(zipFileToCreate); + } + TestContext.WriteLine(sw.ToString()); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, + String.Format("The zip file created in cycle {0} has the wrong number of entries.", k)); + + // verify that the entries in the zip are in the top level directory!! + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + TestContext.WriteLine("found entry: {0}", e.FileName); + foreach (ZipEntry e in zip2) + { + Assert.IsTrue(RE.Regex.IsMatch(e.FileName, trials[k].re), + String.Format("In cycle {0}, Matching {1} against {2}", k, e.FileName, trials[k].re)); + } + + } + } + } + + + [TestMethod] + public void Basic_SaveToFileStream() + { + // from small numbers of files to larger numbers of files + for (int k = 0; k < 3; k++) + { + string zipFileToCreate = String.Format("SaveToFileStream-t{0}.zip", k); + string dirToZip = Path.GetRandomFileName(); + Directory.CreateDirectory(dirToZip); + + int filesToAdd = _rnd.Next(k * 10 + 3) + k * 10 + 3; + for (int i = 0; i < filesToAdd; i++) + { + var s = Path.Combine(dirToZip, String.Format("tempfile-{0}.bin", i)); + int sz = _rnd.Next(10000) + 5000; + TestContext.WriteLine(" Creating file: {0} sz({1})", s, sz); + TestUtilities.CreateAndFillFileBinary(s, sz); + } + + using (var fileStream = File.Create(zipFileToCreate)) + { + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(dirToZip); + zip1.Comment = "This is a Comment On the Archive (AM/PM)"; + zip1.Save(fileStream); + } + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToAdd, + "Trial {0}: file {1} wrong number of entries.", + k, zipFileToCreate); + } + } + + + + [TestMethod] + public void Basic_IsText() + { + // from small numbers of files to larger numbers of files + for (int k = 0; k < 3; k++) + { + string zipFileToCreate = String.Format("Basic_IsText-trial{0}.zip", k); + string dirToZip = Path.GetRandomFileName(); + Directory.CreateDirectory(dirToZip); + + int filesToAdd = _rnd.Next(33) + 11; + for (int i = 0; i < filesToAdd; i++) + { + var s = Path.Combine(dirToZip, String.Format("tempfile-{0}.txt", i)); + int sz = _rnd.Next(10000) + 5000; + TestContext.WriteLine(" Creating file: {0} sz({1})", s, sz); + TestUtilities.CreateAndFillFileText(s, sz); + } + + using (ZipFile zip1 = new ZipFile()) + { + int count = 0; + var filesToZip = Directory.GetFiles(dirToZip); + foreach (var f in filesToZip) + { + var e = zip1.AddFile(f, "files"); + switch (k) + { + case 0: break; + case 1: if ((count % 2) == 0) e.IsText = true; break; + case 2: if ((count % 2) != 0) e.IsText = true; break; + case 3: e.IsText = true; break; + } + count++; + } + zip1.Comment = "This is a Comment On the Archive (AM/PM)"; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToAdd, + "trial {0}: file {1} number of entries.", + k, zipFileToCreate); + + // verify the isText setting + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + int count = 0; + foreach (var e in zip2) + { + switch (k) + { + case 0: Assert.IsFalse(e.IsText); break; + case 1: Assert.AreEqual((count % 2) == 0, e.IsText); break; + case 2: Assert.AreEqual((count % 2) != 0, e.IsText); break; + case 3: Assert.IsTrue(e.IsText); break; + } + count++; + } + } + } + } + + + [TestMethod] + public void CreateZip_VerifyThatStreamRemainsOpenAfterSave() + { + Ionic.Zlib.CompressionLevel[] compressionLevelOptions = { + Ionic.Zlib.CompressionLevel.None, + Ionic.Zlib.CompressionLevel.BestSpeed, + Ionic.Zlib.CompressionLevel.Default, + Ionic.Zlib.CompressionLevel.BestCompression, + }; + + string[] Passwords = { null, Path.GetRandomFileName() }; + + for (int j = 0; j < Passwords.Length; j++) + { + for (int k = 0; k < compressionLevelOptions.Length; k++) + { + TestContext.WriteLine("\n\n---------------------------------\n" + + "Trial ({0},{1}): Password='{2}' Compression={3}\n", + j, k, Passwords[j], compressionLevelOptions[k]); + string dirToZip = Path.GetRandomFileName(); + Directory.CreateDirectory(dirToZip); + + int filesAdded = _rnd.Next(3) + 3; + for (int i = 0; i < filesAdded; i++) + { + var s = Path.Combine(dirToZip, String.Format("tempfile-{0}-{1}-{2}.bin", j, k, i)); + int sz = _rnd.Next(10000) + 5000; + TestContext.WriteLine(" Creating file: {0} sz({1})", s, sz); + TestUtilities.CreateAndFillFileBinary(s, sz); + } + + TestContext.WriteLine("\n"); + + //string dirToZip = Path.GetFileName(TopLevelDir); + var ms = new MemoryStream(); + Assert.IsTrue(ms.CanSeek, String.Format("Trial {0}: The output MemoryStream does not do Seek.", k)); + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = compressionLevelOptions[k]; + zip1.Password = Passwords[j]; + zip1.Comment = String.Format("Trial ({0},{1}): Password='{2}' Compression={3}\n", + j, k, Passwords[j], compressionLevelOptions[k]); + zip1.AddDirectory(dirToZip); + zip1.Save(ms); + } + + Assert.IsTrue(ms.CanSeek, String.Format("Trial {0}: After writing, the OutputStream does not do Seek.", k)); + Assert.IsTrue(ms.CanRead, String.Format("Trial {0}: The OutputStream cannot be Read.", k)); + + // seek to the beginning + ms.Seek(0, SeekOrigin.Begin); + int filesFound = 0; + using (ZipFile zip2 = ZipFile.Read(ms)) + { + foreach (ZipEntry e in zip2) + { + TestContext.WriteLine(" Found entry: {0} isDir({1}) sz_c({2}) sz_unc({3})", e.FileName, e.IsDirectory, e.CompressedSize, e.UncompressedSize); + if (!e.IsDirectory) + filesFound++; + } + } + Assert.AreEqual(filesFound, filesAdded, + "Trial {0}", k); + } + } + } + + + [TestMethod] + public void CreateZip_AddFile_VerifyCrcAndContents() + { + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + string zipFileToCreate = "CreateZip_AddFile_VerifyCrcAndContents.zip"; + string subdir = "A"; + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(10) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::CreateZip_AddFile_VerifyCrcAndContents(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate),entriesAdded); + + // now extract the files and verify their contents + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in zip2.EntryFileNames) + { + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", s); + zip2[s].Extract("extract"); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string actualLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, actualLine, + "Updated file ({0}) is incorrect.", s); + } + } + } + + + + + [TestMethod] + public void Extract_IntoMemoryStream() + { + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + string zipFileToCreate = "Extract_IntoMemoryStream.zip"; + string subdir = "A"; + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(10) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Create the zip file + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "BasicTests::Extract_IntoMemoryStream()"; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // now extract the files into memory streams, checking only the length of the file. + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in zip2.EntryFileNames) + { + using (MemoryStream ms = new MemoryStream()) + { + zip2[s].Extract(ms); + byte[] a = ms.ToArray(); + string f = Path.Combine(subdir, s); + var fi = new FileInfo(f); + Assert.AreEqual((int)(fi.Length), a.Length, "Unequal file lengths."); + } + } + } + } + + + [TestMethod] + public void Retrieve_ViaIndexer2_wi11056() + { + string fileName = "wi11056.dwf"; + string entryName = @"com.autodesk.dwf.ePlot_5VFMLy3OdEetAPFe7uWXYg\descriptor.xml"; + string SourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + SourceDir = Path.GetDirectoryName(SourceDir); + + TestContext.WriteLine("Current Dir: {0}", CurrentDir); + + string filename = Path.Combine(SourceDir, "Zip Tests\\bin\\Debug\\zips\\" + fileName); + + TestContext.WriteLine("Reading zip file: '{0}'", filename); + using (ZipFile zip = ZipFile.Read(filename)) + { + var e = zip[entryName]; + Assert.IsFalse(e == null, + "Retrieval by stringindex failed."); + } + } + + + + [TestMethod] + public void Retrieve_ViaIndexer() + { + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "Retrieve_ViaIndexer.zip"); + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + // create the subdirectory + string subdir = "A"; + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(10) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("File{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(23000) + 4000); + entriesAdded++; + } + + // Create the zip file + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "BasicTests::Retrieve_ViaIndexer()"; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // now extract the files into memory streams, checking only the length of the file. + // We do 4 combinations: case-sensitive on or off, and filename conversion on or off. + for (int m = 0; m < 2; m++) + { + for (int n = 0; n < 2; n++) + { + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + if (n == 1) zip2.CaseSensitiveRetrieval = true; + foreach (string s in zip2.EntryFileNames) + { + var s2 = (m == 1) ? s.ToUpper() : s; + using (MemoryStream ms = new MemoryStream()) + { + try + { + zip2[s2].Extract(ms); + byte[] a = ms.ToArray(); + string f = Path.Combine(subdir, s2); + var fi = new FileInfo(f); + Assert.AreEqual((int)(fi.Length), a.Length, "Unequal file lengths."); + } + catch + { + Assert.AreEqual(1, n * m, "Indexer retrieval failed unexpectedly."); + } + } + } + } + } + } + } + + + + + [TestMethod] + public void CreateZip_SetFileComments() + { + string zipFileToCreate = "FileComments.zip"; + string FileCommentFormat = "Comment Added By Test to file '{0}'"; + string commentOnArchive = "Comment added by FileComments() method."; + + int fileCount = _rnd.Next(3) + 3; + string[] filesToZip = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + { + filesToZip[i] = Path.Combine(TopLevelDir, String.Format("file{0:D3}.bin", i)); + TestUtilities.CreateAndFillFile(filesToZip[i], _rnd.Next(10000) + 5000); + } + + using (ZipFile zip = new ZipFile()) + { + //zip.StatusMessageTextWriter = System.Console.Out; + for (int i = 0; i < filesToZip.Length; i++) + { + // use the local filename (not fully qualified) + ZipEntry e = zip.AddFile(Path.GetFileName(filesToZip[i])); + e.Comment = String.Format(FileCommentFormat, e.FileName); + } + zip.Comment = commentOnArchive; + zip.Save(zipFileToCreate); + } + + int entries = 0; + using (ZipFile z2 = ZipFile.Read(zipFileToCreate)) + { + Assert.AreEqual(commentOnArchive, z2.Comment, "Unexpected comment on ZipFile."); + foreach (ZipEntry e in z2) + { + string expectedComment = String.Format(FileCommentFormat, e.FileName); + Assert.AreEqual(expectedComment, e.Comment, "Unexpected comment on ZipEntry."); + entries++; + } + } + Assert.AreEqual(entries, filesToZip.Length, "Unexpected file count. Expected {0}, got {1}.", + filesToZip.Length, entries); + } + + + [TestMethod] + public void CreateZip_SetFileLastModified() + { + //int fileCount = _rnd.Next(13) + 23; + int fileCount = _rnd.Next(3) + 2; + string[] filesToZip = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + { + filesToZip[i] = Path.Combine(TopLevelDir, String.Format("file{0:D3}.bin", i)); + TestUtilities.CreateAndFillFileBinary(filesToZip[i], _rnd.Next(10000) + 5000); + } + DateTime[] timestamp = + { + new System.DateTime(2007, 9, 1, 15, 0, 0), + new System.DateTime(2007, 4, 2, 14, 0, 0), + new System.DateTime(2007, 5, 18, 19, 0, 0), + }; + + // try Kind = unspecified, local, and UTC + DateTimeKind[] kinds = + { + DateTimeKind.Unspecified, + DateTimeKind.Local, + DateTimeKind.Utc, + }; + + for (int m = 0; m < timestamp.Length; m++) + { + for (int n = 0; n < 3; n++) + { + for (int k = 0; k < 2; k++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("CreateZip-SetFileLastModified-{0}.{1}.{2}.zip", m, n, k)); + TestContext.WriteLine("Cycle {0}.{1}.{2}", m, n, k); + TestContext.WriteLine("zipfile {0}", zipFileToCreate); + DateTime t = DateTime.SpecifyKind(timestamp[m], kinds[n]); + + using (ZipFile zip = new ZipFile()) + { + zip.EmitTimesInWindowsFormatWhenSaving = (k != 0); + + for (int i = 0; i < filesToZip.Length; i++) + { + // use the local filename (not fully qualified) + ZipEntry e = zip.AddFile(Path.GetFileName(filesToZip[i])); + e.LastModified = t; + } + zip.Comment = "All files in this archive have the same LastModified value."; + zip.Save(zipFileToCreate); + } + + // NB: comparing two DateTime variables will return "not + // equal" if they are not of the same "Kind", even if they + // represent the same point in time. To counteract that, + // we compare using UniversalTime. + + var x1 = t.ToUniversalTime().ToString("u"); + + string unpackDir = String.Format("unpack{0}.{1}.{2}", m, n, k); + int entries = 0; + using (ZipFile z2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in z2) + { + var t2 = e.LastModified; + var x2 = t2.ToUniversalTime().ToString("u"); + Assert.AreEqual(x1, x2, + "cycle {0}.{1}.{2}: Unexpected LastModified value on ZipEntry.", m, n, k); + entries++; + // now verify that the LastMod time on the filesystem file is set correctly + e.Extract(unpackDir); + DateTime ActualFilesystemLastMod = File.GetLastWriteTime(Path.Combine(unpackDir, e.FileName)); + ActualFilesystemLastMod = AdjustTime_Win32ToDotNet(ActualFilesystemLastMod); + + //Assert.AreEqual(t, ActualFilesystemLastMod, + x2 = ActualFilesystemLastMod.ToUniversalTime().ToString("u"); + Assert.AreEqual(x1, x2, + "cycle {0}.{1}.{2}: Unexpected LastWriteTime on extracted filesystem file.", m, n, k); + } + } + Assert.AreEqual(entries, filesToZip.Length, "Unexpected file count. Expected {0}, got {1}.", + filesToZip.Length, entries); + } + } + } + } + + + [TestMethod] + public void CreateAndExtract_VerifyAttributes() + { + + try + { + string zipFileToCreate = "CreateAndExtract_VerifyAttributes.zip"; + string subdir = "A"; + Directory.CreateDirectory(subdir); + + //int fileCount = _rnd.Next(13) + 23; + FileAttributes[] attributeCombos = { + FileAttributes.ReadOnly, + FileAttributes.ReadOnly | FileAttributes.System, + FileAttributes.ReadOnly | FileAttributes.System | FileAttributes.Hidden, + FileAttributes.ReadOnly | FileAttributes.System | FileAttributes.Hidden | FileAttributes.Archive, + FileAttributes.ReadOnly | FileAttributes.Hidden, + FileAttributes.ReadOnly | FileAttributes.Hidden| FileAttributes.Archive, + FileAttributes.ReadOnly | FileAttributes.Archive, + FileAttributes.System, + FileAttributes.System | FileAttributes.Hidden, + FileAttributes.System | FileAttributes.Hidden | FileAttributes.Archive, + FileAttributes.System | FileAttributes.Archive, + FileAttributes.Hidden, + FileAttributes.Hidden | FileAttributes.Archive, + FileAttributes.Archive, + FileAttributes.Normal, + FileAttributes.NotContentIndexed | FileAttributes.ReadOnly, + FileAttributes.NotContentIndexed | FileAttributes.System, + FileAttributes.NotContentIndexed | FileAttributes.Hidden, + FileAttributes.NotContentIndexed | FileAttributes.Archive, + FileAttributes.Temporary, + FileAttributes.Temporary | FileAttributes.Archive, + }; + int fileCount = attributeCombos.Length; + string[] filesToZip = new string[fileCount]; + TestContext.WriteLine("============\nCreating."); + for (int i = 0; i < fileCount; i++) + { + filesToZip[i] = Path.Combine(subdir, String.Format("file{0:D3}.bin", i)); + TestUtilities.CreateAndFillFileBinary(filesToZip[i], _rnd.Next(10000) + 5000); + TestContext.WriteLine("Creating {0} [{1}]", filesToZip[i], attributeCombos[i].ToString()); + File.SetAttributes(filesToZip[i], attributeCombos[i]); + } + + TestContext.WriteLine("============\nZipping."); + using (ZipFile zip = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + { + // use the local filename (not fully qualified) + ZipEntry e = zip.AddFile(filesToZip[i], ""); + } + zip.Save(zipFileToCreate); + } + + int entries = 0; + TestContext.WriteLine("============\nExtracting."); + using (ZipFile z2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in z2) + { + TestContext.WriteLine("Extracting {0}", e.FileName); + Assert.AreEqual + (attributeCombos[entries], + e.Attributes, + "unexpected attribute {0} 0x{1:X4}", + e.FileName, + (int)e.Attributes); + entries++; + e.Extract("unpack"); + // now verify that the attributes are set + // correctly in the filesystem + var attrs = File.GetAttributes(Path.Combine("unpack", e.FileName)); + Assert.AreEqual(attrs, e.Attributes, + "Unexpected attributes on the extracted filesystem file {0}.", e.FileName); + } + } + Assert.AreEqual(entries, + filesToZip.Length, + "Bad file count. Expected {0}, got {1}.", + filesToZip.Length, entries); + } + catch (Exception ex1) + { + TestContext.WriteLine("Exception: " + ex1); + throw; + } + } + + + + [TestMethod] + public void CreateAndExtract_SetAndVerifyAttributes() + { + string zipFileToCreate = "CreateAndExtract_SetAndVerifyAttributes.zip"; + + // Here, we build a list of combinations of FileAttributes + // to try. We cannot simply do an exhaustive combination + // because (a) not all combinations are valid, and (b) if + // you SetAttributes(file,Compressed) (also with Encrypted, + // ReparsePoint) it does not "work." So those attributes + // must be excluded. + FileAttributes[] attributeCombos = { + FileAttributes.ReadOnly, + FileAttributes.ReadOnly | FileAttributes.System, + FileAttributes.ReadOnly | FileAttributes.System | FileAttributes.Hidden, + FileAttributes.ReadOnly | FileAttributes.System | FileAttributes.Hidden | FileAttributes.Archive, + FileAttributes.ReadOnly | FileAttributes.Hidden, + FileAttributes.ReadOnly | FileAttributes.Hidden| FileAttributes.Archive, + FileAttributes.ReadOnly | FileAttributes.Archive, + FileAttributes.System, + FileAttributes.System | FileAttributes.Hidden, + FileAttributes.System | FileAttributes.Hidden | FileAttributes.Archive, + FileAttributes.System | FileAttributes.Archive, + FileAttributes.Hidden, + FileAttributes.Hidden | FileAttributes.Archive, + FileAttributes.Archive, + FileAttributes.Normal, + FileAttributes.NotContentIndexed | FileAttributes.ReadOnly, + FileAttributes.NotContentIndexed | FileAttributes.System, + FileAttributes.NotContentIndexed | FileAttributes.Hidden, + FileAttributes.NotContentIndexed | FileAttributes.Archive, + FileAttributes.Temporary, + FileAttributes.Temporary | FileAttributes.Archive, + }; + int fileCount = attributeCombos.Length; + + TestContext.WriteLine("============\nZipping."); + using (ZipFile zip = new ZipFile()) + { + for (int i = 0; i < fileCount; i++) + { + // use the local filename (not fully qualified) + ZipEntry e = zip.AddEntry("file" + i.ToString(), + "FileContent: This file has these attributes: " + attributeCombos[i].ToString()); + TestContext.WriteLine("Adding {0} [{1}]", e.FileName, attributeCombos[i].ToString()); + e.Attributes = attributeCombos[i]; + } + zip.Save(zipFileToCreate); + } + + int entries = 0; + TestContext.WriteLine("============\nExtracting."); + using (ZipFile z2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in z2) + { + TestContext.WriteLine("Extracting {0}", e.FileName); + Assert.AreEqual + (attributeCombos[entries], e.Attributes, + "unexpected attributes value in the entry {0} 0x{1:X4}", + e.FileName, + (int)e.Attributes); + entries++; + e.Extract("unpack"); + + // now verify that the attributes are set correctly in the filesystem + var attrs = File.GetAttributes(Path.Combine("unpack", e.FileName)); + Assert.AreEqual + (e.Attributes, attrs, + "Unexpected attributes on the extracted filesystem file {0}.", + e.FileName); + } + } + Assert.AreEqual(fileCount, entries, "Unexpected file count."); + } + + + [TestMethod] + [Timeout(1000 * 240)] // timeout in ms. 240s = 4 mins + public void CreateZip_VerifyFileLastModified() + { + string zipFileToCreate = "CreateZip_VerifyFileLastModified.zip"; + string envTemp = Environment.GetEnvironmentVariable("TEMP"); + String[] candidateFileNames = Directory.GetFiles(envTemp); + var checksums = new Dictionary(); + var timestamps = new Dictionary(); + var actualFilenames = new List(); + var excludedFilenames = new List(); + + int maxFiles = _rnd.Next(candidateFileNames.Length / 2) + candidateFileNames.Length / 3; + maxFiles = Math.Min(maxFiles, 145); + //maxFiles = Math.Min(maxFiles, 15); + TestContext.WriteLine("\n-----------------------------\r\n{1}: Finding files in '{0}'...", + envTemp, + DateTime.Now.ToString("HH:mm:ss")); + do + { + string filename = null; + bool foundOne = false; + while (!foundOne) + { + filename = candidateFileNames[_rnd.Next(candidateFileNames.Length)]; + if (excludedFilenames.Contains(filename)) continue; + var fi = new FileInfo(filename); + + if (Path.GetFileName(filename)[0] == '~' + || actualFilenames.Contains(filename) + || fi.Length > 10000000 + || Path.GetFileName(filename) == "dd_BITS.log" + // There WERE some weird files on my system that cause this + // test to fail! the GetLastWrite() method returns the + // "wrong" time - does not agree with what is shown in + // Explorer or in a cmd.exe dir output. So I exclude those + // files here. (This is no longer a problem?) + + //|| filename.EndsWith(".cer") + //|| filename.EndsWith(".msrcincident") + //|| filename == "MSCERTS.ini" + ) + { + excludedFilenames.Add(filename); + } + else + { + foundOne = true; + } + } + + var key = Path.GetFileName(filename); + + // surround this in a try...catch so as to avoid grabbing a file that is open by someone else, or has disappeared + try + { + var lastWrite = File.GetLastWriteTime(filename); + var fi = new FileInfo(filename); + + // Rounding to nearest even second was necessary when DotNetZip did + // not process NTFS times in the NTFS Extra field. Since v1.8.0.5, + // this is no longer the case. + // + // var tm = TestUtilities.RoundToEvenSecond(lastWrite); + + var tm = lastWrite; + // hop out of the try block if the file is from TODAY. (heuristic + // to avoid currently open files) + if ((tm.Year == DateTime.Now.Year) && (tm.Month == DateTime.Now.Month) && (tm.Day == DateTime.Now.Day)) + throw new Exception(); + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(key, chk); + TestContext.WriteLine(" {4}: {1} {2} {3,-9} {0}", + Path.GetFileName(filename), + lastWrite.ToString("yyyy MMM dd HH:mm:ss"), + tm.ToString("yyyy MMM dd HH:mm:ss"), + fi.Length, + DateTime.Now.ToString("HH:mm:ss")); + timestamps.Add(key, this.AdjustTime_Win32ToDotNet(tm)); + actualFilenames.Add(filename); + } + catch + { + excludedFilenames.Add(filename); + } + } while ((actualFilenames.Count < maxFiles) && (actualFilenames.Count < candidateFileNames.Length) && + actualFilenames.Count + excludedFilenames.Count < candidateFileNames.Length); + + TestContext.WriteLine("{0}: Creating zip...", DateTime.Now.ToString("HH:mm:ss")); + + // create the zip file + using (ZipFile zip = new ZipFile()) + { + foreach (string s in actualFilenames) + { + ZipEntry e = zip.AddFile(s, ""); + e.Comment = File.GetLastWriteTime(s).ToString("yyyyMMMdd HH:mm:ss"); + } + zip.Comment = "The files in this archive will be checked for LastMod timestamp and checksum."; + TestContext.WriteLine("{0}: Saving zip....", DateTime.Now.ToString("HH:mm:ss")); + zip.Save(zipFileToCreate); + } + + TestContext.WriteLine("{0}: Unpacking zip....", DateTime.Now.ToString("HH:mm:ss")); + + // unpack the zip, and verify contents + int entries = 0; + using (ZipFile z2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in z2) + { + TestContext.WriteLine("{0}: Checking entry {1}....", DateTime.Now.ToString("HH:mm:ss"), e.FileName); + entries++; + // verify that the LastMod time on the filesystem file is set correctly + e.Extract("unpack"); + string pathToExtractedFile = Path.Combine("unpack", e.FileName); + DateTime actualFilesystemLastMod = AdjustTime_Win32ToDotNet(File.GetLastWriteTime(pathToExtractedFile)); + TimeSpan delta = timestamps[e.FileName] - actualFilesystemLastMod; + + // get the delta as an absolute value: + if (delta < new TimeSpan(0, 0, 0)) + delta = new TimeSpan(0, 0, 0) - delta; + + TestContext.WriteLine("time delta: {0}", delta.ToString()); + // The time delta can be at most, 1 second. + Assert.IsTrue(delta < new TimeSpan(0, 0, 1), + "Unexpected LastMod timestamp on extracted filesystem file ({0}) expected({1}) actual({2}) delta({3}).", + pathToExtractedFile, + timestamps[e.FileName].ToString("F"), + actualFilesystemLastMod.ToString("F"), + delta.ToString() + ); + + // verify the checksum of the file is correct + string expectedCheckString = TestUtilities.CheckSumToString(checksums[e.FileName]); + string actualCheckString = TestUtilities.GetCheckSumString(pathToExtractedFile); + Assert.AreEqual + (expectedCheckString, + actualCheckString, + "Unexpected checksum on extracted filesystem file ({0}).", + pathToExtractedFile); + } + } + Assert.AreEqual(entries, actualFilenames.Count, "Unexpected file count."); + } + + + + private DateTime AdjustTime_Win32ToDotNet(DateTime time) + { + // If I read a time from a file with GetLastWriteTime() (etc), I need + // to adjust it for display in the .NET environment. + if (time.Kind == DateTimeKind.Utc) return time; + DateTime adjusted = time; + if (DateTime.Now.IsDaylightSavingTime() && !time.IsDaylightSavingTime()) + adjusted = time + new System.TimeSpan(1, 0, 0); + + else if (!DateTime.Now.IsDaylightSavingTime() && time.IsDaylightSavingTime()) + adjusted = time - new System.TimeSpan(1, 0, 0); + + return adjusted; + } + + + + [TestMethod] + public void CreateZip_AddDirectory_NoFilesInRoot() + { + string zipFileToCreate = "CreateZip_AddDirectory_NoFilesInRoot.zip"; + string zipThis = "ZipThis"; + Directory.CreateDirectory(zipThis); + + int i, j; + int entries = 0; + + int subdirCount = _rnd.Next(4) + 4; + for (i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(zipThis, "DirectoryToZip.test." + i); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(3) + 3; + for (j = 0; j < fileCount; j++) + { + String file = Path.Combine(subdir, "file" + j); + TestUtilities.CreateAndFillFile(file, _rnd.Next(1000) + 1500); + entries++; + } + } + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(zipThis); + zip.Save(zipFileToCreate); + } + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, + "The Zip file has the wrong number of entries."); + } + + + [TestMethod] + public void CreateZip_AddDirectory_OneCharOverrideName() + { + int entries = 0; + String filename = null; + + // set the name of the zip file to create + string zipFileToCreate = "CreateZip_AddDirectory_OneCharOverrideName.zip"; + String commentOnArchive = "BasicTests::CreateZip_AddDirectory_OneCharOverrideName(): This archive override the name of a directory with a one-char name."; + + string subdir = "A"; + Directory.CreateDirectory(subdir); + + int numFilesToCreate = _rnd.Next(23) + 14; + var checksums = new Dictionary(); + for (int j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(12000) + 5000); + var chk = TestUtilities.ComputeChecksum(filename); + + var relativePath = Path.Combine(Path.GetFileName(subdir), Path.GetFileName(filename)); + //var key = Path.Combine("A", filename); + var key = TestUtilities.TrimVolumeAndSwapSlashes(relativePath); + checksums.Add(key, TestUtilities.CheckSumToString(chk)); + + entries++; + } + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subdir, Path.GetFileName(subdir)); + zip1.Comment = commentOnArchive; + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries); + + // validate all the checksums + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + { + e.Extract("unpack"); + if (checksums.ContainsKey(e.FileName)) + { + string pathToExtractedFile = Path.Combine("unpack", e.FileName); + + // verify the checksum of the file is correct + string expectedCheckString = checksums[e.FileName]; + string actualCheckString = TestUtilities.GetCheckSumString(pathToExtractedFile); + Assert.AreEqual + (expectedCheckString, + actualCheckString, + "Unexpected checksum on extracted filesystem file ({0}).", + pathToExtractedFile); + } + } + } + + } + + + + [TestMethod] + public void CreateZip_CompressionLevelZero_AllEntries() + { + string zipFileToCreate = "CompressionLevelZero.zip"; + String commentOnArchive = "BasicTests::CompressionLevelZero(): This archive override the name of a directory with a one-char name."; + int entriesAdded = 0; + String filename = null; + string subdir = "A"; + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(10) + 10; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + using (ZipFile zip = new ZipFile()) + { + zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + zip.AddDirectory(subdir, Path.GetFileName(subdir)); + zip.Comment = commentOnArchive; + zip.Save(zipFileToCreate); + } + + int entriesFound = 0; + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip) + { + if (!e.IsDirectory) entriesFound++; + Assert.AreEqual(0, (short)e.CompressionMethod, + "compression method"); + } + } + Assert.AreEqual(entriesAdded, entriesFound, + "unexpected number of entries."); + BasicVerifyZip(zipFileToCreate); + } + + + + [TestMethod] + public void CreateZip_ForceNoCompressionSomeEntries() + { + string zipFileToCreate = "ForceNoCompression.zip"; + String filename = null; + string subdir = "A"; + Directory.CreateDirectory(subdir); + int fileCount = _rnd.Next(13) + 13; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, String.Format("{0}-file{1:D3}.txt", (_rnd.Next(2) == 0) ? "C":"U", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + } + + using (ZipFile zip = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + { + ZipEntry e = zip.AddFile(f, ""); + if (e.FileName.StartsWith("U")) + e.CompressionMethod = 0x0; + } + zip.Comment = "Some of these files do not use compression."; + zip.Save(zipFileToCreate); + } + + int entriesFound = 0; + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip) + { + if (!e.IsDirectory) entriesFound++; + Assert.AreEqual((e.FileName.StartsWith("U"))?0x00:0x08, + (Int32)e.CompressionMethod, + "Unexpected compression method on text file ({0}).", e.FileName); + } + } + Assert.AreEqual(fileCount, entriesFound, "The created Zip file has an unexpected number of entries."); + + BasicVerifyZip(zipFileToCreate); + } + + + + [TestMethod] + public void AddFile_CompressionMethod_None_wi9208() + { + string zipFileToCreate = "AddFile_CompressionMethod_None_wi9208.zip"; + string subdir = "A"; + Directory.CreateDirectory(subdir); + using (ZipFile zip = new ZipFile()) + { + string filename = Path.Combine(subdir, String.Format("FileToBeAdded-{0:D2}.txt", _rnd.Next(1000))); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + var e = zip.AddFile(filename,"zipped"); + e.CompressionMethod = CompressionMethod.None; + zip.Save(zipFileToCreate); + } + + TestContext.WriteLine("File zipped!..."); + TestContext.WriteLine("Reading..."); + + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip) + { + Assert.AreEqual("None", e.CompressionMethod.ToString()); + } + } + BasicVerifyZip(zipFileToCreate); + } + + + + [TestMethod] + public void GetInfo() + { + TestContext.WriteLine("GetInfo"); + string zipFileToCreate = "GetInfo.zip"; + String filename = null; + int n; + string subdir = Path.Combine(TopLevelDir, + TestUtilities.GenerateRandomAsciiString(9)); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(27) + 23; + TestContext.WriteLine("Creating {0} files", fileCount); + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + if (_rnd.Next(7)!=0) + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + else + { + // create an empty file + using (var fs = File.Create(filename)) { } + } + } + + TestContext.WriteLine("Creating a zip file"); + using (ZipFile zip = new ZipFile()) + { + zip.Password = TestUtilities.GenerateRandomPassword(11); + var filenames = Directory.GetFiles(subdir); + foreach (String f in filenames) + { + ZipEntry e = zip.AddFile(f, ""); + if (_rnd.Next(3)==0) + e.CompressionMethod = 0x0; + n = _rnd.Next(crypto.Length); + e.Encryption = crypto[n]; + } + zip.Save(zipFileToCreate); + } + + TestContext.WriteLine("Calling ZipFile::Info_get"); + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + string info = zip.Info; + TestContext.WriteLine("Info: (len({0}))", info.Length); + foreach (var line in info.Split('\n')) + TestContext.WriteLine(line); + + Assert.IsTrue(info.Length > 300, + "Suspect info string (length({0}))", + info.Length); + } + } + + + + [TestMethod] + public void Create_WithChangeDirectory() + { + string zipFileToCreate = "Create_WithChangeDirectory.zip"; + String filename = "Testfile.txt"; + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + + string cwd = Directory.GetCurrentDirectory(); + using (var zip = new ZipFile()) + { + zip.AddFile(filename, ""); + Directory.SetCurrentDirectory("\\"); + zip.AddFile("dev\\codeplex\\DotNetZip\\Zip Tests\\BasicTests.cs", ""); + Directory.SetCurrentDirectory(cwd); + zip.Save(zipFileToCreate); + } + } + + + + + private void VerifyEntries(string zipFile, + Variance variance, + int[] values, + EncryptionAlgorithm[] a, + int stage, + int compFlavor, + int encryptionFlavor) + { + using (var zip = ZipFile.Read(zipFile)) + { + foreach (ZipEntry e in zip) + { + var compCheck = false; + if (variance == Variance.Method) + { + compCheck = (e.CompressionMethod == (CompressionMethod)values[stage]); + } + else + { + // Variance.Level + CompressionMethod expectedMethod = + ((Ionic.Zlib.CompressionLevel)values[stage] == Ionic.Zlib.CompressionLevel.None) + ? CompressionMethod.None + : CompressionMethod.Deflate; + compCheck = (e.CompressionMethod == expectedMethod); + } + + Assert.IsTrue(compCheck, + "Unexpected compression method ({0}) on entry ({1}) variance({2}) flavor({3},{4}) stage({5})", + e.CompressionMethod, + e.FileName, + variance, + compFlavor, encryptionFlavor, + stage + ); + + var cryptoCheck = (e.Encryption == a[stage]); + + Assert.IsTrue(cryptoCheck, + "Unexpected encryption ({0}) on entry ({1}) variance({2}) flavor({3},{4}) stage({5})", + e.Encryption, + e.FileName, + variance, + compFlavor, + encryptionFlavor, + stage + ); + } + } + } + + + + private void QuickCreateZipAndChecksums(string zipFile, + Variance variance, + object compressionMethodOrLevel, + EncryptionAlgorithm encryption, + string password, + out string[] files, + out Dictionary checksums + ) + { + string srcDir = TestUtilities.GetTestSrcDir(CurrentDir); + files = Directory.GetFiles(srcDir, "*.cs", SearchOption.TopDirectoryOnly); + checksums = new Dictionary(); + foreach (string f in files) + { + var chk = TestUtilities.ComputeChecksum(f); + var key = Path.GetFileName(f); + checksums.Add(key, chk); + } + + using (var zip = new ZipFile()) + { + if (variance == Variance.Level) + { + zip.CompressionLevel= (Ionic.Zlib.CompressionLevel) compressionMethodOrLevel; + } + else + { + if ((Ionic.Zip.CompressionMethod)compressionMethodOrLevel == CompressionMethod.None) + zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + } + + if (password != null) + { + zip.Password = password; + zip.Encryption = encryption; + } + zip.AddFiles(files, ""); + zip.Save(zipFile); + } + + int count = TestUtilities.CountEntries(zipFile); + Assert.IsTrue(count > 5, + "Unexpected number of entries ({0}) in the zip file.", count); + } + + enum Variance + { + Method = 0 , + Level = 1 + } + + + private string GeneratePassword() + { + return TestUtilities.GenerateRandomPassword(); + //return TestUtilities.GenerateRandomAsciiString(9); + //return "Alphabet"; + } + + private void _Internal_Resave(string zipFile, + Variance variance, + int[] values, + EncryptionAlgorithm[] cryptos, + int compFlavor, + int encryptionFlavor + ) + { + // Create a zip file, then re-save it with changes in compression methods, + // compression levels, and/or encryption. The methods/levels, cryptos are + // for original and re-saved values. This tests whether we can update a zip + // entry with changes in those properties. + + string[] passwords = new string[2]; + passwords[0]= (cryptos[0]==EncryptionAlgorithm.None) ? null : GeneratePassword(); + passwords[1]= passwords[0] ?? ((cryptos[1]==EncryptionAlgorithm.None) ? null : GeneratePassword()); + + //TestContext.WriteLine(" crypto: '{0}' '{1}'", crypto[0]??"-NONE-", passwords[1]??"-NONE-"); + TestContext.WriteLine(" crypto: '{0}' '{1}'", cryptos[0], cryptos[1]); + + + // first, create a zip file + string[] filesToZip; + Dictionary checksums; + QuickCreateZipAndChecksums(zipFile, variance, values[0], cryptos[0], passwords[0], out filesToZip, out checksums); + + + // check that the zip was constructed as expected + VerifyEntries(zipFile, variance, values, cryptos, 0, compFlavor, encryptionFlavor); + + + // modify some properties (CompressionLevel, CompressionMethod, and/or Encryption) on each entry + using (var zip = ZipFile.Read(zipFile)) + { + zip.Password = passwords[1]; + foreach (ZipEntry e in zip) + { + if (variance == Variance.Method) + e.CompressionMethod = (CompressionMethod)values[1]; + else + e.CompressionLevel = (Ionic.Zlib.CompressionLevel)values[1]; + + e.Encryption = cryptos[1]; + } + zip.Save(); + } + + + // Check that the zip was modified as expected + VerifyEntries(zipFile, variance, values, cryptos, 1, compFlavor, encryptionFlavor); + + // now extract the items and verify checksums + string extractDir = "ex"; + int c=0; + while (Directory.Exists(extractDir + c)) c++; + extractDir += c; + + // extract + using (var zip = ZipFile.Read(zipFile)) + { + zip.Password = passwords[1]; + zip.ExtractAll(extractDir); + } + + VerifyChecksums(extractDir, filesToZip, checksums); + } + + + + + + EncryptionAlgorithm[][] CryptoPairs = { + new EncryptionAlgorithm[] {EncryptionAlgorithm.None, EncryptionAlgorithm.None}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.None, EncryptionAlgorithm.WinZipAes128}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.WinZipAes128, EncryptionAlgorithm.None}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.WinZipAes128, EncryptionAlgorithm.WinZipAes128}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.None, EncryptionAlgorithm.PkzipWeak}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.PkzipWeak, EncryptionAlgorithm.None}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.WinZipAes128, EncryptionAlgorithm.PkzipWeak}, + new EncryptionAlgorithm[] {EncryptionAlgorithm.PkzipWeak, EncryptionAlgorithm.WinZipAes128} + }; + + int[][][] VariancePairs = { + new int[][] { + new int[] {(int)CompressionMethod.Deflate, (int)CompressionMethod.Deflate}, + new int[] {(int)CompressionMethod.Deflate, (int)CompressionMethod.None}, + new int[] {(int)CompressionMethod.None, (int)CompressionMethod.Deflate}, + new int[] {(int)CompressionMethod.None, (int)CompressionMethod.None} + }, + new int[][] { + new int[] {(int)Ionic.Zlib.CompressionLevel.Default, (int)Ionic.Zlib.CompressionLevel.Default}, + new int[] {(int)Ionic.Zlib.CompressionLevel.Default, (int)Ionic.Zlib.CompressionLevel.None}, + new int[] {(int)Ionic.Zlib.CompressionLevel.None, (int)Ionic.Zlib.CompressionLevel.Default}, + new int[] {(int)Ionic.Zlib.CompressionLevel.None, (int)Ionic.Zlib.CompressionLevel.None} + } + }; + + private void _Internal_Resave(Variance variance, int compFlavor, int encryptionFlavor) + { + // Check that re-saving a zip, after modifying properties on + // each entry, actually does what we want. + if (encryptionFlavor == 0) + TestContext.WriteLine("Resave workdir: {0}", TopLevelDir); + + string rootname = String.Format("Resave_Compression{0}_{1}_Encryption_{2}.zip", + variance, compFlavor, encryptionFlavor); + + string zipFileToCreate = Path.Combine(TopLevelDir, rootname); + int[] values = VariancePairs[(int)variance][compFlavor]; + + TestContext.WriteLine("Resave {0} {1} {2} file({3})", variance, compFlavor, encryptionFlavor, Path.GetFileName(zipFileToCreate)); + + _Internal_Resave(zipFileToCreate, variance, values, CryptoPairs[encryptionFlavor], compFlavor, encryptionFlavor); + } + + + [TestMethod] + public void Resave_CompressionMethod_0() + { + for (int i=0; i<8; i++) + { + _Internal_Resave(Variance.Method, 0, i); + } + } + + + [TestMethod] + public void Resave_CompressionMethod_1() + { + for (int i=0; i<8; i++) + { + if (i!=3) + _Internal_Resave(Variance.Method, 1, i); + } + } + + [TestMethod] + public void Resave_CompressionMethod_2() + { + for (int i=0; i<8; i++) + { + _Internal_Resave(Variance.Method, 2, i); + } + } + + [TestMethod] + public void Resave_CompressionMethod_3() + { + for (int i=0; i<8; i++) + { + _Internal_Resave(Variance.Method, 3, i); + } + } + + + [TestMethod] + public void Resave_CompressionLevel_0() + { + for (int i=0; i<8; i++) + { + _Internal_Resave(Variance.Level, 0, i); + } + } + + + [TestMethod] + public void Resave_CompressionLevel_1() + { + for (int i=0; i<8; i++) + { + if (i!=3) + _Internal_Resave(Variance.Level, 1, i); + } + } + + [TestMethod] + public void Resave_CompressionLevel_2() + { + for (int i=0; i<8; i++) + { + _Internal_Resave(Variance.Level, 2, i); + } + } + + [TestMethod] + public void Resave_CompressionLevel_3() + { + for (int i=0; i<8; i++) + { + _Internal_Resave(Variance.Level, 3, i); + } + } + + } +} diff --git a/dotNetZip/Zip Tests/Compatibility.cs b/dotNetZip/Zip Tests/Compatibility.cs new file mode 100644 index 0000000..0a3de1f --- /dev/null +++ b/dotNetZip/Zip Tests/Compatibility.cs @@ -0,0 +1,2620 @@ +// Compatibility.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-05 18:32:33> +// +// ------------------------------------------------------------------ +// +// This module defines the tests for compatibility for DotNetZip. The +// idea is to verify that DotNetZip can read the zip files produced by +// other tools, and that other tools can read the output produced +// by DotNetZip. The tools and libraries tested are: +// - WinZip +// - 7zip +// - Infozip (unzip 6.0, zip 3.0) +// - Perl's IO::Compress +// - zipfldr.dll (via script) +// - the Visual Studio DLL +// - MS-Word +// +// ------------------------------------------------------------------ + + +using System; +using System.Text; +using System.Collections.Generic; +using System.Linq; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + + +namespace Ionic.Zip.Tests +{ + /// + /// Summary description for Compatibility + /// + [TestClass] + public class Compatibility : IonicTestClass + { + EncryptionAlgorithm[] crypto = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.PkzipWeak, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; + + Ionic.Zlib.CompressionLevel[] compLevels = + { + Ionic.Zlib.CompressionLevel.None, + Ionic.Zlib.CompressionLevel.BestSpeed, + Ionic.Zlib.CompressionLevel.Default, + Ionic.Zlib.CompressionLevel.BestCompression, + }; + + + [ClassInitialize()] + public static void MyClassInitialize(TestContext testContext) + { + // get the path to the DotNetZip DLL + string SourceDir = System.IO.Directory.GetCurrentDirectory(); + for (int i = 0; i < 3; i++) + SourceDir = Path.GetDirectoryName(SourceDir); + + IonicZipDll = Path.Combine(SourceDir, "Zip\\bin\\Debug\\Ionic.Zip.dll"); + + Assert.IsTrue(File.Exists(IonicZipDll), "DLL ({0}) does not exist", IonicZipDll); + + // register it for COM interop + string output; + + int rc = TestUtilities.Exec_NoContext(RegAsm, String.Format("\"{0}\" /codebase /verbose", IonicZipDll), out output); + if (rc != 0) + { + string cmd = String.Format("{0} \"{1}\" /codebase /verbose", RegAsm, IonicZipDll); + throw new Exception(String.Format("Failed to register DotNetZip with COM rc({0}) cmd({1}) out({2})", rc, cmd, output)); + } + } + + + [ClassCleanup()] + public static void MyClassCleanup() + { + string output; + // unregister the DLL for COM interop + int rc = TestUtilities.Exec_NoContext(RegAsm, String.Format("\"{0}\" /unregister /verbose", IonicZipDll), out output); + if (rc != 0) + throw new Exception(String.Format("Failed to unregister DotNetZip with COM rc({0}) ({1})", rc, output)); + } + + + private static string IonicZipDll; + private static string RegAsm = "c:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\regasm.exe"; + + + + private System.Reflection.Assembly _myself; + private System.Reflection.Assembly myself + { + get + { + if (_myself == null) + { + _myself = System.Reflection.Assembly.GetExecutingAssembly(); + } + return _myself; + } + } + + + private string _windir = null; + private string windir + { + get + { + if (_windir == null) + { + _windir = System.Environment.GetEnvironmentVariable("Windir"); + Assert.IsTrue(Directory.Exists(_windir), "%windir% does not exist ({0})", _windir); + } + return _windir; + } + } + + + + private string _perl = null; + private string perl + { + get + { + if (_perl == null) + { + var sysPath = Environment.GetEnvironmentVariable("Path"); + var pathElts = sysPath.Split(';'); + foreach (var elt in pathElts) + { + var putative = Path.Combine(elt, "perl.exe"); + if (File.Exists(putative)) + { + _perl = putative; + break; + } + } + Assert.IsTrue(File.Exists(_perl), "Cannot find perl.exe"); + } + return _perl; + } + } + + + + private string _cscriptExe = null; + private string cscriptExe + { + get + { + if (_cscriptExe == null) + { + _cscriptExe = Path.Combine(Path.Combine(windir, "system32"), "cscript.exe"); + Assert.IsTrue(File.Exists(_cscriptExe), "cscript.exe does not exist ({0})", _cscriptExe); + } + return _cscriptExe; + } + } + + + private string GetScript(string scriptName) + { + // check existence of script and script engine + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + string script = Path.Combine(resourceDir, scriptName); + Assert.IsTrue(File.Exists(script), "script ({0}) does not exist", script); + return script; + } + + private void VerifyFileTimes(string extractDir, + IEnumerable filesToCheck, + bool applyShellAllowance, + bool checkNtfsTimes, + int thresholdNanoseconds) + { + TestContext.WriteLine(""); + TestContext.WriteLine("Verify file times..."); + TimeSpan threshold = new TimeSpan(thresholdNanoseconds); + TestContext.WriteLine("Using threshold: ({0})", threshold.ToString()); + + foreach (var fqPath in filesToCheck) + { + var f = Path.GetFileName(fqPath); + var extractedFile = Path.Combine(extractDir, f); + Assert.IsTrue(File.Exists(extractedFile), "File does not exist ({0})", extractedFile); + + // check times + DateTime t1 = File.GetLastWriteTimeUtc(fqPath); + DateTime t2 = File.GetLastWriteTimeUtc(extractedFile); + TestContext.WriteLine("{0} lastwrite orig({1}) extracted({2})", + Path.GetFileName(fqPath), + t1.ToString("G"), + t2.ToString("G")); + + TimeSpan delta = (t1 > t2) ? t1 - t2 : t2 - t1; + if (checkNtfsTimes) + { + Assert.AreEqual(t1, t2, "LastWriteTime delta actual({0}) expected({1})", delta.ToString(), threshold.ToString()); + t1 = File.GetCreationTimeUtc(fqPath); + t2 = File.GetCreationTimeUtc(extractedFile); + delta = (t1 > t2) ? t1 - t2 : t2 - t1; + Assert.IsTrue(delta <= threshold, "CreationTime delta actual({0}) expected({1})", delta.ToString(), threshold.ToString()); + } + else + { + if (applyShellAllowance) + { + if (delta > threshold) + { + // In some cases - specifically when the file lastmod time + // is on the other side of a DST event - extracting with the + // shell gets a time on the extracted file that is 1 hour + // off the expected value. This doesn't happen when WinZip + // or DotNetZip is used for extraction - only when using the + // shell extension. In those cases we can allow for the + // extra hour. + TestContext.WriteLine("Adjusting delta for shell allowance..."); + delta -= new TimeSpan(1, 0, 0); // 1 hour + } + } + + Assert.IsTrue(delta <= threshold, + "LastWriteTime delta actual({0}) expected({1})", + delta.ToString(), + threshold.ToString()); + } + } + } + + + private void VerifyTimesUnix(string extractDir, IEnumerable filesToCheck) + { + VerifyFileTimes(extractDir, filesToCheck, true, false, + 10000 * 1000); // 1 second for unix + } + + private void VerifyTimesNtfs(string extractDir, IEnumerable filesToCheck) + { + VerifyFileTimes(extractDir, filesToCheck, true, false, + 100 * 1000); // default 0.01s for NTFS + } + + private void VerifyTimesDos(string extractDir, IEnumerable filesToCheck) + { + VerifyFileTimes(extractDir, filesToCheck, false, false, + 20000 * 1000); // 2 seconds for DOS times + + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_ZipFile_Initialize_Error() + { + string notaZipFile = GetScript("VbsUnzip-ShellApp.vbs"); + + // try to read a bogus zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Initialize(notaZipFile); + } + } + + + + + [TestMethod] + public void ShellApplication_Unzip() + { + // get a set of files to zip up + string subdir = Path.Combine(TopLevelDir, "files"); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + var script = GetScript("VbsUnzip-ShellApp.vbs"); + + int i = 0; + foreach (var compLevel in compLevels) + { + // create and fill the directories + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("ShellApplication_Unzip.{0}.zip", i)); + string extractDir = Path.Combine(TopLevelDir, String.Format("extract.{0}", i)); + + // Create the zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = (Ionic.Zlib.CompressionLevel)compLevel; + //zip.StatusMessageTextWriter = System.Console.Out; + for (int j = 0; j < filesToZip.Length; j++) + zip1.AddItem(filesToZip[j], "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the unzip script + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, extractDir)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + // verify the file times + VerifyTimesDos(Path.Combine(extractDir, "files"), filesToZip); + i++; + } + } + + + [TestMethod] + public void ShellApplication_Unzip_NonSeekableOutput() + { + // get a set of files to zip up + string subdir = Path.Combine(TopLevelDir, "files"); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + var script = GetScript("VbsUnzip-ShellApp.vbs"); + + int i = 0; + foreach (var compLevel in compLevels) + { + // create and fill the directories + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("ShellApplication_Unzip_NonSeekableOutput.{0}.zip", i)); + string extractDir = Path.Combine(TopLevelDir, String.Format("extract.{0}", i)); + + // Create the zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + + // Want to test the library when saving to non-seekable output streams. Like + // stdout or ASPNET's Response.OutputStream. This simulates it. + using (var rawOut = System.IO.File.Create(zipFileToCreate)) + { + using (var nonSeekableOut = new Ionic.Zip.Tests.NonSeekableOutputStream(rawOut)) + { + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = (Ionic.Zlib.CompressionLevel)compLevel; + for (int j = 0; j < filesToZip.Length; j++) + zip1.AddItem(filesToZip[j], "files"); + zip1.Save(nonSeekableOut); + } + } + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the unzip script + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, + Path.GetFileName(zipFileToCreate), + Path.GetFileName(extractDir))); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + VerifyFileTimes(Path.Combine(extractDir, "files"), filesToZip, + false, false, 20000 * 1000); // 2s threshold for DOS times + i++; + } + } + + +#if SHELLAPP_UNZIP_SFX + + [TestMethod] + public void ShellApplication_Unzip_SFX() + { + // get a set of files to zip up + string subdir = Path.Combine(TopLevelDir, "files"); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + var script = GetScript("VbsUnzip-ShellApp.vbs"); + + int i=0; + foreach (var compLevel in compLevels) + { + // create and fill the directories + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("ShellApp_Unzip_SFX.{0}.exe", i)); + string extractDir = Path.Combine(TopLevelDir, String.Format("extract.{0}",i)); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = (Ionic.Zlib.CompressionLevel) compLevel; + //zip.StatusMessageTextWriter = System.Console.Out; + for (int j = 0; j < filesToZip.Length; j++) + zip1.AddItem(filesToZip[j], "files"); + zip1.SaveSelfExtractor(zipFileToCreate, SelfExtractorFlavor.ConsoleApplication); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the unzip script + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, extractDir)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + // verify the file times + VerifyTimesDos(Path.Combine(extractDir, "files"), filesToZip); + i++; + } + } +#endif + + + + [TestMethod] + public void ShellApplication_Unzip_2() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ShellApplication_Unzip-2.zip"); + // create and fill the directories + string extractDir = Path.Combine(TopLevelDir, "extract"); + var checksums = new Dictionary(); + var filesToZip = GetSelectionOfTempFiles(_rnd.Next(13) + 8, checksums); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip, "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Count, + "Incorrect number of entries in the zip file."); + + // run the unzip script + string script = GetScript("VbsUnzip-ShellApp.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, extractDir)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + #if IN_A_SANE_WORLD + // !! + // I think the file times get messed up using the Shell to unzip. + // !! + + // verify the file times + VerifyTimesDos(Path.Combine(extractDir, "files"), filesToZip); + #endif + } + + + + [TestMethod] + public void ShellApplication_SelectedFiles_Unzip() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ShellApplication_SelectedFiles_Unzip.zip"); + + TestContext.WriteLine("ZipFile version: {0}", ZipFile.LibraryVersion); + + // create and fill the directories + string extractDir = "extract"; + string dirToZip = "files"; + TestContext.WriteLine("creating dir '{0}' with files", dirToZip); + Directory.CreateDirectory(dirToZip); + + int numFilesToAdd = _rnd.Next(5) + 6; + int numFilesAdded = 0; + int baseSize = _rnd.Next(0x100ff) + 8000; + int nFilesInSubfolders = 0; + Dictionary checksums = new Dictionary(); + var flist = new List(); + for (int i = 0; i < numFilesToAdd && nFilesInSubfolders < 2; i++) + { + string fileName = string.Format("Test{0}.txt", i); + if (i != 0) + { + int x = _rnd.Next(4); + if (x != 0) + { + string folderName = string.Format("folder{0}", x); + fileName = Path.Combine(folderName, fileName); + if (!Directory.Exists(Path.Combine(dirToZip, folderName))) + Directory.CreateDirectory(Path.Combine(dirToZip, folderName)); + nFilesInSubfolders++; + } + } + fileName = Path.Combine(dirToZip, fileName); + TestUtilities.CreateAndFillFileBinary(fileName, baseSize + _rnd.Next(28000)); + var key = Path.GetFileName(fileName); + var chk = TestUtilities.ComputeChecksum(fileName); + checksums.Add(key, chk); + flist.Add(fileName); + numFilesAdded++; + } + + // Create the zip archive + var sw = new System.IO.StringWriter(); + using (ZipFile zip1 = new ZipFile()) + { + zip1.StatusMessageTextWriter = sw; + //zip1.StatusMessageTextWriter = Console.Out; + zip1.AddSelectedFiles("*.*", dirToZip, "", true); + zip1.Save(zipFileToCreate); + } + TestContext.WriteLine(sw.ToString()); + + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), numFilesAdded, + "Incorrect number of entries in the zip file."); + + // run the unzip script + string script = GetScript("VbsUnzip-ShellApp.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, Path.Combine(TopLevelDir, extractDir))); + + // check the files in the extract dir + foreach (var fqPath in flist) + { + var f = Path.GetFileName(fqPath); + var extractedFile = fqPath.Replace("files", "extract"); + Assert.IsTrue(File.Exists(extractedFile), "File does not exist ({0})", extractedFile); + var chk = TestUtilities.ComputeChecksum(extractedFile); + Assert.AreEqual(TestUtilities.CheckSumToString(checksums[f]), + TestUtilities.CheckSumToString(chk), + String.Format("Checksums for file {0} do not match.", f)); + checksums.Remove(f); + } + + Assert.AreEqual(0, checksums.Count, "Not all of the expected files were found in the extract directory."); + } + + + + + [TestMethod] + public void ShellApplication_Zip() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ShellApplication_Zip.zip"); + //Directory.SetCurrentDirectory(TopLevelDir); + + string subdir = Path.Combine(TopLevelDir, "files"); + string extractDir = "extract"; + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive via script + string script = GetScript("VbsCreateZip-ShellApp.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, subdir)); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unzip + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(extractDir, filesToZip, checksums); + + VerifyTimesDos(extractDir, filesToZip); + } + + + [TestMethod] + public void ShellApplication_Zip_2() + { + string zipFileToCreate = "ShellApplication_Zip.zip"; + string subdir = "files"; + string extractDir = "extract"; + + TestContext.WriteLine("======================================================"); + + Dictionary checksums = new Dictionary(); + var filesToZip = GetSelectionOfTempFiles(_rnd.Next(33) + 11, checksums); + + Directory.CreateDirectory(subdir); + Directory.SetCurrentDirectory(subdir); + var w = System.Environment.GetEnvironmentVariable("Windir"); + Assert.IsTrue(Directory.Exists(w), "%windir% does not exist ({0})", w); + var fsutil = Path.Combine(Path.Combine(w, "system32"), "fsutil.exe"); + Assert.IsTrue(File.Exists(fsutil), "fsutil.exe does not exist ({0})", fsutil); + string ignored; + + TestContext.WriteLine("validating the list of files..."); + List markedForRemoval = new List (); + // remove those with spaces in the names. The ShellApp (zipfldr.dll) doesn't + // deal with these files very well. Or something. + foreach (var f in filesToZip) + { + if (Path.GetFileName(f).IndexOf(' ') > 0) + markedForRemoval.Add(f); + } + + foreach (var f in markedForRemoval) + { + TestContext.WriteLine("removing {0}...", Path.GetFileName(f)); + filesToZip.Remove(f); + checksums.Remove(Path.GetFileName(f)); + } + + TestContext.WriteLine("--------------------------------------------"); + TestContext.WriteLine("creating links..."); + foreach (var f in filesToZip) + { + string shortfile= Path.GetFileName(f); + Assert.IsTrue(File.Exists(f)); + string cmd = String.Format("hardlink create \"{0}\" \"{1}\"", shortfile, f); + TestUtilities.Exec_NoContext(fsutil, cmd, out ignored); + } + + TestContext.WriteLine("++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + // Create the zip archive via script + Directory.SetCurrentDirectory(TopLevelDir); + string script = GetScript("VbsCreateZip-ShellApp.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, subdir)); + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + // DEBUGGING! + if (TestUtilities.CountEntries(zipFileToCreate) != filesToZip.Count) + { + string[] linkedFiles = Directory.GetFiles(subdir); + + Action, string> ListFiles = (list, name) => + { + TestContext.WriteLine("**********************************"); + TestContext.WriteLine("files in ({0})", name); + foreach (var s in list) + { + TestContext.WriteLine(" {0}", Path.GetFileName(s)); + } + TestContext.WriteLine("----------------------------------"); + TestContext.WriteLine(" {0} total files", list.Count()); + }; + + ListFiles(linkedFiles, "Linked Files"); + ListFiles(filesToZip, "selected Files"); + + IEnumerable selection = null; + using (var zip = ZipFile.Read(zipFileToCreate)) + { + selection = from e in zip.Entries select e.FileName; + } + + ListFiles(selection, "zipped Files"); + + foreach (var file in linkedFiles) + { + if (!selection.Contains(Path.GetFileName(file))) + { + TestContext.WriteLine("Missing: {0}", Path.GetFileName(file)); + } + } + } + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Count, + "Incorrect number of entries in the zip file."); + + // unzip + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(extractDir, filesToZip, checksums); + + VerifyTimesDos(extractDir, filesToZip); + } + + + + [TestMethod] + public void VStudio_Zip() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "VStudio_Zip.zip"); + string subdir = Path.Combine(TopLevelDir, "files"); + string extractDir = "extract"; + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + //Directory.SetCurrentDirectory(TopLevelDir); + + String[] a = Array.ConvertAll(filesToZip, x => Path.GetFileName(x)); + Microsoft.VisualStudio.Zip.ZipFileCompressor zfc = new Microsoft.VisualStudio.Zip.ZipFileCompressor(zipFileToCreate, "files", a, true); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unzip + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(extractDir, filesToZip, checksums); + + // visual Studio's ZIP library doesn't bother with times... + //VerifyNtfsTimes(extractDir, filesToZip); + } + + + + [TestMethod] + [Timeout(3 * 60 * 1000)] // timeout in ms. + public void VStudio_UnZip() + { + string zipFileToCreate = "VStudio_UnZip.zip"; + string shortDir = "files"; + string subdir = Path.Combine(TopLevelDir, shortDir); + string extractDir = "extract"; + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], shortDir); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unzip + var decompressor = new Microsoft.VisualStudio.Zip.ZipFileDecompressor(zipFileToCreate, false, true, false); + decompressor.UncompressToFolder(extractDir, false); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, shortDir), filesToZip, checksums); + + // visual Studio's ZIP library doesn't bother with times... + //VerifyNtfsTimes(Path.Combine(extractDir, "files"), filesToZip); + } + + + + [TestMethod] + public void COM_Zip() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "COM_Zip.zip"); + string shortDir = "files"; + string subdir = Path.Combine(TopLevelDir, shortDir); + string extractDir = "extract"; + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // run the COM script to create the ZIP archive + string script = GetScript("VbsCreateZip-DotNetZip.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, subdir)); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unzip + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(extractDir, filesToZip, checksums); + + VerifyTimesNtfs(extractDir, filesToZip); + } + + + + [TestMethod] + public void COM_Unzip() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "COM_Unzip.zip"); + + // construct the directories + //string ExtractDir = Path.Combine(TopLevelDir, "extract"); + string extractDir = "extract"; + string shortDir = "files"; + string subdir = Path.Combine(TopLevelDir, shortDir); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], shortDir); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + + // run the COM script to unzip the ZIP archive + string script = GetScript("VbsUnzip-DotNetZip.vbs"); + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, extractDir)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, shortDir), filesToZip, checksums); + + VerifyTimesNtfs(Path.Combine(extractDir, shortDir), filesToZip); + } + + + [TestMethod] + public void COM_Check() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "COM_Check.zip"); + + // create and fill the directories + string subdir = Path.Combine(TopLevelDir, "files"); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the COM script to check the ZIP archive + string script = GetScript("TestCheckZip.js"); + + string testOut = this.Exec(cscriptExe, + String.Format("\"{0}\" {1}", script, zipFileToCreate)); + + Assert.IsTrue(testOut.StartsWith("That zip is OK")); + } + + + [TestMethod] + public void COM_CheckWithExtract() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "COM_CheckWithExtract.zip"); + + // create and fill the directories + string subdir = Path.Combine(TopLevelDir, "files"); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the COM script to check and test-extract the ZIP archive + string script = GetScript("TestCheckZip.js"); + + string testOut = this.Exec(cscriptExe, + String.Format("\"{0}\" -x {1}", script, zipFileToCreate)); + + Assert.IsTrue(testOut.StartsWith("That zip is OK"), "output: {0}", testOut); + } + + + [TestMethod] + public void COM_CheckError() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + // run the COM script to check the (not) ZIP archive + string script = GetScript("TestCheckZip.js"); + + string testOut = this.Exec(cscriptExe, + String.Format("\"{0}\" {1}", script, cscriptExe)); + + Assert.IsTrue(testOut.StartsWith("That zip is not OK")); + } + + [TestMethod] + public void COM_CheckPassword() + { + // create and fill the directories + string subdir = Path.Combine(TopLevelDir, "files"); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // first case - all entries have same password - should pass the check. + // second case - last entry uses a different password - should fail the check. + for (int k=0; k < 2; k++) + { + string password = GeneratePassword(11); + string zipFileToCreate= String.Format("COM_CheckPass-{0}.zip", k); + zipFileToCreate = Path.Combine(TopLevelDir, zipFileToCreate); + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + //zip1.Password = password; + for (int i = 0; i < filesToZip.Length; i++) + { + var e = zip1.AddFile(filesToZip[i], "files"); + e.Password = (k == 1 && i == filesToZip.Length-1) + ? "7" + : password; + } + zip1.Save(zipFileToCreate); + } + + TestContext.WriteLine("Checking the count..."); + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file."); + + TestContext.WriteLine("Checking the password (case {0})...", k); + string script = GetScript("TestCheckZipPassword.js"); + string testOut = this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", + script, zipFileToCreate, password)); + + if (k==0) + Assert.IsTrue(testOut.StartsWith("That zip is OK")); + else + Assert.IsFalse(testOut.StartsWith("That zip is OK")); + } + } + + + private string GeneratePassword(int n) + { + // not good for passwords used on the command line with cmd line tools!! + // return TestUtilities.GenerateRandomPassword(); + + return TestUtilities.GenerateRandomAsciiString(n).Replace(" ","_"); + //return "Alphabet"; + } + + + + [TestMethod] + public void InfoZip_Unzip() + { + if (!InfoZipIsPresent) + throw new Exception("[InfoZip_Unzip] : InfoZip is not present"); + + string shortDir = "filesToZip"; + string subdir = Path.Combine(TopLevelDir, shortDir); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + for (int j=0; j < 2; j++) // crypto.Length + { + // Cannot do WinZipAES encryption - not supported by InfoZip + int i = 0; + foreach (var compLevel in compLevels) + { + string zipFileToCreate = + String.Format("InfoZip_Unzip.{0}.{1}.zip", i,j); + + string password = GeneratePassword(9); + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = (Ionic.Zlib.CompressionLevel)compLevel; + if (j!=0) + { + zip1.Encryption = crypto[j]; + zip1.Password = password; + } + for (int n = 0; n < filesToZip.Length; n++) + zip1.AddItem(filesToZip[n], shortDir); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file"+ + " (i,j)=({0},{1}).", i,j); + + string extractDir = String.Format("extract.{0}.{1}", i,j); + + if (j==0) + { + this.Exec(infoZipUnzip, + String.Format("{0} -d {1}", + Path.GetFileName(zipFileToCreate), + Path.GetFileName(extractDir))); + } + else + { + this.Exec(infoZipUnzip, + String.Format("-P {0} {1} -d {2}", + password, + Path.GetFileName(zipFileToCreate), + Path.GetFileName(extractDir))); + } + + var extractedFiles = Directory.GetFiles(Path.Combine(extractDir, shortDir)); + Assert.AreEqual + (filesToZip.Length, extractedFiles.Length, + "Incorrect number of extracted files. (i,j)={0},{1}", + i,j); + + VerifyChecksums(Path.Combine(extractDir, shortDir), + filesToZip, checksums); + + i++; + } + } + } + + + [TestMethod] + public void InfoZip_Zip() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + // create and fill the directories + string shortDir = "filesToZip"; + string subdir = Path.Combine(TopLevelDir, shortDir); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // infozip usage: + // zip.exe zipfile.zip -r + // zip.exe zipfile.zip + + for (int k=0; k < 2; k++) + { + string zipFileToCreate = String.Format("InfoZip_Zip-{0}.zip", k); + string extractDir = "extractDir-" + k; + + var relativePath = Path.GetFileName(subdir); + + if (k==0) + { + // Create the zip archive via Infozip.exe + // zip.exe zipfile.zip -r + this.Exec(infoZip, String.Format("{0} -r {1}", + zipFileToCreate, relativePath)); + } + else + { + string[] relPathFiles = + Array.ConvertAll(filesToZip, + path => + Path.Combine(relativePath, + Path.GetFileName(path))); + + // zip.exe zipfile.zip + this.Exec(infoZip, zipFileToCreate + " " + + String.Join(" ", relPathFiles)); + } + + // delay a bit between file creation and check/unzip + System.Threading.Thread.Sleep(1200); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the COM script to unzip the ZIP archive + string script = GetScript("VbsUnZip-DotNetZip.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", + script, + Path.GetFileName(zipFileToCreate), + extractDir)); + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir,shortDir), filesToZip, checksums); + VerifyTimesUnix(Path.Combine(extractDir,shortDir), filesToZip); + } + } + + + + [TestMethod] + public void InfoZip_Zip_Password() + { + if (!InfoZipIsPresent) + throw new Exception("[InfoZip_Zip_Password] : InfoZip is not present"); + + // create and fill the directories + string extractDir = "extractDir"; + string shortDir = "filesToZip"; + string subdir = Path.Combine(TopLevelDir, shortDir); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // infozip usage: + // zip.exe zipfile.zip -r -P + + string password = GeneratePassword(9); + string zipFileToCreate = "InfoZip_Zip_Password.zip"; + + // Create the zip archive via Infozip.exe + this.Exec(infoZip, String.Format("{0} -r -P {1} {2}", + zipFileToCreate, + password, + shortDir)); + + // delay a bit between file creation and check/unzip + System.Threading.Thread.Sleep(1200); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // extract + using (var zip = ZipFile.Read(zipFileToCreate)) + { + zip.Password = password; + zip.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, shortDir), filesToZip, checksums); + VerifyTimesNtfs(Path.Combine(extractDir, shortDir), filesToZip); + } + + + + [TestMethod] + public void InfoZip_Zip_Split() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + string dirToZip = "dirToZip"; + int numFiles = _rnd.Next(17) + 12; + string[] filesToZip; + string msg; + Dictionary checksums; + int[] segmentSizes = { 256, 512, 1024, 4096, 8192 }; // in kb + + _txrx = TestUtilities.StartProgressMonitor("InfoZip-compat", + "InfoZip split archives", + "Creating "+numFiles+" files"); + _txrx.Send("pb 0 max 2"); + _txrx.Send("pb 1 max " + numFiles); + + var update = new Action( (x,y,z) => { + switch (x) + { + case 0: + break; + case 1: + break; + case 2: + _txrx.Send("pb 1 step"); + msg = String.Format("status created {0}/{1} files", + y+1, + ((int)z)); + _txrx.Send(msg); + break; + } + }); + + CreateLargeFilesWithChecksums(dirToZip, numFiles, update, + out filesToZip, out checksums); + + _txrx.Send("pb 0 step"); + _txrx.Send("pb 1 max " + segmentSizes.Length); + _txrx.Send("pb 1 value 0"); + for (int i=0; i < segmentSizes.Length; i++) + { + _txrx.Send("status zip with " + segmentSizes[i] + "k segments"); + string trialDir = segmentSizes[i] + "k"; + Directory.CreateDirectory(trialDir); + string zipFileToCreate = Path.Combine(trialDir, trialDir + ".zip"); + // Create the zip archive via Infozip.exe + this.Exec(infoZip, String.Format("{0} -r -s {1}k -sv {2}", + zipFileToCreate, + segmentSizes[i], + dirToZip)); + + string extractDir = segmentSizes[i] + "k.extract"; + using (var zip = ZipFile.Read(zipFileToCreate)) + { + zip.ExtractAll(extractDir); + } + + VerifyChecksums(Path.Combine(extractDir, dirToZip), filesToZip, checksums); + + _txrx.Send("pb 1 step"); + } + } + + + + +#if NOT + // warning [256k/256k.zip]: zipfile claims to be last disk of a + // multi-part archive; attempting to process anyway, assuming + // all parts have been concatenated together in order. Expect + // "errors" and warnings...true multi-part support doesn't exist + // yet (coming soon). + + [TestMethod] + public void InfoZip_Unzip_Split() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + string dirToZip = "dirToZip"; + int numFiles = _rnd.Next(17) + 12; + string[] filesToZip; + string msg; + Dictionary checksums; + int[] segmentSizes = { 256, 512, 1024, 4096, 8192 }; // in kb + + _txrx = TestUtilities.StartProgressMonitor("InfoZip-compat", + "InfoZip split archives", + "Creating "+numFiles+" files"); + _txrx.Send("pb 0 max 2"); + _txrx.Send("pb 1 max " + numFiles); + + var update = new Action( (x,y,z) => { + switch (x) + { + case 0: + break; + case 1: + break; + case 2: + _txrx.Send("pb 1 step"); + msg = String.Format("status created {0}/{1} files", + y+1, + ((int)z)); + _txrx.Send(msg); + break; + } + }); + + CreateLargeFilesWithChecksums(dirToZip, numFiles, update, + out filesToZip, out checksums); + + _txrx.Send("pb 0 step"); + _txrx.Send("pb 1 max " + segmentSizes.Length); + _txrx.Send("pb 1 value 0"); + for (int i=0; i < segmentSizes.Length; i++) + { + //Directory.SetCurrentDirectory(TopLevelDir); + _txrx.Send("status zip with " + segmentSizes[i] + "k segments"); + string trialDir = segmentSizes[i] + "k"; + Directory.CreateDirectory(trialDir); + string zipFileToCreate = Path.Combine(trialDir, trialDir + ".zip"); + // Create the zip archive via DotNetZip + using (var zip = new ZipFile()) + { + zip.AddFiles(filesToZip); + zip.MaxOutputSegmentSize = segmentSizes[i]*1024; + zip.Save(zipFileToCreate); + } + + // extract using InfoZip + string extractDir = segmentSizes[i] + "k.extract"; + //Directory.SetCurrentDirectory(TopLevelDir); + this.Exec(infoZipUnzip, + String.Format("{0} -d {1}", + zipFileToCreate, + extractDir)); + + VerifyChecksums(Path.Combine(extractDir, dirToZip), filesToZip, checksums); + + _txrx.Send("pb 1 step"); + } + } +#endif + + + [TestMethod] + public void InfoZip_Unzip_z64_wi11936() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + string dirToZip = "dirToZip"; + int numFiles = _rnd.Next(17) + 12; + string[] filesToZip; + string msg; + Dictionary checksums; + + _txrx = TestUtilities.StartProgressMonitor("InfoZip-compat", + "InfoZip split archives", + "Creating "+numFiles+" files"); + _txrx.Send("pb 0 max 3"); + _txrx.Send("pb 1 max " + numFiles); + + var update = new Action( (x,y,z) => { + switch (x) + { + case 0: + break; + case 1: + break; + case 2: + _txrx.Send("pb 1 step"); + msg = String.Format("status created {0}/{1} files", + y+1, + ((int)z)); + _txrx.Send(msg); + break; + } + }); + + CreateLargeFilesWithChecksums(dirToZip, numFiles, update, + out filesToZip, out checksums); + + _txrx.Send("pb 0 step"); + _txrx.Send("pb 1 max 3"); + _txrx.Send("pb 1 value 0"); + + string zipFileToCreate = "infozip-z64-unzip.zip"; + // Create the zip archive via DotNetZip + using (var zip = new ZipFile()) + { + zip.AddFiles(filesToZip); + zip.UseZip64WhenSaving = Zip64Option.Always; + zip.Save(zipFileToCreate); + } + _txrx.Send("pb 1 step"); + + // extract using InfoZip + string extractDir = "extract"; + this.Exec(infoZipUnzip, + String.Format("{0} -d {1}", + zipFileToCreate, + extractDir)); + _txrx.Send("pb 1 step"); + + VerifyChecksums(Path.Combine(extractDir, dirToZip), filesToZip, checksums); + _txrx.Send("pb 1 step"); + } + + + [TestMethod] + public void InfoZip_Unzip_ZeroLengthFile() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + string password = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + // pass 1 for one regular zero length file. + // pass 2 for zero-length file with WinZip encryption (which does not actually + // get applied) + // pass 3 for PKZip encryption (ditto) + for (int k=0; k < 3; k++) + { + string zipFileToCreate = "ZLF.zip"; + + // create an empty file + string filename = Path.GetRandomFileName(); + using (StreamWriter sw = File.CreateText(filename)) { } + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + if(k==1) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.Password = password; + } + else if (k==2) + { + zip1.Password = password; + zip1.Encryption = EncryptionAlgorithm.PkzipWeak; + } + zip1.AddFile(filename, ""); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(1, TestUtilities.CountEntries(zipFileToCreate), + "Incorrect number of entries in the zip file."); + + string extractDir = "extract." + k; + Directory.CreateDirectory(extractDir); + + // now, extract the zip. Possibly need a password. + // eg, unzip.exe -P test.zip -d + string args = zipFileToCreate + " -d " + extractDir; + if (k!=0) + args = "-P " + password + " " + args; + string infozipOut = this.Exec(infoZipUnzip, args); + + TestContext.WriteLine("{0}", infozipOut); + Assert.IsFalse(infozipOut.Contains("signature not found")); + } + } + + + + + [TestMethod] + public void Perl_Zip() + { + if (perl == null) + throw new Exception("[Perl_Zip] : Perl is not present"); + + string zipFileToCreate = "newzip.zip"; + string shortDir = "filesToZip"; + string dirToZip = Path.Combine(TopLevelDir, shortDir); + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(dirToZip, out filesToZip, out checksums); + + // create a zip with perl: + TestContext.WriteLine("Creating a zip with perl..."); + string createZipPl = GetScript("CreateZip.pl"); + this.Exec(perl, + String.Format("\"{0}\" {1} \"{2}\"", + createZipPl, + zipFileToCreate, + shortDir)); + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting that zip with DotNetZip..."); + string extractDir = "extract"; + using (var zip = ZipFile.Read(zipFileToCreate)) + { + zip.ExtractAll(extractDir); + } + + TestContext.WriteLine(""); + TestContext.WriteLine("Verifying checksums..."); + VerifyChecksums(Path.Combine(extractDir, dirToZip), filesToZip, checksums); + } + + + + + [TestMethod] + public void SevenZip_Zip_1() + { + if (!SevenZipIsPresent) + throw new Exception("[7z_Zip_1] : SevenZip is not present"); + + string zipFileToCreate = Path.Combine(TopLevelDir, "7z_Zip_1.zip"); + // create and fill the directories + string extractDir = "extract"; + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive via 7z.exe + this.Exec(sevenZip, String.Format("a {0} {1}", zipFileToCreate, subdir)); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // run the COM script to unzip the ZIP archive + string script = GetScript("VbsUnZip-DotNetZip.vbs"); + + this.Exec(cscriptExe, + String.Format("\"{0}\" {1} {2}", script, zipFileToCreate, extractDir)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + VerifyTimesNtfs(Path.Combine(extractDir, "files"), filesToZip); + } + + + + [TestMethod] + public void SevenZip_Zip_2() + { + if (!SevenZipIsPresent) + throw new Exception("[7z_Zip_2] : SevenZip is not present"); + + string zipFileToCreate = Path.Combine(TopLevelDir, "7z_Zip_2.zip"); + + // create and fill the directories + string extractDir = "extract"; + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive via 7z.exe + //Directory.SetCurrentDirectory(TopLevelDir); + + this.Exec(sevenZip, String.Format("a {0} {1}", zipFileToCreate, subdir)); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unzip + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + VerifyTimesNtfs(Path.Combine(extractDir, "files"), filesToZip); + } + + + + [TestMethod] + public void SevenZip_Unzip() + { + if (!SevenZipIsPresent) + throw new Exception("[7z_Unzip] : SevenZip is not present"); + + string zipFileToCreate = Path.Combine(TopLevelDir, "7z_Unzip.zip"); + + // create and fill the directories + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive with DotNetZip + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unpack the zip archive via 7z.exe + Directory.CreateDirectory("extract"); + Directory.SetCurrentDirectory("extract"); + this.Exec(sevenZip, String.Format("x {0}", zipFileToCreate)); + + // check the files in the extract dir + Directory.SetCurrentDirectory(TopLevelDir); + + VerifyChecksums(Path.Combine("extract", "files"), filesToZip, checksums); + } + + + [TestMethod] + public void SevenZip_Unzip_Password() + { + if (!SevenZipIsPresent) + throw new Exception("[7z_Unzip_Password] : SevenZip is not present"); + + string zipFileToCreate = Path.Combine(TopLevelDir, "7z_Unzip_Password.zip"); + string password = Path.GetRandomFileName(); + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive with DotNetZip + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = password; + zip1.AddFiles(filesToZip, "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unpack the zip archive via 7z.exe + Directory.CreateDirectory("extract"); + Directory.SetCurrentDirectory("extract"); + this.Exec(sevenZip, String.Format("x -p{0} {1}", password, zipFileToCreate)); + + // check the files in the extract dir + Directory.SetCurrentDirectory(TopLevelDir); + + VerifyChecksums(Path.Combine("extract", "files"), filesToZip, checksums); + } + + + + + [TestMethod] + public void SevenZip_Unzip_Password_NonSeekableOutput() + { + if (!SevenZipIsPresent) + throw new Exception("[7z_Unzip_Password_NonSeekableOutput] : SevenZip is not present"); + + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip; + Dictionary checksums = null; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + //CreateFilesAndChecksums(subdir, 2, 32, out filesToZip, out checksums); + +#if NOT + // debugging + Directory.CreateDirectory(subdir); + DateTime atMidnight = new DateTime(DateTime.Now.Year, + DateTime.Now.Month, + DateTime.Now.Day, + 11,11,11); + filesToZip = new String[2]; + for (int z=0; z < 2; z++) + { + string fname = Path.Combine(subdir, String.Format("file{0:D3}.txt", z)); + File.WriteAllText(fname, "12341234123412341234123412341234"); + File.SetLastWriteTime(fname, atMidnight); + File.SetLastAccessTime(fname, atMidnight); + File.SetCreationTime(fname, atMidnight); + filesToZip[z]= fname; + } +#endif + TestContext.WriteLine("Test Unzip with 7zip"); + TestContext.WriteLine("============================================"); + + // marker file + // using (File.Create(Path.Combine(TopLevelDir, "DotNetZip-" + ZipFile.LibraryVersion.ToString()))) ; + + int i = 0; + foreach (var compLevel in compLevels) + { + TestContext.WriteLine("---------------------------------"); + TestContext.WriteLine("Trial {0}", i); + TestContext.WriteLine("CompressionLevel = {0}", compLevel); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("7z_Unzip_Password_NonSeekableOutput.{0}.zip", i)); + string password = Path.GetRandomFileName(); + //string password = "0123456789ABCDEF"; + string extractDir = Path.Combine(TopLevelDir, String.Format("extract.{0}", i)); + + TestContext.WriteLine("Password = {0}", password); + + // Create the zip archive with DotNetZip + //Directory.SetCurrentDirectory(TopLevelDir); + // Want to test the library when saving to non-seekable output streams. Like + // stdout or ASPNET's Response.OutputStream. This simulates it. + using (var rawOut = System.IO.File.Create(zipFileToCreate)) + { + using (var nonSeekableOut = new Ionic.Zip.Tests.NonSeekableOutputStream(rawOut)) + { + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = (Ionic.Zlib.CompressionLevel)compLevel; + zip1.Password = password; + zip1.AddFiles(filesToZip, "files"); + zip1.Save(nonSeekableOut); + } + } + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unpack the zip archive via 7z.exe + Directory.CreateDirectory(extractDir); + this.Exec(sevenZip, String.Format("x -o{0} -p{1} {2}", + Path.GetFileName(extractDir), + password, + zipFileToCreate)); + + // check the files in the extract dir + //Directory.SetCurrentDirectory(TopLevelDir); + + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + i++; + } + } + + + + [TestMethod] + public void SevenZip_Unzip_SFX() + { + if (!SevenZipIsPresent) + throw new Exception("[7z_Unzip_SFX] : SevenZip is not present"); + + string zipFileToCreate = Path.Combine(TopLevelDir, "7z_Unzip_SFX.exe"); + + // create and fill the directories + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // Create the zip archive with DotNetZip + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < filesToZip.Length; i++) + zip1.AddItem(filesToZip[i], "files"); + zip1.SaveSelfExtractor(zipFileToCreate, + SelfExtractorFlavor.ConsoleApplication); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // unpack the zip archive via 7z.exe + Directory.CreateDirectory("extract"); + Directory.SetCurrentDirectory("extract"); + this.Exec(sevenZip, String.Format("x {0}", zipFileToCreate)); + + // check the files in the extract dir + Directory.SetCurrentDirectory(TopLevelDir); + + VerifyChecksums(Path.Combine("extract", "files"), filesToZip, checksums); + } + + + + [TestMethod] + public void Winzip_Zip() + { + Winzip_Zip_Variable(""); + } + + + [TestMethod] + public void Winzip_Zip_Password() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Zip_Password] : winzip is not present"); + + + string password = Path.GetRandomFileName().Replace(".", "@"); + TestContext.WriteLine("creating zip with password ({0})", password); + string zipfile = Winzip_Zip_Variable("-s" + password, false); + string extractDir = "extract"; + + // unzip with DotNetZip + //Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = ZipFile.Read(zipfile)) + { + zip1.Password = password; + zip1.ExtractAll(extractDir); + } + } + + + [TestMethod] + public void Winzip_Zip_Normal() + { + Winzip_Zip_Variable("-en"); + } + + [TestMethod] + public void Winzip_Zip_Fast() + { + Winzip_Zip_Variable("-ef"); + } + + [TestMethod] + public void Winzip_Zip_SuperFast() + { + Winzip_Zip_Variable("-es"); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Winzip_Zip_EZ() + { + if (!WinZipIsPresent) throw new Exception("no winzip"); + // Unsupported compression method + Winzip_Zip_Variable("-ez"); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Winzip_Zip_PPMd() + { + if (!WinZipIsPresent) throw new Exception("no winzip"); + // Unsupported compression method + Winzip_Zip_Variable("-ep"); + } + + [TestMethod] + public void Winzip_Zip_Bzip2() + { + if (!WinZipIsPresent) throw new Exception("no winzip"); + Winzip_Zip_Variable("-eb"); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Winzip_Zip_Enhanced() + { + if (!WinZipIsPresent) throw new Exception("no winzip"); + // Unsupported compression method + Winzip_Zip_Variable("-ee"); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Winzip_Zip_LZMA() + { + if (!WinZipIsPresent) throw new Exception("no winzip"); + // Unsupported compression method + Winzip_Zip_Variable("-el"); + } + + + public string Winzip_Zip_Variable(string options) + { + return Winzip_Zip_Variable(options, true); + } + + public string Winzip_Zip_Variable(string options, bool wantVerify) + { + if (!WinZipIsPresent) + throw new Exception(String.Format("[options({0})] : winzip is not present", options)); + + // options: + // -sPassword + // -ep - PPMd compression. + // -el - LZMA compression + // -eb - bzip2 compression + // -ee - "enhanced" compression. + // -en - normal compression. + // -ef - fast compression. + // -es - superfast compression. + // -ez - select best method at runtime. Requires WinZip12 to extract. + // empty string = default + string zipFileToCreate = Path.Combine(TopLevelDir, "Winzip_Zip.zip"); + + string dirInZip = "files"; + string subdir = Path.Combine(TopLevelDir, dirInZip); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + // delay between file creation and zip creation + System.Threading.Thread.Sleep(1200); + + // exec wzzip.exe to create the zip file + string formatString = "-a -p " + options + " -yx {0} {1}\\*.*"; + string wzzipOut = this.Exec(wzzip, String.Format(formatString, zipFileToCreate, subdir)); + + if (wantVerify) + { + // unzip with DotNetZip + string extractDir = "extract"; + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.ExtractAll(extractDir); + } + + // check the files in the extract dir + VerifyChecksums(extractDir, filesToZip, checksums); + + // verify the file times. + VerifyTimesNtfs(extractDir, filesToZip); + } + + return zipFileToCreate; + } + + + + [TestMethod] + [Timeout(9 * 60 * 1000)] // in ms, 60 * 1000 = 1min + public void Winzip_Unzip_2() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Unzip_2] : winzip is not present"); + + string zipFileToCreate = "Winzip_Unzip_2.zip"; + + // create and fill the directories + string extractDir = "extract"; + //string subdir = "files"; + Dictionary checksums = new Dictionary(); + var filesToZip = GetSelectionOfTempFiles(_rnd.Next(13) + 8, checksums); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip, "files"); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Count, + "Incorrect number of entries in the zip file."); + + // now, extract the zip + // eg, wzunzip.exe -d test.zip + Directory.CreateDirectory(extractDir); + this.Exec(wzunzip, String.Format("-d -yx {0} \"{1}\"", + zipFileToCreate, extractDir)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + // verify the file times + VerifyTimesDos(Path.Combine(extractDir, "files"), filesToZip); + } + + + + + [TestMethod] + public void Winzip_Unzip_ZeroLengthFile() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Unzip_ZeroLengthFile] : winzip is not present"); + + string password = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + // pass 1 for one regular zero length file. + // pass 2 for zero-length file with WinZip encryption (which does not actually + // get applied) + // pass 3 for PKZip encryption (ditto) + for (int k=0; k < 3; k++) + { + string zipFileToCreate = "ZLF.zip"; + + // create an empty file + string filename = Path.GetRandomFileName(); + using (StreamWriter sw = File.CreateText(filename)) { } + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + if(k==1) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.Password = password; + } + else if (k==2) + { + zip1.Password = password; + zip1.Encryption = EncryptionAlgorithm.PkzipWeak; + } + zip1.AddFile(filename, ""); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(1, TestUtilities.CountEntries(zipFileToCreate), + "Incorrect number of entries in the zip file."); + + // now, test the zip. Possibly need a password. + // eg, wzunzip.exe -t test.zip + string args = "-t " + zipFileToCreate; + if (k!=0) + args = "-s" + password + " " + args; + string wzunzipOut = this.Exec(wzunzip, args); + + TestContext.WriteLine("{0}", wzunzipOut); + Assert.IsTrue(wzunzipOut.Contains("No errors")); + Assert.IsFalse(wzunzipOut.Contains("At least one error was detected")); + } + } + + + + [TestMethod] + public void Winzip_Unzip_Password() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Unzip_Password] : winzip is not present"); + + //Directory.SetCurrentDirectory(TopLevelDir); + string zipFileToCreate = "Winzip_Unzip_Password.zip"; + string extractDir = "extract"; + string subdir = "fodder"; + // create a bunch of files + var filesToZip = TestUtilities.GenerateFilesFlat(subdir); + string password = Path.GetRandomFileName(); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = password; + zip1.AddFiles(filesToZip, ""); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(filesToZip.Length, TestUtilities.CountEntries(zipFileToCreate), + "Incorrect number of entries in the zip file."); + + // now, test the zip + // eg, wzunzip.exe -t test.zip + string args = String.Format("-t -s{0} {1}", password, zipFileToCreate); + string wzunzipOut = this.Exec(wzunzip, args); + TestContext.WriteLine("{0}", wzunzipOut); + + Assert.IsTrue(wzunzipOut.Contains("No errors")); + Assert.IsFalse(wzunzipOut.Contains("At least one error was detected")); + + // extract the zip + // eg, wzunzip.exe -d -yx -sPassword test.zip + args = String.Format("-d -yx -s{0} {1} {2}", + password, zipFileToCreate, extractDir); + Directory.CreateDirectory(extractDir); + wzunzipOut = this.Exec(wzunzip, args); + + Assert.IsFalse(wzunzipOut.Contains("skipping")); + Assert.IsFalse(wzunzipOut.Contains("incorrect")); + } + + + + [TestMethod] + public void Winzip_Unzip_Password_NonSeekableOutput() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Unzip_Password_NonSeekableOutput] : winzip is not present"); + + + // create a bunch of files + string subdir = "fodder"; + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + var compressionLevels = Enum.GetValues(typeof(Ionic.Zlib.CompressionLevel)); + int i = 0; + foreach (var compLevel in compressionLevels) + { + string zipFileToCreate = + Path.Combine(TopLevelDir, + String.Format("Winzip_Unzip_Pwd_NonSeek.{0}.zip", + i)); + string extractDir = "extract" + i.ToString(); + string password = Path.GetRandomFileName(); + + // Want to test the library when saving to non-seekable + // output streams. Like stdout or ASPNET's + // Response.OutputStream. This simulates it. + using (var rawOut = System.IO.File.Create(zipFileToCreate)) + { + using (var nonSeekableOut = new Ionic.Zip.Tests.NonSeekableOutputStream(rawOut)) + { + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = (Ionic.Zlib.CompressionLevel)compLevel; + zip1.Password = password; + zip1.AddFiles(filesToZip, "files"); + zip1.Save(nonSeekableOut); + } + } + } + + // Verify the number of files in the zip + Assert.AreEqual(filesToZip.Length, + TestUtilities.CountEntries(zipFileToCreate), + "Incorrect number of entries in the zip file."); + + // now, test the zip + // eg, wzunzip.exe -t test.zip + string wzunzipOut = this.Exec(wzunzip, String.Format("-t -s{0} {1}", + password, zipFileToCreate)); + TestContext.WriteLine("{0}", wzunzipOut); + + Assert.IsTrue(wzunzipOut.Contains("No errors")); + Assert.IsFalse(wzunzipOut.Contains("At least one error was detected")); + + // extract the zip + Directory.CreateDirectory(extractDir); + // eg, wzunzip.exe -d -yx -sPassword test.zip + wzunzipOut = this.Exec(wzunzip, String.Format("-d -yx -s{0} {1} {2}", + password, zipFileToCreate, extractDir)); + Assert.IsFalse(wzunzipOut.Contains("skipping")); + Assert.IsFalse(wzunzipOut.Contains("incorrect")); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + i++; + } + } + + + + [TestMethod] + public void Winzip_Unzip_SFX() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Unzip_SFX] : winzip is not present"); + + string zipFileToCreate = "Winzip_Unzip_SFX.exe"; + + // create and fill the directories + string extractDir = Path.Combine(TopLevelDir, "extract"); + string subdir = Path.Combine(TopLevelDir, "files"); + + Dictionary checksums = new Dictionary(); + var filesToZip = GetSelectionOfTempFiles(_rnd.Next(13) + 8, checksums); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip, "files"); + zip1.SaveSelfExtractor(zipFileToCreate, + SelfExtractorFlavor.ConsoleApplication); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Count, + "Incorrect number of entries in the zip file."); + + // now, extract the zip + // eg, wzunzip.exe -d test.zip [] + Directory.CreateDirectory(extractDir); + Directory.SetCurrentDirectory(extractDir); + + // -d = restore folder structure + // -yx = restore extended timestamps to extracted files + this.Exec(wzunzip, "-d -yx " + Path.Combine("..", zipFileToCreate)); + + // check the files in the extract dir + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + + // verify the file times + VerifyTimesDos(Path.Combine(extractDir, "files"), filesToZip); + } + + + [TestMethod] + public void Winzip_Unzip_Bzip2() + { + if (!WinZipIsPresent) throw new Exception("no winzip"); + + string zipFileToCreate = "Winzip_Unzip.zip"; + + string dirInZip = "files"; + string extractDir = "extract"; + string subdir = Path.Combine(TopLevelDir, dirInZip); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + var additionalFiles = GetSelectionOfTempFiles(checksums); + + // Now, Create the zip archive with DotNetZip + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionMethod = CompressionMethod.BZip2; + zip1.AddFiles(filesToZip, dirInZip); + zip1.AddFiles(additionalFiles, dirInZip); + zip1.Save(zipFileToCreate); + } + + TestContext.WriteLine("Verifying the number of files in the zip"); + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length + additionalFiles.Count, + "Incorrect number of entries in the zip file."); + + + // verify that the output states that the compression method + // used for each entry was BZIP2... + TestContext.WriteLine("Verifying that BZIP2 was the comp method used..."); + + // examine and unpack the zip archive via WinZip + // first, examine the zip entry metadata: + string wzzipOut = this.Exec(wzzip, "-vt " + zipFileToCreate); + + var numBzipped = TestUtilities.CountOccurrences(wzzipOut, "Compression Method: BZipped"); + TestContext.WriteLine("Found {0} bzipped entries.", numBzipped); + + // Not all of the files will be bzipped. Some of the files + // may be "stored" because they are incompressible. This + // should be the exception, though. + var numStored = TestUtilities.CountOccurrences(wzzipOut, "Compression Method: Stored"); + TestContext.WriteLine("Found {0} stored entries.", numStored); + + Assert.AreEqual( numBzipped + numStored, + filesToZip.Length + additionalFiles.Count); + Assert.IsTrue( numBzipped > 2*numStored, + "The number of bzipped files is too low."); + + TestContext.WriteLine("Extracting..."); + // now, extract the zip + // eg, wzunzip.exe -d test.zip + Directory.CreateDirectory(extractDir); + Directory.SetCurrentDirectory(extractDir); + this.Exec(wzunzip, String.Format("-d -yx \"{0}\"", + Path.Combine(TopLevelDir,zipFileToCreate))); + + // check the files in the extract dir + Directory.SetCurrentDirectory(TopLevelDir); + String[] filesToCheck = new String[filesToZip.Length + additionalFiles.Count]; + filesToZip.CopyTo(filesToCheck, 0); + additionalFiles.ToArray().CopyTo(filesToCheck, filesToZip.Length); + + VerifyChecksums(Path.Combine("extract", dirInZip), filesToCheck, checksums); + + VerifyFileTimes1(extractDir, additionalFiles); + } + + + [TestMethod] + public void Winzip_Unzip_Bzip2_Large() + { + // BZip2 uses work buffers of 900k (ish). When compressing files that + // can be Run-length-encoded into a buffer smaller than 900k, only one + // "block" is used in the compressed output. Multiple blocks get + // emitted with input files that cannot be run-length encoded into + // 900k (ish). This test verifies that everything works correctly when + // compressing larger files that require multiple blocks in the + // compressed output. (At one point there was a problem combining CRCs + // from multiple blocks.) + if (!WinZipIsPresent) throw new Exception("no winzip"); + + TestContext.WriteLine("Creating the fodder files..."); + string zipFileToCreate = "BZ_Large.zip"; + int n = _rnd.Next(5) + 5; + int baseSize = _rnd.Next(0x80000) + 0x3000ff; + int delta = 0x80000; + string dirInZip = "files"; + string extractDir = "extract"; + string subdir = Path.Combine(TopLevelDir, dirInZip); + var filesToZip = TestUtilities.GenerateFilesFlat(subdir, n, baseSize, baseSize+delta); + + TestContext.WriteLine("Creating the zip..."); + // Now, Create the zip archive with DotNetZip + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionMethod = CompressionMethod.BZip2; + zip1.AddFiles(filesToZip, dirInZip); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + TestContext.WriteLine("Verifying the number of files in the zip..."); + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file."); + + // examine and unpack the zip archive via WinZip + // first, examine the zip entry metadata: + string wzzipOut = this.Exec(wzzip, "-vt " + zipFileToCreate); + + // verify that the output states that the compression method + // used for each entry was BZIP2... + TestContext.WriteLine("Verifying that BZIP2 was the comp method used..."); + Assert.AreEqual(TestUtilities.CountOccurrences(wzzipOut, "Compression Method: BZipped"), + filesToZip.Length); + + // now, extract the zip + // eg, wzunzip.exe -d test.zip + TestContext.WriteLine("Extracting..."); + Directory.CreateDirectory(extractDir); + Directory.SetCurrentDirectory(extractDir); + this.Exec(wzunzip, String.Format("-d -yx \"{0}\"", + Path.Combine("..",zipFileToCreate))); + } + + + + + [TestMethod] + public void Winzip_Unzip_Basic() + { + if (!WinZipIsPresent) + throw new Exception("[Winzip_Unzip_Basic] : winzip is not present"); + + string zipFileToCreate = "Winzip_Unzip_Basic.zip"; + + string dirInZip = "files"; + string extractDir = "extract"; + string subdir = Path.Combine(TopLevelDir, dirInZip); + + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + var additionalFiles = GetSelectionOfTempFiles(checksums); + + int i = 0; + // set R and S attributes on the first file + if (!File.Exists(filesToZip[i])) throw new Exception("Something is berry berry wrong."); + File.SetAttributes(filesToZip[i], FileAttributes.ReadOnly | FileAttributes.System); + + // set H attribute on the second file + i++; + if (i == filesToZip.Length) throw new Exception("Not enough files??."); + if (!File.Exists(filesToZip[i])) throw new Exception("Something is berry berry wrong."); + File.SetAttributes(filesToZip[i], FileAttributes.Hidden); + + // Now, Create the zip archive with DotNetZip + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip, dirInZip); + zip1.AddFiles(additionalFiles, dirInZip); + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length + additionalFiles.Count, + "Incorrect number of entries in the zip file."); + + // examine and unpack the zip archive via WinZip + // first, examine the zip entry metadata: + string wzzipOut = this.Exec(wzzip, "-vt " + zipFileToCreate); + + string[] expectedAttrStrings = { "s-r-", "-hw-", "--w-" }; + + // example: Filename: folder5\Test8.txt + for (i = 0; i < expectedAttrStrings.Length; i++) + { + var f = Path.GetFileName(filesToZip[i]); + var fileInZip = Path.Combine(dirInZip, f); + string textToLookFor = String.Format("Filename: {0}", fileInZip.Replace("/", "\\")); + int x = wzzipOut.IndexOf(textToLookFor); + Assert.IsTrue(x > 0, "Could not find expected text ({0}) in WZZIP output.", textToLookFor); + textToLookFor = "Attributes: "; + x = wzzipOut.IndexOf(textToLookFor, x); + string attrs = wzzipOut.Substring(x + textToLookFor.Length, 4); + Assert.AreEqual(expectedAttrStrings[i], attrs, "Unexpected attributes on File {0}.", i); + } + + // now, extract the zip + // eg, wzunzip.exe -d test.zip + Directory.CreateDirectory(extractDir); + Directory.SetCurrentDirectory(extractDir); + this.Exec(wzunzip, String.Format("-d -yx ..\\{0}", zipFileToCreate)); + + // check the files in the extract dir + Directory.SetCurrentDirectory(TopLevelDir); + String[] filesToCheck = new String[filesToZip.Length + additionalFiles.Count]; + filesToZip.CopyTo(filesToCheck, 0); + additionalFiles.ToArray().CopyTo(filesToCheck, filesToZip.Length); + + VerifyChecksums(Path.Combine("extract", dirInZip), filesToCheck, checksums); + + VerifyFileTimes1(extractDir, additionalFiles); + } + + + private void VerifyFileTimes1(string extractDir, List additionalFiles) + { + // verify the file times + DateTime atMidnight = new DateTime(DateTime.Now.Year, + DateTime.Now.Month, + DateTime.Now.Day); + DateTime fortyFiveDaysAgo = atMidnight - new TimeSpan(45, 0, 0, 0); + + string[] extractedFiles = Directory.GetFiles(extractDir); + + foreach (var fqPath in extractedFiles) + { + string filename = Path.GetFileName(fqPath); + DateTime stamp = File.GetLastWriteTime(fqPath); + if (filename.StartsWith("testfile")) + { + Assert.IsTrue((stamp == atMidnight || stamp == fortyFiveDaysAgo), + "The timestamp on the file {0} is incorrect ({1}).", + fqPath, stamp.ToString("yyyy-MM-dd HH:mm:ss")); + } + else + { + var orig = (from f in additionalFiles + where Path.GetFileName(f) == filename + select f) + .First(); + + DateTime t1 = File.GetLastWriteTime(filename); + DateTime t2 = File.GetLastWriteTime(orig); + Assert.AreEqual(t1, t2); + t1 = File.GetCreationTime(filename); + t2 = File.GetCreationTime(orig); + Assert.AreEqual(t1, t2); + } + } + } + + private List GetSelectionOfTempFiles(Dictionary checksums) + { + return GetSelectionOfTempFiles(_rnd.Next(23) + 9, checksums); + } + + private List excludedFilenames = new List(); + + + private List GetSelectionOfTempFiles(int numFilesWanted, Dictionary checksums) + { + string tmpPath = Environment.GetEnvironmentVariable("TEMP"); // C:\Users\dinoch\AppData\Local\Temp + String[] candidates = Directory.GetFiles(tmpPath); + var theChosenOnes = new List(); + int trials = 0; + int otherSide = 0; + int minOtherSide = numFilesWanted / 3 + 1; + do + { + if (theChosenOnes.Count > numFilesWanted && otherSide >= minOtherSide) break; + + // randomly select a candidate + var f = candidates[_rnd.Next(candidates.Length)]; + if (excludedFilenames.Contains(f)) continue; + + try + { + var fi = new FileInfo(f); + if (Path.GetFileName(f)[0] == '~' + || theChosenOnes.Contains(f) + || fi.Length > 10000000 // too large + || fi.Length < 100) // too small + { + excludedFilenames.Add(f); + } + else + { + DateTime lastwrite = File.GetLastWriteTime(f); + bool onOtherSideOfDst = + (DateTime.Now.IsDaylightSavingTime() && !lastwrite.IsDaylightSavingTime()) || + (!DateTime.Now.IsDaylightSavingTime() && lastwrite.IsDaylightSavingTime()); + + if (onOtherSideOfDst) + otherSide++; + + // If it's on the other side of DST, + // or + // there are zero or one on *this side* + // or + // we can still reach the "other side" quota. + if (onOtherSideOfDst || (theChosenOnes.Count - otherSide < 2) || + ((otherSide < minOtherSide) && (numFilesWanted - theChosenOnes.Count > minOtherSide - otherSide))) + { + var key = Path.GetFileName(f); + var chk = TestUtilities.ComputeChecksum(f); + checksums.Add(key, chk); + theChosenOnes.Add(f); + } + } + } + catch { /* gulp! */ } + trials++; + } + while (trials < 1000); + + theChosenOnes.Sort(); + return theChosenOnes; + } + + + + + + [TestMethod] + public void Extract_WinZip_SelfExtractor() + { + _Extract_ZipFile("winzip-sfx.exe"); + } + + [TestMethod] + public void Extract_Docx() + { + _Extract_ZipFile("Vanishing Oatmeal Cookies.docx"); + } + + [TestMethod] + public void Extract_ZipWithDuplicateNames_wi10330() + { + _Extract_ZipFile("wi10330-badzip.zip"); + } + + [TestMethod] + public void Extract_Xlsx() + { + _Extract_ZipFile("Book1.xlsx"); + } + + [TestMethod] + public void Extract_DWF() + { + _Extract_ZipFile("plot.dwf"); + } + + [TestMethod] + public void Extract_InfoZipAppNote() + { + _Extract_ZipFile("appnote-iz-latest.zip"); + } + + [TestMethod] + public void Extract_AndroidApp() + { + _Extract_ZipFile("Calendar.apk"); + } + + + private void _Extract_ZipFile(string fileName) + { + TestContext.WriteLine("Current Dir: {0}", CurrentDir); + string sourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + string fqFileName = Path.Combine(Path.Combine(sourceDir, + "Zip Tests\\bin\\Debug\\zips"), + fileName); + + TestContext.WriteLine("Reading zip file: '{0}'", fqFileName); + using (ZipFile zip = ZipFile.Read(fqFileName)) + { + string extractDir = "extract"; + foreach (ZipEntry e in zip) + { + + TestContext.WriteLine("{1,-22} {2,9} {3,5:F0}% {4,9} {5,3} {6:X8} {0}", + e.FileName, + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + e.UncompressedSize, + e.CompressionRatio, + e.CompressedSize, + (e.UsesEncryption) ? "Y" : "N", + e.Crc); + e.Extract(extractDir); + } + } + } + + + + } + + +} diff --git a/dotNetZip/Zip Tests/ErrorTests.cs b/dotNetZip/Zip Tests/ErrorTests.cs new file mode 100644 index 0000000..b4914dc --- /dev/null +++ b/dotNetZip/Zip Tests/ErrorTests.cs @@ -0,0 +1,870 @@ +// ErrorTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-28 12:58:36> +// +// ------------------------------------------------------------------ +// +// This module defines some "error tests" - tests that the expected +// errors or exceptions occur in DotNetZip under exceptional conditions. +// These conditions include corrupted zip files, bad input, and so on. +// +// ------------------------------------------------------------------ + +using System; +using System.Text; +using System.IO; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +//using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; + + +namespace Ionic.Zip.Tests.Error +{ + /// + /// Summary description for ErrorTests + /// + [TestClass] + public class ErrorTests : IonicTestClass + { + public ErrorTests() : base() { } + + + [TestMethod] + [ExpectedException(typeof(FileNotFoundException))] + public void Error_AddFile_NonExistentFile() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Error_AddFile_NonExistentFile.zip"); + using (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile(zipFileToCreate)) + { + zip.AddFile("ThisFileDoesNotExist.txt"); + zip.Comment = "This is a Comment On the Archive"; + zip.Save(); + } + } + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentNullException))] + public void Error_Read_NullStream() + { + System.IO.Stream s = null; + using (var zip = ZipFile.Read(s)) + { + foreach (var e in zip) + { + Console.WriteLine("entry: {0}", e.FileName); + } + } + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void CreateZip_AddDirectory_BlankName() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "CreateZip_AddDirectory_BlankName.zip"); + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + zip.AddDirectoryByName(""); + zip.Save(); + } + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void CreateZip_AddEntry_String_BlankName() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "CreateZip_AddEntry_String_BlankName.zip"); + using (ZipFile zip = new ZipFile()) + { + zip.AddEntry("", "This is the content."); + zip.Save(zipFileToCreate); + } + } + + + private void OverwriteDecider(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite: + // randomly choose whether to overwrite or not + e.CurrentEntry.ExtractExistingFile = (_rnd.Next(2) == 0) + ? ExtractExistingFileAction.DoNotOverwrite + : ExtractExistingFileAction.OverwriteSilently; + break; + } + } + + + + private void _Internal_ExtractExisting(int flavor) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Error-Extract-ExistingFileWithoutOverwrite-{0}.zip", flavor)); + + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + + Assert.IsTrue(Directory.Exists(resourceDir)); + + Directory.SetCurrentDirectory(TopLevelDir); + var filenames = Directory.GetFiles(resourceDir); + + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + zip.AddFiles(filenames, ""); + zip.Comment = "This is a Comment On the Archive"; + zip.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filenames.Length, + "The zip file created has the wrong number of entries."); + + // Extract twice: the first time should succeed. + // The second, should fail, because of a failed file overwrite. + // Unless flavor==3, in which case we overwrite silently. + for (int k = 0; k < 2; k++) + { + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + if (flavor > 10) + zip.ExtractProgress += OverwriteDecider; + for (int j = 0; j < filenames.Length; j++) + { + ZipEntry e = zip[Path.GetFileName(filenames[j])]; + if (flavor == 4) + e.Extract("unpack"); + else + e.Extract("unpack", (ExtractExistingFileAction) flavor); + } + } + } + } + + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_Extract_ExistingFileWithoutOverwrite_Throw() + { + _Internal_ExtractExisting((int)ExtractExistingFileAction.Throw); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_Extract_ExistingFileWithoutOverwrite_NoArg() + { + _Internal_ExtractExisting(4); + } + + + // not an error test + [TestMethod] + public void Extract_ExistingFileWithOverwrite_OverwriteSilently() + { + _Internal_ExtractExisting((int)ExtractExistingFileAction.OverwriteSilently); + } + + // not an error test + [TestMethod] + public void Extract_ExistingFileWithOverwrite_DoNotOverwrite() + { + _Internal_ExtractExisting((int)ExtractExistingFileAction.DoNotOverwrite); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_Extract_ExistingFileWithoutOverwrite_InvokeProgress() + { + _Internal_ExtractExisting((int)ExtractExistingFileAction.InvokeExtractProgressEvent); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_Extract_ExistingFileWithoutOverwrite_InvokeProgress_2() + { + _Internal_ExtractExisting(10+(int)ExtractExistingFileAction.InvokeExtractProgressEvent); + } + + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_Extract_ExistingFileWithoutOverwrite_7() + { + // this is a test of the test! + _Internal_ExtractExisting(7); + } + + + [TestMethod] + public void Error_EmptySplitZip() + { + string zipFileToCreate = "zftc.zip"; + using (var zip = new ZipFile()) + { + zip.MaxOutputSegmentSize = 1024*1024; + zip.Save(zipFileToCreate); + } + + string extractDir = "extract"; + using (var zip = ZipFile.Read(zipFileToCreate)) + { + zip.ExtractAll(extractDir); + Assert.IsTrue(zip.Entries.Count == 0); + } + } + + + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void Error_Read_InvalidZip() + { + string filename = zipit; + // try reading the invalid zipfile - this must fail. + using (ZipFile zip = ZipFile.Read(filename)) + { + foreach (ZipEntry e in zip) + { + System.Console.WriteLine("name: {0} compressed: {1} has password?: {2}", + e.FileName, e.CompressedSize, e.UsesEncryption); + } + } + } + + + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void Error_NonZipFile_wi11743() + { + // try reading an empty, extant file as a zip file + string zipFileToRead = Path.GetTempFileName(); + _FilesToRemove.Add(zipFileToRead); + using (ZipFile zip = new ZipFile(zipFileToRead)) + { + zip.AddEntry("EntryName1.txt", "This is the content"); + zip.Save(); + } + + } + + + private void CreateSmallZip(string zipFileToCreate) + { + string sourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + // the list of filenames to add to the zip + string[] fileNames = + { + Path.Combine(sourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(sourceDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + Path.Combine(sourceDir, "Tools\\WinFormsApp\\Icon2.res"), + }; + + using (ZipFile zip = new ZipFile()) + { + for (int j = 0; j < fileNames.Length; j++) + zip.AddFile(fileNames[j], ""); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + fileNames.Length, + "Wrong number of entries."); + } + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void MalformedZip() + { + string filePath = Path.GetTempFileName(); + _FilesToRemove.Add(filePath); + File.WriteAllText( filePath , "asdfasdf" ); + string outputDirectory = Path.GetTempPath(); + using ( ZipFile zipFile = ZipFile.Read( filePath ) ) + { + zipFile.ExtractAll( outputDirectory ); + } + } + + + + [TestMethod] + [ExpectedException(typeof(InvalidOperationException))] + public void Error_UseZipEntryExtractWith_ZIS_wi10355() + { + string zipFileToCreate = "UseOpenReaderWith_ZIS.zip"; + CreateSmallZip(zipFileToCreate); + + // mixing ZipEntry.Extract and ZipInputStream is a no-no!! + + string extractDir = "extract"; + + // Use ZipEntry.Extract with ZipInputStream. + // This must fail. + TestContext.WriteLine("Reading with ZipInputStream"); + using (var zip = new ZipInputStream(zipFileToCreate)) + { + ZipEntry entry; + while ((entry = zip.GetNextEntry()) != null) + { + entry.Extract(extractDir, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently); + } + } + } + + + + + [TestMethod] + [ExpectedException(typeof(InvalidOperationException))] + public void Error_UseOpenReaderWith_ZIS_wi10923() + { + string zipFileToCreate = "UseOpenReaderWith_ZIS.zip"; + CreateSmallZip(zipFileToCreate); + + // mixing OpenReader and ZipInputStream is a no-no!! + int n; + var buffer = new byte[2048]; + + // Use OpenReader with ZipInputStream. + // This must fail. + TestContext.WriteLine("Reading with ZipInputStream"); + using (var zip = new ZipInputStream(zipFileToCreate)) + { + ZipEntry entry; + while ((entry = zip.GetNextEntry()) != null) + { + TestContext.WriteLine(" Entry: {0}", entry.FileName); + using (Stream file = entry.OpenReader()) + { + while((n= file.Read(buffer,0,buffer.Length)) > 0) ; + } + TestContext.WriteLine(" -- OpenReader() is done. "); + } + } + } + + + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void Error_Save_InvalidLocation() + { + string badLocation = "c:\\Windows\\"; + Assert.IsTrue(Directory.Exists(badLocation)); + + // Add an entry to the zipfile, then try saving to a directory. + // This must fail. + using (ZipFile zip = new ZipFile()) + { + zip.AddEntry("This is a file.txt", "Content for the file goes here."); + zip.Save(badLocation); // fail + } + } + + + [TestMethod] + public void Error_Save_NonExistentFile() + { + int j; + string repeatedLine; + string filename; + string zipFileToCreate = Path.Combine(TopLevelDir, "Error_Save_NonExistentFile.zip"); + + // create the subdirectory + string Subdir = Path.Combine(TopLevelDir, "DirToZip"); + Directory.CreateDirectory(Subdir); + + int entriesAdded = 0; + // create the files + int numFilesToCreate = _rnd.Next(20) + 18; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(Subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(1800) + 1500); + entriesAdded++; + } + + string tempFileFolder = Path.Combine(TopLevelDir, "Temp"); + Directory.CreateDirectory(tempFileFolder); + TestContext.WriteLine("Using {0} as the temp file folder....", tempFileFolder); + String[] tfiles = Directory.GetFiles(tempFileFolder); + int nTemp = tfiles.Length; + TestContext.WriteLine("There are {0} files in the temp file folder.", nTemp); + String[] filenames = Directory.GetFiles(Subdir); + + var a1 = System.Reflection.Assembly.GetExecutingAssembly(); + String myName = a1.GetName().ToString(); + string toDay = System.DateTime.Now.ToString("yyyy-MMM-dd"); + + try + { + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + zip.TempFileFolder = tempFileFolder; + zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + + TestContext.WriteLine("Zipping {0} files...", filenames.Length); + + int count = 0; + foreach (string fn in filenames) + { + count++; + TestContext.WriteLine(" {0}", fn); + + string file = fn; + + if (count == filenames.Length - 2) + { + file += "xx"; + TestContext.WriteLine("(Injecting a failure...)"); + } + + zip.UpdateFile(file, myName + '-' + toDay + "_done"); + } + TestContext.WriteLine("\n"); + zip.Save(); + TestContext.WriteLine("Zip Completed '{0}'", zipFileToCreate); + } + } + catch (Exception ex) + { + TestContext.WriteLine("Zip Failed (EXPECTED): {0}", ex.Message); + } + + tfiles = Directory.GetFiles(tempFileFolder); + + Assert.AreEqual(nTemp, tfiles.Length, + "There are unexpected files remaining in the TempFileFolder."); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadStateException))] + public void Error_Save_NoFilename() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + Directory.SetCurrentDirectory(TopLevelDir); + string filename = Path.Combine(resourceDir, "TestStrings.txt"); + Assert.IsTrue(File.Exists(filename), String.Format("The file '{0}' doesnot exist.", filename)); + + // add an entry to the zipfile, then try saving, never having specified a filename. This should fail. + using (ZipFile zip = new ZipFile()) + { + zip.AddFile(filename, ""); + zip.Save(); // FAIL: don't know where to save! + } + + // should never reach this + Assert.IsTrue(false); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadStateException))] + public void Error_Extract_WithoutSave() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + Directory.SetCurrentDirectory(TopLevelDir); + + // add a directory to the zipfile, then try + // extracting, without a Save. This should fail. + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(resourceDir, ""); + Assert.IsTrue(zip.Entries.Count > 0); + zip[0].Extract(); // FAIL: has not been saved + } + + // should never reach this + Assert.IsTrue(false); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadStateException))] + public void Error_Read_WithoutSave() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + Directory.SetCurrentDirectory(TopLevelDir); + + // add a directory to the zipfile, then try + // extracting, without a Save. This should fail. + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(resourceDir, ""); + Assert.IsTrue(zip.Entries.Count > 0); + + using (var s = zip[0].OpenReader()) // FAIL: has not been saved + { + byte[] buffer= new byte[1024]; + int n; + while ((n= s.Read(buffer,0,buffer.Length)) > 0) ; + } + } + + // should never reach this + Assert.IsTrue(false); + } + + + [TestMethod] + [ExpectedException(typeof(System.IO.IOException))] + public void Error_AddDirectory_SpecifyingFile() + { + string zipFileToCreate = "AddDirectory_SpecifyingFile.zip"; + string filename = "ThisIsAFile"; + File.Copy(zipit, filename); + string baddirname = Path.Combine(TopLevelDir, filename); + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(baddirname); // FAIL + zip.Save(zipFileToCreate); + } + } + + + [TestMethod] + [ExpectedException(typeof(FileNotFoundException))] + public void Error_AddFile_SpecifyingDirectory() + { + string zipFileToCreate = "AddFile_SpecifyingDirectory.zip"; + string badfilename = "ThisIsADirectory.txt"; + Directory.CreateDirectory(badfilename); + + using (ZipFile zip = new ZipFile()) + { + zip.AddFile(badfilename); // should fail + zip.Save(zipFileToCreate); + } + } + + private void IntroduceCorruption(string filename) + { + // now corrupt the zip archive + using (FileStream fs = File.OpenWrite(filename)) + { + byte[] corruption = new byte[_rnd.Next(100) + 12]; + int min = 5; + int max = (int)fs.Length - 20; + int offsetForCorruption, lengthOfCorruption; + + int numCorruptions = _rnd.Next(2) + 2; + for (int i = 0; i < numCorruptions; i++) + { + _rnd.NextBytes(corruption); + offsetForCorruption = _rnd.Next(min, max); + lengthOfCorruption = _rnd.Next(2) + 3; + fs.Seek(offsetForCorruption, SeekOrigin.Begin); + fs.Write(corruption, 0, lengthOfCorruption); + } + } + } + + + [TestMethod] + [ExpectedException(typeof(ZipException))] // not sure which exception - could be one of several. + public void Error_ReadCorruptedZipFile_Passwords() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Read_CorruptedZipFile_Passwords.zip"); + string sourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + Directory.SetCurrentDirectory(TopLevelDir); + + // the list of filenames to add to the zip + string[] filenames = + { + Path.Combine(sourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(sourceDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + Path.Combine(sourceDir, "Tools\\WinFormsApp\\Icon2.res"), + }; + + // passwords to use for those entries + string[] passwords = { "12345678", "0987654321", }; + + // create the zipfile, adding the files + int j = 0; + using (ZipFile zip = new ZipFile()) + { + for (j = 0; j < filenames.Length; j++) + { + zip.Password = passwords[j % passwords.Length]; + zip.AddFile(filenames[j], ""); + } + zip.Save(zipFileToCreate); + } + + IntroduceCorruption(zipFileToCreate); + + try + { + // read the corrupted zip - this should fail in some way + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + { + ZipEntry e = zip[Path.GetFileName(filenames[j])]; + + System.Console.WriteLine("name: {0} compressed: {1} has password?: {2}", + e.FileName, e.CompressedSize, e.UsesEncryption); + Assert.IsTrue(e.UsesEncryption, "The entry does not use encryption"); + e.ExtractWithPassword("unpack", passwords[j % passwords.Length]); + } + } + } + catch (Exception exc1) + { + throw new ZipException("expected", exc1); + } + } + + + + [TestMethod] + [ExpectedException(typeof(ZipException))] // not sure which exception - could be one of several. + public void Error_ReadCorruptedZipFile() + { + int i; + string zipFileToCreate = Path.Combine(TopLevelDir, "Read_CorruptedZipFile.zip"); + + string sourceDir = CurrentDir; + for (i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + Directory.SetCurrentDirectory(TopLevelDir); + + // the list of filenames to add to the zip + string[] filenames = + { + Path.Combine(sourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(sourceDir, "Tools\\Unzip\\bin\\Debug\\Unzip.exe"), + Path.Combine(sourceDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + Path.Combine(sourceDir, "Tools\\WinFormsApp\\Icon2.res"), + }; + + // create the zipfile, adding the files + using (ZipFile zip = new ZipFile()) + { + for (i = 0; i < filenames.Length; i++) + zip.AddFile(filenames[i], ""); + zip.Save(zipFileToCreate); + } + + // now corrupt the zip archive + IntroduceCorruption(zipFileToCreate); + + try + { + // read the corrupted zip - this should fail in some way + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + foreach (var e in zip) + { + System.Console.WriteLine("name: {0} compressed: {1} has password?: {2}", + e.FileName, e.CompressedSize, e.UsesEncryption); + e.Extract("extract"); + } + } + } + catch (Exception exc1) + { + throw new ZipException("expected", exc1); + } + } + + + [TestMethod] + public void Error_LockedFile_wi13903() + { + TestContext.WriteLine("==Error_LockedFile_wi13903()"); + string fname = Path.GetRandomFileName(); + TestContext.WriteLine("create file {0}", fname); + TestUtilities.CreateAndFillFileText(fname, _rnd.Next(10000) + 5000); + string zipFileToCreate = "wi13903.zip"; + + var zipErrorHandler = new EventHandler( (sender, e) => + { + TestContext.WriteLine("Error reading entry {0}", e.CurrentEntry); + TestContext.WriteLine(" (this was expected)"); + e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; + }); + + // lock the file + TestContext.WriteLine("lock file {0}", fname); + using (var s = System.IO.File.Open(fname, + FileMode.Open, + FileAccess.Read, + FileShare.None)) + { + using (var rawOut = File.Create(zipFileToCreate)) + { + using (var nonSeekableOut = new Ionic.Zip.Tests.NonSeekableOutputStream(rawOut)) + { + TestContext.WriteLine("create zip file {0}", zipFileToCreate); + using (var zip = new ZipFile()) + { + zip.ZipError += zipErrorHandler; + zip.AddFile(fname); + // should trigger a read error, + // which should be skipped. Result will be + // a zero-entry zip file. + zip.Save(nonSeekableOut); + } + } + } + } + TestContext.WriteLine("all done, A-OK"); + } + + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void Error_Read_EmptyZipFile() + { + string zipFileToRead = Path.Combine(TopLevelDir, "Read_BadFile.zip"); + string newFile = Path.GetTempFileName(); + _FilesToRemove.Add(newFile); + File.Move(newFile, zipFileToRead); + newFile = Path.GetTempFileName(); + _FilesToRemove.Add(newFile); + string fileToAdd = Path.Combine(TopLevelDir, "EmptyFile.txt"); + File.Move(newFile, fileToAdd); + + try + { + using (ZipFile zip = ZipFile.Read(zipFileToRead)) + { + zip.AddFile(fileToAdd, ""); + zip.Save(); + } + } + catch (System.Exception exc1) + { + throw new ZipException("expected", exc1); + } + + } + + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Error_AddFile_Twice() + { + int i; + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "Error_AddFile_Twice.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "files"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFilesToCreate = _rnd.Next(23) + 14; + for (i = 0; i < numFilesToCreate; i++) + TestUtilities.CreateUniqueFile("bin", subdir, _rnd.Next(10000) + 5000); + + // Create the zip archive + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + zip1.StatusMessageTextWriter = System.Console.Out; + string[] files = Directory.GetFiles(subdir); + zip1.AddFiles(files, "files"); + zip1.Save(); + } + + + // this should fail - adding the same file twice + using (ZipFile zip2 = new ZipFile(zipFileToCreate)) + { + zip2.StatusMessageTextWriter = System.Console.Out; + string[] files = Directory.GetFiles(subdir); + for (i = 0; i < files.Length; i++) + zip2.AddFile(files[i], "files"); + zip2.Save(); + } + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Error_FileNotAvailableFails() + { + // verify the correct exception is being thrown + string zipFileToCreate = Path.Combine(TopLevelDir, "Error_FileNotAvailableFails.zip"); + + // create a zip file with no entries + using (var zipfile = new ZipFile(zipFileToCreate)) { zipfile.Save(); } + + // open and lock + using (new FileStream(zipFileToCreate, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)) + { + using (new ZipFile(zipFileToCreate)) { } + } + } + + + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void IncorrectZipContentTest1_wi10459() + { + byte[] content = Encoding.UTF8.GetBytes("wrong zipfile content"); + using (var ms = new MemoryStream(content)) + { + using (var zipFile = ZipFile.Read(ms)) { } + } + } + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void IncorrectZipContentTest2_wi10459() + { + using (var ms = new MemoryStream()) + { + using (var zipFile = ZipFile.Read(ms)) { } + } + } + + [TestMethod] + [ExpectedException(typeof(ZipException))] + public void IncorrectZipContentTest3_wi10459() + { + byte[] content = new byte[8192]; + using (var ms = new MemoryStream(content)) + { + using (var zipFile = ZipFile.Read(ms)) { } + } + } + + } +} diff --git a/dotNetZip/Zip Tests/ExtendedTests.cs b/dotNetZip/Zip Tests/ExtendedTests.cs new file mode 100644 index 0000000..9b85f01 --- /dev/null +++ b/dotNetZip/Zip Tests/ExtendedTests.cs @@ -0,0 +1,2240 @@ +// ExtendedTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 17:04:31> +// +// ------------------------------------------------------------------ +// +// This module defines some extended tests for DotNetZip. It gets into +// advanced features - file selection, encryption, and more. +// +// ------------------------------------------------------------------ + +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; + + +namespace Ionic.Zip.Tests.Extended +{ + + public class XTWFND : System.Xml.XmlTextWriter + { + public XTWFND(TextWriter w) : base(w) { Formatting = System.Xml.Formatting.Indented; } + public override void WriteStartDocument() { } + } + + /// + /// Summary description for ExtendedTests + /// + [TestClass] + public class ExtendedTests : IonicTestClass + { + public ExtendedTests() : base() { } + + + static String StreamToStringUTF8(Stream s) + { + string result = null; + // UTF-8 is the default, but I want to be explicit here. + using (var f = new StreamReader(s, System.Text.Encoding.UTF8)) + { + result = f.ReadToEnd(); + } + return result; + } + + + static bool IsEncodable(String s, Encoding e) + { + bool result = false; + try + { + byte[] b = e.GetBytes(s); + var s2 = e.GetString(b); + result = (s == s2); + } + catch + { + result = false; + } + return result; + } + + + + EncryptionAlgorithm[] crypto = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.PkzipWeak, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; + + EncryptionAlgorithm[] cryptoNoPkzip = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; + + Ionic.Zlib.CompressionLevel[] compLevels = + { + Ionic.Zlib.CompressionLevel.None, + Ionic.Zlib.CompressionLevel.BestSpeed, + Ionic.Zlib.CompressionLevel.Default, + Ionic.Zlib.CompressionLevel.BestCompression, + }; + + Zip64Option[] z64 = + { + Zip64Option.Never, + Zip64Option.AsNecessary, + Zip64Option.Always, + }; + + + + + [TestMethod] + [Timeout(22 * 60*1000)] + public void Bzip2_Perf() + { + // Verify that the parallel compress option works properly + // with BZip2. + TestContext.WriteLine("Creating the fodder files..."); + + _txrx = TestUtilities.StartProgressMonitor("BZip2PerfTest", + "BZip2 Performance Test", + "Creating files"); + var update = new Action((op,ix,sz) => { + switch(op) + { + case 0: + _txrx.Send("pb 1 max " + sz); + _txrx.Send("status Creating file " + ix); + break; + case 1: + _txrx.Send("pb 1 value " + sz); + break; + case 2: + _txrx.Send("pb 0 step"); + _txrx.Send("pb 1 value 0"); + break; + } + }); + _txrx.Send("bars 2"); + int threshold = 1024 * 1024; + int n = _rnd.Next(3) + 3; + int minSize = 0x2000000 + this._rnd.Next(0x4000000); + int maxSize = 0x2000000 + minSize + this._rnd.Next(0x80000); + string dirInZip = "files"; + string extractDir = "extract"; + string subdir = dirInZip; + _txrx.Send("pb 0 max " + n); + + var filesToZip = TestUtilities.GenerateFilesFlat(subdir, n, + minSize, maxSize, update); + var fi = new FileInfo(filesToZip[_rnd.Next(filesToZip.Length)]); + Assert.IsTrue(fi.Length > threshold, + "For file {1}, length ({0}) does not meet threshold", + fi.Name, fi.Length); + + // Get the unzip.exe tool: + string dnzDir = CurrentDir; + for (int i = 0; i < 3; i++) + dnzDir = Path.GetDirectoryName(dnzDir); + string unzip = Path.Combine(dnzDir, "Tools\\Unzip\\bin\\debug\\Unzip.exe"); + Assert.IsTrue(File.Exists(unzip), + "The unzip.exe tool is not available."); + + _txrx.Send("pb 0 max " + (4*2)); + _txrx.Send("status done creating files..."); + // two passes: once for regular, once for parallel compress + var ts = new TimeSpan[2]; + var fileSize = new Int64[2]; + for (int k=0; k < 2; k++) + { + System.Threading.Thread.Sleep(1200); + var msg = string.Format("test BZip2 perf check, cycle {0}/2 (est. time: 22 mins)",k+1); + _txrx.Send(msg); + string zipFileToCreate = "BZip2_Perf."+k+".zip"; + TestContext.WriteLine("pass {0}, Creating the zip...", k); + var stopwatch = new System.Diagnostics.Stopwatch(); + stopwatch.Start(); + + // Now, Create the zip archive with DotNetZip + _cancelIndex = -1; + using (ZipFile zip1 = new ZipFile()) + { + zip1.ParallelDeflateThreshold = (k==0) + ? -1 : threshold; + zip1.CompressionMethod = CompressionMethod.BZip2; + zip1.AddFiles(filesToZip, dirInZip); + zip1.SaveProgress += SaveProgress; + zip1.Save(zipFileToCreate); + } + stopwatch.Stop(); + ts[k] = stopwatch.Elapsed; + fi = new FileInfo(zipFileToCreate); + fileSize[k] = fi.Length; + TestContext.WriteLine("size of resulting zip: {0}k", + fileSize[k] / 1024); + + _txrx.Send("pb 0 step"); + + _txrx.Send("status verifying the number of files"); + // Verify the number of files in the zip + TestContext.WriteLine("Verifying the number of files in the zip..."); + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length, + "Incorrect number of entries in the zip file."); + + _txrx.Send("pb 0 step"); + // examine and unpack the zip archive via DNZ tools. + // Get info on the zip file: + string unzipOut = this.Exec(unzip, "-i " + zipFileToCreate); + + // Verify that the output states that the compression method + // used for each entry was BZIP2... + _txrx.Send("status checking for BZIP compression..."); + TestContext.WriteLine("Verifying that BZIP2 was used..."); + Assert.AreEqual + (TestUtilities.CountOccurrences(unzipOut, "Compression: BZip2"), n); + + _txrx.Send("pb 0 step"); + + _txrx.Send("status Extracting via infozip unzip.exe..."); + // Extract the zip. eg, unzip.exe test.zip -d + TestContext.WriteLine("Extracting via unzip.exe..."); + this.Exec(unzip, zipFileToCreate + " -d " + extractDir); + + // Verify the count of extracted files + int fileCount = Directory.GetFiles(Path.Combine(extractDir,dirInZip)).Length; + Assert.IsTrue(fileCount == n, + "Not all files were extracted? (found {0}, expected {1})", + fileCount, n); + Directory.Delete(extractDir, true); + + _txrx.Send("pb 0 step"); + } + + var delta = (ts[0].TotalSeconds - ts[1].TotalSeconds) / + (0.01 * ts[0].TotalSeconds); + TestContext.WriteLine("Parallel compression reduced compression time by {0:N1}%", + delta); + + // verify the time required for parallel compression is lower. + Assert.IsTrue(ts[1] < ts[0], + "Parallel compression took MORE time."); + + delta = Math.Abs((int)(fileSize[1]-fileSize[0])) / + (0.01 * fileSize[0]); + + Assert.IsTrue(delta < 5.0, + "Parallel compression is not within 5% of normal filesize."); + TestContext.WriteLine("A-ok"); + } + + + + + [TestMethod] + public void TestZip_IsZipFile() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "TestZip_IsZipFile.zip"); + int entriesAdded = 0; + String filename = null; + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(10) + 10; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, String.Format("FileToBeAdded-{0:D2}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subdir, Path.GetFileName(subdir)); + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + Assert.IsTrue(ZipFile.IsZipFile(zipFileToCreate), + "The IsZipFile() method returned an unexpected result for an existing zip file."); + + Assert.IsTrue(ZipFile.IsZipFile(zipFileToCreate, true), + "The IsZipFile() method returned an unexpected result for an existing zip file."); + + Assert.IsTrue(!ZipFile.IsZipFile(filename), + "The IsZipFile() method returned an unexpected result for a extant file that is not a zip."); + + filename = Path.Combine(subdir, String.Format("ThisFileDoesNotExist.{0:D2}.txt", _rnd.Next(2000))); + Assert.IsTrue(!ZipFile.IsZipFile(filename), + "The IsZipFile() method returned an unexpected result for a non-existent file."); + + } + + + [TestMethod] + public void TestZip_IsZipFile_Stream() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "TestZip_IsZipFile_Stream.zip"); + int entriesAdded = 0; + String filename = null; + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(10) + 10; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, String.Format("FileToBeAdded-{0:D2}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subdir, Path.GetFileName(subdir)); + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + using (FileStream input = File.OpenRead(zipFileToCreate)) + { + Assert.IsTrue(ZipFile.IsZipFile(input, false), + "The IsZipFile() method returned an unexpected result for an existing zip file."); + } + + using (FileStream input = File.OpenRead(zipFileToCreate)) + { + Assert.IsTrue(ZipFile.IsZipFile(input, true), + "The IsZipFile() method returned an unexpected result for an existing zip file."); + } + } + + + + + + + [TestMethod] + public void ReadZip_DirectoryBitSetForEmptyDirectories() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ReadZip_DirectoryBitSetForEmptyDirectories.zip"); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectoryByName("Directory1"); + // must retrieve with a trailing slash. + ZipEntry e1 = zip1["Directory1/"]; + Assert.AreNotEqual(null, e1); + Assert.IsTrue(e1.IsDirectory, + "The IsDirectory property was not set as expected."); + zip1.AddDirectoryByName("Directory2"); + zip1.AddEntry(Path.Combine("Directory2", "Readme.txt"), "This is the content"); + Assert.IsTrue(zip1["Directory2/"].IsDirectory, + "The IsDirectory property was not set as expected."); + zip1.Save(zipFileToCreate); + Assert.IsTrue(zip1["Directory1/"].IsDirectory, + "The IsDirectory property was not set as expected."); + } + + // read the zip and retrieve the dir entries again + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + Assert.IsTrue(zip2["Directory1/"].IsDirectory, + "The IsDirectory property was not set as expected."); + + Assert.IsTrue(zip2["Directory2/"].IsDirectory, + "The IsDirectory property was not set as expected."); + } + + // now specify dir names with backslash + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + Assert.IsTrue(zip3["Directory1\\"].IsDirectory, + "The IsDirectory property was not set as expected."); + + Assert.IsTrue(zip3["Directory2\\"].IsDirectory, + "The IsDirectory property was not set as expected."); + + Assert.IsNull(zip3["Directory1"]); + Assert.IsNull(zip3["Directory2"]); + } + + } + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Create_DuplicateEntries_wi8047() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_DuplicateEntries_wi8047.zip"); + string filename = "file.test"; + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + using (var zip = new ZipFile()) + { + int n = _rnd.Next(files.Length); + zip.UpdateFile(files[n]).FileName = filename; + int n2 = 0; + while ((n2 = _rnd.Next(files.Length)) == n) ; + zip.UpdateFile(files[n2]).FileName = filename; + zip.Save(zipFileToCreate); + } + } + + + [TestMethod] + public void Create_RenameRemoveAndRenameAgain_wi8047() + { + string filename = "file.test"; + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + for (int m = 0; m < 2; m++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Create_RenameRemoveAndRenameAgain_wi8047-{0}.zip", m)); + + using (var zip = new ZipFile()) + { + // select a single file from the list + int n = _rnd.Next(files.Length); + + // insert the selected file into the zip, and also rename it + zip.UpdateFile(files[n]).FileName = filename; + + // conditionally save + if (m > 0) zip.Save(zipFileToCreate); + + // remove the original file + zip.RemoveEntry(zip[filename]); + + // select another file from the list, making sure it is not the same file + int n2 = 0; + while ((n2 = _rnd.Next(files.Length)) == n) ; + + // insert that other file and rename it + zip.UpdateFile(files[n2]).FileName = filename; + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(1, TestUtilities.CountEntries(zipFileToCreate), "Trial {0}: The Zip file has the wrong number of entries.", m); + } + } + + + [TestMethod] + public void Create_EmitTimestampOptions() + { + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + for (int j = 0; j < 3; j++) + { + for (int k = 0; k < 3; k++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Create_EmitTimestampOptions-{0}-{1}.zip", j, k)); + using (var zip = new ZipFile()) + { + if (j == 1) zip.EmitTimesInUnixFormatWhenSaving = false; + else if (j == 2) zip.EmitTimesInUnixFormatWhenSaving = true; + + if (k == 1) zip.EmitTimesInWindowsFormatWhenSaving = false; + else if (k == 2) zip.EmitTimesInWindowsFormatWhenSaving = true; + + zip.AddFiles(files, "files"); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), "The Zip file has the wrong number of entries."); + + using (var zip = ZipFile.Read(zipFileToCreate)) + { + for (int i = 0; i < zip.Entries.Count; i++) + { + if (j == 2) + Assert.AreEqual(ZipEntryTimestamp.Unix, zip[i].Timestamp & ZipEntryTimestamp.Unix, + "Missing Unix timestamp (cycle {0},{1}) (entry {2}).", j, k, i); + else + Assert.AreEqual(ZipEntryTimestamp.None, zip[i].Timestamp & ZipEntryTimestamp.Unix, + "Unix timestamp is present when none is expected (cycle {0},{1}) (entry {2}).", j, k, i); + + if (k == 1) + Assert.AreEqual(ZipEntryTimestamp.None, zip[i].Timestamp & ZipEntryTimestamp.Windows, + "Windows timestamp is present when none is expected (cycle {0},{1}) (entry {2}).", j, k, i); + else + Assert.AreEqual(ZipEntryTimestamp.Windows, zip[i].Timestamp & ZipEntryTimestamp.Windows, + "Missing Windows timestamp (cycle {0},{1}) (entry {2}).", j, k, i); + + Assert.AreEqual(ZipEntryTimestamp.DOS, zip[i].Timestamp & ZipEntryTimestamp.DOS, + "Missing DOS timestamp (entry (cycle {0},{1}) (entry {2}).", j, k, i); + } + } + } + } + } + + + + [TestMethod] + public void Extract_AfterSaveNoDispose() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Extract_AfterSaveNoDispose.zip"); + string inputString = ""; + + using (ZipFile zip1 = new ZipFile()) + { + MemoryStream ms1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(inputString)); + zip1.AddEntry("woo\\Test.xml", ms1); + zip1.Save(zipFileToCreate); + + MemoryStream ms2 = new MemoryStream(); + zip1["Woo/Test.xml"].Extract(ms2); + ms2.Seek(0, SeekOrigin.Begin); + + var sw1 = new StringWriter(); + var w1 = new XTWFND(sw1); + + var d1 = new System.Xml.XmlDocument(); + d1.Load(ms2); + d1.Save(w1); + + var sw2 = new StringWriter(); + var w2 = new XTWFND(sw2); + var d2 = new System.Xml.XmlDocument(); + d2.Load(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(inputString))); + d2.Save(w2); + + Assert.AreEqual(sw2.ToString(), sw1.ToString(), "Unexpected value on extract ({0}).", sw1.ToString()); + } + } + + + + [TestMethod] + public void Test_AddUpdateFileFromStream() + { + string[] passwords = { null, "Password", TestUtilities.GenerateRandomPassword(), "A" }; + for (int k = 0; k < passwords.Length; k++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Test_AddUpdateFileFromStream-{0}.zip", k)); + string[] inputStrings = new string[] + { + TestUtilities.LoremIpsum.Substring(_rnd.Next(5), 170 + _rnd.Next(25)), + TestUtilities.LoremIpsum.Substring(100 + _rnd.Next(40), 180+ _rnd.Next(30)) + }; + + // add entries to a zipfile. + // use a password.(possibly null) + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = passwords[k]; + for (int i = 0; i < inputStrings.Length; i++) + { + zip1.AddEntry(String.Format("Lorem{0}.txt", i + 1), inputStrings[i]); + } + zip1.Save(zipFileToCreate); + } + + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2["Lorem2.txt"].Password = passwords[k]; + string output = StreamToStringUTF8(zip2["Lorem2.txt"].OpenReader()); + + Assert.AreEqual(output, inputStrings[1], "Trial {0}: Read entry 2 after create: Unexpected value on extract.", k); + + zip2["Lorem1.txt"].Password = passwords[k]; + Stream s = zip2["Lorem1.txt"].OpenReader(); + output = StreamToStringUTF8(s); + + Assert.AreEqual(output, inputStrings[0], "Trial {0}: Read entry 1 after create: Unexpected value on extract.", k); + } + + + // update an entry in the zipfile. For this pass, don't use a password. + string UpdateString = "This is the updated content. It will replace the original content, added from a string."; + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + var ms1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(UpdateString)); + zip3.UpdateEntry("Lorem1.txt", ms1); + zip3.Save(); + } + + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + string output = StreamToStringUTF8(zip4["Lorem1.txt"].OpenReader()); + Assert.AreEqual(output, UpdateString, "Trial {0}: Reading after update: Unexpected value on extract.", k); + } + } + } + + + + [TestMethod] + public void Test_AddEntry_String() + { + string[] passwords = { null, "Password", TestUtilities.GenerateRandomPassword(), "A" }; + + Encoding[] encodings = { Encoding.UTF8, + Encoding.Default, + Encoding.ASCII, + Encoding.GetEncoding("Big5"), + Encoding.GetEncoding("iso-8859-1"), + Encoding.GetEncoding("Windows-1252"), + }; + + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string testStringsFile = Path.Combine(testBin, "Resources\\TestStrings.txt"); + var contentStrings = File.ReadAllLines(testStringsFile); + + int[] successfulEncodings = new int[contentStrings.Length]; + + for (int a = 0; a < crypto.Length; a++) + { + for (int b = 0; b < passwords.Length; b++) + { + for (int c = 0; c < encodings.Length; c++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Test_AddEntry_String-{0}.{1}.{2}.zip", a, b, c)); + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + + // add entries to a zipfile. + // use a password.(possibly null) + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + zip1.Comment = String.Format("Test zip file.\nEncryption({0}) Pw({1}) fileEncoding({2})", + crypto[a].ToString(), + passwords[b], + encodings[c].ToString()); + zip1.Encryption = crypto[a]; + zip1.Password = passwords[b]; + for (int d = 0; d < contentStrings.Length; d++) + { + string entryName = String.Format("File{0}.txt", d + 1); + // add each string using the given encoding + zip1.AddEntry(entryName, contentStrings[d], encodings[c]); + } + zip1.Save(); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), contentStrings.Length, + "Incorrect number of entries in the zip file."); + + + + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.Password = passwords[b]; + for (int d = 0; d < contentStrings.Length; d++) + { + try + { + string entryName = String.Format("File{0}.txt", d + 1); + //zip2[entryName].Password = Passwords[b]; // should not be necessary + using (Stream s = zip2[entryName].OpenReader()) + { + using (var sr = new StreamReader(s, encodings[c])) + { + try + { + Assert.AreNotEqual(null, sr); + string retrievedContent = sr.ReadLine(); + if (IsEncodable(contentStrings[d], encodings[c])) + { + Assert.AreEqual(contentStrings[d], retrievedContent, + "encryption({0}) pw({1}) encoding({2}), contentString({3}) file({4}): the content did not match.", + a, b, c, d, entryName); + successfulEncodings[d]++; + } + else + { + Assert.AreNotEqual(Encoding.UTF8, encodings[c]); + Assert.AreNotEqual(contentStrings[d], retrievedContent, + "encryption({0}) pw({1}) encoding({2}), contentString({3}) file({4}): the content should not match, but does.", + a, b, c, d, entryName); + } + } + catch (Exception exc1) + { + TestContext.WriteLine("Exception while reading: a({0}) b({1}) c({2}) d({3})", + a, b, c, d); + throw new Exception("broken", exc1); + } + } + } + + } + catch (Exception e1) + { + TestContext.WriteLine("Exception in OpenReader: Encryption({0}) pw({1}) c({2}) d({3})", + crypto[a].ToString(), + passwords[b], + encodings[c].ToString(), + d); + + throw new Exception("broken", e1); + } + } + } + } + } + } + + for (int d = 0; d < successfulEncodings.Length; d++) + Assert.AreNotEqual(0, successfulEncodings[d], "Content item #{0} ({1}) was never encoded successfully.", d, contentStrings[d]); + + } + + + + [TestMethod] + public void Test_AddDirectoryByName() + { + for (int n = 1; n <= 10; n++) + { + var dirsAdded = new System.Collections.Generic.List(); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Test_AddDirectoryByName{0:N2}.zip", n)); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < n; i++) + { + // create an arbitrary directory name, add it to the zip archive + string dirName = TestUtilities.GenerateRandomName(24); + zip1.AddDirectoryByName(dirName); + dirsAdded.Add(dirName + "/"); + } + zip1.Save(zipFileToCreate); + } + + + int dirCount = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip2) + { + TestContext.WriteLine("dir: {0}", e.FileName); + Assert.IsTrue(dirsAdded.Contains(e.FileName), "Cannot find the expected entry"); + Assert.IsTrue(e.IsDirectory); + dirCount++; + } + } + Assert.AreEqual(n, dirCount); + } + } + + + + [TestMethod] + public void Test_AddDirectoryByName_Nested() + { + Directory.SetCurrentDirectory(TopLevelDir); + var dirsAdded = new System.Collections.Generic.List(); + string zipFileToCreate = Path.Combine(TopLevelDir, "Test_AddDirectoryByName_Nested.zip"); + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + for (int n = 1; n <= 14; n++) + { + string DirName = n.ToString(); + for (int i = 0; i < n; i++) + { + // create an arbitrary directory name, add it to the zip archive + DirName = Path.Combine(DirName, TestUtilities.GenerateRandomAsciiString(11)); + } + zip1.AddDirectoryByName(DirName); + dirsAdded.Add(DirName.Replace("\\", "/") + "/"); + } + zip1.Save(); + } + + int dirCount = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip2) + { + TestContext.WriteLine("dir: {0}", e.FileName); + Assert.IsTrue(dirsAdded.Contains(e.FileName), "Cannot find the expected directory."); + Assert.IsTrue(e.IsDirectory); + dirCount++; + } + } + Assert.AreEqual(dirsAdded.Count, dirCount); + } + + + [TestMethod] + public void Test_AddDirectoryByName_WithFiles() + { + Directory.SetCurrentDirectory(TopLevelDir); + + var dirsAdded = new System.Collections.Generic.List(); + string password = TestUtilities.GenerateRandomPassword(); + string zipFileToCreate = Path.Combine(TopLevelDir, "Test_AddDirectoryByName_WithFiles.zip"); + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + string dirName = null; + int T = 3 + _rnd.Next(4); + for (int n = 0; n < T; n++) + { + // nested directories + dirName = (n == 0) ? "root" : + Path.Combine(dirName, TestUtilities.GenerateRandomAsciiString(8)); + + zip1.AddDirectoryByName(dirName); + dirsAdded.Add(dirName.Replace("\\", "/") + "/"); + if (n % 2 == 0) zip1.Password = password; + zip1.AddEntry(Path.Combine(dirName, new System.String((char)(n + 48), 3) + ".txt"), "Hello, Dolly!"); + if (n % 2 == 0) zip1.Password = null; + } + zip1.Save(); + } + + int entryCount = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip2) + { + TestContext.WriteLine("e: {0}", e.FileName); + if (e.IsDirectory) + Assert.IsTrue(dirsAdded.Contains(e.FileName), "Cannot find the expected directory."); + else + { + if ((entryCount - 1) % 4 == 0) e.Password = password; + string output = StreamToStringUTF8(e.OpenReader()); + Assert.AreEqual("Hello, Dolly!", output); + } + entryCount++; + } + } + Assert.AreEqual(dirsAdded.Count * 2, entryCount); + } + + + + + int _progressEventCalls, _numSaving, _totalToSave, _cancelIndex, spCycles; + bool _pb2Set, _pb1Set; + + Int64 maxBytesXferred = 0; + void SaveProgress(object sender, SaveProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + if (_txrx != null) + { + _txrx.Send("status saving started..."); + _pb1Set = false; + _numSaving= 1; + } + break; + case ZipProgressEventType.Saving_BeforeWriteEntry: + if (_txrx != null) + { + _txrx.Send("status Compressing " + e.CurrentEntry.FileName); + spCycles = 0; + if (!_pb1Set) + { + _txrx.Send("pb 1 max " + e.EntriesTotal); + _pb1Set = true; + } + _totalToSave = e.EntriesTotal; + _pb2Set = false; + } + break; + case ZipProgressEventType.Saving_AfterWriteEntry: + _progressEventCalls++; + TestContext.WriteLine("{0}: {1} ({2}/{3})", e.EventType.ToString(), e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal); + if (_cancelIndex == _progressEventCalls) + { + e.Cancel = true; + TestContext.WriteLine("Cancelling..."); + } + if (_txrx != null) + { + _txrx.Send("pb 1 step"); + _numSaving++; + } + break; + + case ZipProgressEventType.Saving_EntryBytesRead: + Assert.IsTrue(e.BytesTransferred <= e.TotalBytesToTransfer, + "For entry {0}, BytesTransferred is greater than TotalBytesToTransfer: ({1} > {2})", + e.CurrentEntry.FileName, e.BytesTransferred, e.TotalBytesToTransfer); + maxBytesXferred = e.BytesTransferred; + if (_txrx!=null) + { + spCycles++; + if ((spCycles % 128) == 0) + { + if (!_pb2Set) + { + _txrx.Send("pb 2 max " + e.TotalBytesToTransfer); + _pb2Set = true; + } + _txrx.Send(String.Format("status Saving entry {0}/{1} :: {2} :: {3}/{4}mb {5:N0}%", + _numSaving, _totalToSave, + e.CurrentEntry.FileName, + e.BytesTransferred/(1024*1024), e.TotalBytesToTransfer/(1024*1024), + ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))); + _txrx.Send("pb 2 value " + e.BytesTransferred); + } + } + break; + + case ZipProgressEventType.Saving_Completed: + if (_txrx != null) + { + _txrx.Send("status Save completed"); + _pb2Set = false; + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + } + break; + + default: + break; + } + } + + bool _wasCanceled = false; + void AddProgress(object sender, AddProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Adding_AfterAddEntry: + _progressEventCalls++; + TestContext.WriteLine("{0}: {1}", e.EventType.ToString(), e.CurrentEntry.FileName); + if (_cancelIndex == _progressEventCalls) + { + e.Cancel = true; + TestContext.WriteLine("Cancelling..."); + _wasCanceled = true; + } + break; + } + } + + + void ExtractProgress(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_AfterExtractEntry: + _progressEventCalls++; + TestContext.WriteLine("Extracted: {0} ({1}/{2})", e.CurrentEntry.FileName, e.EntriesExtracted, e.EntriesTotal); + // synthetic cancellation + if (_cancelIndex == _progressEventCalls) + { + e.Cancel = true; + TestContext.WriteLine("Cancelling..."); + } + break; + + case ZipProgressEventType.Extracting_EntryBytesWritten: + maxBytesXferred = e.BytesTransferred; + break; + + default: + break; + } + } + + + [TestMethod] + public void Create_WithEvents() + { + string dirToZip = Path.Combine(TopLevelDir, "EventTest"); + Directory.CreateDirectory(dirToZip); + + var randomizerSettings = new int[] + { + 6, 4, // dircount + 7, 8, // filecount + 10000, 15000 // filesize + }; + int subdirCount = 0; + int entriesAdded = TestUtilities.GenerateFilesOneLevelDeep(TestContext, "Create_WithEvents", dirToZip, randomizerSettings, null, out subdirCount); + + for (int m = 0; m < 2; m++) + { + TestContext.WriteLine("======================================================="); + TestContext.WriteLine("Trial {0}", m); + + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Create_WithEvents-{0}.zip", m)); + string targetDirectory = Path.Combine(TopLevelDir, "unpack" + m.ToString()); + + _progressEventCalls = 0; + _cancelIndex = -1; // don't cancel this Save + + // create a zip file + using (ZipFile zip1 = new ZipFile()) + { + zip1.SaveProgress += SaveProgress; + zip1.Comment = "This is the comment on the zip archive."; + zip1.AddDirectory(dirToZip, Path.GetFileName(dirToZip)); + zip1.Save(zipFileToCreate); + } + + if (m > 0) + { + // update the zip file + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + zip1.SaveProgress += SaveProgress; + zip1.Comment = "This is the comment on the zip archive."; + zip1.AddEntry("ReadThis.txt", "This is the content for the readme file in the archive."); + zip1.Save(); + } + entriesAdded++; + } + + int expectedNumberOfProgressCalls = (entriesAdded + subdirCount) * (m + 1) + 1; + Assert.AreEqual(expectedNumberOfProgressCalls, _progressEventCalls, + "The number of progress events was unexpected ({0}!={1}).", expectedNumberOfProgressCalls, _progressEventCalls); + + _progressEventCalls = 0; + _cancelIndex = -1; // don't cancel this Extract + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.ExtractProgress += ExtractProgress; + zip2.ExtractAll(targetDirectory); + } + + Assert.AreEqual(_progressEventCalls, entriesAdded + subdirCount + 1, + "The number of Entries added is not equal to the number of entries extracted."); + + } + + } + + + + + [TestMethod] + public void CreateZip_AddDirectory_NoFilesInRoot_WI5893() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "CreateZip_AddDirectory_NoFilesInRoot_WI5893.zip"); + int i, j; + int entries = 0; + int subdirCount = _rnd.Next(5) + 5; + for (i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(TopLevelDir, "DirectoryToZip.test." + i); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(13) + 7; + for (j = 0; j < fileCount; j++) + { + String file = Path.Combine(subdir, String.Format("file{0:D3}.a", j)); + TestUtilities.CreateAndFillFile(file, _rnd.Next(100) + 500); + entries++; + } + } + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(TopLevelDir, string.Empty); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, "The Zip file has the wrong number of entries."); + } + + + [TestMethod] + public void Create_AddDirectory_NoFilesInRoot_WI5893a() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_AddDirectory_NoFilesInRoot_WI5893a.zip"); + + int i, j; + int entries = 0; + int subdirCount = _rnd.Next(4) + 4; + for (i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(TopLevelDir, "DirectoryToZip.test." + i); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(16) + 8; + for (j = 0; j < fileCount; j++) + { + String file = Path.Combine(subdir, String.Format("testfile{0:D3}.a", j)); + TestUtilities.CreateAndFillFile(file, _rnd.Next(100) + 500); + entries++; + } + } + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(TopLevelDir, string.Empty); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, "The Zip file has the wrong number of entries."); + } + + + + + [TestMethod] + public void Create_SaveCancellation() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_SaveCancellation.zip"); + + string dirToZip = Path.Combine(TopLevelDir, "EventTest"); + Directory.CreateDirectory(dirToZip); + int subdirCount = 0; + int entriesAdded = TestUtilities.GenerateFilesOneLevelDeep(TestContext, "Create_SaveCancellation", dirToZip, null, out subdirCount); + + _cancelIndex = entriesAdded - _rnd.Next(entriesAdded / 2); + _progressEventCalls = 0; + using (ZipFile zip1 = new ZipFile()) + { + zip1.SaveProgress += SaveProgress; + zip1.Comment = "The save on this zip archive will be canceled."; + zip1.AddDirectory(dirToZip, Path.GetFileName(dirToZip)); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(_progressEventCalls, _cancelIndex); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file save should have been canceled."); + } + + + [TestMethod] + public void Create_AddCancellation_wi13371() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_AddCancellation.zip"); + + string dirToZip = Path.Combine(TopLevelDir, "EventTest"); + Directory.CreateDirectory(dirToZip); + int subdirCount = 0; + int entriesAdded = TestUtilities.GenerateFilesOneLevelDeep(TestContext, "Create_AddCancellation", dirToZip, null, out subdirCount); + + _cancelIndex = entriesAdded - _rnd.Next(entriesAdded / 2); + _progressEventCalls = 0; + _wasCanceled = false; + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddProgress += AddProgress; + zip1.Comment = "The add of files into this zip archive will be canceled."; + zip1.AddDirectory(dirToZip, Path.GetFileName(dirToZip)); + if (!_wasCanceled) + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(_progressEventCalls, _cancelIndex); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file should not exist."); + } + + + + [TestMethod] + public void ExtractAll_Cancellation() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ExtractAll_Cancellation.zip"); + string targetDirectory = Path.Combine(TopLevelDir, "unpack"); + string dirToZip = Path.Combine(TopLevelDir, "EventTest"); + Directory.CreateDirectory(dirToZip); + int subdirCount = 0; + int entriesAdded = TestUtilities.GenerateFilesOneLevelDeep(TestContext, "ExtractAll_Cancellation", dirToZip, null, out subdirCount); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.Comment = "The extract on this zip archive will be canceled."; + zip1.AddDirectory(dirToZip, Path.GetFileName(dirToZip)); + zip1.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + _cancelIndex = entriesAdded - _rnd.Next(entriesAdded / 2); + _progressEventCalls = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.ExtractProgress += ExtractProgress; + zip2.ExtractAll(targetDirectory); + } + + Assert.AreEqual(_progressEventCalls, _cancelIndex); + } + + + + [TestMethod] + public void ExtractAll_WithPassword() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ExtractAll_WithPassword.zip"); + string targetDirectory = Path.Combine(TopLevelDir, "unpack"); + string dirToZip = Path.Combine(TopLevelDir, "dirToZip"); + Directory.CreateDirectory(dirToZip); + int subdirCount = 0; + + int entriesAdded = TestUtilities.GenerateFilesOneLevelDeep(TestContext, "ExtractAll_WithPassword", dirToZip, null, out subdirCount); + string password = TestUtilities.GenerateRandomPassword(); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = password; + zip1.Comment = "Brick walls are there for a reason: to let you show how badly you want your goal."; + zip1.AddDirectory(dirToZip, Path.GetFileName(dirToZip)); + zip1.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + + _cancelIndex = -1; // don't cancel this Extract + _progressEventCalls = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.Password = password; + zip2.ExtractProgress += ExtractProgress; + zip2.ExtractAll(targetDirectory); + } + + Assert.AreEqual(_progressEventCalls, entriesAdded + subdirCount + 1); + } + + + + + + [TestMethod] + public void Extract_ImplicitPassword() + { + for (int k = 0; k < compLevels.Length; k++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Extract_ImplicitPassword-{0}.zip", k)); + Directory.SetCurrentDirectory(TopLevelDir); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + string[] passwords = new string[files.Length]; + + using (ZipFile zip1 = new ZipFile()) + { + zip1.Comment = "Brick walls are there for a reason: to let you show how badly you want your goal."; + zip1.CompressionLevel = compLevels[k]; + for (int i = 0; i < files.Length; i++) + { + passwords[i] = TestUtilities.GenerateRandomPassword(); + zip1.Password = passwords[i]; + TestContext.WriteLine(" Adding entry: {0} pw({1})", files[i], passwords[i]); + zip1.AddFile(files[i], Path.GetFileName(dirToZip)); + } + zip1.Save(zipFileToCreate); + } + TestContext.WriteLine("\n"); + + // extract using the entry from the enumerator + int nExtracted = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + { + e.Password = passwords[nExtracted]; + TestContext.WriteLine(" Extracting entry: {0} pw({1})", e.FileName, passwords[nExtracted]); + e.Extract("unpack1"); + nExtracted++; + } + } + + Assert.AreEqual(files.Length, nExtracted); + + // extract using the filename indexer + nExtracted = 0; + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (var name in zip3.EntryFileNames) + { + zip3.Password = passwords[nExtracted]; + zip3[name].Extract("unpack2"); + nExtracted++; + } + } + + Assert.AreEqual(files.Length, nExtracted); + } + } + + + + [TestMethod] + public void Extract_MultiThreaded_wi6637() + { + int nConcurrentZipFiles = 5; + for (int k = 0; k < 1; k++) + { + TestContext.WriteLine("\n-----------------------------\r\n{0}: Trial {1}...", + DateTime.Now.ToString("HH:mm:ss"), + k); + + Directory.SetCurrentDirectory(TopLevelDir); + + string[] zipFileToCreate = new string[nConcurrentZipFiles]; + for (int m = 0; m < nConcurrentZipFiles; m++) + { + zipFileToCreate[m] = Path.Combine(TopLevelDir, String.Format("Extract_MultiThreaded-{0}-{1}.zip", k, m)); + TestContext.WriteLine(" Creating file: {0}", zipFileToCreate[m]); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + var files = TestUtilities.GenerateFilesFlat(dirToZip); + TestContext.WriteLine("Zipping {0} files from dir '{1}'...", files.Length, dirToZip); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.Comment = "Brick walls are there for a reason: to let you show how badly you want your goal."; + for (int i = 0; i < files.Length; i++) + { + TestContext.WriteLine(" Adding entry: {0}", files[i]); + zip1.AddFile(files[i], Path.GetFileName(dirToZip)); + } + zip1.Save(zipFileToCreate[m]); + } + TestContext.WriteLine("\n"); + BasicVerifyZip(zipFileToCreate[m]); + } + + + // multi-thread extract + foreach (string fileName in zipFileToCreate) + { + TestContext.WriteLine("queueing unzip for file: {0}", fileName); + System.Threading.ThreadPool.QueueUserWorkItem(processZip, fileName); + } + + while (completedEntries != zipFileToCreate.Length) + System.Threading.Thread.Sleep(400); + + TestContext.WriteLine("done."); + + } + } + + + + private int _completedEntries; + private int completedEntries + { + get { return _completedEntries; } + set + { + lock (this) + { + _completedEntries = value; + } + } + } + + + + private void processZip(object o) + { + string fileName = o as string; + + string zDir = Path.Combine("extract", + Path.GetFileNameWithoutExtension(fileName.ToString())); + + TestContext.WriteLine("extracting {0}...", fileName); + + using (var zFile = ZipFile.Read(fileName)) + { + zFile.ExtractAll(zDir, ExtractExistingFileAction.OverwriteSilently); + } + completedEntries++; + } + + + + + + void OverwriteDecider(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite: + // randomly choose whether to overwrite or not + e.CurrentEntry.ExtractExistingFile = (_rnd.Next(2) == 0) + ? ExtractExistingFileAction.DoNotOverwrite + : ExtractExistingFileAction.OverwriteSilently; + break; + } + } + + + + [TestMethod] + public void Extract_ExistingFile() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Extract_ExistingFile.zip"); + string sourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + Directory.SetCurrentDirectory(TopLevelDir); + + string[] filenames = + { + Path.Combine(sourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(sourceDir, "Zip\\bin\\Debug\\Ionic.Zip.dll"), + Path.Combine(sourceDir, "Zip\\bin\\Debug\\Ionic.Zip.pdb"), + Path.Combine(sourceDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + //Path.Combine(SourceDir, "AppNote.txt") + }; + + int j = 0; + using (ZipFile zip = new ZipFile()) + { + for (j = 0; j < filenames.Length; j++) + zip.AddFile(filenames[j], ""); + zip.Comment = "This is a Comment On the Archive"; + zip.Save(zipFileToCreate); + } + + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filenames.Length, + "The zip file created has the wrong number of entries."); + + TestContext.WriteLine("- - - - - - - - - - - - - - - - - - - - - - - - - - - -"); + TestContext.WriteLine("1. first extract - this should succeed"); + var options = new ReadOptions { StatusMessageWriter = new StringWriter() }; + using (ZipFile zip = ZipFile.Read(zipFileToCreate, options)) + { + for (j = 0; j < filenames.Length; j++) + { + var f = Path.GetFileName(filenames[j]); + zip[f].Extract("unpack", ExtractExistingFileAction.Throw); + } + } + TestContext.WriteLine(options.StatusMessageWriter.ToString()); + + TestContext.WriteLine("- - - - - - - - - - - - - - - - - - - - - - - - - - - -"); + TestContext.WriteLine("2. extract again - DoNotOverwrite"); + options.StatusMessageWriter = new StringWriter(); + using (ZipFile zip = ZipFile.Read(zipFileToCreate, options)) + { + for (j = 0; j < filenames.Length; j++) + { + var f = Path.GetFileName(filenames[j]); + zip[f].Extract("unpack", ExtractExistingFileAction.DoNotOverwrite); + } + } + TestContext.WriteLine(options.StatusMessageWriter.ToString()); + + TestContext.WriteLine("- - - - - - - - - - - - - - - - - - - - - - - - - - - -"); + TestContext.WriteLine("3. extract again - OverwriteSilently"); + options.StatusMessageWriter = new StringWriter(); + using (ZipFile zip = ZipFile.Read(zipFileToCreate, options)) + { + for (j = 0; j < filenames.Length; j++) + { + var f = Path.GetFileName(filenames[j]); + zip[f].Extract("unpack", ExtractExistingFileAction.OverwriteSilently); + } + } + TestContext.WriteLine(options.StatusMessageWriter.ToString()); + + TestContext.WriteLine("- - - - - - - - - - - - - - - - - - - - - - - - - - - -"); + TestContext.WriteLine("4. extract again - InvokeExtractProgressEvent"); + options.StatusMessageWriter = new StringWriter(); + using (ZipFile zip = ZipFile.Read(zipFileToCreate, options)) + { + zip.ExtractProgress += OverwriteDecider; + for (j = 0; j < filenames.Length; j++) + { + var f = Path.GetFileName(filenames[j]); + zip[f].Extract("unpack", ExtractExistingFileAction.InvokeExtractProgressEvent); + } + } + TestContext.WriteLine(options.StatusMessageWriter.ToString()); + } + + + + + [TestMethod] + public void Extended_CheckZip1() + { + string[] dirNames = { "", Path.GetFileName(Path.GetRandomFileName()) }; + + string textToEncode = + "Pay no attention to this: " + + "We've read in the regular entry header, the extra field, and any " + + "encryption header. The pointer in the file is now at the start of " + + "the filedata, which is potentially compressed and encrypted. Just " + + "ahead in the file, there are _CompressedFileDataSize bytes of data, " + + "followed by potentially a non-zero length trailer, consisting of " + + "optionally, some encryption stuff (10 byte MAC for AES), " + + "and then the bit-3 trailer (16 or 24 bytes). "; + + for (int i = 0; i < crypto.Length; i++) + { + for (int j = 0; j < z64.Length; j++) + { + for (int k = 0; k < dirNames.Length; k++) + { + string zipFile = String.Format("Extended-CheckZip1-{0}.{1}.{2}.zip", i, j, k); + string password = Path.GetRandomFileName(); + + TestContext.WriteLine("================================="); + TestContext.WriteLine("Creating {0}...", Path.GetFileName(zipFile)); + + using (var zip = new ZipFile()) + { + zip.Comment = String.Format("Encryption={0} Zip64={1} pw={2}", + crypto[i].ToString(), z64[j].ToString(), password); + if (crypto[i] != EncryptionAlgorithm.None) + { + TestContext.WriteLine("Encryption({0}) Zip64({1}) pw({2})", + crypto[i].ToString(), z64[j].ToString(), password); + zip.Encryption = crypto[i]; + zip.Password = password; + } + else + TestContext.WriteLine("Encryption({0}) Zip64({1})", + crypto[i].ToString(), z64[j].ToString()); + + zip.UseZip64WhenSaving = z64[j]; + if (!String.IsNullOrEmpty(dirNames[k])) + zip.AddDirectoryByName(dirNames[k]); + zip.AddEntry(Path.Combine(dirNames[k], "File1.txt"), textToEncode); + zip.Save(zipFile); + } + + BasicVerifyZip(zipFile, password); + TestContext.WriteLine("Checking zip..."); + using (var sw = new StringWriter()) + { + bool result = ZipFile.CheckZip(zipFile, false, sw); + Assert.IsTrue(result, "Zip ({0}) does not check OK", zipFile); + var msgs = sw.ToString().Split('\n'); + foreach (var msg in msgs) + TestContext.WriteLine("{0}", msg); + } + } + } + } + } + + + + [TestMethod] + public void Extended_CheckZip2() + { + string textToEncode = + "Pay no attention to this: " + + "We've read in the regular entry header, the extra field, and any " + + "encryption header. The pointer in the file is now at the start of " + + "the filedata, which is potentially compressed and encrypted. Just " + + "ahead in the file, there are _CompressedFileDataSize bytes of " + + "data, followed by potentially a non-zero length trailer, " + + "consisting of optionally, some encryption stuff (10 byte MAC for " + + "AES), and then the bit-3 trailer (16 or 24 bytes). " + + " " + + "The encryption can be either PKZIP 2.0 (weak) encryption, or " + + "WinZip-compatible AES encryption, which is considered to be " + + "strong and for that reason is preferred. In the WinZip AES " + + "option, there are two different keystrengths supported: 128 bits " + + "and 256 bits. " + + " " + + "The extra field, which I mentioned previously, specifies " + + "additional metadata about the entry, which is strictly-speaking, " + + "optional. These data are things like high-resolution timestamps, " + + "data sizes that exceed 2^^32, and other encryption " + + "possibilities. In each case the library that reads a zip file " + + "needs to be able to correctly deal with the various fields, " + + "validating the values within them. " + + " " + + "Now, cross all that with the variety of usage patterns - creating a " + + "zip, or reading, or extracting, or updating, or updating several " + + "times. And also, remember that the metadata may change during " + + "updates: an application can apply a password where none was used " + + "previously, or it may wish to remove an entry from the zip entirely. " + + " " + + "The huge variety of combinations of possibilities is what makes " + + "testing a zip library so challenging. " ; + + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string fileToZip = Path.Combine(testBin, "Ionic.Zip.dll"); + + for (int i = 0; i < crypto.Length; i++) + { + for (int j = 0; j < z64.Length; j++) + { + string zipFile = String.Format("Extended-CheckZip2-{0}.{1}.zip", i, j); + string password = Path.GetRandomFileName(); + + TestContext.WriteLine("================================="); + TestContext.WriteLine("Creating {0}...", Path.GetFileName(zipFile)); + + string dir = Path.GetRandomFileName(); + using (var zip = new ZipFile()) + { + zip.Comment = String.Format("Encryption={0} Zip64={1} pw={2}", + crypto[i].ToString(), z64[j].ToString(), password); + + zip.Encryption = crypto[i]; + if (crypto[i] != EncryptionAlgorithm.None) + { + TestContext.WriteLine("Encryption({0}) Zip64({1}) pw({2})", + crypto[i].ToString(), z64[j].ToString(), password); + zip.Password = password; + } + else + TestContext.WriteLine("Encryption({0}) Zip64({1})", + crypto[i].ToString(), z64[j].ToString()); + + zip.UseZip64WhenSaving = z64[j]; + int N = _rnd.Next(11) + 5; + for (int k = 0; k < N; k++) + zip.AddDirectoryByName(Path.GetRandomFileName()); + + zip.AddEntry("File1.txt", textToEncode); + zip.AddFile(fileToZip, Path.GetRandomFileName()); + zip.Save(zipFile); + } + + BasicVerifyZip(zipFile, password, false); + + TestContext.WriteLine("Checking zip..."); + + using (var sw = new StringWriter()) + { + bool result = ZipFile.CheckZip(zipFile, false, sw); + Assert.IsTrue(result, "Zip ({0}) does not check OK", zipFile); + var msgs = sw.ToString().Split('\n'); + foreach (var msg in msgs) + TestContext.WriteLine("{0}", msg); + } + TestContext.WriteLine("OK"); + TestContext.WriteLine(""); + } + } + } + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Create_DuplicateNames_DifferentFolders_wi8982_flat() + { + _Internal_DuplicateNames_DifferentFolders_wi8982(true); + } + + [TestMethod] + public void Create_DuplicateNames_DifferentFolders_wi8982_PreserveHierarchy() + { + _Internal_DuplicateNames_DifferentFolders_wi8982(false); + } + + public void _Internal_DuplicateNames_DifferentFolders_wi8982(bool flat) + { + Directory.SetCurrentDirectory(TopLevelDir); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + TestUtilities.GenerateFilesFlat(dirToZip, 3); + string subdir = Path.Combine(dirToZip, "subdir1"); + TestUtilities.GenerateFilesFlat(subdir, 2); + + for (int i = 0; i < 2; i++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Create_DuplicateNames_DifferentFolders.{0}.zip", i)); + + using (var zip = new ZipFile()) + { + zip.ZipErrorAction = ZipErrorAction.Throw; + if (i == 0) + zip.AddDirectory(dirToZip, "fodder"); + else + { + var files = Directory.GetFiles(dirToZip, "*.*", SearchOption.AllDirectories); + if (flat) + zip.AddFiles(files, "fodder"); + else + zip.AddFiles(files, true, "fodder"); + + } + + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(5, TestUtilities.CountEntries(zipFileToCreate), + "Trial {0}: The zip file created has the wrong number of entries.", i); + } + } + + + + [TestMethod] + [ExpectedException(typeof(System.IO.IOException))] + public void Create_ZipErrorAction_Throw() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_ZipErrorAction_Throw.zip"); + Directory.SetCurrentDirectory(TopLevelDir); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + int n = _rnd.Next(files.Length); + + TestContext.WriteLine("Locking file {0}...", files[n]); + using (Stream lockStream = new FileStream(files[n], FileMode.Open, FileAccess.Read, FileShare.None)) + { + using (var zip = new ZipFile()) + { + zip.ZipErrorAction = ZipErrorAction.Throw; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + } + } + + + + + + [TestMethod] + public void Create_ZipErrorAction_Skip() + { + Directory.SetCurrentDirectory(TopLevelDir); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + // m is the number of files to lock + for (int m = 1; m < 4; m++) + { + // k is the type of locking. 0 == whole file, 1 == range lock + for (int k = 0; k < 2; k++) + { + TestContext.WriteLine("Trial {0}.{1}...", m, k); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Create_ZipErrorAction_Skip-{0}-{1}.zip", m, k)); + var locked = new Dictionary(); + try + { + for (int i = 0; i < m; i++) + { + int n = 0; + do + { + n = _rnd.Next(files.Length); + } while (locked.ContainsKey(files[n])); + + TestContext.WriteLine(" Locking file {0}...", files[n]); + + FileStream lockStream = null; + if (k == 0) + { + lockStream = new FileStream(files[n], FileMode.Open, FileAccess.Read, FileShare.None); + } + else + { + lockStream = new FileStream(files[n], FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + int r = _rnd.Next((int)(lockStream.Length / 2)); + int s = _rnd.Next((int)(lockStream.Length / 2)); + lockStream.Lock(s, r); + } + + locked.Add(files[n], lockStream); + } + + using (var zip = new ZipFile()) + { + zip.ZipErrorAction = ZipErrorAction.Skip; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + + using (var zip = new ZipFile(zipFileToCreate)) + { + // Writing the info as a single block puts everything on the + // same line, makes it unreadable. So we split the strings on + // newline boundaries and write them individually. + foreach (string s in zip.Info.Split('\r', '\n')) + { + Console.WriteLine("{0}", s); + } + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(files.Length - m, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + } + finally + { + foreach (String s in locked.Keys) + { + locked[s].Close(); + } + } + + TestContext.WriteLine(" ..."); + System.Threading.Thread.Sleep(320); + } + } + } + + + + private int _retryCount; + void ErrorHandler_RetryAndEventuallySkip(object sender, ZipErrorEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Error_Saving: + _retryCount++; + if (_retryCount < 29) + e.CurrentEntry.ZipErrorAction = ZipErrorAction.Retry; + else + e.CurrentEntry.ZipErrorAction = ZipErrorAction.Skip; + break; + } + } + + void ErrorHandler_RetryAndEventuallyThrow(object sender, ZipErrorEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Error_Saving: + _retryCount++; + if (_retryCount < 29) + e.CurrentEntry.ZipErrorAction = ZipErrorAction.Retry; + else + e.CurrentEntry.ZipErrorAction = ZipErrorAction.Throw; + break; + } + } + + + + [TestMethod] + public void Create_ZipErrorAction_RetryAndEventuallySkip() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_ZipErrorAction_RetryAndEventuallySkip.zip"); + Directory.SetCurrentDirectory(TopLevelDir); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + int n = _rnd.Next(files.Length); + + TestContext.WriteLine("Locking file {0}...", files[n]); + using (Stream lockStream = new FileStream(files[n], FileMode.Open, FileAccess.Read, FileShare.None)) + { + _retryCount = 0; + using (var zip = new ZipFile()) + { + zip.ZipErrorAction = ZipErrorAction.InvokeErrorEvent; + zip.ZipError += ErrorHandler_RetryAndEventuallySkip; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(files.Length - 1, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + } + + + + [TestMethod] + [ExpectedException(typeof(System.IO.IOException))] + public void Create_ZipErrorAction_RetryAndEventuallyThrow() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_ZipErrorAction_RetryAndEventuallyThrow.zip"); + Directory.SetCurrentDirectory(TopLevelDir); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + int n = _rnd.Next(files.Length); + + TestContext.WriteLine("Locking file {0}...", files[n]); + using (Stream lockStream = new FileStream(files[n], FileMode.Open, FileAccess.Read, FileShare.None)) + { + _retryCount = 0; + using (var zip = new ZipFile()) + { + zip.ZipErrorAction = ZipErrorAction.InvokeErrorEvent; + zip.ZipError += ErrorHandler_RetryAndEventuallyThrow; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + } + } + + + private void lockFile(object state) + { + Object[] a = (Object[])state; + string filename = (string)a[0]; + int duration = (int)a[1]; + + using (Stream lockStream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.None)) + { + // hold the lock for a specified period of time + System.Threading.Thread.Sleep(duration); + } + } + + + + [TestMethod] + public void Create_ZipErrorAction_RetryAndEventuallySucceed() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_ZipErrorAction_RetryAndEventuallySucceed.zip"); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + int n = _rnd.Next(files.Length); + + TestContext.WriteLine("Locking file {0}...", files[n]); + + // This will lock the file for 3 seconds, then release it. + // The goal is to test whether the retry actually succeeds. + System.Threading.ThreadPool.QueueUserWorkItem(lockFile, new Object[] { files[n], 3000 }); + System.Threading.Thread.Sleep(200); + + _retryCount = 0; + using (var zip = new ZipFile()) + { + zip.ZipErrorAction = ZipErrorAction.Retry; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + } + + + + + + [TestMethod] + public void ParallelDeflateStream_Create() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ParallelDeflateStream_Create.zip"); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip, _rnd.Next(5) + 5, 128 * 1024 + _rnd.Next(20000)); + + using (var zip = new ZipFile()) + { + zip.ParallelDeflateThreshold = 65536; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + } + + + + [TestMethod] + public void ParallelDeflateStream_Create_CompareSpeeds() + { + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip, _rnd.Next(5) + 5, 2048 * 1024 + _rnd.Next(200000)); + + var ts = new TimeSpan[2]; + + // 2 sets of 2 cycles: first set is warmup, 2nd is timed. + // Actually they're both timed but times for the 2nd set + // overwrite the times for the 1st set. + // Within a set, the first run is non-parallel, 2nd is timed parallel. + for (int i = 0; i < 2; i++) + { + for (int j = 0; j < 2; j++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("ParallelDeflateStream_Create.{0}.{1}.zip", i, j)); + + var sw = new System.Diagnostics.Stopwatch(); + sw.Start(); + using (var zip = new ZipFile()) + { + if (j == 0) + zip.ParallelDeflateThreshold = -1L; // disable parallel deflate + else + zip.ParallelDeflateThreshold = 128 * 1024; // threshold for parallel deflating + + zip.AddFiles(files, "fodder"); + + zip.Save(zipFileToCreate); + } + sw.Stop(); + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + ts[j] = sw.Elapsed; + TestContext.WriteLine("Cycle {0},{1}, Timespan: {2}", i, j, ts[j]); + } + } + Assert.IsTrue(ts[1] < ts[0], "Parallel deflating is NOT faster than single-threaded, for large files."); + } + + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentOutOfRangeException))] + public void ParallelDeflateStream_Create_InvalidThreshold() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "ParallelDeflateStream_Create_InvalidThreshold.zip"); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip, _rnd.Next(5) + 5, 128 * 1024 + _rnd.Next(20000)); + + using (var zip = new ZipFile()) + { + zip.ParallelDeflateThreshold = 17129; + zip.AddFiles(files, "fodder"); + zip.Save(zipFileToCreate); + } + + // not reached + } + + + + + + [TestMethod] + public void CompressTiff_Level9_wi8647() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + + string tifFile = Path.Combine(testBin, "Resources\\wi8647.tif"); + Assert.IsTrue(File.Exists(tifFile), "tif file does not exist ({0})", tifFile); + + byte[] chk1 = TestUtilities.ComputeChecksum(tifFile); + string chk1String = TestUtilities.CheckSumToString(chk1); + + for (int x = 0; x < (int)(Ionic.Zlib.CompressionLevel.BestCompression); x++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, + String.Format("CompressTiff_Level9-{0}.zip", x)); + byte[] chk2 = null; + + using (var zip = new ZipFile()) + { + zip.CompressionLevel = (Ionic.Zlib.CompressionLevel)x; + zip.AddFile(tifFile, "fodder"); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(1, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + + TestContext.WriteLine("---------------Reading {0}...", zipFileToCreate); + string extractDir = String.Format("extract{0}", x); + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + var e = zip[0]; + + TestContext.WriteLine(" Entry: {0} c({1}) u({2})", + e.FileName, + e.CompressedSize, + e.UncompressedSize); + e.Extract(extractDir); + string filename = Path.Combine(extractDir, e.FileName); + chk2 = TestUtilities.ComputeChecksum(filename); + } + + string chk2String = TestUtilities.CheckSumToString(chk2); + + Assert.AreEqual(chk1String, chk2String, "Cycle {0}, Checksums for ({1}) do not match.", x, tifFile); + TestContext.WriteLine(" Cycle {0}: Checksums match ({1}).\n", x, chk1String); + } + } + + + + + [TestMethod] + [Timeout(30000)] // timeout in ms. 30000 = 30s + public void AddDirectory_ReparsePoint_wi8617() + { + _Internal_AddDirectory_ReparsePoint_wi8617(1); + } + + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void AddDirectory_ReparsePoint_wi8617_Error1() + { + _Internal_AddDirectory_ReparsePoint_wi8617(2); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void AddDirectory_ReparsePoint_wi8617_Error2() + { + _Internal_AddDirectory_ReparsePoint_wi8617(0); + } + + + private void _Internal_AddDirectory_ReparsePoint_wi8617(int flavor) + { + string zipFileToCreate = Path.Combine(TopLevelDir, + String.Format("AddDirectory_ReparsePoint-{0}.zip", + flavor)); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + string junction = Path.Combine(dirToZip, "cycle"); + Ionic.IO.JunctionPoint.Create(junction, dirToZip); + + using (var zip = new ZipFile()) + { + if (flavor == 1) + zip.AddDirectoryWillTraverseReparsePoints = false; + else if (flavor == 2) + zip.AddDirectoryWillTraverseReparsePoints = true; + // else nothing + zip.AddDirectory(dirToZip, "fodder"); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "The zip file created has the wrong number of entries."); + } + + [TestMethod] + public void ContainsEntryTest() + { + string zipFileToCreate = "ContainsEntry.zip"; + string dirToZip = "dirToZip"; + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + using (var zip = new ZipFile()) + { + zip.AddFiles(files); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate)); + using (var zip2 = ZipFile.Read(zipFileToCreate)) + { + for (int i=0; i < 28; i++) + { + int n = _rnd.Next(files.Length); + TestContext.WriteLine("Checking {0}", files[n]); + Assert.IsTrue(zip2.ContainsEntry(files[n]), "missing entry"); + } + } + } + + + [TestMethod] + public void SortedSave() + { + var rtg = new RandomTextGenerator(); + + WriteDelegate writer = (name, stream) => + { + byte[] buffer = System.Text.Encoding.ASCII.GetBytes(rtg.Generate(_rnd.Next(2000) + 200)); + stream.Write(buffer, 0, buffer.Length); + }; + + int numEntries = _rnd.Next(256) + 48; + + // Two trials, one with sorted output, and the other with non-sorted output. + for (int m = 0; m < 2; m++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, + String.Format("SortedSave-{0}.zip", m)); + using (var zip = new ZipFile()) + { + for (int i = 0; i < numEntries; i++) + { + // I need the randomness in the first part, to force the sort. + string filename = String.Format("{0}-{1:000}.txt", + TestUtilities.GenerateRandomAsciiString(6), i); + zip.AddEntry(filename, writer); + } + + zip.SortEntriesBeforeSaving = (m == 1); + zip.Save(zipFileToCreate); + } + + using (var zip = ZipFile.Read(zipFileToCreate)) + { + bool sorted = true; + for (int i = 0; i < zip.Entries.Count - 1 && sorted; i++) + { + for (int j = i; j < zip.Entries.Count && sorted; j++) + { + if (String.Compare(zip[i].FileName, zip[j].FileName, StringComparison.OrdinalIgnoreCase) > 0) + { + sorted = false; + } + } + } + + Assert.IsTrue((((m == 1) && sorted) || ((m == 0) && !sorted)), + "Unexpected sort results"); + } + } + } + + [TestMethod] + public void DoubleSave_wi10735() + { + string zipFileToCreate1 = "DoubleSave.1.zip"; + string zipFileToCreate2 = "DoubleSave.2.zip"; + string dirToZip = "dirToZip"; + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + using (var zip = new ZipFile()) + { + zip.AddFiles(files); + zip.Save(zipFileToCreate1); + zip.Save(zipFileToCreate2); + } + } + + } + +} diff --git a/dotNetZip/Zip Tests/IonicTestClass.cs b/dotNetZip/Zip Tests/IonicTestClass.cs new file mode 100644 index 0000000..52b40cc --- /dev/null +++ b/dotNetZip/Zip Tests/IonicTestClass.cs @@ -0,0 +1,550 @@ +// IonicTestClass.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-26 10:04:54> +// +// ------------------------------------------------------------------ +// +// This module defines the base class for DotNetZip test classes. +// +// ------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Net; +using System.Linq; +using System.IO; +using Ionic.Zip; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Ionic.Zip.Tests.Utilities +{ + [TestClass] + public class IonicTestClass + { + protected System.Random _rnd; + protected System.Collections.Generic.List _FilesToRemove; + protected static string CurrentDir = null; + protected string TopLevelDir = null; + private string _wzunzip = null; + private string _wzzip = null; + private string _sevenzip = null; + private string _zipit = null; + private string _infozipzip = null; + private string _infozipunzip = null; + private bool? _ZipitIsPresent; + private bool? _WinZipIsPresent; + private bool? _SevenZipIsPresent; + private bool? _InfoZipIsPresent; + + protected Ionic.CopyData.Transceiver _txrx; + + + public IonicTestClass() + { + _rnd = new System.Random(); + _FilesToRemove = new System.Collections.Generic.List(); + } + + #region Context + private TestContext testContextInstance; + + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + public TestContext TestContext + { + get + { + return testContextInstance; + } + set + { + testContextInstance = value; + } + } + + #endregion + + + + #region Test Init and Cleanup + // + // You can use the following additional attributes as you write your tests: + // + // Use ClassInitialize to run code before running the first test in the class + [ClassInitialize] + public static void BaseClassInitialize(TestContext testContext) + { + CurrentDir = Directory.GetCurrentDirectory(); + Assert.AreNotEqual(Path.GetFileName(CurrentDir), "Temp", "at startup"); + } + + // + // Use ClassCleanup to run code after all tests in a class have run + // [ClassCleanup()] + // public static void MyClassCleanup() { } + // + + + // Use TestInitialize to run code before running each test + [TestInitialize()] + public void MyTestInitialize() + { + if (CurrentDir == null) CurrentDir = Directory.GetCurrentDirectory(); + TestUtilities.Initialize(out TopLevelDir); + _FilesToRemove.Add(TopLevelDir); + Directory.SetCurrentDirectory(TopLevelDir); + } + + // Use TestCleanup to run code after each test has run + [TestCleanup()] + public void MyTestCleanup() + { + // The CWD of the monitoring process is the CurrentDir, + // therefore this test must shut down the monitoring process + // FIRST, to allow the deletion of the directory. + if (_txrx!=null) + { + try + { + _txrx.Send("stop"); + _txrx = null; + } + catch { } + } + + TestUtilities.Cleanup(CurrentDir, _FilesToRemove); + } + + #endregion + + + + internal string Exec(string program, string args) + { + return Exec(program, args, true); + } + + internal string Exec(string program, string args, bool waitForExit) + { + return Exec(program, args, waitForExit, true); + } + + internal string Exec(string program, string args, bool waitForExit, bool emitOutput) + { + if (program == null) + throw new ArgumentException("program"); + + if (args == null) + throw new ArgumentException("args"); + + // Microsoft.VisualStudio.TestTools.UnitTesting + this.TestContext.WriteLine("running command: {0} {1}", program, args); + + string output; + int rc = TestUtilities.Exec_NoContext(program, args, waitForExit, out output); + + if (rc != 0) + throw new Exception(String.Format("Non-zero RC {0}: {1}", program, output)); + + if (emitOutput) + this.TestContext.WriteLine("output: {0}", output); + else + this.TestContext.WriteLine("A-OK. (output suppressed)"); + + return output; + } + + + public class AsyncReadState + { + public System.IO.Stream s; + public byte[] buf= new byte[1024]; + } + + + internal int ExecRedirectStdOut(string program, string args, string outFile) + { + if (program == null) + throw new ArgumentException("program"); + + if (args == null) + throw new ArgumentException("args"); + + this.TestContext.WriteLine("running command: {0} {1}", program, args); + + Stream fs = File.Create(outFile); + try + { + System.Diagnostics.Process p = new System.Diagnostics.Process + { + StartInfo = + { + FileName = program, + CreateNoWindow = true, + Arguments = args, + WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true, + } + }; + + p.Start(); + + var stdout = p.StandardOutput.BaseStream; + var rs = new AsyncReadState { s = stdout }; + Action readAsync1 = null; + var readAsync = new Action( (ar) => { + AsyncReadState state = (AsyncReadState) ar.AsyncState; + int n = state.s.EndRead(ar); + if (n > 0) + { + fs.Write(state.buf, 0, n); + state.s.BeginRead(state.buf, + 0, + state.buf.Length, + new System.AsyncCallback(readAsync1), + state); + } + }); + readAsync1 = readAsync; // ?? + + // kickoff + stdout.BeginRead(rs.buf, + 0, + rs.buf.Length, + new System.AsyncCallback(readAsync), + rs); + + p.WaitForExit(); + + this.TestContext.WriteLine("Process exited, rc={0}", p.ExitCode); + + return p.ExitCode; + } + finally + { + if (fs != null) + fs.Dispose(); + } + } + + + protected string sevenZip + { + get { return SevenZipIsPresent ? _sevenzip : null; } + } + + protected string zipit + { + get { return ZipitIsPresent ? _zipit : null; } + } + + protected string infoZip + { + get { return InfoZipIsPresent ? _infozipzip : null; } + } + + protected string infoZipUnzip + { + get { return InfoZipIsPresent ? _infozipunzip : null; } + } + + protected string wzzip + { + get { return WinZipIsPresent ? _wzzip : null; } + } + + protected string wzunzip + { + get { return WinZipIsPresent ? _wzunzip : null; } + } + + protected bool ZipitIsPresent + { + get + { + if (_ZipitIsPresent == null) + { + string sourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + _zipit = + Path.Combine(sourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"); + + _ZipitIsPresent = new Nullable(File.Exists(_zipit)); + } + return _ZipitIsPresent.Value; + } + } + + protected bool WinZipIsPresent + { + get + { + if (_WinZipIsPresent == null) + { + string progfiles = null; + if (_wzunzip == null || _wzzip == null) + { + progfiles = System.Environment.GetEnvironmentVariable("ProgramFiles(x86)"); + _wzunzip = Path.Combine(progfiles, "winzip\\wzunzip.exe"); + _wzzip = Path.Combine(progfiles, "winzip\\wzzip.exe"); + } + _WinZipIsPresent = new Nullable(File.Exists(_wzunzip) && File.Exists(_wzzip)); + } + return _WinZipIsPresent.Value; + } + } + + protected bool SevenZipIsPresent + { + get + { + if (_SevenZipIsPresent == null) + { + string progfiles = null; + if (_sevenzip == null) + { + progfiles = System.Environment.GetEnvironmentVariable("ProgramFiles"); + _sevenzip = Path.Combine(progfiles, "7-zip\\7z.exe"); + } + _SevenZipIsPresent = new Nullable(File.Exists(_sevenzip)); + } + return _SevenZipIsPresent.Value; + } + } + + + protected bool InfoZipIsPresent + { + get + { + if (_InfoZipIsPresent == null) + { + string progfiles = null; + if (_infozipzip == null) + { + progfiles = System.Environment.GetEnvironmentVariable("ProgramFiles(x86)"); + _infozipzip = Path.Combine(progfiles, "infozip.org\\zip.exe"); + _infozipunzip = Path.Combine(progfiles, "infozip.org\\unzip.exe"); + } + _InfoZipIsPresent = new Nullable(File.Exists(_infozipzip) && + File.Exists(_infozipunzip)); + } + return _InfoZipIsPresent.Value; + } + } + + internal string BasicVerifyZip(string zipfile) + { + return BasicVerifyZip(zipfile, null); + } + + + internal string BasicVerifyZip(string zipfile, string password) + { + return BasicVerifyZip(zipfile, password, true); + } + + internal string BasicVerifyZip(string zipfile, string password, bool emitOutput) + { + return BasicVerifyZip(zipfile, password, emitOutput, null); + } + + + internal string BasicVerifyZip(string zipfile, string password, bool emitOutput, + EventHandler extractProgress) + { + // basic verification of the zip file - can it be extracted? + // The extraction tool will verify checksums and passwords, as appropriate +#if NOT + if (WinZipIsPresent) + { + TestContext.WriteLine("Verifying zip file {0} with WinZip", zipfile); + string args = (password == null) + ? String.Format("-t {0}", zipfile) + : String.Format("-s{0} -t {1}", password, zipfile); + + string wzunzipOut = this.Exec(wzunzip, args, true, emitOutput); + } + else +#endif + { + TestContext.WriteLine("Verifying zip file {0} with DotNetZip", zipfile); + ReadOptions options = new ReadOptions(); + if (emitOutput) + options.StatusMessageWriter = new StringWriter(); + + string extractDir = "verify"; + int c = 0; + while (Directory.Exists(extractDir + c)) c++; + extractDir += c; + + using (ZipFile zip2 = ZipFile.Read(zipfile, options)) + { + zip2.Password = password; + if (extractProgress != null) + zip2.ExtractProgress += extractProgress; + zip2.ExtractAll(extractDir); + } + // emit output, as desired + if (emitOutput) + TestContext.WriteLine("{0}",options.StatusMessageWriter.ToString()); + + return extractDir; + } + } + + + + internal static void CreateFilesAndChecksums(string subdir, + out string[] filesToZip, + out Dictionary checksums) + { + CreateFilesAndChecksums(subdir, 0, 0, out filesToZip, out checksums); + } + + + internal static void CreateFilesAndChecksums(string subdir, + int numFiles, + int baseSize, + out string[] filesToZip, + out Dictionary checksums) + { + // create a bunch of files + filesToZip = TestUtilities.GenerateFilesFlat(subdir, numFiles, baseSize); + DateTime atMidnight = new DateTime(DateTime.Now.Year, + DateTime.Now.Month, + DateTime.Now.Day); + DateTime fortyFiveDaysAgo = atMidnight - new TimeSpan(45, 0, 0, 0); + + // get checksums for each one + checksums = new Dictionary(); + + var rnd = new System.Random(); + foreach (var f in filesToZip) + { + if (rnd.Next(3) == 0) + File.SetLastWriteTime(f, fortyFiveDaysAgo); + else + File.SetLastWriteTime(f, atMidnight); + + var key = Path.GetFileName(f); + var chk = TestUtilities.ComputeChecksum(f); + checksums.Add(key, chk); + } + } + + protected static void CreateLargeFilesWithChecksums + (string subdir, + int numFiles, + Action update, + out string[] filesToZip, + out Dictionary checksums) + { + var rnd = new System.Random(); + // create a bunch of files + filesToZip = TestUtilities.GenerateFilesFlat(subdir, + numFiles, + 256 * 1024, + 3 * 1024 * 1024, + update); + + var dates = new DateTime[rnd.Next(6) + 7]; + // midnight + dates[0] = new DateTime(DateTime.Now.Year, + DateTime.Now.Month, + DateTime.Now.Day); + + for (int i=1; i < dates.Length; i++) + { + dates[i] = DateTime.Now - + new TimeSpan(rnd.Next(300), + rnd.Next(23), + rnd.Next(60), + rnd.Next(60)); + } + + // get checksums for each one + checksums = new Dictionary(); + + foreach (var f in filesToZip) + { + File.SetLastWriteTime(f, dates[rnd.Next(dates.Length)]); + var key = Path.GetFileName(f); + var chk = TestUtilities.ComputeChecksum(f); + checksums.Add(key, chk); + } + } + + + + protected void VerifyChecksums(string extractDir, + System.Collections.Generic.IEnumerable filesToCheck, + Dictionary checksums) + { + TestContext.WriteLine(""); + TestContext.WriteLine("Verify checksums..."); + int count = 0; + foreach (var fqPath in filesToCheck) + { + var f = Path.GetFileName(fqPath); + var extractedFile = Path.Combine(extractDir, f); + Assert.IsTrue(File.Exists(extractedFile), "File does not exist ({0})", extractedFile); + var chk = TestUtilities.ComputeChecksum(extractedFile); + Assert.AreEqual(TestUtilities.CheckSumToString(checksums[f]), + TestUtilities.CheckSumToString(chk), + String.Format("Checksums for file {0} do not match.", f)); + count++; + } + + if (checksums.Count < count) + { + TestContext.WriteLine("There are {0} more extracted files than checksums", count - checksums.Count); + foreach (var file in filesToCheck) + { + if (!checksums.ContainsKey(file)) + TestContext.WriteLine("Missing: {0}", Path.GetFileName(file)); + } + } + + if (checksums.Count > count) + { + TestContext.WriteLine("There are {0} more checksums than extracted files", checksums.Count - count); + foreach (var file in checksums.Keys) + { + var selection = from f in filesToCheck where Path.GetFileName(f).Equals(file) select f; + + if (selection.Count() == 0) + TestContext.WriteLine("Missing: {0}", Path.GetFileName(file)); + } + } + + + Assert.AreEqual(checksums.Count, count, "There's a mismatch between the checksums and the filesToCheck."); + } + } + + +} diff --git a/dotNetZip/Zip Tests/LongRunning.cs b/dotNetZip/Zip Tests/LongRunning.cs new file mode 100644 index 0000000..5fd7c21 --- /dev/null +++ b/dotNetZip/Zip Tests/LongRunning.cs @@ -0,0 +1,433 @@ +// LongRunning.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-June-19 21:51:30> +// +// ------------------------------------------------------------------ +// +// This module some long-running unit tests for DotNetZip: tests for +// saving very large numbers of files, very large (multi-GB) files, and so on. +// +// ------------------------------------------------------------------ + +using System; +using System.Text; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using RE = System.Text.RegularExpressions; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + +namespace Ionic.Zip.Tests.LongRunning +{ + /// + /// Summary description for LongRunning + /// + [TestClass] + public class LongRunning : IonicTestClass + { + Int64 maxBytesXferred = 0; + bool _pb1Set; + bool _pb2Set; + int _numEntriesSaved = 0; + int _numEntriesToAdd = 0; + int _numEntriesAdded = 0; + int _numFilesToExtract; + int _spCycles; + int _epCycles; + + + void LNSF_SaveProgress(object sender, Ionic.Zip.SaveProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + _numEntriesSaved = 0; + _txrx.Send("status saving started..."); + _pb1Set = false; + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + _numEntriesSaved++; + if (_numEntriesSaved % 64 == 0) + _txrx.Send(String.Format("status Compressing {0}", e.CurrentEntry.FileName)); + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", e.EntriesTotal)); + _pb1Set = true; + } + break; + + case ZipProgressEventType.Saving_EntryBytesRead: + Assert.IsTrue(e.BytesTransferred <= e.TotalBytesToTransfer); + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + _txrx.Send("pb 1 step"); + break; + + case ZipProgressEventType.Saving_Completed: + _txrx.Send("status Save completed"); + _pb1Set = false; + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + break; + } + } + + + void LNSF_AddProgress(object sender, AddProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Adding_Started: + _txrx.Send("status Adding files to the zip..."); + _pb1Set = false; + break; + + case ZipProgressEventType.Adding_AfterAddEntry: + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", _numEntriesToAdd)); + _pb1Set = true; + } + if (!e.CurrentEntry.FileName.EndsWith("/")) + { + _numEntriesAdded++; + if (_numEntriesAdded % 64 == 0) + _txrx.Send(String.Format("status Adding file {0}/{1} :: {2}", + _numEntriesAdded, _numEntriesToAdd, e.CurrentEntry.FileName)); + _txrx.Send("pb 1 step"); + } + break; + + case ZipProgressEventType.Adding_Completed: + _txrx.Send("status Added all files"); + _pb1Set = false; + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + break; + } + } + + + + + [TestMethod, Timeout(120 * 60 * 1000)] + public void CreateZip_AddDirectory_LargeNumberOfSmallFiles() + { + // start the visible progress monitor + _txrx = TestUtilities.StartProgressMonitor("LargeNumberOfSmallFiles", + "Large # of Small Files", + "Creating files"); + int max1 = 0; + Action progressUpdate = (x, y) => { + if (x == 0) + { + _txrx.Send(String.Format("pb 1 max {0}", y)); + max1 = y; + } + else if (x == 2) + { + _txrx.Send(String.Format("pb 1 value {0}", y)); + _txrx.Send(String.Format("status creating directory {0} of {1}", + y, max1)); + } + else if (x == 4) + { + _txrx.Send(String.Format("status done creating {0} files", y)); + } + }; + + int[][] settings = { + // sizes and numbers of files/directories to create + new int[] {71, 21, 97, 27, 200, 200 }, + new int[] {51, 171, 47, 197, 100, 100 }, + }; + _txrx.Send(String.Format("pb 0 max {0}", settings.Length * 2)); + TestContext.WriteLine("============================================"); + TestContext.WriteLine("Test beginning - {0}", DateTime.Now.ToString("G")); + for (int m = 0; m < settings.Length; m++) + { + string zipFileToCreate = String.Format("LrgNumOfSmallFiles-{0}.zip", m); + string dirToZip = "zipthis" + m; + Directory.CreateDirectory(dirToZip); + TestContext.WriteLine("============================================"); + TestContext.WriteLine("Creating files, cycle {0}...", m); + + int subdirCount = 0; + int entries = + TestUtilities.GenerateFilesOneLevelDeep(TestContext, + "LargeNumberOfFiles", + dirToZip, + settings[m], + progressUpdate, + out subdirCount); + _numEntriesToAdd = entries; // used in LNSF_AddProgress + _numEntriesAdded = 0; + + _txrx.Send("pb 0 step"); + TestContext.WriteLine("============================================"); + TestContext.WriteLine("Total of {0} files in {1} subdirs", + entries, subdirCount); + TestContext.WriteLine("Creating zip - {0}", DateTime.Now.ToString("G")); + Directory.SetCurrentDirectory(TopLevelDir); + _pb1Set = false; + using (ZipFile zip = new ZipFile()) + { + zip.AddProgress += LNSF_AddProgress; + zip.AddDirectory(Path.GetFileName(dirToZip)); + _txrx.Send("test Large # of Small Files"); // for good measure + zip.BufferSize = 4096; + zip.SortEntriesBeforeSaving = true; + zip.SaveProgress += LNSF_SaveProgress; + zip.Save(zipFileToCreate); + } + + _txrx.Send("pb 0 step"); + + TestContext.WriteLine("Checking zip - {0}", DateTime.Now.ToString("G")); + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries); + + _txrx.Send("status cleaning up..."); + // clean up for this cycle + Directory.Delete(dirToZip, true); + } + TestContext.WriteLine("============================================"); + TestContext.WriteLine("Test end - {0}", DateTime.Now.ToString("G")); + } + + + + void LF_SaveProgress(object sender, SaveProgressEventArgs e) + { + string msg; + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + _txrx.Send("status saving started..."); + _pb1Set = false; + //_txrx.Send(String.Format("pb1 max {0}", e.EntriesTotal)); + //_txrx.Send("pb2 max 1"); + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + _txrx.Send(String.Format("status Compressing {0}", e.CurrentEntry.FileName)); + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", e.EntriesTotal)); + _pb1Set = true; + } + _pb2Set = false; + _spCycles = 0; + break; + + case ZipProgressEventType.Saving_EntryBytesRead: + _spCycles++; + if ((_spCycles % 32) == 0) + { + if (!_pb2Set) + { + _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); + _pb2Set = true; + } + _txrx.Send(String.Format("status Saving {0} :: [{1}/{2}mb] ({3:N0}%)", + e.CurrentEntry.FileName, + e.BytesTransferred / (1024 * 1024), e.TotalBytesToTransfer / (1024 * 1024), + ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer) + )); + msg = String.Format("pb 2 value {0}", e.BytesTransferred); + _txrx.Send(msg); + Assert.IsTrue(e.BytesTransferred <= e.TotalBytesToTransfer); + } + if (maxBytesXferred < e.BytesTransferred) + maxBytesXferred = e.BytesTransferred; + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + _txrx.Send("pb 1 step"); + break; + + case ZipProgressEventType.Saving_Completed: + _txrx.Send("status Save completed"); + _pb1Set = false; + _pb2Set = false; + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + break; + } + } + + + + void LF_ExtractProgress(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_BeforeExtractEntry: + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", _numFilesToExtract)); + _pb1Set = true; + } + _pb2Set = false; + _epCycles=0; + break; + + case ZipProgressEventType.Extracting_EntryBytesWritten: + _epCycles++; + if ((_epCycles % 32) == 0) + { + if (!_pb2Set) + { + _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); + _pb2Set = true; + } + _txrx.Send(String.Format("status Extracting {0} :: [{1}/{2}mb] ({3:N0}%)", + e.CurrentEntry.FileName, + e.BytesTransferred/(1024*1024), + e.TotalBytesToTransfer/(1024*1024), + ((double)e.BytesTransferred / (0.01 * e.TotalBytesToTransfer)) + )); + string msg = String.Format("pb 2 value {0}", e.BytesTransferred); + _txrx.Send(msg); + } + if (maxBytesXferred < e.BytesTransferred) + maxBytesXferred = e.BytesTransferred; + break; + + case ZipProgressEventType.Extracting_AfterExtractEntry: + _txrx.Send("pb 1 step"); + break; + } + } + + + void InjectNoise(string fileName) + { + var finfo = new FileInfo(fileName); + var flen = finfo.Length; + var segmentSize = flen/128; + var bytes = new byte[Math.Min(segmentSize,128)]; + using (var fs = File.Open(fileName, FileMode.Open, FileAccess.ReadWrite)) + { + while (fs.Position < flen - segmentSize - 8) + { + var t = _rnd.Next((int)segmentSize) + 8; + fs.Seek(t, SeekOrigin.Current); + _rnd.NextBytes(bytes); + fs.Write(bytes, 0, bytes.Length/2+_rnd.Next(bytes.Length/2)); + } + } + } + + + + [TestMethod, Timeout(60 * 60 * 1000)] + public void LargeFile_WithProgress() + { + // This test checks the Int64 limits in progress events (Save + Extract) + TestContext.WriteLine("Test beginning {0}", System.DateTime.Now.ToString("G")); + + _txrx = TestUtilities.StartProgressMonitor("LargeFile_WithProgress", + "Large File Save and Extract", + "Creating a large file..."); + + _txrx.Send("bars 3"); + System.Threading.Thread.Sleep(120); + _txrx.Send("pb 0 max 3"); + + string zipFileToCreate = "LargeFile_WithProgress.zip"; + string unpackDir = "unpack"; + string dirToZip = "LargeFile"; + string baseName = "LargeFile.bin"; + Directory.CreateDirectory(dirToZip); + + Int64 minFileSize = 0x7FFFFFFFL + _rnd.Next(1000000); + TestContext.WriteLine("Creating a large file, size>={0}", minFileSize); + string filename = Path.Combine(dirToZip, baseName); + _txrx.Send(String.Format("pb 1 max {0}", minFileSize)); + + Action progressUpdate = (x) => + { + _txrx.Send(String.Format("pb 1 value {0}", x)); + _txrx.Send(String.Format("status Creating a large file, ({0}/{1}mb) ({2:N0}%)", + x / (1024 * 1024), minFileSize / (1024 * 1024), + ((double)x) / (0.01 * minFileSize))); + }; + + // this will take about a minute + TestUtilities.CreateAndFillFileBinaryZeroes(filename, minFileSize, progressUpdate); + + InjectNoise(filename); + + _txrx.Send("pb 0 step"); + var finfo = new FileInfo(filename); + var actualFileSize = finfo.Length; + + TestContext.WriteLine("File Create complete {0}", System.DateTime.Now.ToString("G")); + + maxBytesXferred = 0; + using (ZipFile zip1 = new ZipFile()) + { + zip1.SaveProgress += LF_SaveProgress; + zip1.Comment = "This is the comment on the zip archive."; + zip1.AddEntry("Readme.txt", "This is some content."); + zip1.AddDirectory(dirToZip, dirToZip); + zip1.BufferSize = 65536 * 8; // 512k + zip1.CodecBufferSize = 65536 * 2; // 128k + zip1.Save(zipFileToCreate); + } + + _txrx.Send("pb 0 step"); + TestContext.WriteLine("Save complete {0}", System.DateTime.Now.ToString("G")); + Assert.AreEqual(actualFileSize, maxBytesXferred); + var chk1 = TestUtilities.ComputeChecksum(filename); + + // remove the large file before extracting + Directory.Delete(dirToZip, true); + + _pb1Set = _pb2Set = false; + maxBytesXferred = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + _numFilesToExtract = zip2.Entries.Count; + zip2.ExtractProgress += LF_ExtractProgress; + zip2.BufferSize = 65536 * 8; + zip2.ExtractAll(unpackDir); + } + + _txrx.Send("pb 0 step"); + + TestContext.WriteLine("Extract complete {0}", System.DateTime.Now.ToString("G")); + Assert.AreEqual(actualFileSize, maxBytesXferred); + var exFile = Path.Combine(unpackDir, Path.Combine(dirToZip, baseName)); + var chk2 = TestUtilities.ComputeChecksum(exFile); + + string s1 = TestUtilities.CheckSumToString(chk1); + string s2 = TestUtilities.CheckSumToString(chk2); + Assert.AreEqual(s1,s2); + TestContext.WriteLine(" Checksums match ({0}).\n", s2); + TestContext.WriteLine("Test complete {0}", System.DateTime.Now.ToString("G")); + } + + + } + +} \ No newline at end of file diff --git a/dotNetZip/Zip Tests/NonSeekableOutputStream.cs b/dotNetZip/Zip Tests/NonSeekableOutputStream.cs new file mode 100644 index 0000000..8938f5e --- /dev/null +++ b/dotNetZip/Zip Tests/NonSeekableOutputStream.cs @@ -0,0 +1,101 @@ +// NonSeekableOutputStream.cs +// ------------------------------------------------------------------ +// +// Need a non-seekable output stream to test ZIP construction. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 by Dino Chiesa +// All rights reserved! +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; + + +namespace Ionic.Zip.Tests +{ + public class NonSeekableOutputStream : Stream + { + protected Stream _s; + protected bool _disposed; + + public NonSeekableOutputStream (Stream s) : base() + { + if (!s.CanWrite) + throw new NotSupportedException(); + _s = s; + } + + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException(); + } + + public override void Write(byte[] buffer, int offset, int count) + { + _s.Write(buffer, offset, count); + } + + public override bool CanRead + { + get { return false; } + } + + public override bool CanSeek + { + get { return false; } + } + + public override bool CanWrite + { + get { return true; } + } + + public override void Flush() + { + _s.Flush(); + } + + public override long Length + { + get { return _s.Length; } + } + + public override long Position + { + get { return _s.Position; } + set { _s.Position = value; } + } + + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + public override void SetLength(long value) + { + _s.SetLength(value); + } + + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this._s != null)) + this._s.Dispose(); + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + } +} diff --git a/dotNetZip/Zip Tests/PasswordTests.cs b/dotNetZip/Zip Tests/PasswordTests.cs new file mode 100644 index 0000000..72e639f --- /dev/null +++ b/dotNetZip/Zip Tests/PasswordTests.cs @@ -0,0 +1,528 @@ +// PasswordTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008-2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-06 11:23:57> +// +// ------------------------------------------------------------------ +// +// This module provides tests for password features. +// +// ------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.IO; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; + +namespace Ionic.Zip.Tests.Password +{ + [TestClass] + public class PasswordTests : IonicTestClass + { + public PasswordTests() : base() { } + + [TestMethod] + public void Password_BasicAddAndExtract() + { + int i; + string[] Passwords = { null, "Password!", TestUtilities.GenerateRandomPassword(), "A" }; + + Ionic.Zlib.CompressionLevel[] compressionLevelOptions = { + Ionic.Zlib.CompressionLevel.None, + Ionic.Zlib.CompressionLevel.BestSpeed, + Ionic.Zlib.CompressionLevel.Default, + Ionic.Zlib.CompressionLevel.BestCompression, + }; + + for (int k = 0; k < compressionLevelOptions.Length; k++) + { + for (int j = 0; j < Passwords.Length; j++) + { + TestContext.WriteLine("\n\n===================\nTrial ({0}) pw({1})", j, Passwords[j]); + string ZipFileToCreate = Path.Combine(TopLevelDir, String.Format("Password_BasicAddAndExtract-{0}-{1}.zip", k, j)); + Assert.IsFalse(File.Exists(ZipFileToCreate), "The temporary zip file '{0}' already exists.", ZipFileToCreate); + + Directory.SetCurrentDirectory(TopLevelDir); + string DirToZip = String.Format("zipthis-{0}-{1}", k, j); + Directory.CreateDirectory(DirToZip); + + TestContext.WriteLine("\n---------------------creating files and computing checksums..."); + int NumFilesToCreate = _rnd.Next(10) + 10; + string[] filenames = new string[NumFilesToCreate]; + var checksums = new Dictionary(); + for (i = 0; i < NumFilesToCreate; i++) + { + filenames[i] = Path.Combine(DirToZip, String.Format("file{0:D3}.txt", i)); + int sz = _rnd.Next(22000) + 3000; + //int sz = 1000; + var repeatedLine = String.Format("Line to Repeat... {0} {1} {2} filename: {3}", i, k, j, filenames[i]); + TestUtilities.CreateAndFillFileText(filenames[i], repeatedLine, sz); + string key = Path.GetFileName(filenames[i]); + checksums.Add(key, TestUtilities.GetCheckSumString(filenames[i])); + TestContext.WriteLine(" chk[{0}]={1}", key, checksums[key]); + } + + TestContext.WriteLine("\n---------------------adding files to the archive..."); + + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile(ZipFileToCreate, sw)) + { + zip.CompressionLevel = compressionLevelOptions[k]; + zip.Password = Passwords[j]; + zip.AddDirectory(Path.GetFileName(DirToZip)); + zip.Save(); + } + TestContext.WriteLine(sw.ToString()); + + Assert.AreEqual(TestUtilities.CountEntries(ZipFileToCreate), NumFilesToCreate, + "The Zip file has an unexpected number of entries."); + + TestContext.WriteLine("\n---------------------verifying checksums..."); + + using (ZipFile zip = ZipFile.Read(ZipFileToCreate)) + { + foreach (ZipEntry e in zip) + TestContext.WriteLine("found entry: {0}", e.FileName); + + var extractDir = String.Format("extract-{0}-{1}", k, j); + TestContext.WriteLine(" Extract with pw({0})", Passwords[j]); + foreach (ZipEntry e in zip) + { + e.ExtractWithPassword(extractDir, ExtractExistingFileAction.OverwriteSilently, Passwords[j]); + if (!e.IsDirectory) + { + byte[] c2 = TestUtilities.ComputeChecksum(Path.Combine(extractDir, e.FileName)); + Assert.AreEqual(checksums[e.FileName], + TestUtilities.CheckSumToString(c2), "The checksum of the extracted file is incorrect."); + } + } + } + TestContext.WriteLine("\n"); + } + } + } + + + + [TestMethod] + public void Password_CheckZipPassword_wi13664() + { + string[] passwords = { null, + "Password!", + TestUtilities.GenerateRandomPassword(), + "_" }; + + string dirToZip = Path.Combine(TopLevelDir, "zipthis"); + int subdirCount; + int entries = TestUtilities.GenerateFilesOneLevelDeep + (TestContext, "wi13664", dirToZip, null, out subdirCount); + string[] filesToZip = Directory.GetFiles("zipthis", "*.*", SearchOption.AllDirectories); + + Assert.AreEqual(filesToZip.Length, entries, + "Incorrect number of entries in the directory."); + + for (int j = 0; j < passwords.Length; j++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Password_CheckZipPassword_wi13664-{0}.zip", j)); + + // Create the zip archive + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = passwords[j]; + zip1.AddFiles(filesToZip, true, ""); + zip1.Save(zipFileToCreate); + } + + var r = ZipFile.CheckZipPassword(zipFileToCreate, passwords[j]); + Assert.IsTrue(r, "Bad password in round {0}", j); + } + } + + + [TestMethod] + public void Password_UnsetEncryptionAfterSetPassword_wi13909_ZOS() + { + // Verify that unsetting the Encryption property after + // setting a Password results in no encryption being used. + // This method tests ZipOutputStream. + string unusedPassword = TestUtilities.GenerateRandomPassword(); + int numTotalEntries = _rnd.Next(46)+653; + string zipFileToCreate = "UnsetEncryption.zip"; + + using (FileStream fs = File.Create(zipFileToCreate)) + { + using (var zos = new ZipOutputStream(fs)) + { + zos.Password = unusedPassword; + zos.Encryption = EncryptionAlgorithm.None; + + for (int i=0; i < numTotalEntries; i++) + { + if (_rnd.Next(7)==0) + { + string entryName = String.Format("{0:D5}/", i); + zos.PutNextEntry(entryName); + } + else + { + string entryName = String.Format("{0:D5}.txt", i); + zos.PutNextEntry(entryName); + if (_rnd.Next(12)==0) + { + var block = TestUtilities.GenerateRandomAsciiString() + " "; + string contentBuffer = String.Format("This is the content for entry {0}", i); + int n = _rnd.Next(6) + 2; + for (int j=0; j < n; j++) + contentBuffer += block; + byte[] buffer = System.Text.Encoding.ASCII.GetBytes(contentBuffer); + zos.Write(buffer, 0, buffer.Length); + } + } + } + } + } + + BasicVerifyZip(zipFileToCreate); + } + + + + [TestMethod] + public void Password_UnsetEncryptionAfterSetPassword_wi13909_ZF() + { + // Verify that unsetting the Encryption property after + // setting a Password results in no encryption being used. + // This method tests ZipFile. + string unusedPassword = TestUtilities.GenerateRandomPassword(); + int numTotalEntries = _rnd.Next(46)+653; + string zipFileToCreate = "UnsetEncryption.zip"; + + using (var zip = new ZipFile()) + { + zip.Password = unusedPassword; + zip.Encryption = EncryptionAlgorithm.None; + + for (int i=0; i < numTotalEntries; i++) + { + if (_rnd.Next(7)==0) + { + string entryName = String.Format("{0:D5}", i); + zip.AddDirectoryByName(entryName); + } + else + { + string entryName = String.Format("{0:D5}.txt", i); + if (_rnd.Next(12)==0) + { + var block = TestUtilities.GenerateRandomAsciiString() + " "; + string contentBuffer = String.Format("This is the content for entry {0}", i); + int n = _rnd.Next(6) + 2; + for (int j=0; j < n; j++) + contentBuffer += block; + byte[] buffer = System.Text.Encoding.ASCII.GetBytes(contentBuffer); + zip.AddEntry(entryName, contentBuffer); + } + else + zip.AddEntry(entryName, Stream.Null); + } + } + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void Password_CheckBadPassword_wi13668() + { + TestContext.WriteLine("Password_CheckBadPassword_wi13668()"); + // In this case, the password is "correct" but the decrypted + // header does not match the CRC. Therefore the library + // should fail this password. I don't know how the zip was + // constructed but I suspect a broken library. + string fileName = _GetNameForZipContentFile("wi13668-bad-pwd-472713.zip"); + string password = "472713"; + TestContext.WriteLine("Reading zip file: '{0}'", fileName); + using (ZipFile zip = ZipFile.Read(fileName)) + { + foreach (ZipEntry e in zip) + { + // will throw if wrong password + e.ExtractWithPassword(Stream.Null, password); + } + } + + } + + private string _GetNameForZipContentFile(string shortFileName) + { + string SourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + SourceDir = Path.GetDirectoryName(SourceDir); + + TestContext.WriteLine("Current Dir: {0}", CurrentDir); + + return Path.Combine(SourceDir, + "Zip Tests\\bin\\Debug\\zips\\" + shortFileName); + } + + + [TestMethod] + public void Password_MultipleEntriesDifferentPasswords() + { + string ZipFileToCreate = Path.Combine(TopLevelDir, "Password_MultipleEntriesDifferentPasswords.zip"); + Assert.IsFalse(File.Exists(ZipFileToCreate), "The temporary zip file '{0}' already exists.", ZipFileToCreate); + + string SourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + SourceDir = Path.GetDirectoryName(SourceDir); + + Directory.SetCurrentDirectory(TopLevelDir); + + string[] filenames = + { + Path.Combine(SourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(SourceDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + }; + + string[] checksums = + { + TestUtilities.GetCheckSumString(filenames[0]), + TestUtilities.GetCheckSumString(filenames[1]), + }; + + string[] passwords = + { + "12345678", + "0987654321", + }; + + int j = 0; + using (ZipFile zip = new ZipFile(ZipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + { + zip.Password = passwords[j]; + zip.AddFile(filenames[j], ""); + } + zip.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(ZipFileToCreate), filenames.Length, + "The zip file created has the wrong number of entries."); + + using (ZipFile zip = new ZipFile(ZipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + { + zip[Path.GetFileName(filenames[j])].ExtractWithPassword("unpack", ExtractExistingFileAction.OverwriteSilently, passwords[j]); + string newpath = Path.Combine("unpack", filenames[j]); + string chk = TestUtilities.GetCheckSumString(newpath); + Assert.AreEqual(checksums[j], chk, "File checksums do not match."); + } + } + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void Password_Extract_WrongPassword() + { + string ZipFileToCreate = Path.Combine(TopLevelDir, "MultipleEntriesDifferentPasswords.zip"); + Assert.IsFalse(File.Exists(ZipFileToCreate), "The temporary zip file '{0}' already exists.", ZipFileToCreate); + + string SourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + SourceDir = Path.GetDirectoryName(SourceDir); + + Directory.SetCurrentDirectory(TopLevelDir); + + string[] filenames = + { + Path.Combine(SourceDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(SourceDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + }; + + string[] passwords = + { + "12345678", + "0987654321", + }; + + int j = 0; + using (ZipFile zip = new ZipFile(ZipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + { + zip.Password = passwords[j]; + zip.AddFile(filenames[j], ""); + } + zip.Save(); + } + + // now try to extract + using (ZipFile zip = new ZipFile(ZipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + zip[Path.GetFileName(filenames[j])].ExtractWithPassword("unpack", ExtractExistingFileAction.OverwriteSilently, "WrongPassword"); + } + } + + + [TestMethod] + public void Password_AddEntryWithPasswordToExistingZip() + { + string zipFileToCreate = "AddEntryWithPasswordToExistingZip.zip"; + string dnzDir = CurrentDir; + for (int i = 0; i < 3; i++) + dnzDir = Path.GetDirectoryName(dnzDir); + + string[] filenames = + { + Path.Combine(dnzDir, "Tools\\Zipit\\bin\\Debug\\Zipit.exe"), + Path.Combine(dnzDir, "Zip\\bin\\Debug\\Ionic.Zip.xml"), + }; + + string[] checksums = + { + TestUtilities.GetCheckSumString(filenames[0]), + TestUtilities.GetCheckSumString(filenames[1]), + }; + + int j = 0; + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + zip.AddFile(filenames[j], ""); + zip.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 2, + "wrong number of entries."); + + string fileX = Path.Combine(dnzDir, "Tools\\Unzip\\bin\\debug\\unzip.exe"); + string checksumX = TestUtilities.GetCheckSumString(fileX); + string password = TestUtilities.GenerateRandomPassword() + "!"; + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + zip.Password = password; + zip.AddFile(fileX, ""); + zip.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 3, + "wrong number of entries."); + + string unpackDir = "unpack"; + string newpath, chk, baseName; + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + for (j = 0; j < filenames.Length; j++) + { + baseName = Path.GetFileName(filenames[j]); + zip[baseName].Extract(unpackDir, ExtractExistingFileAction.OverwriteSilently); + newpath = Path.Combine(unpackDir, filenames[j]); + chk = TestUtilities.GetCheckSumString(newpath); + Assert.AreEqual(checksums[j], chk, "Checksums do not match."); + } + + baseName = Path.GetFileName(fileX); + + zip[baseName].ExtractWithPassword(unpackDir, + ExtractExistingFileAction.OverwriteSilently, + password); + + newpath = Path.Combine(unpackDir, fileX); + chk = TestUtilities.GetCheckSumString(newpath); + Assert.AreEqual(checksumX, chk, "Checksums do not match."); + } + } + + + + + [TestMethod] + public void SilentDeletion_wi10639() + { + string zipFileToCreate = "SilentDeletion.zip"; + string dirToZip = "dirToZip"; + string extractDir = "extracted"; + string password = TestUtilities.GenerateRandomPassword(); + string wrongPassword = "passworD"; + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + TestContext.WriteLine("Creating the zip."); + using (var zip = new ZipFile()) + { + zip.Password = password; + zip.AddFiles(files, dirToZip); + zip.Save(zipFileToCreate); + } + + TestContext.WriteLine("Extract one file with wrong password."); + + // pick a random entry to extract + int ix = -1; + string extractedFile = null; + // perform two passes: first with correct password to extract the + // file. 2nd with incorrect password to see if the file is + // deleted. + + Directory.CreateDirectory(extractDir); + for (int i=0; i < 2; i++) + { + try + { + using (var zip = ZipFile.Read(zipFileToCreate)) + { + if (i==0) + { + do + { + ix = this._rnd.Next(zip.Entries.Count); + } + while (zip[ix].IsDirectory); + TestContext.WriteLine("Selected entry: {0}", zip[ix].FileName); + extractedFile = Path.Combine(extractDir, zip[ix].FileName.Replace("/","\\")); + TestContext.WriteLine("name for extracted file: {0}", extractedFile); + Assert.IsFalse(File.Exists(extractedFile), "The file exists."); + } + TestContext.WriteLine("Cycle {0}: ExtractWithPassword()", i); + zip[ix].ExtractWithPassword(extractDir, + ExtractExistingFileAction.OverwriteSilently, + (i==0)? password : wrongPassword); + } + } + catch (Ionic.Zip.BadPasswordException bpe1) + { + // only swallow exceptions on the first go-round + if (i==0) throw; + } + Assert.IsTrue(File.Exists(extractedFile), "Cycle {0}: The extracted file does not exist.", i); + } + } + + + + } + +} diff --git a/dotNetZip/Zip Tests/Progress.cs b/dotNetZip/Zip Tests/Progress.cs new file mode 100644 index 0000000..507bd83 --- /dev/null +++ b/dotNetZip/Zip Tests/Progress.cs @@ -0,0 +1,162 @@ +// Progress.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2010-January-21 11:14:35> +// +// ------------------------------------------------------------------ +// +// This module defines the tests for progress events in DotNetZip. +// +// ------------------------------------------------------------------ + + +using System; +using System.Text; +using System.Collections.Generic; +using System.Linq; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + + +namespace Ionic.Zip.Tests +{ + /// + /// Summary description for Compatibility + /// + [TestClass] + public class Progress : IonicTestClass + { + public Progress() : base() { } + + private System.Reflection.Assembly _myself; + private System.Reflection.Assembly myself + { + get + { + if (_myself == null) + { + _myself = System.Reflection.Assembly.GetExecutingAssembly(); + } + return _myself; + } + } + + + void ReadProgress1(object sender, ReadProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Reading_Started: + TestContext.WriteLine("Reading_Started"); + break; + case ZipProgressEventType.Reading_Completed: + TestContext.WriteLine("Reading_Completed"); + break; + case ZipProgressEventType.Reading_BeforeReadEntry: + TestContext.WriteLine("Reading_BeforeReadEntry"); + break; + case ZipProgressEventType.Reading_AfterReadEntry: + TestContext.WriteLine("Reading_AfterReadEntry: {0}", + e.CurrentEntry.FileName); + break; + case ZipProgressEventType.Reading_ArchiveBytesRead: + break; + } + } + + + + [TestMethod] + public void Progress_ReadFile() + { + Directory.SetCurrentDirectory(TopLevelDir); + string zipFileToCreate = Path.Combine(TopLevelDir, "Progress_ReadFile.zip"); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + using (ZipFile zip = new ZipFile()) + { + zip.AddFiles(files); + zip.Save(zipFileToCreate); + } + + int count = TestUtilities.CountEntries(zipFileToCreate); + Assert.IsTrue(count>0); + + var options = new ReadOptions { + StatusMessageWriter = new StringWriter(), + ReadProgress = ReadProgress1 + }; + using (ZipFile zip = ZipFile.Read(zipFileToCreate, options)) + { + // this should be fine + zip.RemoveEntry(zip[1]); + zip.Save(); + } + TestContext.WriteLine(options.StatusMessageWriter.ToString()); + Assert.AreEqual(count, TestUtilities.CountEntries(zipFileToCreate)+1); + } + + + void AddProgress1(object sender, AddProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Adding_Started: + TestContext.WriteLine("Adding_Started"); + break; + case ZipProgressEventType.Adding_Completed: + TestContext.WriteLine("Adding_Completed"); + break; + case ZipProgressEventType.Adding_AfterAddEntry: + TestContext.WriteLine("Adding_AfterAddEntry: {0}", + e.CurrentEntry.FileName); + break; + } + } + + + [TestMethod] + public void Progress_AddFiles() + { + Directory.SetCurrentDirectory(TopLevelDir); + string zipFileToCreate = Path.Combine(TopLevelDir, "Progress_AddFiles.zip"); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile(zipFileToCreate, sw)) + { + zip.AddProgress += AddProgress1; + zip.AddFiles(files); + zip.Save(); + } + TestContext.WriteLine(sw.ToString()); + + int count = TestUtilities.CountEntries(zipFileToCreate); + Assert.AreEqual(count, files.Length); + } + + } + + +} diff --git a/dotNetZip/Zip Tests/Properties/AssemblyInfo.cs b/dotNetZip/Zip Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2632cba Binary files /dev/null and b/dotNetZip/Zip Tests/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zip Tests/RandomTextGenerator.cs b/dotNetZip/Zip Tests/RandomTextGenerator.cs new file mode 100644 index 0000000..6c51639 --- /dev/null +++ b/dotNetZip/Zip Tests/RandomTextGenerator.cs @@ -0,0 +1,461 @@ +// RandomTextGenerator.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-13 16:37:19> +// +// ------------------------------------------------------------------ +// +// This module defines a class that generates random text sequences +// using a Markov chain. +// +// ------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Net; +using System.IO; +using Ionic.Zip; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Threading; + +namespace Ionic.Zip.Tests.Utilities +{ + + public class RandomTextGenerator + { + static string[] uris = new string[] + { + // "Through the Looking Glass", by Lewis Carroll (~181k) + "http://www.gutenberg.org/files/12/12.txt", + + // Decl of Independence (~16k) + "http://www.gutenberg.org/files/16780/16780.txt", + + // Decl of Independence, alternative source + "http://www.constitution.org/usdeclar.txt", + + // Section 552a of the US code - on privacy for individuals + "http://www.opm.gov/feddata/usc552a.txt", + + // The Naval War of 1812, by Theodore Roosevelt (968k) + "http://www.gutenberg.org/dirs/etext05/7trnv10.txt", + + // On Prayer and the Contemplative Life, by Thomas Aquinas (440k) + "http://www.gutenberg.org/files/22295/22295.txt", + + // IETF RFC 1951 - the DEFLATE format + "http://www.ietf.org/rfc/rfc1951.txt", + + // pkware's appnote + "http://www.pkware.com/documents/casestudies/APPNOTE.TXT", + }; + + SimpleMarkovChain markov; + + public RandomTextGenerator() + { + System.Random rnd = new System.Random(); + string seedText = null; + int cycles = 0; + do { + try + { + string uri= uris[rnd.Next(uris.Length)]; + seedText = GetPageMarkup(uri); + } + catch (System.Net.WebException) + { + cycles++; + if (cycles>8) throw; + seedText = null; + } + } while (seedText == null); + + markov = new SimpleMarkovChain(seedText); + } + + + public string Generate(int length) + { + return markov.GenerateText(length); + } + + + private static string GetPageMarkup(string uri) + { + string pageData = null; + using (WebClient client = new WebClient()) + { + pageData = client.DownloadString(uri); + } + return pageData; + } + } + + + /// + /// Implements a simple Markov chain for text. + /// + /// + /// + /// Uses a Markov chain starting with some base texts to produce + /// random natural-ish text. This implementation is based on Pike's + /// perl implementation, see + /// http://cm.bell-labs.com/cm/cs/tpop/markov.pl + /// + public class SimpleMarkovChain + { + Dictionary> table = new Dictionary>(); + System.Random rnd = new System.Random(); + + public SimpleMarkovChain(string seed) + { + string NEWLINE = "\n"; + string key = NEWLINE; + var sr = new StringReader(seed); + string line; + while ((line = sr.ReadLine()) != null) + { + foreach (var word in line.SplitByWords()) + { + var w = (word == "") ? NEWLINE : word; // newline + if (word == "\r") w = NEWLINE; + + if (!table.ContainsKey(key)) table.Add(key, new List()); + table[key].Add(w); + key = w.ToLower().TrimPunctuation(); + } + } + if (!table.ContainsKey(key)) table.Add(key, new List()); + table[key].Add(NEWLINE); + key = NEWLINE; + } + + + internal void Diag() + { + Console.WriteLine("There are {0} keys in the table", table.Keys.Count); + foreach (string s in table.Keys) + { + string x = s.Replace("\n", "�"); + var y = table[s].ToArray(); + Console.WriteLine(" {0}: {1}", x, String.Join(", ", y)); + } + } + + internal void ShowList(string word) + { + string x = word.Replace("\n", "�"); + if (table.ContainsKey(word)) + { + var y = table[word].ToArray(); + var z = Array.ConvertAll(y, x1 => x1.Replace("\n", "�")); + Console.WriteLine(" {0}: {1}", x, String.Join(", ", z)); + } + else + Console.WriteLine(" {0}: -key not found-", x); + } + + private List _keywords; + private List keywords + { + get + { + if (_keywords == null) + _keywords = new List(table.Keys); + return _keywords; + } + } + + /// + /// Generates random text with a minimum character length. + /// + /// + /// + /// The minimum length of text, in characters, to produce. + /// + public string GenerateText(int minimumLength) + { + var chosenStartWord = keywords[rnd.Next(keywords.Count)]; + return _InternalGenerate(chosenStartWord, StopCriterion.NumberOfChars, minimumLength); + } + + /// + /// Generates random text with a minimum character length. + /// + /// + /// + /// The first sentence will start with the given start word. + /// + /// + /// + /// The minimum length of text, in characters, to produce. + /// + /// + /// The word to start with. If this word does not exist in the + /// seed text, the generation will fail. + /// + /// + /// + /// + public string GenerateText(string start, int minimumLength) + { + return _InternalGenerate(start, StopCriterion.NumberOfChars, minimumLength); + } + + /// + /// Generate random text with a minimum number of words. + /// + /// + /// + /// The first sentence will start with the given start word. + /// + /// + /// + /// The minimum number of words of text to produce. + /// + /// + /// The word to start with. If this word does not exist in the + /// seed text, the generation will fail. + /// + /// + /// + /// + public string GenerateWords(string start, int minimumWords) + { + return _InternalGenerate(start, StopCriterion.NumberOfWords, minimumWords); + } + + + /// + /// Generate random text with a minimum number of words. + /// + /// + /// + /// The minimum number of words of text to produce. + /// + /// + /// + public string GenerateWords(int minimumWords) + { + var chosenStartWord = keywords[rnd.Next(keywords.Count)]; + return _InternalGenerate(chosenStartWord, StopCriterion.NumberOfWords, minimumWords); + } + + + private string _InternalGenerate(string start, StopCriterion crit, int limit) + { + string w1 = start.ToLower(); + StringBuilder sb = new StringBuilder(); + sb.Append(start.Capitalize()); + + int consecutiveNewLines = 0; + string word = null; + string priorWord = null; + + // About the stop criteria: + // we keep going til we reach the specified number of words or chars, with the added + // proviso that we have to complete the in-flight sentence when the limit is reached. + + for (int i = 0; + (crit == StopCriterion.NumberOfWords && i < limit) || + (crit == StopCriterion.NumberOfChars && sb.Length < limit) || + consecutiveNewLines == 0; + i++) + { + if (table.ContainsKey(w1)) + { + var list = table[w1]; + int ix = rnd.Next(list.Count); + priorWord = word; + word = list[ix]; + if (word != "\n") + { + // capitalize + if (consecutiveNewLines > 0) + sb.Append(word.Capitalize()); + else + sb.Append(" ").Append(word); + + // words that end sentences get a newline + if (word.EndsWith(".")) + { + if (consecutiveNewLines == 0 || consecutiveNewLines == 1) + sb.Append("\n"); + consecutiveNewLines++; + } + else consecutiveNewLines = 0; + } + w1 = word.ToLower().TrimPunctuation(); + } + } + return sb.ToString(); + } + + + + private enum StopCriterion + { + NumberOfWords, + NumberOfChars + } + + } + + + + public class RandomTextInputStream : Stream + { + RandomTextGenerator _rtg; + Int64 _desiredLength; + Int64 _bytesRead; + System.Text.Encoding _encoding; + byte[][] _randomText; + System.Random _rnd; + int _gnt; + byte[] src = null; + private static readonly int _chunkSize = 1024 * 128; + private static readonly int _chunks = 48; + + public RandomTextInputStream(Int64 length) + : this(length, System.Text.Encoding.GetEncoding("ascii")) + { + } + + public RandomTextInputStream(Int64 length, System.Text.Encoding encoding) + : base() + { + _desiredLength = length; + _rtg = new RandomTextGenerator(); + _encoding = encoding; + _randomText = new byte[_chunks][]; + _rnd = new System.Random(); + } + + /// + /// for diagnostic purposes only + /// + public int GetNewTextCount + { + get + { + return _gnt; + } + } + + new public void Dispose() + { + Dispose(true); + } + + /// The Dispose method + protected override void Dispose(bool disposeManagedResources) + { + } + + private byte[] GetNewText() + { + _gnt++; + int nowServing = _rnd.Next(_chunks); + if (_randomText[nowServing]==null) + _randomText[nowServing] = _encoding.GetBytes(_rtg.Generate(_chunkSize)); + return _randomText[nowServing]; + } + + public Int64 BytesRead + { + get { return _bytesRead; } + } + + public override int Read(byte[] buffer, int offset, int count) + { + int bytesToReadThisTime = count; + if (_desiredLength - _bytesRead < bytesToReadThisTime) + bytesToReadThisTime = unchecked((int)(_desiredLength - _bytesRead)); + + int bytesToRead = bytesToReadThisTime; + while (bytesToRead > 0) + { + src = GetNewText(); + int bytesAvailable = src.Length; + int chunksize = (bytesToRead > bytesAvailable) + ? bytesAvailable + : bytesToRead; + + Buffer.BlockCopy(src, 0, buffer, offset, chunksize); + bytesToRead -= chunksize; + offset += chunksize; + } + _bytesRead += bytesToReadThisTime; + return bytesToReadThisTime; + } + + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException(); + } + + public override bool CanRead + { + get { return true; } + } + public override bool CanSeek + { + get { return false; } + } + + public override bool CanWrite + { + get { return false; } + } + + public override long Length + { + get { return _desiredLength; } + } + + public override long Position + { + get { return _desiredLength - _bytesRead; } + set + { + throw new NotSupportedException(); + } + } + + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + public override void SetLength(long value) + { + if (value < _bytesRead) + throw new NotSupportedException(); + _desiredLength = value; + } + + public override void Flush() + { + } + } + + + +} diff --git a/dotNetZip/Zip Tests/Resources/AspNetHost.exe b/dotNetZip/Zip Tests/Resources/AspNetHost.exe new file mode 100644 index 0000000..ef897bd Binary files /dev/null and b/dotNetZip/Zip Tests/Resources/AspNetHost.exe differ diff --git a/dotNetZip/Zip Tests/Resources/CreateZip.pl b/dotNetZip/Zip Tests/Resources/CreateZip.pl new file mode 100644 index 0000000..f333f5d --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/CreateZip.pl @@ -0,0 +1,31 @@ +use strict; +use IO::Compress::Zip qw(:all); + +my $dir = $ARGV[1]; +opendir(DIR, $dir) or die $!; + +my @files = (); + +while (my $file = readdir(DIR)) { + + # We only want files + next unless (-f "$dir/$file"); + + # Use a regular expression to find files ending in .txt + next unless ($file =~ m/^[^\.]/); + + push(@files, "$dir\\$file"); +} + +closedir(DIR); + + +##my @files = grep { /^[^\.]/ } readdir(DIR); + +foreach my $file2 (@files) { + print "$file2\n"; +} + + +zip \@files => $ARGV[0] + or die "Cannot create zip file: $ZipError\n"; diff --git a/dotNetZip/Zip Tests/Resources/GenerateZip-Cs.aspx b/dotNetZip/Zip Tests/Resources/GenerateZip-Cs.aspx new file mode 100644 index 0000000..eca7bd4 --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/GenerateZip-Cs.aspx @@ -0,0 +1,125 @@ +<%@ Page + Language="C#" + EnableViewState="False" + Debug="True" +%> + + +<%@ Import Namespace="System.Text" %> +<%@ Import Namespace="System.IO" %> +<%@ Import Namespace="System.Linq" %> +<%@ Import Namespace="Ionic.Zip" %> +<%@ Import Namespace="System.Collections.Generic" %> + + + + + + + + + + + + +
+ +

Zip Files from ASP.NET

+ +

This page uses the .NET Zip library (see http://DotNetZip.codeplex.com) + to dynamically create a zip archive, and then send it to the + browser through Response.OutputStream.

+ + +
+ +

To generate a zip file, + specify a fodder file in the "file" parameter of the query + string. Choose from one of these:

+
+
+ + + + + + +
+
+ + + + + + + + + +
Nothing to see here...
+
+ +
+ + + + + + + + diff --git a/dotNetZip/Zip Tests/Resources/Ionic.CopyData.dll b/dotNetZip/Zip Tests/Resources/Ionic.CopyData.dll new file mode 100644 index 0000000..dd5ab36 Binary files /dev/null and b/dotNetZip/Zip Tests/Resources/Ionic.CopyData.dll differ diff --git a/dotNetZip/Zip Tests/Resources/Ionic.IO.JunctionPoint.dll b/dotNetZip/Zip Tests/Resources/Ionic.IO.JunctionPoint.dll new file mode 100644 index 0000000..57327d6 Binary files /dev/null and b/dotNetZip/Zip Tests/Resources/Ionic.IO.JunctionPoint.dll differ diff --git a/dotNetZip/Zip Tests/Resources/TestCheckZip.js b/dotNetZip/Zip Tests/Resources/TestCheckZip.js new file mode 100644 index 0000000..84b5e41 --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/TestCheckZip.js @@ -0,0 +1,71 @@ +// TestCheckZip.js +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-September-08 23:09:56> +// +// ------------------------------------------------------------------ +// +// This is a script file that calls into the static ZipFile.CheckZip +// method via the ComHelper class. This script is used for +// compatibility testing of the DotNetZip output. +// +// created Tue, 08 Sep 2009 22:11 +// +// ------------------------------------------------------------------ + + + +function checkZip(filename) +{ + var obj = new ActiveXObject("Ionic.Zip.ComHelper"); + return obj.IsZipFile(filename); +} + +function checkZipWithExtract(filename) +{ + var obj = new ActiveXObject("Ionic.Zip.ComHelper"); + return obj.IsZipFileWithExtract(filename); +} + + +function main() +{ + var result; + var args = WScript.Arguments; + + if (args.Length == 1) + { + result = checkZip(args(0)); + } + else if (args.Length == 2 && args(0) == "-x") + { + result = checkZipWithExtract(args(1)); + } + else + { + WScript.Echo("TestCheckZip.js - check a zipfile using Javascript."); + WScript.Echo(" usage: TestCheckZip.js [-x] "); + WScript.Quit(1); + } + + WScript.Echo((result==0)?"That zip is not OK":"That zip is OK"); + WScript.Quit(0); +} + + +main(); + diff --git a/dotNetZip/Zip Tests/Resources/TestCheckZipPassword.js b/dotNetZip/Zip Tests/Resources/TestCheckZipPassword.js new file mode 100644 index 0000000..d9a155d --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/TestCheckZipPassword.js @@ -0,0 +1,56 @@ +// TestCheckZip.js +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved: <2011-June-13 17:04:58> +// +// ------------------------------------------------------------------ +// +// This is a script file that calls into the static ZipFile.CheckZipPassword +// method via the ComHelper class. This script is used for +// compatibility testing of the DotNetZip output. +// +// created Mon, 13 Jun 2011 16:50 +// +// ------------------------------------------------------------------ + + + +function checkZipPassword(filename, passwd) { + var obj = new ActiveXObject("Ionic.Zip.ComHelper"); + return obj.CheckZipPassword(filename, passwd); +} + + +function main() { + var result; + var args = WScript.Arguments; + + if (args.Length == 2) { + result = checkZipPassword(args(0), args(1)); + } + else { + WScript.Echo("TestCheckZipPassword.js - check a zipfile using Javascript."); + WScript.Echo(" usage: TestCheckZipPassword.js "); + WScript.Quit(1); + } + + WScript.Echo((result==0)?"That zip is not OK":"That zip is OK"); + WScript.Quit(0); +} + + +main(); + diff --git a/dotNetZip/Zip Tests/Resources/TestStrings.txt b/dotNetZip/Zip Tests/Resources/TestStrings.txt new file mode 100644 index 0000000..7a6aba7 --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/TestStrings.txt @@ -0,0 +1,7 @@ +This file contains test strings to be stuffed into entries in zip files. Each line will be placed into a separate file. +Note: The file must end in a newline. +过去一周,业界可谓是大事连连,2009 JavaOne大会和谷歌开发者日大会相继举行,微软正式推出新搜索引擎品牌Bing,受到业界极大关注。当然最火热的还是智能手机领域,本周又有三家重头公司宣布对手机市场进行开拓和布局。 +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer vulputate, nibh non rhoncus euismod, erat odio pellentesque lacus, sit amet convallis mi augue et odio. Phasellus cursus urna facilisis quam. Suspendisse nec metus et sapien scelerisque euismod. Nullam molestie sem quis nisl. Fusce pellentesque, ante sed semper egestas, sem nulla vestibulum nulla, quis sollicitudin leo lorem elementum wisi. Aliquam vestibulum nonummy orci. Sed in dolor sed enim ullamcorper accumsan. Duis vel nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Sed faucibus, enim sit amet venenatis laoreet, nisl elit posuere est, ut sollicitudin tortor velit ut ipsum. Aliquam erat volutpat. Phasellus tincidunt vehicula eros. Curabitur vitae erat. +¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ +Cyrillic - А Б В Г Д Є Ж Ѕ З И І К Л М Н О П Р +Greek - Ελληνικό αλφάβητο diff --git a/dotNetZip/Zip Tests/Resources/UnitTestProgressMonitor.exe b/dotNetZip/Zip Tests/Resources/UnitTestProgressMonitor.exe new file mode 100644 index 0000000..268bb5b Binary files /dev/null and b/dotNetZip/Zip Tests/Resources/UnitTestProgressMonitor.exe differ diff --git a/dotNetZip/Zip Tests/Resources/VbsCreateZip-DotNetZip.vbs b/dotNetZip/Zip Tests/Resources/VbsCreateZip-DotNetZip.vbs new file mode 100644 index 0000000..f49411c --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/VbsCreateZip-DotNetZip.vbs @@ -0,0 +1,112 @@ +' VbsCreateZip-DotNetZip.vbs +' ------------------------------------------------------------------ +' +' Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +' All rights reserved. +' +' This code module is part of DotNetZip, a zipfile class library. +' +' ------------------------------------------------------------------ +' +' This code is licensed under the Microsoft Public License. +' See the file License.txt for the license details. +' More info on: http://dotnetzip.codeplex.com +' +' ------------------------------------------------------------------ +' +' last saved (in emacs): +' Time-stamp: <2009-May-30 06:23:21> +' +' ------------------------------------------------------------------ +' +' This is a script file that creates a zip file from a specified directory. +' It uses the Shell.Application object to do the zipping. +' This script is used for compatibility testing of the DotNetZip output. +' +' created Fri, 29 May 2009 +' +' ------------------------------------------------------------------ + +Dim filename +Dim dirToZip +Dim password +Dim extractLocation + + + +Sub CreateZip(pathToZipFile, dirToZip) + + WScript.Echo "Creating zip (" & pathToZipFile & ") from (" & dirToZip & ")" + + Dim fso + Set fso= Wscript.CreateObject("Scripting.FileSystemObject") + + If fso.FileExists(pathToZipFile) Then + WScript.Echo "That zip file already exists - deleting it." + fso.DeleteFile pathToZipFile + End If + + If Not fso.FolderExists(dirToZip) Then + WScript.Echo "The directory to zip does not exist." + Exit Sub + End If + + WScript.echo("") + WScript.echo("Instantiating a ZipFile Object...") + + Dim zip1 + Set zip1 = CreateObject("Ionic.Zip.ZipFile") + + If Not (password = "") Then + WScript.echo("using AES256 encryption...") + zip1.Encryption = 3 + + WScript.echo("setting the password...") + zip1.Password = password + End IF + + WScript.echo("adding a directory...") + zip1.AddDirectory(dirToZip) + + WScript.echo("setting the save name to (" & pathToZipFile & ")...") + zip1.Name = pathToZipFile + + WScript.echo("Saving...") + zip1.Save() + + WScript.echo("Disposing...") + zip1.Dispose() + +End Sub + + +Sub Main() + + dim args + + set args = WScript.Arguments + + If (args.Length < 2) Then + + WScript.Echo "VbsCreatezip.vbs - create a zip file using the DotNetZip COM object." + WScript.Echo " usage: VbsCreatezip.vbs " + Exit Sub + End If + + + password = "" + + If (args.Count > 2) Then + For i = 2 To args.Count-1 + If (args(i) = "-p") Then + i= i+1 + password= args(i+1) + End If + Next + End If + + CreateZip args(0), args(1) + +End Sub + +Call Main diff --git a/dotNetZip/Zip Tests/Resources/VbsCreateZip-ShellApp.vbs b/dotNetZip/Zip Tests/Resources/VbsCreateZip-ShellApp.vbs new file mode 100644 index 0000000..68961ad --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/VbsCreateZip-ShellApp.vbs @@ -0,0 +1,140 @@ +' VbsCreateZip-ShellApp.vbs +' ------------------------------------------------------------------ +' +' Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +' All rights reserved. +' +' This code module is part of DotNetZip, a zipfile class library. +' +' ------------------------------------------------------------------ +' +' This code is licensed under the Microsoft Public License. +' See the file License.txt for the license details. +' More info on: http://dotnetzip.codeplex.com +' +' ------------------------------------------------------------------ +' +' last saved (in emacs): +' Time-stamp: <2011-June-18 21:41:42> +' +' ------------------------------------------------------------------ +' +' This is a script file that creates a zip file from a specified directory. +' It uses the Shell.Application object to do the zipping. +' This script is used for compatibility testing of the DotNetZip output. +' +' created Fri, 29 May 2009 +' +' ------------------------------------------------------------------ + + +Sub NewZip(pathToZipFile) + + WScript.Echo "Newing up a zip file (" & pathToZipFile & ") " + + Dim fso + Set fso = CreateObject("Scripting.FileSystemObject") + Dim file + Set file = fso.CreateTextFile(pathToZipFile) + + file.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0) + + file.Close + Set fso = Nothing + Set file = Nothing + + WScript.Sleep 500 + +End Sub + + + +Sub CreateZip(pathToZipFile, dirToZip) + + WScript.Echo "Creating zip (" & pathToZipFile & ") from (" & dirToZip & ")" + + Dim fso + Set fso= Wscript.CreateObject("Scripting.FileSystemObject") + + If fso.FileExists(pathToZipFile) Then + WScript.Echo "That zip file already exists - deleting it." + fso.DeleteFile pathToZipFile + End If + + If Not fso.FolderExists(dirToZip) Then + WScript.Echo "The directory to zip does not exist." + Exit Sub + End If + + NewZip pathToZipFile + + pathToZipFile = fso.GetAbsolutePathName(pathToZipFile) + dirToZip = fso.GetAbsolutePathName(dirToZip) + + dim sa + set sa = CreateObject("Shell.Application") + + Dim zip + Set zip = sa.NameSpace(pathToZipFile) + + WScript.Echo "opening dir (" & dirToZip & ")" + + Dim d + Set d = sa.NameSpace(dirToZip) + + For Each s In d.items + WScript.Echo s + Next + + + ' http://msdn.microsoft.com/en-us/library/bb787866(VS.85).aspx + ' =============================================================== + ' 4 = do not display a progress box + ' 16 = Respond with "Yes to All" for any dialog box that is displayed. + ' 128 = Perform the operation on files only if a wildcard file name (*.*) is specified. + ' 256 = Display a progress dialog box but do not show the file names. + ' 2048 = Version 4.71. Do not copy the security attributes of the file. + ' 4096 = Only operate in the local directory. Don't operate recursively into subdirectories. + + WScript.Echo "copying files..." + + zip.CopyHere d.items, 4 + + +' WScript.Echo "d.items.Count = " & d.items.Count +' WScript.Echo "zip.items.Count = " & zip.items.Count + + sLoop = 0 + Do Until d.Items.Count <= zip.Items.Count + Wscript.Sleep(1000) +' sLoop = sLoop + 1 +' If (sLoop = 10) Then +' WScript.Echo "/ items so far = " & zip.items.Count +' WScript.Echo "(looking for " & d.items.Count & " items)" +' sLoop = 0 +' End IF + Loop + +End Sub + + + +Sub Main() + + dim args + + set args = WScript.Arguments + + If (args.Length = 2) Then + + CreateZip args(0), args(1) + + Else + WScript.Echo "VbsCreatezip.vbs - create a zip file using the Shell.Application object." + WScript.Echo " usage: VbsCreatezip.vbs " + WScript.Echo " " + End If + +End Sub + +Call Main diff --git a/dotNetZip/Zip Tests/Resources/VbsUnZip-DotNetZip.vbs b/dotNetZip/Zip Tests/Resources/VbsUnZip-DotNetZip.vbs new file mode 100644 index 0000000..eeb0f1c --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/VbsUnZip-DotNetZip.vbs @@ -0,0 +1,71 @@ +' VbsUnzip-DotNetZip.vbs +' ------------------------------------------------------------------ +' +' Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +' All rights reserved. +' +' This code module is part of DotNetZip, a zipfile class library. +' +' ------------------------------------------------------------------ +' +' This code is licensed under the Microsoft Public License. +' See the file License.txt for the license details. +' More info on: http://dotnetzip.codeplex.com +' +' ------------------------------------------------------------------ +' +' last saved (in emacs): +' Time-stamp: <2009-May-30 07:08:28> +' +' ------------------------------------------------------------------ +' +' This is a script file that unzips a specified zip file to a specified directory. +' It uses the DotNetZip library, via COM, to do the unzipping. +' This script is used for compatibility testing of the DotNetZip output. +' +' created Fri, 29 May 2009 17:07 +' +' ------------------------------------------------------------------ + + + +Sub UnpackZip(pathToZipFile, extractLocation) + + WScript.Echo "Unpacking zip (" & pathToZipFile & ") to (" & extractLocation & ")" + + Dim zip + WScript.echo("Instantiating a ZipFile object...") + Set zip = CreateObject("Ionic.Zip.ZipFile") + + WScript.echo("Initialize (Read)...") + zip.Initialize(pathToZipFile) + + WScript.echo("extracting...") + zip.ExtractAll(extractLocation) + + WScript.echo("Disposing...") + zip.Dispose() + + WScript.echo("Done.") + +End Sub + + +Sub Main() + + dim args + + set args = WScript.Arguments + + If (args.Length = 2) Then + + UnpackZip args(0), args(1) + + Else + WScript.Echo "VbsUnzip.vbs - unzip a zip file using the DotNetZip library." + WScript.Echo " usage: VbsUnzip.vbs " + End If + +End Sub + +Call Main diff --git a/dotNetZip/Zip Tests/Resources/VbsUnzip-ShellApp.vbs b/dotNetZip/Zip Tests/Resources/VbsUnzip-ShellApp.vbs new file mode 100644 index 0000000..5b7a7b9 --- /dev/null +++ b/dotNetZip/Zip Tests/Resources/VbsUnzip-ShellApp.vbs @@ -0,0 +1,85 @@ +' VbsUnzip.vbs +' ------------------------------------------------------------------ +' +' Copyright (c) 2009 Dino Chiesa. +' All rights reserved. +' +' This code module is part of DotNetZip, a zipfile class library. +' +' ------------------------------------------------------------------ +' +' This code is licensed under the Microsoft Public License. +' See the file License.txt for the license details. +' More info on: http://dotnetzip.codeplex.com +' +' ------------------------------------------------------------------ +' +' last saved (in emacs): +' Time-stamp: <2009-September-08 22:21:31> +' +' ------------------------------------------------------------------ +' +' This is a script file that unzips a specified zip file to a specified directory. +' It uses the Shell.Application object to do the unzipping. +' This script is used for compatibility testing of the DotNetZip output. +' +' created Fri, 29 May 2009 17:07 +' +' ------------------------------------------------------------------ + + + +Sub UnpackZip(pathToZipFile, extractLocation) + + WScript.Echo "Unpacking zip (" & pathToZipFile & ") to (" & extractLocation & ")" + + dim sa + set sa = CreateObject("Shell.Application") + + Dim fso + Set fso= CreateObject("Scripting.FileSystemObject") + fqPathToZip= fso.GetAbsolutePathName(pathToZipFile) + + If Not fso.FolderExists(extractLocation) Then fso.CreateFolder(extractLocation) + fqExtractLoc= fso.GetAbsolutePathName(extractLocation) + + Dim zip + Set zip = sa.NameSpace(fqPathToZip) + + Dim ex + Set ex = sa.NameSpace(fqExtractLoc) + + ' http://msdn.microsoft.com/en-us/library/bb787866(VS.85).aspx + ' =============================================================== + ' 4 = do not display a progress box + ' 16 = Respond with "Yes to All" for any dialog box that is displayed. + ' 128 = Perform the operation on files only if a wildcard file name (*.*) is specified. + ' 256 = Display a progress dialog box but do not show the file names. + ' 2048 = Version 4.71. Do not copy the security attributes of the file. + ' 4096 = Only operate in the local directory. Don't operate recursively into subdirectories. + + ex.CopyHere zip.items, 20 + +End Sub + + + +Sub Main() + + dim args + + set args = WScript.Arguments + + If (args.Length = 2) Then + + UnpackZip args(0), args(1) + + Else + WScript.Echo "VbsUnzip.vbs - unzip a zip file using the Shell.Application object." + WScript.Echo " usage: VbsUnzip.vbs " + WScript.Quit(1) + End If + +End Sub + +Call Main diff --git a/dotNetZip/Zip Tests/Resources/wi8647.tif b/dotNetZip/Zip Tests/Resources/wi8647.tif new file mode 100644 index 0000000..6f507a8 Binary files /dev/null and b/dotNetZip/Zip Tests/Resources/wi8647.tif differ diff --git a/dotNetZip/Zip Tests/Selector.cs b/dotNetZip/Zip Tests/Selector.cs new file mode 100644 index 0000000..e8e98cd --- /dev/null +++ b/dotNetZip/Zip Tests/Selector.cs @@ -0,0 +1,2280 @@ +// Selector.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2010 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 17:57:24> +// +// ------------------------------------------------------------------ +// +// This module defines tests for the File and Entry Selection stuff in +// DotNetZip. +// +// ------------------------------------------------------------------ + +using System; +using System.Text; +using System.Collections.Generic; +using System.Linq; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + +namespace Ionic.Zip.Tests +{ + /// + /// Summary description for Selector + /// + [TestClass] + public class Selector : IonicTestClass + { + public Selector() : base() { } + + [ClassInitialize] + public static void ClassInit(TestContext a) + { + CurrentDir = Directory.GetCurrentDirectory(); + twentyDaysAgo = DateTime.Now - new TimeSpan(20,0,0,0); + todayAtMidnight = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); + tomorrow = todayAtMidnight + new TimeSpan(1, 0, 0, 0); + threeDaysAgo = todayAtMidnight - new TimeSpan(3, 0, 0, 0); + twoDaysAgo = todayAtMidnight - new TimeSpan(2, 0, 0, 0); + threeYearsAgo = new DateTime(DateTime.Now.Year - 3, DateTime.Now.Month, DateTime.Now.Day); + + oneDay = new TimeSpan(1,0,0,0); + yesterdayAtMidnight = todayAtMidnight - oneDay; + } + + // [ClassCleanup()] + // public static void MyClassCleanup() + // { + // CleanDirectory(fodderDirectory, null); + // } + + + private static void CleanDirectory(string dirToClean, Ionic.CopyData.Transceiver txrx) + { + if (dirToClean == null) return; + + if (!Directory.Exists(dirToClean)) return; + + var dirs = Directory.GetDirectories(dirToClean, "*.*", SearchOption.AllDirectories); + + if (txrx!=null) + txrx.Send("pb 1 max " + dirs.Length.ToString()); + + foreach (var d in dirs) + { + CleanDirectory(d, txrx); + if (txrx!=null) + txrx.Send("pb 1 step"); + } + + // Some of the files are marked as ReadOnly/System, and + // before deleting the dir we must strip those attrs. + var files = Directory.GetFiles(dirToClean, "*.*", SearchOption.AllDirectories); + if (txrx!=null) + txrx.Send("pb 1 max " + files.Length.ToString()); + + foreach (var f in files) + { + var a = File.GetAttributes(f); + // must do ReadOnly bit first - to allow setting other bits. + if ((a & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) + { + a &= ~FileAttributes.ReadOnly; + File.SetAttributes(f, a); + } + if (((a & FileAttributes.Hidden) == FileAttributes.Hidden) || + ((a & FileAttributes.System) == FileAttributes.System)) + { + a &= ~FileAttributes.Hidden; + a &= ~FileAttributes.System; + File.SetAttributes(f, a); + } + File.Delete(f); + if (txrx!=null) + txrx.Send("pb 1 step"); + } + + // Delete the directory with delay and retry. + // Sometimes I have a console window in the directory + // and I want it to not give up so easily. + int tries =0; + bool success = false; + do + { + try + { + Directory.Delete(dirToClean, true); + success = true; + } + catch + { + System.Threading.Thread.Sleep(600); + } + tries++; + } while (tries < 100 && !success); + } + + + + + + [TestMethod] + public void Selector_EdgeCases() + { + string Subdir = Path.Combine(TopLevelDir, "A"); + + Ionic.FileSelector ff = new Ionic.FileSelector("name = *.txt"); + var list = ff.SelectFiles(Subdir); + + ff.SelectionCriteria = "name = *.bin"; + list = ff.SelectFiles(Subdir); + } + + + private static DateTime twentyDaysAgo; + private static DateTime todayAtMidnight; + private static DateTime tomorrow; + private static DateTime threeDaysAgo; + private static DateTime threeYearsAgo; + private static DateTime twoDaysAgo; + private static DateTime yesterdayAtMidnight; + private static TimeSpan oneDay; + + private string fodderDirectory; + private Object LOCK = new Object(); + private int numFodderFiles, numFodderDirs; + + + /// + /// Checks a fodder directory to see if suitable. + /// + /// the directory to check + /// + /// + /// true if the directory contains a goodly number of fodder files. + /// + private bool TryOneFodderDir(string dir) + { + if (!Directory.Exists(dir)) + return false; + + var ctime = File.GetCreationTime(dir).ToUniversalTime(); + if ((todayAtMidnight - ctime) > oneDay || (ctime - todayAtMidnight) > oneDay) + return false; + + + var fodderFiles = Directory.GetFiles(dir, "*.*", SearchOption.AllDirectories); + + numFodderFiles = fodderFiles.Length; + if (numFodderFiles <= 2) + { + numFodderFiles = 0; + return false; + } + + var fodderDirs = Directory.GetDirectories(dir, "*.*", + SearchOption.AllDirectories); + numFodderDirs = fodderDirs.Length; + if (numFodderDirs <= 2) + { + numFodderDirs = numFodderFiles = 0; + return false; + } + return true; + } + + + private string SetupFiles() + { + lock (LOCK) + { + if (fodderDirectory != null && numFodderFiles > 5) + return fodderDirectory; + + string homeDir = System.Environment.GetEnvironmentVariable("TEMP"); + var oldDirs = Directory.GetDirectories(homeDir, "*.SelectorTests"); + + foreach (var dir in oldDirs) + { + if (TryOneFodderDir(dir)) + { + fodderDirectory = dir; + return dir; + } + + if (Directory.Exists(dir)) + Directory.Delete(dir, true); + } + + // Arriving here means no good fodder directories exist. + // Create one. + ActuallyCreateFodderFiles(); + Assert.IsTrue(TryOneFodderDir(fodderDirectory)); + return fodderDirectory; + } + } + + + private static void DeleteOldFodderDirectories( Ionic.CopyData.Transceiver txrx ) + { + // Before creating the directory for the current run, Remove old directories. + // For some reason the test cleanup code tends to leave these directories?? + string tempDir = System.Environment.GetEnvironmentVariable("TEMP"); + var oldDirs = Directory.GetDirectories(tempDir, "*.SelectorTests"); + if (oldDirs.Length > 0) + { + if (txrx != null) + { + txrx.Send("status deleting old directories..."); + txrx.Send(String.Format("pb 0 max {0}", oldDirs.Length)); + } + + foreach (var dir in oldDirs) + { + CleanDirectory(dir, txrx); + if (txrx != null) txrx.Send("pb 0 step"); + } + } + } + + + + private void ActuallyCreateFodderFiles() + { + var txrx = TestUtilities.StartProgressMonitor("selector-setup", + "Selector one-time setup", + "setting up files..."); + var rnd = new System.Random(); + DeleteOldFodderDirectories(txrx); + + int fileCount = rnd.Next(95) + 95; + if (txrx!=null) + { + txrx.Send("status creating files..."); + txrx.Send(String.Format("pb 0 max {0}", fileCount)); + } + + fodderDirectory = TestUtilities.GenerateUniquePathname("SelectorTests"); + + // remember this directory so we can restore later + string originalDir = Directory.GetCurrentDirectory(); + + int entriesAdded = 0; + + // get the base directory for tests: + Directory.SetCurrentDirectory(CurrentDir); + Directory.CreateDirectory(fodderDirectory); + Directory.SetCurrentDirectory(fodderDirectory); + + string[] nameFormats = + { + "file{0:D3}", + "{0:D3}", + "PrettyLongFileName-{0:D3}", + "Very-Long-Filename-{0:D3}-with-a-repeated-segment-{0:D3}-{0:D3}-{0:D3}-{0:D3}", + + }; + + string[] dirs = + { + "dir1", + "dir1\\dirA", + "dir1\\dirB", + "dir2" + }; + + + foreach (string s in dirs) + Directory.CreateDirectory(s); + + for (int j = 0; j < fileCount; j++) + { + // select the size + int sz = 0; + if (j % 5 == 0) sz = rnd.Next(15000) + 150000; + else if (j % 17 == 1) sz = rnd.Next(50 * 1024) + 1024 * 1024; + else if (rnd.Next(13) == 0) sz = 8080; // exactly + else sz = rnd.Next(5000) + 5000; + + // randomly select the format of the file name + int n = rnd.Next(4); + + // binary or text + string filename = null; + if (rnd.Next(2) == 0) + { + filename = Path.Combine(fodderDirectory, String.Format(nameFormats[n], j) + ".txt"); + TestUtilities.CreateAndFillFileText(filename, sz); + } + else + { + filename = Path.Combine(fodderDirectory, String.Format(nameFormats[n], j) + ".bin"); + TestUtilities.CreateAndFillFileBinary(filename, sz); + } + + + // maybe backdate ctime + if (rnd.Next(2) == 0) + { + var span = new TimeSpan(_rnd.Next(12), + _rnd.Next(24), + _rnd.Next(59), + _rnd.Next(59)); + TouchFile(filename, WhichTime.ctime, twentyDaysAgo + span); + } + + // maybe backdate mtime + if (rnd.Next(2) == 0) + { + var span = new TimeSpan(_rnd.Next(1), + _rnd.Next(24), + _rnd.Next(59), + _rnd.Next(59)); + TouchFile(filename, WhichTime.mtime, threeDaysAgo+span); + } + + // maybe backdate atime + if (rnd.Next(2) == 0) + { + var span = new TimeSpan(_rnd.Next(24),_rnd.Next(59),_rnd.Next(59)); + TouchFile(filename, WhichTime.atime, yesterdayAtMidnight+span); + } + + // set the creation time to "a long time ago" on 1/14th of the files + if (j % 14 == 0) + { + DateTime x = new DateTime(1998, 4, 29); // julianna + var span = new TimeSpan(_rnd.Next(22), + _rnd.Next(24), + _rnd.Next(59), + _rnd.Next(59)); + File.SetCreationTime(filename, x+span); + } + + // maybe move to a subdir + n = rnd.Next(6); + if (n < 4) + { + string newFilename = Path.Combine(dirs[n], Path.GetFileName(filename)); + File.Move(filename, newFilename); + filename = newFilename; + } + + // mark some of the files as hidden, system, readonly, etc + if (j % 9 == 0) + File.SetAttributes(filename, FileAttributes.Hidden); + if (j % 14 == 0) + File.SetAttributes(filename, FileAttributes.ReadOnly); + if (j % 13 == 0) + File.SetAttributes(filename, FileAttributes.System); + if (j % 11 == 0) + File.SetAttributes(filename, FileAttributes.Archive); + + entriesAdded++; + + if (txrx != null) + { + txrx.Send("pb 0 step"); + if (entriesAdded % 8 == 0) + txrx.Send(String.Format("status creating files ({0}/{1})", entriesAdded, fileCount)); + } + } + // restore the cwd + Directory.SetCurrentDirectory(originalDir); + + txrx.Send("stop"); + } + + + + class Trial + { + public string Label; + public string C1; + public string C2; + } + + + + + [TestMethod] + public void Selector_SelectFiles() + { + Directory.SetCurrentDirectory(TopLevelDir); + + Trial[] trials = new Trial[] + { + new Trial { Label = "name", C1 = "name = *.txt", C2 = "name = *.bin" }, + new Trial { Label = "name (shorthand)", C1 = "*.txt", C2 = "*.bin" }, + new Trial { Label = "size", C1 = "size < 7500", C2 = "size >= 7500" }, + new Trial { Label = "size", C1 = "size = 8080", C2 = "size != 8080" }, + new Trial { Label = "name & size", + C1 = "name = *.bin AND size > 7500", + C2 = "name != *.bin OR size <= 7500", + }, + new Trial { Label = "name XOR name", + C1 = "name = *.bin XOR name = *4.*", + C2 = "(name != *.bin OR name = *4.*) AND (name = *.bin OR name != *4.*)", + }, + new Trial { Label = "name XOR size", + C1 = "name = *.bin XOR size > 100k", + C2 = "(name != *.bin OR size > 100k) AND (name = *.bin OR size <= 100k)", + }, + new Trial + { + Label = "mtime", + C1 = String.Format("mtime < {0}", twentyDaysAgo.ToString("yyyy-MM-dd")), + C2 = String.Format("mtime >= {0}", twentyDaysAgo.ToString("yyyy-MM-dd")), + }, + new Trial + { + Label = "ctime", + C1 = String.Format("mtime < {0}", threeDaysAgo.ToString("yyyy-MM-dd")), + C2 = String.Format("mtime >= {0}", threeDaysAgo.ToString("yyyy-MM-dd")), + }, + new Trial + { + Label = "atime", + C1 = String.Format("mtime < {0}", yesterdayAtMidnight.ToString("yyyy-MM-dd")), + C2 = String.Format("mtime >= {0}", yesterdayAtMidnight.ToString("yyyy-MM-dd")), + }, + new Trial { Label = "size (100k)", C1="size > 100k", C2="size <= 100kb", }, + new Trial { Label = "size (1mb)", C1="size > 1m", C2="size <= 1mb", }, + new Trial { Label = "size (1gb)", C1="size > 1g", C2="size <= 1gb", }, + new Trial { Label = "attributes (Hidden)", C1 = "attributes = H", C2 = "attributes != H" }, + new Trial { Label = "attributes (ReadOnly)", C1 = "attributes = R", C2 = "attributes != R" }, + new Trial { Label = "attributes (System)", C1 = "attributes = S", C2 = "attributes != S" }, + new Trial { Label = "attributes (Archive)", C1 = "attributes = A", C2 = "attributes != A" }, + + }; + + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectFiles.zip"); + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + int count1, count2; + //String filename = null; + + SetupFiles(); + var topLevelFiles = Directory.GetFiles(fodderDirectory, "*.*", SearchOption.TopDirectoryOnly); + + for (int m = 0; m < trials.Length; m++) + { + Ionic.FileSelector ff = new Ionic.FileSelector(trials[m].C1); + var list = ff.SelectFiles(fodderDirectory); + TestContext.WriteLine("======================================================="); + TestContext.WriteLine("Selector: " + ff.ToString()); + TestContext.WriteLine("Criteria({0})", ff.SelectionCriteria); + TestContext.WriteLine("Count({0})", list.Count); + count1 = 0; + foreach (string s in list) + { + switch (m) + { + case 0: + case 1: + Assert.IsTrue(s.EndsWith(".txt")); + break; + case 2: + { + FileInfo fi = new FileInfo(s); + Assert.IsTrue(fi.Length < 7500); + } + break; + case 4: + { + FileInfo fi = new FileInfo(s); + bool x = s.EndsWith(".bin") && fi.Length > 7500; + Assert.IsTrue(x); + } + break; + } + count1++; + } + + ff = new Ionic.FileSelector(trials[m].C2); + list = ff.SelectFiles(fodderDirectory); + TestContext.WriteLine("- - - - - - - - - - - - - - - - - - - - - - - - - - - -"); + TestContext.WriteLine("Criteria({0})", ff.SelectionCriteria); + TestContext.WriteLine("Count({0})", list.Count); + count2 = 0; + foreach (string s in list) + { + switch (m) + { + case 0: + case 1: + Assert.IsTrue(s.EndsWith(".bin")); + break; + case 2: + { + FileInfo fi = new FileInfo(s); + Assert.IsTrue(fi.Length >= 7500); + } + break; + case 4: + { + FileInfo fi = new FileInfo(s); + bool x = !s.EndsWith(".bin") || fi.Length <= 7500; + Assert.IsTrue(x); + } + break; + } + count2++; + } + Assert.AreEqual(topLevelFiles.Length, count1 + count2); + } + } + + + + + + + + + [TestMethod, Timeout(7200000)] + public void Selector_AddSelectedFiles() + { + Directory.SetCurrentDirectory(TopLevelDir); + + Trial[] trials = new Trial[] + { + new Trial { Label = "name", C1 = "name = *.txt", C2 = "name = *.bin" }, + new Trial { Label = "name (shorthand)", C1 = "*.txt", C2 = "*.bin" }, + new Trial { Label = "attributes (Hidden)", C1 = "attributes = H", C2 = "attributes != H" }, + new Trial { Label = "attributes (ReadOnly)", C1 = "attributes = R", C2 = "attributes != R" }, + new Trial { Label = "mtime", C1 = "mtime < 2007-01-01", C2 = "mtime > 2007-01-01" }, + new Trial { Label = "atime", C1 = "atime < 2007-01-01", C2 = "atime > 2007-01-01" }, + new Trial { Label = "ctime", C1 = "ctime < 2007-01-01", C2 = "ctime > 2007-01-01" }, + new Trial { Label = "size", C1 = "size < 7500", C2 = "size >= 7500" }, + + new Trial { Label = "name & size", + C1 = "name = *.bin AND size > 7500", + C2 = "name != *.bin OR size <= 7500", + }, + + new Trial { Label = "name, size & attributes", + C1 = "name = *.bin AND size > 8kb and attributes = H", + C2 = "name != *.bin OR size <= 8kb or attributes != H", + }, + + new Trial { Label = "name, size, time & attributes.", + C1 = "name = *.bin AND size > 7k and mtime < 2007-01-01 and attributes = H", + C2 = "name != *.bin OR size <= 7k or mtime > 2007-01-01 or attributes != H", + }, + }; + + _txrx = TestUtilities.StartProgressMonitor("AddSelectedFiles", "AddSelectedFiles", "starting up..."); + + string[] zipFileToCreate = { + Path.Combine(TopLevelDir, "Selector_AddSelectedFiles-1.zip"), + Path.Combine(TopLevelDir, "Selector_AddSelectedFiles-2.zip") + }; + + Assert.IsFalse(File.Exists(zipFileToCreate[0]), "The zip file '{0}' already exists.", zipFileToCreate[0]); + Assert.IsFalse(File.Exists(zipFileToCreate[1]), "The zip file '{0}' already exists.", zipFileToCreate[1]); + + int count1, count2; + + SetupFiles(); + var topLevelFiles = Directory.GetFiles(fodderDirectory, "*.*", SearchOption.TopDirectoryOnly); + + string currentDir = Directory.GetCurrentDirectory(); + _txrx.Send(String.Format("pb 0 max {0}", 2 * (trials.Length + 1))); + + _txrx.Send("pb 0 step"); + + for (int m = 0; m < trials.Length; m++) + { + _txrx.Send("test AddSelectedFiles"); + _txrx.Send("pb 1 max 4"); + _txrx.Send(String.Format("status test {0}/{1}: creating zip #1/2", + m + 1, trials.Length)); + TestContext.WriteLine("==============================================="); + TestContext.WriteLine("AddSelectedFiles() [{0}]", trials[m].Label); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles(trials[m].C1, fodderDirectory, ""); + zip1.Save(zipFileToCreate[0]); + } + count1 = TestUtilities.CountEntries(zipFileToCreate[0]); + TestContext.WriteLine("C1({0}) Count({1})", trials[m].C1, count1); + _txrx.Send("pb 1 step"); + System.Threading.Thread.Sleep(100); + _txrx.Send("pb 0 step"); + + _txrx.Send(String.Format("status test {0}/{1}: creating zip #2/2", + m + 1, trials.Length)); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles(trials[m].C2, fodderDirectory, ""); + zip1.Save(zipFileToCreate[1]); + } + count2 = TestUtilities.CountEntries(zipFileToCreate[1]); + TestContext.WriteLine("C2({0}) Count({1})", trials[m].C2, count2); + Assert.AreEqual(topLevelFiles.Length, count1 + count2); + _txrx.Send("pb 1 step"); + + /// ======================================================= + /// Now, select entries from that ZIP + _txrx.Send(String.Format("status test {0}/{1}: selecting zip #1/2", + m + 1, trials.Length)); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate[0])) + { + var selected1 = zip1.SelectEntries(trials[m].C1); + Assert.AreEqual(selected1.Count, count1); + } + _txrx.Send("pb 1 step"); + + _txrx.Send(String.Format("status test {0}/{1}: selecting zip #2/2", + m + 1, trials.Length)); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate[1])) + { + var selected2 = zip1.SelectEntries(trials[m].C2); + Assert.AreEqual(selected2.Count, count2); + } + _txrx.Send("pb 1 step"); + + _txrx.Send("pb 0 step"); + } + + } + + + [TestMethod] + public void Selector_AddSelectedFiles_2() + { + string zipFileToCreate = "Selector_AddSelectedFiles_2.zip"; + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + var txtFiles = Directory.GetFiles(dirToZip, "*.txt", SearchOption.AllDirectories); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles("*.txt"); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(0, TestUtilities.CountEntries(zipFileToCreate)); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles("*.txt", true); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(txtFiles.Length, TestUtilities.CountEntries(zipFileToCreate)); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles("*.txt", ".", true); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(txtFiles.Length, TestUtilities.CountEntries(zipFileToCreate)); + + } + + + [TestMethod] + public void Selector_AddSelectedFiles_Checkcase_file() + { + string zipFileToCreate = "AddSelectedFiles_Checkcase.zip"; + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + Directory.SetCurrentDirectory(dirToZip); + var f2 = Directory.GetFiles(".", "*.*"); + Array.ForEach(f2, x => { File.Move(x,Path.GetFileName(x).ToUpper()); }); + Directory.SetCurrentDirectory(TopLevelDir); + + var txtFiles = Directory.GetFiles(dirToZip, "*.txt", + SearchOption.AllDirectories); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles("*.txt", dirToZip); + zip1.Save(zipFileToCreate); + } + + int nEntries = 0; + // now, verify that we have not downcased the filenames + using (ZipFile zip2 = new ZipFile(zipFileToCreate)) + { + foreach (var entry in zip2.Entries) + { + Assert.IsFalse(entry.FileName.Equals(entry.FileName.ToLower())); + nEntries++; + } + } + Assert.IsFalse(nEntries < 2, "not enough entries"); + + } + + + + [TestMethod] + public void Selector_AddSelectedFiles_Checkcase_directory() + { + string zipFileToCreate = "AddSelectedFiles_Checkcase.zip"; + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()).ToUpper(); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + var txtFiles = Directory.GetFiles(dirToZip, "*.txt", + SearchOption.AllDirectories); + + Assert.IsFalse(txtFiles.Length < 3, "not enough entries (n={0})", + txtFiles.Length); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles("*.txt", dirToZip); + zip1.Save(zipFileToCreate); + } + + int nEntries = 0; + // now, verify that we have not downcased the filenames + using (ZipFile zip2 = new ZipFile(zipFileToCreate)) + { + foreach (var entry in zip2.Entries) + { + Assert.IsFalse(entry.FileName.Equals(entry.FileName.ToLower())); + nEntries++; + } + } + Assert.IsFalse(nEntries < 3, "not enough entries (n={0})", nEntries); + } + + + [TestMethod] + public void Selector_AddSelectedFiles_Checkcase_directory_2() + { + string zipFileToCreate = "AddSelectedFiles_Checkcase.zip"; + string shortDirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()).ToUpper(); + string dirToZip = Path.Combine(TopLevelDir, shortDirToZip); // fully qualified + var files = TestUtilities.GenerateFilesFlat(shortDirToZip); + string keyword = "Ammon"; + int n = _rnd.Next(3)+2; + for (int i=0; i < n; i++) + { + Directory.SetCurrentDirectory(dirToZip); + string subdir = keyword + i; + TestUtilities.GenerateFilesFlat(subdir); + Directory.SetCurrentDirectory(subdir); + var f2 = Directory.GetFiles(".", "*.*"); + int k = 2; + Array.ForEach(f2, x => { + File.Move(x, String.Format("{0}.{1:D5}.txt", keyword.ToUpper(), k++)); }); + } + + Directory.SetCurrentDirectory(TopLevelDir); + + TestContext.WriteLine("Create zip file"); + using (ZipFile zip1 = new ZipFile()) + { + var criterion = "name = *\\" + keyword + "?\\*.txt"; + zip1.AddSelectedFiles(criterion, ".\\" + shortDirToZip, "files", true); + zip1.Save(zipFileToCreate); + } + + TestContext.WriteLine("Verify case of entry FileNames"); + int nEntries = 0; + // now, verify that we have not downcased entry.FileName + using (ZipFile zip2 = new ZipFile(zipFileToCreate)) + { + foreach (var entry in zip2.Entries) + { + TestContext.WriteLine("Check {0}", entry.FileName); + Assert.AreNotEqual(entry.FileName, + entry.FileName.ToLower(), + entry.FileName); + nEntries++; + } + } + Assert.IsFalse(nEntries < 3, "not enough entries"); + } + + + + [TestMethod] + public void Selector_SelectEntries_FwdSlash_wi13350() + { + string zipFileToCreate = "SelectEntries.zip"; + + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + TestContext.WriteLine("Create zip file"); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(dirToZip, dirToZip); + zip1.Save(zipFileToCreate); + } + + // Select Entries + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + var selection1 = zip2.SelectEntries("name = " + dirToZip + "\\" + "*.txt"); + //var selection1 = zip2.SelectEntries("name = *.txt"); + Assert.IsTrue(selection1.Count > 2, "{0} is simply not enough entries!", + selection1.Count); + var selection2 = zip2.SelectEntries(dirToZip + "/" + "*.txt"); + Assert.AreEqual(selection1.Count, + selection2.Count, + "{0} != {1}", + selection1.Count, + selection2.Count); + } + } + + + [TestMethod] + public void Selector_CheckRemove_wi10499() + { + string zipFileToCreate = "CheckRemove.zip"; + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + TestContext.WriteLine("Create zip file"); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(dirToZip, dirToZip); + zip1.Save(zipFileToCreate); + } + + int nBefore= 0, nAfter = 0, nRemoved = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + ICollection entries = zip2.SelectEntries("*.txt"); + Assert.IsFalse(entries.Count < 3, "not enough entries"); + nBefore = entries.Count; + + foreach(ZipEntry entry in entries) + { + TestContext.WriteLine("Removing {0}", entry.FileName); + zip2.RemoveEntry(entry); + nRemoved++; + } + var remainingEntries = zip2.SelectEntries("*.txt"); + nAfter = remainingEntries.Count; + TestContext.WriteLine("Remaining:"); + foreach(ZipEntry entry in remainingEntries) + { + TestContext.WriteLine(" {0}", + entry.FileName); + } + } + + Assert.IsTrue(nBefore>nAfter,"Removal appeared to have no effect."); + Assert.IsTrue(nBefore-nRemoved==nAfter,"Wrong number of entries {0}-{1}!={2}", + nBefore, nRemoved, nAfter); + } + + + private enum WhichTime + { + atime, + mtime, + ctime, + } + + + + private static void TouchFile(string strFile, WhichTime which, DateTime stamp) + { + System.IO.FileInfo fi = new System.IO.FileInfo(strFile); + if (which == WhichTime.atime) + fi.LastAccessTime = stamp; + else if (which == WhichTime.ctime) + fi.CreationTime = stamp; + else if (which == WhichTime.mtime) + fi.LastWriteTime = stamp; + else throw new System.ArgumentException("which"); + } + + + + [TestMethod] + public void Selector_SelectEntries_ByTime() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectEntries.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + SetupFiles(); + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip..."); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(fodderDirectory, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(numFodderFiles, TestUtilities.CountEntries(zipFileToCreate), "A"); + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, SelectEntries() by date..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + var totalEntries = numFodderFiles+numFodderDirs; + + // all of the files should have been modified either + // after midnight today, or before. + string crit = String.Format("mtime >= {0}", todayAtMidnight.ToString("yyyy-MM-dd")); + var selected1 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case A({0}) count({1})", crit, selected1.Count); + crit = String.Format("mtime < {0}", todayAtMidnight.ToString("yyyy-MM-dd")); + var selected2 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case B({0}) count({1})", crit, selected2.Count); + Assert.AreEqual(totalEntries, + selected1.Count + selected2.Count, "B"); + + + // some nonzero (high) number of files should have been + // created in the past twenty days. + crit = String.Format("ctime >= {0}", twentyDaysAgo.ToString("yyyy-MM-dd")); + var selected3 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case C({0}) count({1})", crit, selected3.Count); + Assert.IsTrue(selected3.Count > 0, "C"); + + + // a nonzero number should be marked as having been + // created more than 3 years ago. + crit = String.Format("ctime < {0}", + threeYearsAgo.ToString("yyyy-MM-dd")); + var selected4 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case D({0}) count({1})", crit, selected4.Count); + Assert.IsTrue(selected4.Count > 0, "D"); + + // None of the files should have been created + // more than 20 years ago + var twentyYearsAgo = new DateTime(DateTime.Now.Year - 20, + DateTime.Now.Month, + DateTime.Now.Day); + crit = String.Format("ctime < {0}", + twentyYearsAgo.ToString("yyyy-MM-dd")); + var selected5 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case F({0}) count({1})", crit, selected5.Count); + Assert.IsTrue(selected5.Count==0, "F"); + + // Some number of the files should have been created + // more than three days ago + crit = String.Format("ctime < {0}", + threeDaysAgo.ToString("yyyy-MM-dd")); + selected5 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case E({0}) count({1})", crit, selected5.Count); + Assert.IsTrue(selected5.Count>0, "E"); + + // summing all those created more than three days ago, + // with those created in the last three days, should be all entries. + crit = String.Format("ctime >= {0}", threeDaysAgo.ToString("yyyy-MM-dd")); + var selected6 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case G({0}) count({1})", crit, selected6.Count); + Assert.IsTrue(selected6.Count>0, "G"); + Assert.AreEqual(totalEntries, selected5.Count + selected6.Count, "G"); + + + // some number should have been accessed in the past 2 days + crit = String.Format("atime >= {0} and atime < {1}", + twoDaysAgo.ToString("yyyy-MM-dd"), + todayAtMidnight.ToString("yyyy-MM-dd")); + selected5 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case H({0}) count({1})", crit, selected5.Count); + Assert.IsTrue(selected5.Count > 0, "H"); + + // those accessed *exactly* at midnight yesterday, plus + // those NOT = all entries + crit = String.Format("atime = {0}", + yesterdayAtMidnight.ToString("yyyy-MM-dd")); + selected5 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case I({0}) count({1})", crit, selected5.Count); + + crit = String.Format("atime != {0}", + yesterdayAtMidnight.ToString("yyyy-MM-dd")); + selected6 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case J({0}) count({1})", crit, selected6.Count); + Assert.AreEqual(totalEntries, selected5.Count + selected6.Count, "J"); + + // those marked as last accessed more than 20 days ago == empty set + crit = String.Format("atime <= {0}", + twentyDaysAgo.ToString("yyyy-MM-dd")); + selected5 = zip1.SelectEntries(crit); + TestContext.WriteLine("Case K({0}) count({1})", crit, selected5.Count); + Assert.AreEqual(0, selected5.Count, "K"); + } + } + + + + [TestMethod] + public void Selector_ExtractSelectedEntries() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_ExtractSelectedEntries.zip"); + + SetupFiles(); + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip..."); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(fodderDirectory, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(numFodderFiles, TestUtilities.CountEntries(zipFileToCreate)); + + string extractDir = "extract"; + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, ExtractSelectedEntries() by date..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + string crit = String.Format("mtime >= {0}", todayAtMidnight.ToString("yyyy-MM-dd")); + TestContext.WriteLine("Criteria({0})", crit); + zip1.ExtractSelectedEntries(crit, null, extractDir); + } + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, ExtractSelectedEntries() by date, with overwrite..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + string crit = String.Format("mtime >= {0}", todayAtMidnight.ToString("yyyy-MM-dd")); + TestContext.WriteLine("Criteria({0})", crit); + zip1.ExtractSelectedEntries(crit, null, extractDir, ExtractExistingFileAction.OverwriteSilently); + } + + + // workitem 9174: test ExtractSelectedEntries using a directoryPathInArchive + List dirs = new List(); + // first, get the list of directories used by all entries + TestContext.WriteLine("Reading zip, ..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip1) + { + TestContext.WriteLine("entry {0}", e.FileName); + string p = Path.GetDirectoryName(e.FileName.Replace("/", "\\")); + if (!dirs.Contains(p)) dirs.Add(p); + } + } + + // with or without trailing slash + for (int i = 0; i < 2; i++) + { + int grandTotal = 0; + extractDir = String.Format("extract.{0}", i); + for (int j = 0; j < dirs.Count; j++) + { + string d = dirs[j]; + if (i == 1) d += "\\"; + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, ExtractSelectedEntries() by name, with directoryInArchive({0})...", d); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + string crit = "name = *.bin"; + TestContext.WriteLine("Criteria({0})", crit); + var s = zip1.SelectEntries(crit, d); + TestContext.WriteLine(" {0} entries", s.Count); + grandTotal += s.Count; + zip1.ExtractSelectedEntries(crit, d, extractDir, ExtractExistingFileAction.OverwriteSilently); + } + } + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Total for all dirs: {0} entries", grandTotal); + + var extracted = Directory.GetFiles(extractDir, "*.bin", SearchOption.AllDirectories); + + Assert.AreEqual(grandTotal, extracted.Length); + } + } + + + + + [TestMethod] + public void Selector_SelectEntries_ByName() + { + // Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectEntries.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + //int count1, count2; + int entriesAdded = 0; + String filename = null; + + string subDir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subDir); + + int fileCount = _rnd.Next(33) + 33; + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Files being added to the zip:"); + for (int j = 0; j < fileCount; j++) + { + // select binary or text + if (_rnd.Next(2) == 0) + { + filename = Path.Combine(subDir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(5000) + 5000); + } + else + { + filename = Path.Combine(subDir, String.Format("file{0:D3}.bin", j)); + TestUtilities.CreateAndFillFileBinary(filename, _rnd.Next(5000) + 5000); + } + TestContext.WriteLine(Path.GetFileName(filename)); + entriesAdded++; + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip..."); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subDir, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(entriesAdded, TestUtilities.CountEntries(zipFileToCreate)); + + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, SelectEntries() by name..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + var selected1 = zip1.SelectEntries("name = *.txt"); + var selected2 = zip1.SelectEntries("name = *.bin"); + var selected3 = zip1.SelectEntries("name = *.bin OR name = *.txt"); + TestContext.WriteLine("Found {0} text files, {0} bin files.", selected1.Count, selected2.Count); + TestContext.WriteLine("Text files:"); + foreach (ZipEntry e in selected1) + { + TestContext.WriteLine(e.FileName); + } + Assert.AreEqual(entriesAdded, selected1.Count + selected2.Count); + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, SelectEntries() using shorthand filters..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + var selected1 = zip1.SelectEntries("*.txt"); + var selected2 = zip1.SelectEntries("*.bin"); + TestContext.WriteLine("Text files:"); + foreach (ZipEntry e in selected1) + { + TestContext.WriteLine(e.FileName); + } + Assert.AreEqual(entriesAdded, selected1.Count + selected2.Count); + } + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, SelectEntries() again ..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + string crit = "name = *.txt AND name = *.bin"; + // none of the entries should match this: + var selected1 = zip1.SelectEntries(crit); + TestContext.WriteLine("Criteria({0}) count({1})", crit, selected1.Count); + Assert.AreEqual(0, selected1.Count); + + // all of the entries should match this: + crit = "name = *.txt XOR name = *.bin"; + var selected2 = zip1.SelectEntries(crit); + TestContext.WriteLine("Criteria({0}) count({1})", crit, selected2.Count); + Assert.AreEqual(entriesAdded, selected2.Count); + + // try an compound criterion with XOR + crit = "name = *.bin XOR name = *2.*"; + var selected3 = zip1.SelectEntries(crit); + Assert.IsTrue(selected3.Count > 0); + TestContext.WriteLine("Criteria({0}) count({1})", crit, selected3.Count); + + // factor out the XOR + crit = "(name = *.bin AND name != *2.*) OR (name != *.bin AND name = *2.*)"; + var selected4 = zip1.SelectEntries(crit); + TestContext.WriteLine("Criteria({0}) count({1})", crit, selected4.Count); + Assert.AreEqual(selected3.Count, selected4.Count); + + // take the negation of the XOR criterion + crit = "(name != *.bin OR name = *2.*) AND (name = *.bin OR name != *2.*)"; + var selected5 = zip1.SelectEntries(crit); + TestContext.WriteLine("Criteria({0}) count({1})", crit, selected4.Count); + Assert.IsTrue(selected5.Count > 0); + Assert.AreEqual(entriesAdded, selected3.Count + selected5.Count); + } + } + + + + [TestMethod] + public void Selector_SelectEntries_ByName_NamesWithSpaces() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectEntries_Spaces.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + //int count1, count2; + int entriesAdded = 0; + String filename = null; + + string subDir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subDir); + + int fileCount = _rnd.Next(44) + 44; + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Files being added to the zip:"); + for (int j = 0; j < fileCount; j++) + { + string space = (_rnd.Next(2) == 0) ? " " : ""; + if (_rnd.Next(2) == 0) + { + filename = Path.Combine(subDir, String.Format("file{1}{0:D3}.txt", j, space)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(5000) + 5000); + } + else + { + filename = Path.Combine(subDir, String.Format("file{1}{0:D3}.bin", j, space)); + TestUtilities.CreateAndFillFileBinary(filename, _rnd.Next(5000) + 5000); + } + TestContext.WriteLine(Path.GetFileName(filename)); + entriesAdded++; + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip..."); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subDir, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(entriesAdded, TestUtilities.CountEntries(zipFileToCreate)); + + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + var selected1 = zip1.SelectEntries("name = *.txt"); + var selected2 = zip1.SelectEntries("name = *.bin"); + TestContext.WriteLine("Text files:"); + foreach (ZipEntry e in selected1) + { + TestContext.WriteLine(e.FileName); + } + Assert.AreEqual(entriesAdded, selected1.Count + selected2.Count); + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, using name patterns that contain spaces..."); + string[] selectionStrings = { "name = '* *.txt'", + "name = '* *.bin'", + "name = *.txt and name != '* *.txt'", + "name = *.bin and name != '* *.bin'", + }; + int count = 0; + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + foreach (string selectionCriteria in selectionStrings) + { + var selected1 = zip1.SelectEntries(selectionCriteria); + count += selected1.Count; + TestContext.WriteLine(" For criteria ({0}), found {1} files.", selectionCriteria, selected1.Count); + } + } + Assert.AreEqual(entriesAdded, count); + + } + + + [TestMethod] + public void Selector_RemoveSelectedEntries_Spaces() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_RemoveSelectedEntries_Spaces.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + //int count1, count2; + int entriesAdded = 0; + String filename = null; + + string subDir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subDir); + + int fileCount = _rnd.Next(44) + 44; + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Files being added to the zip:"); + for (int j = 0; j < fileCount; j++) + { + string space = (_rnd.Next(2) == 0) ? " " : ""; + if (_rnd.Next(2) == 0) + { + filename = Path.Combine(subDir, String.Format("file{1}{0:D3}.txt", j, space)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(5000) + 5000); + } + else + { + filename = Path.Combine(subDir, String.Format("file{1}{0:D3}.bin", j, space)); + TestUtilities.CreateAndFillFileBinary(filename, _rnd.Next(5000) + 5000); + } + TestContext.WriteLine(Path.GetFileName(filename)); + entriesAdded++; + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip..."); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subDir, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(entriesAdded, TestUtilities.CountEntries(zipFileToCreate)); + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, using name patterns that contain spaces..."); + string[] selectionStrings = { "name = '* *.txt'", + "name = '* *.bin'", + "name = *.txt and name != '* *.txt'", + "name = *.bin and name != '* *.bin'", + }; + foreach (string selectionCriteria in selectionStrings) + { + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + var selected1 = zip1.SelectEntries(selectionCriteria); + zip1.RemoveEntries(selected1); + TestContext.WriteLine("for pattern {0}, Removed {1} entries", selectionCriteria, selected1.Count); + zip1.Save(); + } + + } + + Assert.AreEqual(0, TestUtilities.CountEntries(zipFileToCreate)); + } + + + [TestMethod] + public void Selector_RemoveSelectedEntries2() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_RemoveSelectedEntries2.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + //int count1, count2; + int entriesAdded = 0; + String filename = null; + + string subDir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subDir); + + int fileCount = _rnd.Next(44) + 44; + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Files being added to the zip:"); + for (int j = 0; j < fileCount; j++) + { + string space = (_rnd.Next(2) == 0) ? " " : ""; + if (_rnd.Next(2) == 0) + { + filename = Path.Combine(subDir, String.Format("file{1}{0:D3}.txt", j, space)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(5000) + 5000); + } + else + { + filename = Path.Combine(subDir, String.Format("file{1}{0:D3}.bin", j, space)); + TestUtilities.CreateAndFillFileBinary(filename, _rnd.Next(5000) + 5000); + } + TestContext.WriteLine(Path.GetFileName(filename)); + entriesAdded++; + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip..."); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(subDir, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(entriesAdded, TestUtilities.CountEntries(zipFileToCreate)); + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Reading zip, using name patterns that contain spaces..."); + string[] selectionStrings = { "name = '* *.txt'", + "name = '* *.bin'", + "name = *.txt and name != '* *.txt'", + "name = *.bin and name != '* *.bin'", + }; + foreach (string selectionCriteria in selectionStrings) + { + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + var selected1 = zip1.SelectEntries(selectionCriteria); + ZipEntry[] entries = new ZipEntry[selected1.Count]; + selected1.CopyTo(entries, 0); + string[] names = Array.ConvertAll(entries, x => x.FileName); + zip1.RemoveEntries(names); + TestContext.WriteLine("for pattern {0}, Removed {1} entries", selectionCriteria, selected1.Count); + zip1.Save(); + } + + } + + Assert.AreEqual(0, TestUtilities.CountEntries(zipFileToCreate)); + } + + + + [TestMethod] + public void Selector_SelectEntries_subDirs() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectFiles_subDirs.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + int count1, count2; + + string fodder = Path.Combine(TopLevelDir, "fodder"); + Directory.CreateDirectory(fodder); + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating files..."); + int entries = 0; + int i = 0; + int subdirCount = _rnd.Next(17) + 9; + //int subdirCount = _rnd.Next(3) + 2; + var FileCount = new Dictionary(); + + var checksums = new Dictionary(); + // I don't actually verify the checksums in this method... + + + for (i = 0; i < subdirCount; i++) + { + string subDirShort = new System.String(new char[] { (char)(i + 65) }); + string subDir = Path.Combine(fodder, subDirShort); + Directory.CreateDirectory(subDir); + + int filecount = _rnd.Next(8) + 8; + //int filecount = _rnd.Next(2) + 2; + FileCount[subDirShort] = filecount; + for (int j = 0; j < filecount; j++) + { + string filename = String.Format("file{0:D4}.x", j); + string fqFilename = Path.Combine(subDir, filename); + TestUtilities.CreateAndFillFile(fqFilename, _rnd.Next(1000) + 1000); + + var chk = TestUtilities.ComputeChecksum(fqFilename); + var s = TestUtilities.CheckSumToString(chk); + var t1 = Path.GetFileName(fodder); + var t2 = Path.Combine(t1, subDirShort); + var key = Path.Combine(t2, filename); + key = TestUtilities.TrimVolumeAndSwapSlashes(key); + TestContext.WriteLine("chk[{0}]= {1}", key, s); + checksums.Add(key, s); + entries++; + } + } + + Directory.SetCurrentDirectory(TopLevelDir); + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip ({0} entries in {1} subdirs)...", entries, subdirCount); + // add all the subdirectories into a new zip + using (ZipFile zip1 = new ZipFile()) + { + // add all of those subdirectories (A, B, C...) into the root in the zip archive + zip1.AddDirectory(fodder, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(entries, TestUtilities.CountEntries(zipFileToCreate)); + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Selecting entries by directory..."); + + for (int j = 0; j < 2; j++) + { + count1 = 0; + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + for (i = 0; i < subdirCount; i++) + { + string dirInArchive = new System.String(new char[] { (char)(i + 65) }); + if (j == 1) dirInArchive += "\\"; + var selected1 = zip1.SelectEntries("*.*", dirInArchive); + count1 += selected1.Count; + TestContext.WriteLine("--------------\nfiles in dir {0} ({1}):", + dirInArchive, selected1.Count); + foreach (ZipEntry e in selected1) + TestContext.WriteLine(e.FileName); + } + Assert.AreEqual(entries, count1); + } + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Selecting entries by directory and size..."); + count1 = 0; + count2 = 0; + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + for (i = 0; i < subdirCount; i++) + { + string dirInArchive = new System.String(new char[] { (char)(i + 65) }); + var selected1 = zip1.SelectEntries("size > 1500", dirInArchive); + count1 += selected1.Count; + TestContext.WriteLine("--------------\nfiles in dir {0} ({1}):", + dirInArchive, selected1.Count); + foreach (ZipEntry e in selected1) + TestContext.WriteLine(e.FileName); + } + + var selected2 = zip1.SelectEntries("size <= 1500"); + count2 = selected2.Count; + Assert.AreEqual(entries, count1 + count2 - subdirCount); + } + + } + + + + [TestMethod] + public void Selector_SelectEntries_Fullpath() + { + //Directory.SetCurrentDirectory(TopLevelDir); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectFiles_Fullpath.zip"); + + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + int count1, count2; + + string fodder = Path.Combine(TopLevelDir, "fodder"); + Directory.CreateDirectory(fodder); + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating files..."); + int entries = 0; + int i = 0; + int subdirCount = _rnd.Next(17) + 9; + //int subdirCount = _rnd.Next(3) + 2; + var FileCount = new Dictionary(); + + var checksums = new Dictionary(); + // I don't actually verify the checksums in this method... + + + for (i = 0; i < subdirCount; i++) + { + string subDirShort = new System.String(new char[] { (char)(i + 65) }); + string subDir = Path.Combine(fodder, subDirShort); + Directory.CreateDirectory(subDir); + + int filecount = _rnd.Next(8) + 8; + //int filecount = _rnd.Next(2) + 2; + FileCount[subDirShort] = filecount; + for (int j = 0; j < filecount; j++) + { + string filename = String.Format("file{0:D4}.x", j); + string fqFilename = Path.Combine(subDir, filename); + TestUtilities.CreateAndFillFile(fqFilename, _rnd.Next(1000) + 1000); + + var chk = TestUtilities.ComputeChecksum(fqFilename); + var s = TestUtilities.CheckSumToString(chk); + var t1 = Path.GetFileName(fodder); + var t2 = Path.Combine(t1, subDirShort); + var key = Path.Combine(t2, filename); + key = TestUtilities.TrimVolumeAndSwapSlashes(key); + TestContext.WriteLine("chk[{0}]= {1}", key, s); + checksums.Add(key, s); + entries++; + } + } + + Directory.SetCurrentDirectory(TopLevelDir); + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip ({0} entries in {1} subdirs)...", entries, subdirCount); + // add all the subdirectories into a new zip + using (ZipFile zip1 = new ZipFile()) + { + // add all of those subdirectories (A, B, C...) into the root in the zip archive + zip1.AddDirectory(fodder, ""); + zip1.Save(zipFileToCreate); + } + Assert.AreEqual(entries, TestUtilities.CountEntries(zipFileToCreate)); + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Selecting entries by full path..."); + count1 = 0; + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + for (i = 0; i < subdirCount; i++) + { + string dirInArchive = new System.String(new char[] { (char)(i + 65) }); + var selected1 = zip1.SelectEntries(Path.Combine(dirInArchive, "*.*")); + count1 += selected1.Count; + TestContext.WriteLine("--------------\nfiles in dir {0} ({1}):", + dirInArchive, selected1.Count); + foreach (ZipEntry e in selected1) + TestContext.WriteLine(e.FileName); + } + Assert.AreEqual(entries, count1); + } + + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Selecting entries by directory and size..."); + count1 = 0; + count2 = 0; + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + for (i = 0; i < subdirCount; i++) + { + string dirInArchive = new System.String(new char[] { (char)(i + 65) }); + string pathCriterion = String.Format("name = {0}", + Path.Combine(dirInArchive, "*.*")); + string combinedCriterion = String.Format("size > 1500 AND {0}", pathCriterion); + + var selected1 = zip1.SelectEntries(combinedCriterion, dirInArchive); + count1 += selected1.Count; + TestContext.WriteLine("--------------\nfiles in ({0}) ({1} entries):", + combinedCriterion, + selected1.Count); + foreach (ZipEntry e in selected1) + TestContext.WriteLine(e.FileName); + } + + var selected2 = zip1.SelectEntries("size <= 1500"); + count2 = selected2.Count; + Assert.AreEqual(entries, count1 + count2 - subdirCount); + } + } + + + + + [TestMethod] + public void Selector_SelectEntries_NestedDirectories_wi8559() + { + //Directory.SetCurrentDirectory(TopLevelDir); + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectFiles_NestedDirectories.zip"); + + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Creating zip file..."); + + int dirCount = _rnd.Next(4) + 3; + using (var zip = new ZipFile()) + { + for (int i = 0; i < dirCount; i++) + { + String dir = new String((char)(65 + i), i + 1); + zip.AddEntry(Path.Combine(dir, "Readme.txt"), "This is the content for the Readme.txt in directory " + dir); + int subDirCount = _rnd.Next(3) + 2; + for (int j = 0; j < subDirCount; j++) + { + String subdir = Path.Combine(dir, new String((char)(90 - j), 3)); + zip.AddEntry(Path.Combine(subdir, "Readme.txt"), "This is the content for the Readme.txt in directory " + subdir); + } + } + zip.Save(zipFileToCreate); + } + + // this testmethod does not extract files, or verify checksums ... + + // just want to verify that selection of entries works in nested directories as + // well as + TestContext.WriteLine("===================================================="); + TestContext.WriteLine("Selecting entries by path..."); + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + for (int i = 0; i < dirCount; i++) + { + String dir = new String((char)(65 + i), i + 1); + var selected1 = zip1.SelectEntries("*.txt", dir); + Assert.AreEqual(1, selected1.Count); + + selected1 = zip1.SelectEntries("*.txt", dir + "/ZZZ"); + var selected2 = zip1.SelectEntries("*.txt", dir + "\\ZZZ"); + Assert.AreEqual(selected1.Count, selected2.Count); + + selected1 = zip1.SelectEntries("*.txt", dir + "/YYY"); + selected2 = zip1.SelectEntries("*.txt", dir + "\\YYY"); + Assert.AreEqual(selected1.Count, selected2.Count); + } + } + } + + + + + [TestMethod] + public void Selector_SelectFiles_DirName_wi8245() + { + // workitem 8245 + //Directory.SetCurrentDirectory(TopLevelDir); + SetupFiles(); + var ff = new Ionic.FileSelector("*.*"); + var result = ff.SelectFiles(fodderDirectory); + Assert.IsTrue(result.Count > 1); + } + + + [TestMethod] + public void Selector_SelectFiles_DirName_wi8245_2() + { + // workitem 8245 + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_SelectFiles_DirName_wi8245_2.zip"); + //Directory.SetCurrentDirectory(TopLevelDir); + SetupFiles(); + + var fodderFiles = Directory.GetFiles(fodderDirectory, "*.*", SearchOption.AllDirectories); + + TestContext.WriteLine("==============================================="); + TestContext.WriteLine("AddSelectedFiles()"); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles(fodderDirectory, null, "fodder", true); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), fodderFiles.Length, + "The Zip file has the wrong number of entries."); + } + + + + [TestMethod] + public void Selector_SelectFiles_DirName_wi9176() + { + // workitem 9176 + //Directory.SetCurrentDirectory(TopLevelDir); + + _txrx= TestUtilities.StartProgressMonitor("SelectFiles-DirName", + "Select Files by DirName", + "workitem 9176"); + + SetupFiles(); + + var binFiles = Directory.GetFiles(fodderDirectory, "*.bin", SearchOption.AllDirectories); + + int[] eCount = new int[2]; + _txrx.Send("pb 0 max 2"); + for (int i = 0; i < 2; i++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, + String.Format("Selector_SelectFiles_DirName_wi9176-{0}.zip", i)); + _txrx.Send("pb 1 max 4"); + _txrx.Send("pb 1 value 0"); + string d = fodderDirectory; + if (i == 1) d += "\\"; + TestContext.WriteLine("==============================================="); + TestContext.WriteLine("AddSelectedFiles(cycle={0})", i); + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddSelectedFiles("name = *.bin", d, "", true); + _txrx.Send("pb 1 step"); + zip1.Save(zipFileToCreate); + } + _txrx.Send("pb 1 step"); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), binFiles.Length, + "The Zip file has the wrong number of entries."); + + _txrx.Send("pb 2 step"); + + using (ZipFile zip1 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip1) + { + if (e.FileName.Contains("/")) eCount[i]++; + } + } + _txrx.Send("pb 1 step"); + + if (i==1) + Assert.AreEqual(eCount[0], eCount[1], + "Inconsistent results when the directory includes a path.", i); + + _txrx.Send("pb 0 step"); + } + } + + + [TestMethod] + public void Selector_SelectFiles_GoodSyntax01() + { + string[] criteria = { + "type = D", + "type = F", + "attrs = HRS", + "attrs = L", + "name = *.txt OR (size > 7800)", + "name = *.harvey OR (size > 7800 and attributes = H)", + "(name = *.harvey) OR (size > 7800 and attributes = H)", + "(name = *.xls) and (name != *.xls) OR (size > 7800 and attributes = H)", + "(name = '*.xls')", + "(name = Ionic.Zip.dll) or ((size > 1mb) and (name != *.zip))", + "(name = Ionic.Zip.dll) or ((size > 1mb) and (name != *.zip)) or (name = Joe.txt)", + "(name=Ionic.Zip.dll) or ((size>1mb) and (name!=*.zip)) or (name=Joe.txt)", + "(name=Ionic.Zip.dll)or((size>1mb)and(name!=*.zip))or(name=Joe.txt)", + }; + + foreach (string s in criteria) + { + TestContext.WriteLine("Selector: " + s); + var ff = new Ionic.FileSelector(s); + } + } + + + [TestMethod] + public void Selector_Twiddle_wi10153() + { + // workitem 10153: + // + // When calling AddSelectedFiles(String,String,String,bool), and when the + // actual filesystem path uses mixed case, but the specified directoryOnDisk + // argument is downcased, AND when the filename contains a ~ (weird, I + // know), verify that the path replacement works as advertised, and entries + // are rooted in the directoryInArchive specified path. + + string zipFileToCreate = Path.Combine(TopLevelDir, "Selector_Twiddle.zip"); + string dirToZip = "dirToZip"; + var keyword = "Gamma"; + var files = TestUtilities.GenerateFilesFlat(dirToZip); + int k = 0; + Directory.SetCurrentDirectory(dirToZip); + Array.ForEach(files, x => { + File.Move(Path.GetFileName(x), + String.Format("~{0}.{1:D5}.txt", keyword, k++)); + }); + Directory.SetCurrentDirectory(TopLevelDir); + + using (ZipFile zip = new ZipFile()) + { + // must use ToLower to force case mismatch + zip.AddSelectedFiles("name != *.zip*", dirToZip.ToLower(), "", true); + zip.Save(zipFileToCreate); + } + + int nEntries = 0; + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip) + TestContext.WriteLine("entry {0}", e.FileName); + + TestContext.WriteLine(""); + + foreach (var e in zip) + { + TestContext.WriteLine("check {0}", e.FileName); + Assert.IsFalse(e.FileName.Contains("/"), + "The filename contains a path, but shouldn't"); + nEntries++; + } + } + Assert.IsTrue(nEntries>2, "Not enough entries"); + } + + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadNoun() + { + new Ionic.FileSelector("fame = *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax01() + { + new Ionic.FileSelector("size = "); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax02() + { + new Ionic.FileSelector("name = *.txt and"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax03() + { + new Ionic.FileSelector("name = *.txt URF "); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax04() + { + new Ionic.FileSelector("name = *.txt OR ("); + } + + [TestMethod] + [ExpectedException(typeof(System.FormatException))] + public void Selector_SelectFiles_BadSyntax05() + { + new Ionic.FileSelector("name = *.txt OR (size = G)"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax06() + { + new Ionic.FileSelector("name = *.txt OR (size > )"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax07() + { + new Ionic.FileSelector("name = *.txt OR (size > 7800"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax08() + { + new Ionic.FileSelector("name = *.txt OR )size > 7800"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax09() + { + new Ionic.FileSelector("name = *.txt and name ="); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax10() + { + new Ionic.FileSelector("name == *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax10a() + { + new Ionic.FileSelector("name >= *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax11() + { + new Ionic.FileSelector("name ~= *.txt"); + } + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax12() + { + new Ionic.FileSelector("name @ = *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax13() + { + new Ionic.FileSelector("name LIKE *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax14() + { + new Ionic.FileSelector("name AND *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax15() + { + new Ionic.FileSelector("name (AND *.txt"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax16() + { + new Ionic.FileSelector("mtime 2007-01-01"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax17() + { + new Ionic.FileSelector("size 1kb"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax18() + { + Ionic.FileSelector ff = new Ionic.FileSelector(""); + var list = ff.SelectFiles("."); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax19() + { + Ionic.FileSelector ff = new Ionic.FileSelector(null); + var list = ff.SelectFiles("."); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax20() + { + new Ionic.FileSelector("attributes > HRTS"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax21() + { + new Ionic.FileSelector("attributes HRTS"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax22a() + { + new Ionic.FileSelector("attributes = HHHA"); + } + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax22b() + { + new Ionic.FileSelector("attributes = SHSA"); + } + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax22c() + { + new Ionic.FileSelector("attributes = AHA"); + } + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax22d() + { + new Ionic.FileSelector("attributes = RRA"); + } + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax22e() + { + new Ionic.FileSelector("attributes = IRIA"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax23() + { + new Ionic.FileSelector("attributes = INVALID"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax24a() + { + new Ionic.FileSelector("type = I"); + } + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void Selector_SelectFiles_BadSyntax24b() + { + new Ionic.FileSelector("type > D"); + } + + [TestMethod] + public void Selector_Normalize() + { + + string[][] sPairs = { + new string[] { + "name = '.\\Selector (this is a Test)\\this.txt'", + null}, + + new string[] { + "(size > 100)AND(name='Name (with Parens).txt')", + "(size > 100 AND name = 'Name (with Parens).txt')"}, + + new string[] { + "(size > 100) AND ((name='Name (with Parens).txt')OR(name=*.jpg))", + "(size > 100 AND (name = 'Name (with Parens).txt' OR name = '*.jpg'))"}, + + new string[] { + "name='*.txt' and name!='* *.txt'", + "(name = '*.txt' AND name != '* *.txt')"}, + + new string[] { + "name = *.txt AND name != '* *.txt'", + "(name = '*.txt' AND name != '* *.txt')"}, + }; + + + for (int i=0; i < sPairs.Length; i++) + { + var pair = sPairs[i]; + var selector = pair[0]; + var expectedResult = pair[1]; + var fsel = new FileSelector(selector); + var stringVer = fsel.ToString().Replace("\u00006"," "); + Assert.AreEqual("FileSelector("+ (expectedResult ?? selector) + +")", + stringVer, + "entry {0}", i); + } + } + + + [TestMethod] + public void Selector_SingleQuotesAndSlashes_wi14033() + { + var zipFileToCreate = "SingleQuotes.zip"; + var parentDir = "DexMik"; + + int nFolders = this._rnd.Next(4)+3; + TestContext.WriteLine("Creating {0} folders:", nFolders); + Directory.CreateDirectory(parentDir); + string[] childFolders = new string[nFolders+1]; + childFolders[0] = parentDir; + for (int i=0; i < nFolders; i++) + { + var b1 = "folder" + (i+1); + int k = (i > 0) ? this._rnd.Next(i+1) : 0; + var d1 = Path.Combine(childFolders[k], b1); + TestContext.WriteLine(" {0}", d1); + Directory.CreateDirectory(d1); + childFolders[i+1] = d1; + + int nFiles = this._rnd.Next(3)+2; + TestContext.WriteLine(" Creating {0} files:", nFiles); + for (int j=0; j < nFiles; j++) + { + var fn1 = Path.GetRandomFileName(); + var fname = Path.Combine(d1,fn1); + TestContext.WriteLine(" {0}", fn1); + TestUtilities.CreateAndFillFileText(fname, this._rnd.Next(10000) + 1000); + } + TestContext.WriteLine(""); + } + + // create a zip file using those files + TestContext.WriteLine(""); + TestContext.WriteLine("Zipping:"); + using (var zip = new ZipFile()) + { + zip.AddDirectory(parentDir, childFolders[0]); + zip.Save(zipFileToCreate); + } + + // list all the entries + TestContext.WriteLine(""); + TestContext.WriteLine("List of entries:"); + using (var zip = new ZipFile(zipFileToCreate)) + { + foreach (var e in zip) + { + TestContext.WriteLine(" {0}", e.FileName); + } + } + TestContext.WriteLine(""); + + // now select some of the entries + int m = this._rnd.Next(nFolders)+1; + TestContext.WriteLine(""); + TestContext.WriteLine("Selecting entries from folder {0}:", m); + using (var zip = new ZipFile(zipFileToCreate)) + { + string selectCriteria = + String.Format("name = '{0}'", + Path.Combine(childFolders[m], "*.*")); + TestContext.WriteLine("select: {0}", selectCriteria); + var selection1 = zip.SelectEntries(selectCriteria); + Assert.IsTrue(selection1.Count > 0, "first selection failed."); + + foreach (var item in selection1) + { + TestContext.WriteLine(" {0}", item); + } + + // Try different formats of the selection string - with + // and without quotes, with fwd slashes and back + // slashes. + string[][] replacementPairs = { + new string[] { "\\", "/" }, // backslash to fwdslash + new string[] { "'", "" }, // remove single quotes + new string[] { "/", "\\" }, // fwdslash to backslash + }; + + for (int k=0; k < 3; k++) + { + selectCriteria = selectCriteria.Replace(replacementPairs[k][0], + replacementPairs[k][1]); + + TestContext.WriteLine(""); + TestContext.WriteLine("Try #{0}: {1}", k+2, selectCriteria); + var selection2 = zip.SelectEntries(selectCriteria); + foreach (var item in selection2) + { + TestContext.WriteLine(" {0}", item); + } + + Assert.AreEqual(selection1.Count, + selection2.Count, + "selection verification trial {0} failed.", k); + } + } + + } + + } +} diff --git a/dotNetZip/Zip Tests/SelfExtractor.cs b/dotNetZip/Zip Tests/SelfExtractor.cs new file mode 100644 index 0000000..1af55d8 --- /dev/null +++ b/dotNetZip/Zip Tests/SelfExtractor.cs @@ -0,0 +1,859 @@ +// SelfExtractor.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009, 2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-June-18 21:12:09> +// +// ------------------------------------------------------------------ +// +// This module defines the tests for the self-extracting archive capability +// within DotNetZip: creating, reading, updating, and running SFX's. +// +// ------------------------------------------------------------------ + + +using System; +using System.Text; +using System.Collections.Generic; +using System.Linq; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + + +namespace Ionic.Zip.Tests +{ + /// + /// Summary description for Self extracting archives (SFX) + /// + [TestClass] + public class SelfExtractor : IonicTestClass + { + public SelfExtractor() : base() { } + + + [TestMethod] + public void SFX_CanRead() + { + SelfExtractorFlavor[] flavors = + { + SelfExtractorFlavor.ConsoleApplication, + SelfExtractorFlavor.WinFormsApplication + }; + + for (int k = 0; k < flavors.Length; k++) + { + string sfxFileToCreate = Path.Combine(TopLevelDir, String.Format("SFX_{0}.exe", flavors[k].ToString())); + string unpackDir = Path.Combine(TopLevelDir, "unpack"); + if (Directory.Exists(unpackDir)) + Directory.Delete(unpackDir, true); + string readmeString = "Hey there! This zipfile entry was created directly from a string in application code."; + + int entriesAdded = 0; + String filename = null; + + string Subdir = Path.Combine(TopLevelDir, String.Format("A{0}", k)); + Directory.CreateDirectory(Subdir); + var checksums = new Dictionary(); + + int fileCount = _rnd.Next(50) + 30; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(Subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(filename.Replace(TopLevelDir + "\\", "").Replace('\\', '/'), TestUtilities.CheckSumToString(chk)); + } + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddDirectory(Subdir, Path.GetFileName(Subdir)); + zip1.Comment = "This will be embedded into a self-extracting exe"; + MemoryStream ms1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(readmeString)); + zip1.AddEntry("Readme.txt", ms1); + zip1.SaveSelfExtractor(sfxFileToCreate, flavors[k]); + } + + TestContext.WriteLine("---------------Reading {0}...", sfxFileToCreate); + using (ZipFile zip2 = ZipFile.Read(sfxFileToCreate)) + { + //string extractDir = String.Format("extract{0}", j); + foreach (var e in zip2) + { + TestContext.WriteLine(" Entry: {0} c({1}) u({2})", e.FileName, e.CompressedSize, e.UncompressedSize); + e.Extract(unpackDir); + if (!e.IsDirectory) + { + if (checksums.ContainsKey(e.FileName)) + { + filename = Path.Combine(unpackDir, e.FileName); + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(filename)); + Assert.AreEqual(checksums[e.FileName], actualCheckString, "In trial {0}, Checksums for ({1}) do not match.", k, e.FileName); + } + else + { + Assert.AreEqual("Readme.txt", e.FileName, String.Format("trial {0}", k)); + } + } + } + } + } + } + + + + [TestMethod] + public void SFX_Update_Console() + { + SFX_Update(SelfExtractorFlavor.ConsoleApplication); + } + + [TestMethod] + public void SFX_Update_Winforms() + { + SFX_Update(SelfExtractorFlavor.WinFormsApplication); + } + + private void SFX_Update(SelfExtractorFlavor flavor) + { + string sfxFileToCreate = Path.Combine(TopLevelDir, + String.Format("SFX_Update{0}.exe", + flavor.ToString())); + string unpackDir = Path.Combine(TopLevelDir, "unpack"); + if (Directory.Exists(unpackDir)) + Directory.Delete(unpackDir, true); + + string readmeString = "Hey there! This zipfile entry was created directly from a string in application code."; + + // create a file and compute the checksum + string Subdir = Path.Combine(TopLevelDir, "files"); + Directory.CreateDirectory(Subdir); + var checksums = new Dictionary(); + + string filename = Path.Combine(Subdir, "file1.txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(filename.Replace(TopLevelDir + "\\", "").Replace('\\', '/'), TestUtilities.CheckSumToString(chk)); + + // create the SFX + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFile(filename, Path.GetFileName(Subdir)); + zip1.Comment = "This will be embedded into a self-extracting exe"; + MemoryStream ms1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(readmeString)); + zip1.AddEntry("Readme.txt", ms1); + var sfxOptions = new SelfExtractorSaveOptions + { + Flavor = flavor, + Quiet = true, + DefaultExtractDirectory = unpackDir + }; + zip1.SaveSelfExtractor(sfxFileToCreate, sfxOptions); + } + + // verify count + Assert.AreEqual(TestUtilities.CountEntries(sfxFileToCreate), 2, "The Zip file has the wrong number of entries."); + + // create another file + filename = Path.Combine(Subdir, "file2.txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(filename.Replace(TopLevelDir + "\\", "").Replace('\\', '/'), TestUtilities.CheckSumToString(chk)); + string password = "ABCDEFG"; + // update the SFX + using (ZipFile zip1 = ZipFile.Read(sfxFileToCreate)) + { + zip1.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.Comment = "The password is: " + password; + zip1.Password = password; + zip1.AddFile(filename, Path.GetFileName(Subdir)); + var sfxOptions = new SelfExtractorSaveOptions + { + Flavor = flavor, + Quiet = true, + DefaultExtractDirectory = unpackDir + }; + zip1.SaveSelfExtractor(sfxFileToCreate, sfxOptions); + } + + // verify count + Assert.AreEqual(TestUtilities.CountEntries(sfxFileToCreate), 3, "The Zip file has the wrong number of entries."); + + + // read the SFX + TestContext.WriteLine("---------------Reading {0}...", sfxFileToCreate); + using (ZipFile zip2 = ZipFile.Read(sfxFileToCreate)) + { + zip2.Password = password; + //string extractDir = String.Format("extract{0}", j); + foreach (var e in zip2) + { + TestContext.WriteLine(" Entry: {0} c({1}) u({2})", e.FileName, e.CompressedSize, e.UncompressedSize); + e.Extract(unpackDir); + if (!e.IsDirectory) + { + if (checksums.ContainsKey(e.FileName)) + { + filename = Path.Combine(unpackDir, e.FileName); + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(filename)); + Assert.AreEqual(checksums[e.FileName], actualCheckString, "Checksums for ({1}) do not match.", e.FileName); + //TestContext.WriteLine(" Checksums match ({0}).\n", actualCheckString); + } + else + { + Assert.AreEqual("Readme.txt", e.FileName); + } + } + } + } + + int N = (flavor == SelfExtractorFlavor.ConsoleApplication) ? 2 : 1; + for (int j = 0; j < N; j++) + { + // run the SFX + TestContext.WriteLine("Running the SFX... "); + var psi = new System.Diagnostics.ProcessStartInfo(sfxFileToCreate); + if (flavor == SelfExtractorFlavor.ConsoleApplication) + { + if (j == 0) + psi.Arguments = "-o -p " + password; // overwrite + else + psi.Arguments = "-p " + password; + } + psi.WorkingDirectory = TopLevelDir; + psi.UseShellExecute = false; + psi.CreateNoWindow = true; + System.Diagnostics.Process process = System.Diagnostics.Process.Start(psi); + process.WaitForExit(); + int rc = process.ExitCode; + TestContext.WriteLine("SFX exit code: ({0})", rc); + + if (j == 0) + { + Assert.AreEqual(0, rc, "The exit code from the SFX was nonzero ({0}).", rc); + } + else + { + Assert.AreNotEqual(0, rc, "The exit code from the SFX was zero ({0})."); + } + } + + // verify the unpacked files? + } + + + + [TestMethod] + public void SFX_Console() + { + string exeFileToCreate = Path.Combine(TopLevelDir, "SFX_Console.exe"); + string unpackDir = Path.Combine(TopLevelDir, "unpack"); + string readmeString = "Hey there! This zipfile entry was created directly from a string in application code."; + + int entriesAdded = 0; + String filename = null; + + string Subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(Subdir); + var checksums = new Dictionary(); + + int fileCount = _rnd.Next(10) + 10; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(Subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(filename, TestUtilities.CheckSumToString(chk)); + } + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(Subdir, Path.GetFileName(Subdir)); + zip.Comment = "This will be embedded into a self-extracting exe"; + MemoryStream ms1 = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(readmeString)); + zip.AddEntry("Readme.txt", ms1); + var sfxOptions = new SelfExtractorSaveOptions + { + Flavor = Ionic.Zip.SelfExtractorFlavor.ConsoleApplication, + DefaultExtractDirectory = unpackDir + }; + zip.SaveSelfExtractor(exeFileToCreate, sfxOptions); + } + + var psi = new System.Diagnostics.ProcessStartInfo(exeFileToCreate); + psi.WorkingDirectory = TopLevelDir; + psi.UseShellExecute = false; + psi.CreateNoWindow = true; + System.Diagnostics.Process process = System.Diagnostics.Process.Start(psi); + process.WaitForExit(); + + // now, compare the output in unpackDir with the original + string DirToCheck = Path.Combine(unpackDir, "A"); + // verify the checksum of each file matches with its brother + foreach (string fname in Directory.GetFiles(DirToCheck)) + { + string originalName = fname.Replace("\\unpack", ""); + if (checksums.ContainsKey(originalName)) + { + string expectedCheckString = checksums[originalName]; + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(fname)); + Assert.AreEqual(expectedCheckString, actualCheckString, "Unexpected checksum on extracted filesystem file ({0}).", fname); + } + else + Assert.AreEqual("Readme.txt", originalName); + + } + } + + + [TestMethod] + public void SFX_WinForms() + { + string[] Passwords = { null, "12345" }; + for (int k = 0; k < Passwords.Length; k++) + { + string exeFileToCreate = Path.Combine(TopLevelDir, String.Format("SFX_WinForms-{0}.exe", k)); + string DesiredunpackDir = Path.Combine(TopLevelDir, String.Format("unpack{0}", k)); + + String filename = null; + + string Subdir = Path.Combine(TopLevelDir, String.Format("A{0}", k)); + Directory.CreateDirectory(Subdir); + var checksums = new Dictionary(); + + int fileCount = _rnd.Next(10) + 10; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(Subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(filename, TestUtilities.CheckSumToString(chk)); + } + + using (ZipFile zip = new ZipFile()) + { + zip.Password = Passwords[k]; + zip.AddDirectory(Subdir, Path.GetFileName(Subdir)); + zip.Comment = "For testing purposes, please extract to: " + DesiredunpackDir; + if (Passwords[k] != null) zip.Comment += String.Format("\r\n\r\nThe password for all entries is: {0}\n", Passwords[k]); + var sfxOptions = new SelfExtractorSaveOptions + { + Flavor = Ionic.Zip.SelfExtractorFlavor.WinFormsApplication, + // workitem 12608 + SfxExeWindowTitle = "Custom SFX Title " + DateTime.Now.ToString("G"), + DefaultExtractDirectory = DesiredunpackDir + }; + zip.SaveSelfExtractor(exeFileToCreate, sfxOptions); + } + + // run the self-extracting EXE we just created + System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(exeFileToCreate); + psi.Arguments = DesiredunpackDir; + psi.WorkingDirectory = TopLevelDir; + psi.UseShellExecute = false; + psi.CreateNoWindow = true; + System.Diagnostics.Process process = System.Diagnostics.Process.Start(psi); + process.WaitForExit(); + + // now, compare the output in TargetDirectory with the original + string DirToCheck = Path.Combine(DesiredunpackDir, String.Format("A{0}", k)); + // verify the checksum of each file matches with its brother + var fileList = Directory.GetFiles(DirToCheck); + Assert.AreEqual(checksums.Keys.Count, fileList.Length, "Trial {0}: Inconsistent results.", k); + + foreach (string fname in fileList) + { + string expectedCheckString = checksums[fname.Replace(String.Format("\\unpack{0}", k), "")]; + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(fname)); + Assert.AreEqual(expectedCheckString, actualCheckString, "Trial {0}: Unexpected checksum on extracted filesystem file ({1}).", k, fname); + } + } + } + + + + string programCode = + + "using System;\n" + + "namespace Ionic.Tests.Zip.SelfExtractor\n" + + "{\n" + + "\n" + + " public class TestDriver\n" + + " {\n" + + " static int Main(String[] args)\n" + + " {\n" + + " int rc = @@XXX@@;\n" + + " Console.WriteLine(\"Hello from the post-extract command.\\nThis app will return {0}.\", rc);\n" + + " return rc;\n" + + " }\n" + + " }\n" + + "}\n"; + + + private void CompileApp(int rc, string pathToExe) + { + var csharp = new Microsoft.CSharp.CSharpCodeProvider(); + var cp = new System.CodeDom.Compiler.CompilerParameters + { + GenerateInMemory = false, + GenerateExecutable = true, + IncludeDebugInformation = false, + OutputAssembly = pathToExe + }; + + // set the return code in the app + var cr = csharp.CompileAssemblyFromSource + (cp, programCode.Replace("@@XXX@@", rc.ToString())); + + if (cr == null) + throw new Exception("Errors compiling post-extract exe!"); + + foreach (string s in cr.Output) + TestContext.WriteLine(s); + + if (cr.Errors.Count != 0) + throw new Exception("Errors compiling post-extract exe!"); + } + + + // Here's a set of SFX tests with post-extract EXEs. + // We vary these parameters: + // - exe exists or not - 2 trials each test. + // - exe name has spaces or not + // - winforms or not + // - whether to run the exe or just compile + // - whether to append args or not + // - force noninteractive or not (only for Winforms flavor, to allow automated tests) + + [TestMethod] + public void SFX_RunOnExit_Console() + { + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.ConsoleApplication, + true, // runPostExtract + true, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_Console_Args() + { + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.ConsoleApplication, + true, // runPostExtract + true, // quiet + false, // forceNoninteractive + true); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms() + { + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // runPostExtract + true, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_DontRun() + { + // This test case just tests the generation (compilation) of + // the SFX. It is included because the interactive winforms + // SFX is not performed on automated test runs. + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + false, // runPostExtract + true, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_Interactive() + { + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // runPostExtract + false, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_NonInteractive() + { + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // runPostExtract + true, // quiet + true, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_NonInteractive_Args() + { + _Internal_SelfExtractor_Command("post-extract-run-on-exit-{0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // runPostExtract + true, // quiet + true, // forceNoninteractive + true); // wantArgs + } + + // ------------------------------------------------------------------ // + + [TestMethod] + public void SFX_RunOnExit_Console_withSpaces() + { + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.ConsoleApplication, + true, // runPostExtract + true, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + + [TestMethod] + public void SFX_RunOnExit_Console_withSpaces_Args() + { + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.ConsoleApplication, + true, // runPostExtract + true, // quiet + false, // forceNoninteractive + true); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_withSpaces() + { + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // runPostExtract + true, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_withSpaces_DontRun() + { + // This test case just tests the generation (compilation) of + // the SFX. It is included because the interactive winforms + // SFX is not performed on automated test runs. + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + false, // run the SFX? + true, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_withSpaces_Interactive() + { + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // actually run the program + false, // quiet + false, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_withSpaces_NonInteractive() + { + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // actually run the program + true, // quiet + true, // forceNoninteractive + false); // wantArgs + } + + [TestMethod] + public void SFX_RunOnExit_WinForms_withSpaces_NonInteractive_Args() + { + _Internal_SelfExtractor_Command("post extract run on exit {0:D4}.exe", + SelfExtractorFlavor.WinFormsApplication, + true, // actually run the program + true, // quiet + true, // forceNoninteractive + true); // wantArgs + } + + + public void _Internal_SelfExtractor_Command(string cmdFormat, + SelfExtractorFlavor flavor, + bool runSfx, + bool quiet, + bool forceNoninteractive, + bool wantArgs) + { + TestContext.WriteLine("=============================="); + TestContext.WriteLine("SFX_RunOnExit({0})", flavor.ToString()); + + //int entriesAdded = 0; + //String filename = null; + string postExtractExe = String.Format(cmdFormat, _rnd.Next(3000)); + + // If WinForms and want forceNoninteractive, have the post-extract-exe return 0, + // else, select a random number. + int expectedReturnCode = (forceNoninteractive && + flavor == SelfExtractorFlavor.WinFormsApplication) + ? 0 + : _rnd.Next(1024) + 20; + TestContext.WriteLine("The post-extract command ({0}) will return {1}", + postExtractExe, expectedReturnCode); + + string subdir = "A"; + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + + for (int k = 0; k < 2; k++) + { + string readmeString = + String.Format("Hey! This zipfile entry was created directly from " + + "a string in application code. Flavor ({0}) Trial({1})", + flavor.ToString(), k); + string exeFileToCreate = String.Format("SFX_Command.{0}.{1}.exe", + flavor.ToString(), k); + + TestContext.WriteLine("----------------------"); + TestContext.WriteLine("Trial {0}", k); + string unpackDir = String.Format("unpack.{0}", k); + + var sw = new System.IO.StringWriter(); + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + zip.AddDirectory(subdir, subdir); // Path.GetFileName(subdir)); + zip.Comment = String.Format("Trial options: fl({0}) cmd ({3})\r\n"+ + "actuallyRun({1})\r\nquiet({2})\r\n"+ + "exists? {4}\r\nexpected rc={5}", + flavor, + runSfx, + quiet, + postExtractExe, + k!=0, + expectedReturnCode + ); + var ms1 = new MemoryStream(Encoding.UTF8.GetBytes(readmeString)); + zip.AddEntry("Readme.txt", ms1); + if (k != 0) + { + CompileApp(expectedReturnCode, postExtractExe); + zip.AddFile(postExtractExe); + } + + var sfxOptions = new SelfExtractorSaveOptions + { + Flavor = flavor, + DefaultExtractDirectory = unpackDir, + SfxExeWindowTitle = "Custom SFX Title " + DateTime.Now.ToString("G"), + Quiet = quiet + }; + + // In the case of k==0, this exe does not exist. It will result in + // a return code of 5. In k == 1, the exe exists and will succeed. + if (postExtractExe.Contains(' ')) + sfxOptions.PostExtractCommandLine= "\"" + postExtractExe + "\""; + else + sfxOptions.PostExtractCommandLine= postExtractExe; + + if (wantArgs) + sfxOptions.PostExtractCommandLine += " arg1 arg2"; + + zip.SaveSelfExtractor(exeFileToCreate, sfxOptions); + } + + TestContext.WriteLine("status output: " + sw.ToString()); + + if (k != 0) File.Delete(postExtractExe); + + // Run the generated Self-extractor, conditionally. + // + // We always run, unless specifically asked not to, OR if it's a + // winforms app and we want it to be noninteractive and there's no + // EXE to run. If we try running a non-existent app, it will pop an + // error message, hence user interaction, which we need to avoid for + // the automated test. + if (runSfx && + (k != 0 || !forceNoninteractive || + flavor != SelfExtractorFlavor.WinFormsApplication)) + { + TestContext.WriteLine("Running the SFX... "); + System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(exeFileToCreate); + psi.WorkingDirectory = TopLevelDir; + psi.UseShellExecute = false; + psi.CreateNoWindow = true; // false; + System.Diagnostics.Process process = System.Diagnostics.Process.Start(psi); + process.WaitForExit(); + int rc = process.ExitCode; + TestContext.WriteLine("SFX exit code: ({0})", rc); + + // The exit code is returned only if it's a console SFX. + if (flavor == SelfExtractorFlavor.ConsoleApplication) + { + // The program actually runs if k != 0 + if (k == 0) + { + // The file to execute should not have been found, hence rc==5. + Assert.AreEqual + (5, rc, "In trial {0}, the exit code was unexpected.", k); + } + else + { + // The file to execute should have returned a specific code. + Assert.AreEqual + (expectedReturnCode, rc, + "In trial {0}, the exit code did not match.", k); + } + } + else + Assert.AreEqual(0, rc, "In trial {0}, the exit code did not match.", k); + + VerifyChecksums(Path.Combine(unpackDir, "A"), + filesToZip, checksums); + } + } + } + + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadStateException))] + public void SFX_Save_Zip_As_EXE() + { + string sfxFileToCreate = "SFX_Save_Zip_As_EXE.exe"; + + // create a file to zip + string subdir = "files"; + Directory.CreateDirectory(subdir); + string filename = Path.Combine(subdir, "file1.txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + + // add an entry to the zipfile, then try saving to a directory. this should fail + using (ZipFile zip = new ZipFile()) + { + zip.AddFile(filename, ""); + zip.SaveSelfExtractor(sfxFileToCreate, + SelfExtractorFlavor.ConsoleApplication); + } + + // create another file + filename = Path.Combine(subdir, "file2.txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + + // update the SFX, save to a zip format + using (ZipFile zip = ZipFile.Read(sfxFileToCreate)) + { + zip.AddFile(filename, ""); + zip.Save(); // FAIL + } + } + + + + + [TestMethod] + public void SFX_RemoveFilesAfterUnpack_wi10682() + { + string subdir = "files"; + string[] filesToZip; + Dictionary checksums; + CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + string password = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + string postExeFormat = "post-extract-{0:D4}.exe"; + string postExtractExe = String.Format(postExeFormat, _rnd.Next(10000)); + CompileApp(0, postExtractExe); + + // pass 1 to run SFX and verify files are present; + // pass 2 to run SFX and verify that it deletes files after extracting. + + // 2 passes: one for no cmd line overload, one with overload of -r+/-r- + for (int j=0; j < 2; j++) + { + // 2 passes: with RemoveUnpackedFiles set or unset + for (int k=0; k < 2; k++) + { + string sfxFileToCreate = + String.Format("SFX_RemoveFilesAfterUnpack.{0}.{1}.exe",j,k); + using (ZipFile zip = new ZipFile()) + { + zip.Password = password; + zip.Encryption = Ionic.Zip.EncryptionAlgorithm.WinZipAes256; + Array.ForEach(filesToZip, x => { zip.AddFile(x, "files");}); + zip.AddFile(postExtractExe, "files"); + var sfxOptions = new SelfExtractorSaveOptions + { + Flavor = SelfExtractorFlavor.ConsoleApplication, + Quiet = true, + PostExtractCommandLine = Path.Combine("files",postExtractExe) + }; + + if (k==1) + sfxOptions.RemoveUnpackedFilesAfterExecute = true; + + zip.SaveSelfExtractor(sfxFileToCreate, sfxOptions); + } + + string extractDir = String.Format("extract.{0}.{1}",j,k); + string sfxCmdLineArgs = + String.Format("-p {0} -d {1}", password, extractDir); + + if (j==1) + { + // override the option set at time of zip.SaveSfx() + sfxCmdLineArgs += (k==0) ? " -r+" : " -r-"; + } + + // invoke the SFX + this.Exec(sfxFileToCreate, sfxCmdLineArgs, true, true); + + if (k==j) + { + // verify that the files are extracted, and match + VerifyChecksums(Path.Combine(extractDir, "files"), + filesToZip, checksums); + } + else + { + // verify that no files exist in the extract directory + var remainingFiles = Directory.GetFiles(extractDir); + Assert.IsTrue(remainingFiles.Length == 0); + } + } + } + } + + + + + } +} \ No newline at end of file diff --git a/dotNetZip/Zip Tests/SplitArchives.cs b/dotNetZip/Zip Tests/SplitArchives.cs new file mode 100644 index 0000000..d7b0b50 --- /dev/null +++ b/dotNetZip/Zip Tests/SplitArchives.cs @@ -0,0 +1,851 @@ +// SplitArchives.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-14 11:07:00> +// +// ------------------------------------------------------------------ +// +// This module defines tests for split (or 'spanned') archives. +// +// ------------------------------------------------------------------ + +// define REMOTE_FILESYSTEM in order to use a remote filesystem for storage of +// the ZIP64 large archive (which can beb huge). Leave it undefined to simply +// use the local TEMP directory. +//#define REMOTE_FILESYSTEM + +using System; +using System.IO; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Interop=System.Runtime.InteropServices; + + +using Ionic.Zip.Tests.Utilities; + + +namespace Ionic.Zip.Tests.Split +{ + /// + /// Summary description for ErrorTests + /// + [TestClass] + public class Split : IonicTestClass + { + [Interop.DllImport("kernel32.dll", + EntryPoint="CreateSymbolicLinkW", + CharSet=Interop.CharSet.Unicode)] + public static extern int CreateSymbolicLink(string lpSymlinkFileName, + string lpTargetFileName, + int dwFlags); + + + [TestMethod, Timeout(6 * 60*1000)] + public void Spanned_Create() + { + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + _txrx = TestUtilities.StartProgressMonitor("segmentedzip", + "Segmented Zips", + "Creating files"); + _txrx.Send("pb 0 max 2"); + + int numFiles = _rnd.Next(10) + 8; + int overflows = 0; + string msg; + + _txrx.Send("pb 1 max " + numFiles); + + var update = new Action( (x,y,z) => { + switch (x) + { + case 0: + _txrx.Send(String.Format("pb 2 max {0}", ((int)z))); + break; + case 1: + msg = String.Format("pb 2 value {0}", ((int)z)); + _txrx.Send(msg); + break; + case 2: + _txrx.Send("pb 1 step"); + _txrx.Send("pb 2 value 0"); + msg = String.Format("status created {0}/{1} files", + y+1, + ((int)z)); + _txrx.Send(msg); + break; + } + }); + + _txrx.Send("status creating " + numFiles + " files..."); + + string[] filesToZip; + Dictionary checksums; + CreateLargeFilesWithChecksums(dirToZip, numFiles, update, + out filesToZip, out checksums); + _txrx.Send("pb 0 step"); + int[] segmentSizes = { 0, 64*1024, 128*1024, 512*1024, 1024*1024, + 2*1024*1024, 8*1024*1024, 16*1024*1024, + 1024*1024*1024 }; + + _txrx.Send("status zipping..."); + _txrx.Send(String.Format("pb 1 max {0}", segmentSizes.Length)); + + System.EventHandler sp = (sender1, e1) => + { + switch (e1.EventType) + { + case ZipProgressEventType.Saving_Started: + _txrx.Send(String.Format("pb 2 max {0}", filesToZip.Length)); + _txrx.Send("pb 2 value 0"); + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + TestContext.WriteLine("Saved entry {0}, {1} bytes", + e1.CurrentEntry.FileName, + e1.CurrentEntry.UncompressedSize); + _txrx.Send("pb 2 step"); + break; + } + }; + + + for (int m=0; m < segmentSizes.Length; m++) + { + string trialDir = String.Format("trial{0}", m); + Directory.CreateDirectory(trialDir); + string zipFileToCreate = Path.Combine(trialDir, + String.Format("Archive-{0}.zip",m)); + int maxSegSize = segmentSizes[m]; + + msg = String.Format("status trial {0}/{1} (max seg size {2}k)", + m+1, segmentSizes.Length, maxSegSize/1024); + _txrx.Send(msg); + + TestContext.WriteLine("======="); + TestContext.WriteLine("Trial {0}", m); + if (maxSegSize > 0) + TestContext.WriteLine("Creating a segmented zip...segsize({0})", maxSegSize); + else + TestContext.WriteLine("Creating a regular zip..."); + + var sw = new StringWriter(); + bool aok = false; + try + { + using (var zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + zip.BufferSize = 0x8000; + zip.CodecBufferSize = 0x8000; + zip.AddDirectory(dirToZip, "files"); + zip.MaxOutputSegmentSize = maxSegSize; + zip.SaveProgress += sp; + zip.Save(zipFileToCreate); + } + aok = true; + } + catch (OverflowException) + { + TestContext.WriteLine("Overflow - too many segments..."); + overflows++; + } + + if (aok) + { + TestContext.WriteLine("{0}", sw.ToString()); + + // // If you want to see the diskNumber for each entry, + // // uncomment the following: + // TestContext.WriteLine("Checking info..."); + // sw = new StringWriter(); + // //string extractDir = String.Format("ex{0}", m); + // using (var zip = ZipFile.Read(zipFileToCreate)) + // { + // zip.StatusMessageTextWriter = sw; + // foreach (string s in zip.Info.Split('\r','\n')) + // { + // Console.WriteLine("{0}", s); + // } + // + // // unnecessary - BasicVerify does this + // //foreach (var e in zip) + // //e.Extract(extractDir); + // } + // TestContext.WriteLine("{0}", sw.ToString()); + + TestContext.WriteLine("Extracting..."); + string extractDir = BasicVerifyZip(zipFileToCreate); + + // also verify checksums + VerifyChecksums(Path.Combine(extractDir, "files"), filesToZip, checksums); + } + _txrx.Send("pb 1 step"); + } + + _txrx.Send("pb 0 step"); + + Assert.IsTrue(overflows < 3, "Too many overflows. Check the test."); + } + + + + bool _pb1Set; + bool _pb2Set; + int _numExtracted; + int _numFilesToExtract; + int _nCycles; + void ExtractProgress(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_BeforeExtractEntry: + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", _numFilesToExtract)); + _pb1Set = true; + } + _pb2Set = false; + _nCycles = 0; + break; + + case ZipProgressEventType.Extracting_EntryBytesWritten: + if (!_pb2Set) + { + _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); + _pb2Set = true; + } + // for performance, don't update the progress monitor every time. + _nCycles++; + if (_nCycles % 64 == 0) + { + _txrx.Send(String.Format("status Extracting entry {0}/{1} :: {2} :: {3}/{4}mb :: {5:N0}%", + _numExtracted, _numFilesToExtract, + e.CurrentEntry.FileName, + e.BytesTransferred/(1024*1024), + e.TotalBytesToTransfer/(1024*1024), + ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer) + )); + string msg = String.Format("pb 2 value {0}", e.BytesTransferred); + _txrx.Send(msg); + } + break; + + case ZipProgressEventType.Extracting_AfterExtractEntry: + _numExtracted++; + _txrx.Send("pb 1 step"); + break; + } + } + + + + [TestMethod] + [Timeout(90 * 60*1000)] + public void Create_LargeSegmentedArchive() + { + // There was a claim that large archives (around or above + // 1gb) did not work well with archive splitting. This test + // covers that case. + +#if REMOTE_FILESYSTEM + string parentDir = Path.Combine("t:\\tdir", Path.GetFileNameWithoutExtension(TopLevelDir)); + _FilesToRemove.Add(parentDir); + Directory.CreateDirectory(parentDir); + string zipFileToCreate = Path.Combine(parentDir, + "Create_LargeSegmentedArchive.zip"); +#else + string zipFileToCreate = Path.Combine(TopLevelDir, "Create_LargeSegmentedArchive.zip"); +#endif + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + + // This file will "cache" the randomly generated text, so we + // don't have to generate more than once. You know, for + // speed. + string cacheFile = Path.Combine(TopLevelDir, "cacheFile.txt"); + + // int maxSegSize = 4*1024*1024; + // int sizeBase = 20 * 1024 * 1024; + // int sizeRandom = 1 * 1024 * 1024; + // int numFiles = 3; + + // int maxSegSize = 80*1024*1024; + // int sizeBase = 320 * 1024 * 1024; + // int sizeRandom = 20 * 1024 * 1024 ; + // int numFiles = 5; + + int maxSegSize = 120*1024*1024; + int sizeBase = 420 * 1024 * 1024; + int sizeRandom = 20 * 1024 * 1024; + int numFiles = _rnd.Next(5) + 11; + + TestContext.WriteLine("The zip will contain {0} files", numFiles); + + int numSaving= 0, totalToSave = 0, numSegs= 0; + long sz = 0; + + + // There are a bunch of Action's here. This test method originally + // used ZipFile.AddEntry overload that accepts an opener/closer pair. + // It conjured content for the files out of a RandomTextGenerator + // stream. This worked, but was very very slow. So I took a new + // approach to use a WriteDelegate, and still contrive the data, but + // cache it for entries after the first one. This makes things go much + // faster. + // + // But, when using the WriteDelegate, the SaveProgress events of + // flavor ZipProgressEventType.Saving_EntryBytesRead do not get + // called. Therefore the progress updates are done from within the + // WriteDelegate itself. The SaveProgress events for SavingStarted, + // BeforeWriteEntry, and AfterWriteEntry do get called. As a result + // this method uses 2 delegates: one for writing and one for the + // SaveProgress events. + + WriteDelegate writer = (name, stream) => + { + Stream input = null; + Stream cache = null; + try + { + // use a cahce file as the content. The entry + // name will vary but we'll get the content for + // each entry from the a single cache file. + if (File.Exists(cacheFile)) + { + input = File.Open(cacheFile, + FileMode.Open, + FileAccess.ReadWrite, + FileShare.ReadWrite); + // Make the file slightly shorter with each + // successive entry, - just to shake things + // up a little. Also seek forward a little. + var fl = input.Length; + input.SetLength(fl - _rnd.Next(sizeRandom/2) + 5201); + input.Seek(_rnd.Next(sizeRandom/2), SeekOrigin.Begin); + } + else + { + sz = sizeBase + _rnd.Next(sizeRandom); + input = new Ionic.Zip.Tests.Utilities.RandomTextInputStream((int)sz); + cache = File.Create(cacheFile); + } + _txrx.Send(String.Format("pb 2 max {0}", sz)); + _txrx.Send("pb 2 value 0"); + var buffer = new byte[8192]; + int n; + Int64 totalWritten = 0; + int nCycles = 0; + using (input) + { + while ((n= input.Read(buffer,0, buffer.Length))>0) + { + stream.Write(buffer,0,n); + if (cache!=null) + cache.Write(buffer,0,n); + totalWritten += n; + // for performance, don't update the + // progress monitor every time. + nCycles++; + if (nCycles % 312 == 0) + { + _txrx.Send(String.Format("pb 2 value {0}", totalWritten)); + _txrx.Send(String.Format("status Saving entry {0}/{1} {2} :: {3}/{4}mb {5:N0}%", + numSaving, totalToSave, + name, + totalWritten/(1024*1024), sz/(1024*1024), + ((double)totalWritten) / (0.01 * sz))); + } + } + } + } + finally + { + if (cache!=null) cache.Dispose(); + } + }; + + EventHandler sp = (sender1, e1) => + { + switch (e1.EventType) + { + case ZipProgressEventType.Saving_Started: + numSaving= 0; + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + _txrx.Send("test Large Segmented Zip"); + _txrx.Send(String.Format("status saving {0}", e1.CurrentEntry.FileName)); + totalToSave = e1.EntriesTotal; + numSaving++; + break; + + // case ZipProgressEventType.Saving_EntryBytesRead: + // if (!_pb2Set) + // { + // _txrx.Send(String.Format("pb 2 max {0}", e1.TotalBytesToTransfer)); + // _pb2Set = true; + // } + // _txrx.Send(String.Format("status Saving entry {0}/{1} {2} :: {3}/{4}mb {5:N0}%", + // numSaving, totalToSave, + // e1.CurrentEntry.FileName, + // e1.BytesTransferred/(1024*1024), e1.TotalBytesToTransfer/(1024*1024), + // ((double)e1.BytesTransferred) / (0.01 * e1.TotalBytesToTransfer))); + // string msg = String.Format("pb 2 value {0}", e1.BytesTransferred); + // _txrx.Send(msg); + // break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + TestContext.WriteLine("Saved entry {0}, {1} bytes", e1.CurrentEntry.FileName, + e1.CurrentEntry.UncompressedSize); + _txrx.Send("pb 1 step"); + _pb2Set = false; + break; + } + }; + + _txrx = TestUtilities.StartProgressMonitor("largesegmentedzip", "Large Segmented ZIP", "Creating files"); + + _txrx.Send("bars 3"); + _txrx.Send("pb 0 max 2"); + _txrx.Send(String.Format("pb 1 max {0}", numFiles)); + + // build a large zip file out of thin air + var sw = new StringWriter(); + using (ZipFile zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + zip.BufferSize = 256 * 1024; + zip.CodecBufferSize = 128 * 1024; + zip.MaxOutputSegmentSize = maxSegSize; + zip.SaveProgress += sp; + + for (int i = 0; i < numFiles; i++) + { + string filename = TestUtilities.GetOneRandomUppercaseAsciiChar() + + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".txt"; + zip.AddEntry(filename, writer); + } + zip.Save(zipFileToCreate); + + numSegs = zip.NumberOfSegmentsForMostRecentSave; + } + +#if REMOTE_FILESYSTEM + if (((long)numSegs*maxSegSize) < (long)(1024*1024*1024L)) + { + _FilesToRemove.Remove(parentDir); + Assert.IsTrue(false, "There were not enough segments in that zip. numsegs({0}) maxsize({1}).", numSegs, maxSegSize); + } +#endif + _txrx.Send("status Verifying the zip ..."); + + _txrx.Send("pb 0 step"); + _txrx.Send("pb 1 value 0"); + _txrx.Send("pb 2 value 0"); + + ReadOptions options = new ReadOptions + { + StatusMessageWriter = new StringWriter() + }; + + string extractDir = "verify"; + int c = 0; + while (Directory.Exists(extractDir + c)) c++; + extractDir += c; + + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate, options)) + { + _numFilesToExtract = zip2.Entries.Count; + _numExtracted= 1; + _pb1Set= false; + zip2.ExtractProgress += ExtractProgress; + zip2.ExtractAll(extractDir); + } + + string status = options.StatusMessageWriter.ToString(); + TestContext.WriteLine("status:"); + foreach (string line in status.Split('\n')) + TestContext.WriteLine(line); + } + + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Spanned_InvalidSegmentSize() + { + string zipFileToCreate = "InvalidSegmentSize.zip"; + int segSize = 65536/3 + _rnd.Next(65536/2); + using (var zip = new ZipFile()) + { + zip.MaxOutputSegmentSize = segSize; + zip.Save(zipFileToCreate); + } + } + + + + string _fodderDir = null; + /// + /// Finds or creates and fills a cache directory of fodder files. + /// + /// the name of the cache directory + String CreateSomeFiles() + { + string fodderName = "fodder"; + if (_fodderDir != null) + { + CreateSymbolicLink(fodderName, _fodderDir, 1); + return fodderName; + } + + int baseNumFiles = 12; + int baseSize = 0x100000; + int numFilesToAdd = baseNumFiles + _rnd.Next(4); + string tmpDir = System.Environment.GetEnvironmentVariable("TEMP"); + var oldDirs = Directory.GetDirectories(tmpDir, "*.SplitArchives"); + string fodderDir; + foreach (var dir in oldDirs) + { + TestContext.WriteLine("Considering directory: {0}", dir); + fodderDir = Path.Combine(dir, fodderName); + if (!Directory.Exists(fodderDir)) + { + Directory.Delete(dir, true); + } + else + { + var fodderFiles = Directory.GetFiles(fodderDir, "*.txt"); + if (fodderFiles.Length < baseNumFiles) + { + Directory.Delete(dir, true); + } + else + { + _fodderDir = fodderDir; + CreateSymbolicLink(fodderName, _fodderDir, 1); + return fodderName; + } + + } + } + + // upon reaching here, no directories exist that contain suitable + // fodder for these tests. Create the directory, and a few + // fodder files. + + string pname = Path.GetFileName(TestUtilities.GenerateUniquePathname("SplitArchives")); + + string cacheDir = Path.Combine(tmpDir, pname); + Directory.CreateDirectory(cacheDir); + fodderDir = Path.Combine(cacheDir, fodderName); + Directory.CreateDirectory(fodderDir); + + for (int i=0; i < numFilesToAdd; i++) + { + int fileSize = baseSize + _rnd.Next(baseSize/2); + string fileName = Path.Combine(fodderDir, string.Format("Pippo{0}.txt", i)); + TestUtilities.CreateAndFillFileText(fileName, fileSize); + } + _fodderDir = fodderDir; + CreateSymbolicLink(fodderName, _fodderDir, 1); + return fodderName; + } + + + + [TestMethod] + [Timeout(5 * 60*1000)] // to protect against stuck file locks + public void Spanned_Resave_wi13915() + { + TestContext.WriteLine("Creating fodder files... {0}", + DateTime.Now.ToString("G")); + var contentDir = CreateSomeFiles(); + var filesToAdd = new List(Directory.GetFiles(contentDir)); + int[] segSizes = { 128, 256, 512 }; + + // Three passes: + // pass 1: save as regular, then resave as segmented. + // pass 2: save as segmented, then resave as regular. + // pass 3: save as segmented, then resave as another segmented archive. + for (int m=0; m < 3; m++) + { + // for various segment sizes + for (int k=0; k < segSizes.Length; k++) + { + string trialDir = String.Format("trial.{0}.{1}", m, k); + Directory.CreateDirectory(trialDir); + string zipFile1 = Path.Combine(trialDir, "InitialSave."+m+"."+k+".zip"); + string zipFile2 = Path.Combine(trialDir, "Updated."+m+"."+k+".zip"); + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zip... T({0},{1})...{2}", + m, k, DateTime.Now.ToString("G")); + using (var zip1 = new ZipFile()) + { + zip1.AddFiles(filesToAdd, ""); + if (m!=0) + zip1.MaxOutputSegmentSize = segSizes[k] * 1024; + zip1.Save(zipFile1); + } + + TestContext.WriteLine(""); + TestContext.WriteLine("Re-saving..."); + using (var zip2 = ZipFile.Read(zipFile1)) + { + if (m==0) + zip2.MaxOutputSegmentSize = segSizes[k] * 1024; + else if (m==2) + zip2.MaxOutputSegmentSize = 1024 * (3 * segSizes[k])/2; + + zip2.Save(zipFile2); + } + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting..."); + string extractDir = Path.Combine(trialDir,"extract"); + Directory.CreateDirectory(extractDir); + using (var zip3 = ZipFile.Read(zipFile2)) + { + foreach (var e in zip3) + { + TestContext.WriteLine(" {0}", e.FileName); + e.Extract(extractDir); + } + } + + string[] filesUnzipped = Directory.GetFiles(extractDir); + Assert.AreEqual(filesToAdd.Count, filesUnzipped.Length, + "Incorrect number of files extracted."); + } + } + } + + + + + + [TestMethod] + [Timeout(5 * 60*1000)] // to protect against stuck file locks + public void Spanned_WinZip_Unzip_wi13691() + { + if (!WinZipIsPresent) + throw new Exception("winzip is not present"); + + TestContext.WriteLine("Creating fodder files... {0}", + DateTime.Now.ToString("G")); + var contentDir = CreateSomeFiles(); + var filesToAdd = new List(Directory.GetFiles(contentDir)); + int[] segSizes = { 128, 256, 512 }; + + // Save as segmented, then read/extract with winzip unzip + // for various segment sizes. + for (int k=0; k < segSizes.Length; k++) + { + string trialDir = String.Format("trial.{0}", k); + Directory.CreateDirectory(trialDir); + string zipFile1 = Path.Combine(trialDir, "InitialSave."+k+".zip"); + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zip... T({0})...{1}", + k, DateTime.Now.ToString("G")); + + using (var zip1 = new ZipFile()) + { + zip1.AddFiles(filesToAdd, ""); + zip1.MaxOutputSegmentSize = segSizes[k] * 1024; + zip1.Save(zipFile1); + } + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting..."); + string extractDir = Path.Combine(trialDir,"extract"); + Directory.CreateDirectory(extractDir); + string args = String.Format("-d -yx {0} \"{1}\"", + zipFile1, extractDir); + this.Exec(wzunzip, args); + + string[] filesUnzipped = Directory.GetFiles(extractDir); + Assert.AreEqual(filesToAdd.Count, filesUnzipped.Length, + "Incorrect number of files extracted, trail {0}", k); + } + } + + +#if INFOZIP_UNZIP_SUPPORTS_SPLIT_ARCHIVES + + [TestMethod] + [Timeout(5 * 60*1000)] // to protect against stuck file locks + public void Spanned_InfoZip_Unzip_wi13691() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + TestContext.WriteLine("Creating fodder files... {0}", + DateTime.Now.ToString("G")); + var contentDir = CreateSomeFiles(); + var filesToAdd = new List(Directory.GetFiles(contentDir)); + int[] segSizes = { 128, 256, 512 }; + + // Save as segmented, then read/extract with winzip unzip + // for various segment sizes. + for (int k=0; k < segSizes.Length; k++) + { + string trialDir = String.Format("trial.{0}", k); + Directory.CreateDirectory(trialDir); + string zipFile1 = Path.Combine(trialDir, "InitialSave."+k+".zip"); + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zip... T({0})...{1}", + k, DateTime.Now.ToString("G")); + using (var zip1 = new ZipFile()) + { + zip1.AddFiles(filesToAdd, ""); + zip1.MaxOutputSegmentSize = segSizes[k] * 1024; + zip1.Save(zipFile1); + } + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting..."); + string extractDir = Path.Combine(trialDir,"extract"); + Directory.CreateDirectory(extractDir); + string args = String.Format("{0} -d {1}", + zipFile1, + extractDir); + this.Exec(infoZipUnzip, args); + + string[] filesUnzipped = Directory.GetFiles(extractDir); + Assert.AreEqual(filesToAdd.Count, filesUnzipped.Length, + "Incorrect number of files extracted, trail {0}", k); + } + } +#endif + + + [TestMethod] + [Timeout(5 * 60*1000)] // to protect against stuck file locks + public void Spanned_WinZip_Zip_wi13691() + { + if (!WinZipIsPresent) + throw new Exception("WinZip is not present"); + + TestContext.WriteLine("Creating fodder files... {0}", + DateTime.Now.ToString("G")); + var contentDir = CreateSomeFiles(); + var filesToAdd = new List(Directory.GetFiles(contentDir)); + int[] segSizes = { 128, 256, 512 }; + + // Save as segmented, then read/extract with winzip unzip + // for various segment sizes. + for (int k=0; k < segSizes.Length; k++) + { + string trialDir = String.Format("trial.{0}", k); + Directory.CreateDirectory(trialDir); + string nameOfParts = Path.Combine(trialDir, "InitialSave."+k); + string zipFile1 = nameOfParts + ".zip"; + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zip... T({0})...{1}", + k, DateTime.Now.ToString("G")); + + // with WinZip, must produce a segmented zip in two + // steps: first create the regular zip, then split it. + + // step 1: create the regular zip + string args = String.Format("-a -p -r -yx step1.zip \"{0}\"", contentDir); + string wzzipOut = this.Exec(wzzip, args); + + // step 2: split the existing zip + // "wzzip -ys[size] archivetosplit.zip nameofparts " + args = String.Format("-ys{0} step1.zip {1}", + segSizes[k], zipFile1 //nameOfParts + ); + wzzipOut = this.Exec(wzzip, args); + + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting..."); + string extractDir = Path.Combine(trialDir,"extract"); + Directory.CreateDirectory(extractDir); + using (var zip1 = ZipFile.Read(zipFile1)) + { + foreach (var e in zip1) + { + TestContext.WriteLine(" {0}", e.FileName); + e.Extract(extractDir); + } + } + + string[] filesUnzipped = Directory.GetFiles(extractDir); + Assert.AreEqual(filesToAdd.Count, filesUnzipped.Length, + "Incorrect number of files extracted, trail {0}", k); + } + } + + + + [TestMethod] + [Timeout(5 * 60*1000)] // to protect against stuck file locks + public void Spanned_InfoZip_Zip_wi13691() + { + if (!InfoZipIsPresent) + throw new Exception("InfoZip is not present"); + + TestContext.WriteLine("Creating fodder files... {0}", + DateTime.Now.ToString("G")); + var contentDir = CreateSomeFiles(); + var filesToAdd = new List(Directory.GetFiles(contentDir)); + int[] segSizes = { 128, 256, 512 }; + + // Save as segmented, then read/extract with winzip unzip + // for various segment sizes. + for (int k=0; k < segSizes.Length; k++) + { + string trialDir = String.Format("trial.{0}", k); + Directory.CreateDirectory(trialDir); + string zipFile1 = Path.Combine(trialDir, "InitialSave."+k+".zip"); + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zip... T({0})...{1}", + k, DateTime.Now.ToString("G")); + + string args = String.Format("-s {0}k {1} -r {2}", + segSizes[k], + zipFile1, + contentDir); + this.Exec(infoZip, args); + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting..."); + string extractDir = Path.Combine(trialDir,"extract"); + Directory.CreateDirectory(extractDir); + using (var zip1 = ZipFile.Read(zipFile1)) + { + foreach (var e in zip1) + { + TestContext.WriteLine(" {0}", e.FileName); + e.Extract(extractDir); + } + } + + string[] filesUnzipped = + Directory.GetFiles(Path.Combine(extractDir, contentDir)); + Assert.AreEqual(filesToAdd.Count, filesUnzipped.Length, + "Incorrect number of files extracted, trail {0}", k); + } + + } + + + } + +} diff --git a/dotNetZip/Zip Tests/Streams.cs b/dotNetZip/Zip Tests/Streams.cs new file mode 100644 index 0000000..7f6ed9a --- /dev/null +++ b/dotNetZip/Zip Tests/Streams.cs @@ -0,0 +1,2020 @@ +// Streams.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-28 07:33:02> +// +// ------------------------------------------------------------------ +// +// This module defines tests for Streams interfaces into DotNetZip, that +// DotNetZip can write to streams, read from streams, ZipOutputStream, +// ZipInputStream, etc. +// +// ------------------------------------------------------------------ + +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zlib; +using Ionic.Zip.Tests.Utilities; + + +namespace Ionic.Zip.Tests.Streams +{ + /// + /// Summary description for StreamsTests + /// + [TestClass] + public class StreamsTests : IonicTestClass + { + public StreamsTests() : base() { } + + EncryptionAlgorithm[] crypto = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.PkzipWeak, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; + +#if NOT + EncryptionAlgorithm[] cryptoNoPkzip = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; +#endif + + Ionic.Zlib.CompressionLevel[] compLevels = + { + Ionic.Zlib.CompressionLevel.None, + Ionic.Zlib.CompressionLevel.BestSpeed, + Ionic.Zlib.CompressionLevel.Default, + Ionic.Zlib.CompressionLevel.BestCompression, + }; + + Zip64Option[] z64 = + { + Zip64Option.Never, + Zip64Option.AsNecessary, + Zip64Option.Always, + }; + + + [TestMethod] + public void ZOS_Create_Encrypt_wi12815() + { + string zipFileToCreate = + "ZOS_Create_Encrypt_wi12815.zip"; + + var content = new byte[1789]; + unchecked + { + byte b = 0; + for (var i = 0; i < content.Length; i++, b++) + { + content[i] = b; + } + } + + var checkBuffer = new Action(stage => + { + byte b = 0; + TestContext.WriteLine("Checking buffer ({0})", stage); + for (var i = 0; i < content.Length; i++, b++) + { + Assert.IsTrue((content[i] == b), + "Buffer was modified."); + } + }); + + checkBuffer("before"); + + using (var fileStream = File.OpenWrite(zipFileToCreate)) + { + using (var zipStream = new ZipOutputStream(fileStream, true)) + { + zipStream.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + zipStream.Password = "mydummypassword"; + zipStream.Encryption = EncryptionAlgorithm.WinZipAes256; + zipStream.PutNextEntry("myentry.myext"); + zipStream.Write(content, 0, content.Length); + } + } + + checkBuffer("after"); + } + + + + + [TestMethod] + public void ReadZip_OpenReader() + { + string[] passwords = { null, Path.GetRandomFileName(), "EE", "***()" }; + + for (int j = 0; j < compLevels.Length; j++) + { + for (int k = 0; k < passwords.Length; k++) + { + string zipFileToCreate = String.Format("ReadZip_OpenReader-{0}-{1}.zip", j, k); + //int entriesAdded = 0; + //String filename = null; + string dirToZip = String.Format("dirToZip.{0}.{1}", j, k); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.CompressionLevel = compLevels[j]; + zip1.Password = passwords[k]; + zip1.AddDirectory(dirToZip,dirToZip); + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + files.Length, + String.Format("Trial ({0},{1})", j, k)); + + int i = 0; + ZipEntry e1 = null; + Func opener = () => { + if (i == 0) + return e1.OpenReader(); + if (i == 1) + return e1.OpenReader(passwords[k]); + + e1.Password = passwords[k]; + return e1.OpenReader(); + }; + + // now extract the files and verify their contents + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + for (i = 0; i < 3; i++) + { + // try once with Password set on ZipFile, + // another with password on the entry, and + // a third time with password passed into the OpenReader() method. + if (i == 0) zip2.Password = passwords[k]; + + foreach (string eName in zip2.EntryFileNames) + { + e1 = zip2[eName]; + if (e1.IsDirectory) continue; + + using (var s = opener()) + { + string outFile = String.Format("{0}.{1}.out", eName, i); + int totalBytesRead = 0; + using (var output = File.Create(outFile)) + { + byte[] buffer = new byte[4096]; + int n; + while ((n = s.Read(buffer, 0, buffer.Length)) > 0) + { + totalBytesRead += n; + output.Write(buffer, 0, n); + } + } + + TestContext.WriteLine("CRC expected({0:X8}) actual({1:X8})", + e1.Crc, s.Crc); + Assert.AreEqual(s.Crc, e1.Crc, + string.Format("{0} :: CRC Mismatch", eName)); + Assert.AreEqual(totalBytesRead, (int)e1.UncompressedSize, + string.Format("We read an unexpected number of bytes. ({0})", eName)); + } + } + } + } + } + } + } + + + [TestMethod] + public void ZOS_Create_WithComment_wi10339() + { + string zipFileToCreate = "ZOS_Create_WithComment_wi10339.zip"; + using (var fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + output.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + output.Comment = "Cheeso is the man!"; + string entryName = String.Format("entry{0:D4}.txt", _rnd.Next(10000)); + output.PutNextEntry(entryName); + string content = "This is the content for the entry."; + byte[] buffer = Encoding.ASCII.GetBytes(content); + output.Write(buffer, 0, buffer.Length); + } + } + } + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentNullException))] + public void ZOS_Create_NullBuffer_wi12964() + { + using (var zip = new Ionic.Zip.ZipOutputStream(new MemoryStream())) + { + zip.PutNextEntry("EmptyFile.txt"); + zip.Write(null, 0, 0); + //zip.Write(new byte[1], 0, 0); + } + } + + [TestMethod] + public void ZOS_Create_ZeroByteEntry_wi12964() + { + using (var zip = new Ionic.Zip.ZipOutputStream(new MemoryStream())) + { + zip.PutNextEntry("EmptyFile.txt"); + zip.Write(new byte[1], 0, 0); + } + } + + + [TestMethod] + public void AddEntry_JitProvided() + { + for (int i = 0; i < crypto.Length; i++) + { + for (int k = 0; k < compLevels.Length; k++) + { + string zipFileToCreate = String.Format("AddEntry_JitProvided.{0}.{1}.zip", i, k); + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip); + string password = Path.GetRandomFileName(); + + using (var zip = new ZipFile()) + { + TestContext.WriteLine("================================="); + TestContext.WriteLine("Creating {0}...", Path.GetFileName(zipFileToCreate)); + TestContext.WriteLine("Encryption({0}) Compression({1}) pw({2})", + crypto[i].ToString(), compLevels[k].ToString(), password); + + zip.Password = password; + zip.Encryption = crypto[i]; + zip.CompressionLevel = compLevels[k]; + + foreach (var file in files) + zip.AddEntry(file, + (name) => File.OpenRead(name), + (name, stream) => stream.Close() + ); + zip.Save(zipFileToCreate); + } + + if (crypto[i] == EncryptionAlgorithm.None) + BasicVerifyZip(zipFileToCreate); + else + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "Trial ({0},{1}): The zip file created has the wrong number of entries.", i, k); + } + } + } + + + + private delegate void TestCompressionLevels(string[] files, + EncryptionAlgorithm crypto, + bool seekable, + int cycle, + string format, + int fileOutputOption); + + private void _TestDriver(TestCompressionLevels test, string label, bool seekable, bool zero) + { + _TestDriver(test, label, seekable, zero, 0); + } + + + private void _TestDriver(TestCompressionLevels test, string label, bool seekable, bool zero, int fileOutputOption) + { + int[] fileCounts = new int[] { 1, 2, _rnd.Next(14) + 13 }; + + for (int j = 0; j < fileCounts.Length; j++) + { + string dirToZip = String.Format("subdir{0}", j); + string[] files = null; + if (zero) + { + // zero length files + Directory.CreateDirectory(dirToZip); + files = new string[fileCounts[j]]; + for (int i = 0; i < fileCounts[j]; i++) + files[i] = TestUtilities.CreateUniqueFile("zerolength", dirToZip); + } + else + files = TestUtilities.GenerateFilesFlat(dirToZip, fileCounts[j], 40000, 72000); + + + for (int i = 0; i < crypto.Length; i++) + { + string format = String.Format("{0}.{1}.count.{2}.Encrypt.{3}.Seek.{4}.Compress.{5}.zip", + label, + (zero) ? "ZeroBytes" : "regular", + fileCounts[j], + crypto[i].ToString(), + seekable ? "Oui" : "Non", + "{0}"); + + test(files, crypto[i], seekable, i, format, fileOutputOption); + } + } + } + + + + private void _Internal_AddEntry_WriteDelegate(string[] files, + EncryptionAlgorithm crypto, + bool seekable, + int cycle, + string format, + int ignored) + { + int bufferSize = 2048; + byte[] buffer = new byte[bufferSize]; + int n; + + for (int k = 0; k < compLevels.Length; k++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format(format, compLevels[k].ToString())); + string password = TestUtilities.GenerateRandomPassword(); + + using (var zip = new ZipFile()) + { + TestContext.WriteLine("================================="); + TestContext.WriteLine("Creating {0}...", Path.GetFileName(zipFileToCreate)); + TestContext.WriteLine("Encryption({0}) Compression({1}) pw({2})", + crypto.ToString(), compLevels[k].ToString(), password); + + zip.Password = password; + zip.Encryption = crypto; + zip.CompressionLevel = compLevels[k]; + + foreach (var file in files) + { + zip.AddEntry(file, (name, output) => + { + using (var input = File.OpenRead(name)) + { + while ((n = input.Read(buffer, 0, buffer.Length)) != 0) + { + output.Write(buffer, 0, n); + } + } + }); + } + + + if (!seekable) + { + // conditionally use a non-seekable output stream + using (var raw = File.Create(zipFileToCreate)) + { + using (var ns = new Ionic.Zip.Tests.NonSeekableOutputStream(raw)) + { + zip.Save(ns); + } + } + } + else + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(Path.GetFileName(zipFileToCreate), password); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "Trial ({0},{1}): The zip file created has the wrong number of entries.", cycle, k); + } + } + + + + [TestMethod] + public void WriteDelegate() + { + _TestDriver(new TestCompressionLevels(_Internal_AddEntry_WriteDelegate), "WriteDelegate", true, false); + } + + + [TestMethod] + public void WriteDelegate_NonSeekable() + { + _TestDriver(new TestCompressionLevels(_Internal_AddEntry_WriteDelegate), "WriteDelegate", false, false); + } + + + [TestMethod] + public void WriteDelegate_ZeroBytes_wi8931() + { + _TestDriver(new TestCompressionLevels(_Internal_AddEntry_WriteDelegate), "WriteDelegate", true, true); + } + + + + [TestMethod] + public void ZOS_Create_ZeroBytes_Encrypt_NonSeekable() + { + // At one stage, using ZipOutputStream with Encryption and a + // non-seekable output stream did not work. DotNetZip was changed to be + // smarter, so that works now. This test verifies that combination + // of stuff. + + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + Directory.CreateDirectory(dirToZip); + int fileCount = _rnd.Next(4) + 1; + string[] files = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + files[i] = TestUtilities.CreateUniqueFile("zerolength", dirToZip); + + for (int i = 0; i < crypto.Length; i++) + { + string format = String.Format("ZipOutputStream.ZeroBytes.filecount{0}.Encryption.{1}.NonSeekable.{2}.zip", + fileCount, + crypto[i], + "{0}"); + + _Internal_ZOS_Create(files, EncryptionAlgorithm.PkzipWeak, false, 99, format); + } + } + + + + [TestMethod, Timeout(45 * 60*1000)] + public void ZOS_over65534_EncryptPkZip_CompressDefault_Z64AsNecessary() + { + _ZOS_z64Over65534Entries(Zip64Option.AsNecessary, + EncryptionAlgorithm.PkzipWeak, + Ionic.Zlib.CompressionLevel.Default); + } + + [TestMethod, Timeout(2 * 60*60*1000)] + public void ZOS_over65534_EncryptWinZip_CompressDefault_Z64AsNecessary() + { + _ZOS_z64Over65534Entries(Zip64Option.AsNecessary, + EncryptionAlgorithm.WinZipAes256, + Ionic.Zlib.CompressionLevel.Default); + } + + [TestMethod, Timeout(45 * 60*1000)] + public void ZOS_over65534_EncryptNo_CompressDefault_Z64AsNecessary() + { + _ZOS_z64Over65534Entries(Zip64Option.AsNecessary, + EncryptionAlgorithm.None, + Ionic.Zlib.CompressionLevel.Default); + } + + + [TestMethod, Timeout(35 * 60 * 1000)] + [ExpectedException(typeof(System.InvalidOperationException))] + public void ZOS_over65534_FAIL() + { + _ZOS_z64Over65534Entries(Zip64Option.Never, + EncryptionAlgorithm.PkzipWeak, + Ionic.Zlib.CompressionLevel.Default); + } + + + + private void _ZOS_z64Over65534Entries + (Zip64Option z64option, + EncryptionAlgorithm encryption, + Ionic.Zlib.CompressionLevel compression) + { + TestContext.WriteLine("_ZOS_z64Over65534Entries hello: {0}", + DateTime.Now.ToString("G")); + int fileCount = _rnd.Next(14616) + 65536; + //int fileCount = _rnd.Next(146) + 5536; + TestContext.WriteLine("entries: {0}", fileCount); + var txrxLabel = + String.Format("ZOS #{0} 64({3}) E({1}) C({2})", + fileCount, + encryption.ToString(), + compression.ToString(), + z64option.ToString()); + + TestContext.WriteLine("label: {0}", txrxLabel); + string zipFileToCreate = + String.Format("ZOS.Zip64.over65534.{0}.{1}.{2}.zip", + z64option.ToString(), encryption.ToString(), + compression.ToString()); + + TestContext.WriteLine("zipFileToCreate: {0}", zipFileToCreate); + + _txrx = TestUtilities.StartProgressMonitor(zipFileToCreate, + txrxLabel, "starting up..."); + + TestContext.WriteLine("generating {0} entries ", fileCount); + _txrx.Send("pb 0 max 3"); // 2 stages: Write, Count, Verify + _txrx.Send("pb 0 value 0"); + + string password = Path.GetRandomFileName(); + + string statusString = String.Format("status Encryption:{0} Compression:{1}", + encryption.ToString(), + compression.ToString()); + + _txrx.Send(statusString); + + int dirCount = 0; + + using (FileStream fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + _txrx.Send("test " + txrxLabel); + System.Threading.Thread.Sleep(400); + _txrx.Send("pb 1 max " + fileCount); + _txrx.Send("pb 1 value 0"); + + output.Password = password; + output.Encryption = encryption; + output.CompressionLevel = compression; + output.EnableZip64 = z64option; + for (int k = 0; k < fileCount; k++) + { + if (_rnd.Next(7) == 0) + { + // make it a directory + string entryName = String.Format("{0:D4}/", k); + output.PutNextEntry(entryName); + dirCount++; + } + else + { + string entryName = String.Format("{0:D4}.txt", k); + output.PutNextEntry(entryName); + + // only a few entries are non-empty + if (_rnd.Next(18) == 0) + { + var block = TestUtilities.GenerateRandomAsciiString(); + string content = String.Format("This is the content for entry #{0}.\n", k); + int n = _rnd.Next(4) + 1; + for (int j=0; j < n; j++) + content+= block; + + byte[] buffer = Encoding.ASCII.GetBytes(content); + output.Write(buffer, 0, buffer.Length); + } + } + if (k % 1024 == 0) + _txrx.Send(String.Format("status saving ({0}/{1}) {2:N0}%", + k, fileCount, + ((double)k) / (0.01 * fileCount))); + else if (k % 256 == 0) + _txrx.Send("pb 1 value " + k); + } + } + } + + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + _txrx.Send("pb 0 step"); + + System.Threading.Thread.Sleep(400); + + TestContext.WriteLine("Counting entries ... " + DateTime.Now.ToString("G")); + _txrx.Send("status Counting entries..."); + Assert.AreEqual + (fileCount - dirCount, + TestUtilities.CountEntries(zipFileToCreate), + "{0}: The zip file created has the wrong number of entries.", + zipFileToCreate); + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(140); + + // basic verify. The output is really large, so we pass emitOutput=false . + _txrx.Send("status Verifying..."); + TestContext.WriteLine("Verifying ... " + DateTime.Now.ToString("G")); + _numExtracted = 0; + _numFilesToExtract = fileCount; + _txrx.Send("pb 1 max " + fileCount); + System.Threading.Thread.Sleep(200); + _txrx.Send("pb 1 value 0"); + BasicVerifyZip(zipFileToCreate, password, false, Streams_ExtractProgress); + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(800); + TestContext.WriteLine("Done ... " + DateTime.Now.ToString("G")); + } + + + + private int _numExtracted; + private int _numFilesToExtract; + void Streams_ExtractProgress(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_AfterExtractEntry: + _numExtracted++; + if ((_numExtracted % 512) == 0) + _txrx.Send("pb 1 value " + _numExtracted); + else if ((_numExtracted % 256) == 0) + _txrx.Send(String.Format("status extract {0}/{1} {2:N0}%", + _numExtracted, _numFilesToExtract, + _numExtracted / (0.01 *_numFilesToExtract))); + break; + } + } + + + + + [TestMethod] + [ExpectedException(typeof(System.InvalidOperationException))] + public void ZOS_Create_WriteBeforePutNextEntry() + { + string zipFileToCreate = "ZOS_Create_WriteBeforePutNextEntry.zip"; + using (var fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + //output.PutNextEntry("entry1.txt"); + byte[] buffer = Encoding.ASCII.GetBytes("This is the content for entry #1."); + output.Write(buffer, 0, buffer.Length); + } + } + } + + + + + [TestMethod] + public void ZOS_Create_Directories() + { + for (int i = 0; i < crypto.Length; i++) + { + for (int j = 0; j < compLevels.Length; j++) + { + string password = Path.GetRandomFileName(); + + for (int k = 0; k < 2; k++) + { + string zipFileToCreate = + String.Format("ZOS_Create_Directories.Encryption.{0}.{1}.{2}.zip", + crypto[i].ToString(), compLevels[j].ToString(), k); + + using (var fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + byte[] buffer; + output.Password = password; + output.Encryption = crypto[i]; + output.CompressionLevel = compLevels[j]; + output.PutNextEntry("entry1.txt"); + if (k == 0) + { + buffer = Encoding.ASCII.GetBytes("This is the content for entry #1."); + output.Write(buffer, 0, buffer.Length); + } + + output.PutNextEntry("entry2/"); // this will be a directory + output.PutNextEntry("entry3.txt"); + if (k == 0) + { + buffer = Encoding.ASCII.GetBytes("This is the content for entry #3."); + output.Write(buffer, 0, buffer.Length); + } + output.PutNextEntry("entry4.txt"); // a zero length entry + output.PutNextEntry("entry5.txt"); // zero length + } + } + + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(4, TestUtilities.CountEntries(zipFileToCreate), + "Trial ({0},{1})", i, j); + } + } + } + } + + + + + + [TestMethod] + [ExpectedException(typeof(System.InvalidOperationException))] + public void ZOS_Create_Directories_Write() + { + for (int k = 0; k < 2; k++) + { + string zipFileToCreate = String.Format("ZOS_Create_Directories.{0}.zip", k); + using (var fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + byte[] buffer; + output.Encryption = EncryptionAlgorithm.None; + output.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; + output.PutNextEntry("entry1/"); + if (k == 0) + { + buffer = Encoding.ASCII.GetBytes("This is the content for entry #1."); + // this should fail + output.Write(buffer, 0, buffer.Length); + } + + output.PutNextEntry("entry2/"); // this will be a directory + output.PutNextEntry("entry3.txt"); + if (k == 0) + { + buffer = Encoding.ASCII.GetBytes("This is the content for entry #3."); + output.Write(buffer, 0, buffer.Length); + } + output.PutNextEntry("entry4.txt"); // this will be zero length + output.PutNextEntry("entry5.txt"); // this will be zero length + } + } + } + } + + + + [TestMethod] + public void ZOS_Create_EmptyEntries() + { + for (int i = 0; i < crypto.Length; i++) + { + for (int j = 0; j < compLevels.Length; j++) + { + string password = Path.GetRandomFileName(); + + for (int k = 0; k < 2; k++) + { + string zipFileToCreate = String.Format("ZOS_Create_EmptyEntries.Encryption.{0}.{1}.{2}.zip", + crypto[i].ToString(), compLevels[j].ToString(), k); + + using (var fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + byte[] buffer; + output.Password = password; + output.Encryption = crypto[i]; + output.CompressionLevel = compLevels[j]; + output.PutNextEntry("entry1.txt"); + if (k == 0) + { + buffer = Encoding.ASCII.GetBytes("This is the content for entry #1."); + output.Write(buffer, 0, buffer.Length); + } + + output.PutNextEntry("entry2.txt"); // this will be zero length + output.PutNextEntry("entry3.txt"); + if (k == 0) + { + buffer = Encoding.ASCII.GetBytes("This is the content for entry #3."); + output.Write(buffer, 0, buffer.Length); + } + output.PutNextEntry("entry4.txt"); // this will be zero length + output.PutNextEntry("entry5.txt"); // this will be zero length + } + } + + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(5, TestUtilities.CountEntries(zipFileToCreate), + "Trial ({0},{1}): The zip file created has the wrong number of entries.", i, j); + } + } + } + } + + + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void ZOS_Create_DuplicateEntry() + { + string zipFileToCreate = "ZOS_Create_DuplicateEntry.zip"; + + string entryName = Path.GetRandomFileName(); + + using (var fs = File.Create(zipFileToCreate)) + { + using (var output = new ZipOutputStream(fs)) + { + output.PutNextEntry(entryName); + output.PutNextEntry(entryName); + } + } + } + + + + [TestMethod] + public void ZOS_Create() + { + bool seekable = true; + bool zero = false; + _TestDriver(new TestCompressionLevels(_Internal_ZOS_Create), "ZipOutputStream", seekable, zero); + } + + [TestMethod] + public void ZOS_Create_file() + { + bool seekable = true; + bool zero = false; + int fileOutputOption = 1; + _TestDriver(new TestCompressionLevels(_Internal_ZOS_Create), "ZipOutputStream", seekable, zero, fileOutputOption); + } + + [TestMethod] + public void ZOS_Create_NonSeekable() + { + bool seekable = false; + bool zero = false; + _TestDriver(new TestCompressionLevels(_Internal_ZOS_Create), "ZipOutputStream", seekable, zero); + } + + [TestMethod] + public void ZOS_Create_ZeroLength_wi8933() + { + bool seekable = true; + bool zero = true; + _TestDriver(new TestCompressionLevels(_Internal_ZOS_Create), "ZipOutputStream", seekable, zero); + } + + [TestMethod] + public void ZOS_Create_ZeroLength_wi8933_file() + { + bool seekable = true; + bool zero = true; + int fileOutputOption = 1; + _TestDriver(new TestCompressionLevels(_Internal_ZOS_Create), "ZipOutputStream", seekable, zero, fileOutputOption); + } + + + private void _Internal_ZOS_Create(string[] files, + EncryptionAlgorithm crypto, + bool seekable, + int cycle, + string format) + { + _Internal_ZOS_Create(files, crypto, seekable, cycle, format, 0); + } + + + private void _Internal_ZOS_Create(string[] files, + EncryptionAlgorithm crypto, + bool seekable, + int cycle, + string format, + int fileOutputOption) + { + int BufferSize = 2048; + + for (int k = 0; k < compLevels.Length; k++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format(format, compLevels[k].ToString())); + string password = Path.GetRandomFileName(); + + TestContext.WriteLine("================================="); + TestContext.WriteLine("Creating {0}...", Path.GetFileName(zipFileToCreate)); + TestContext.WriteLine("Encryption({0}) Compression({1}) pw({2})", + crypto.ToString(), compLevels[k].ToString(), password); + + using (ZipOutputStream output = GetZipOutputStream(seekable, fileOutputOption, zipFileToCreate)) + { + if (crypto != EncryptionAlgorithm.None) + { + output.Password = password; + output.Encryption = crypto; + } + output.CompressionLevel = compLevels[k]; + + byte[] buffer = new byte[BufferSize]; + int n; + foreach (var file in files) + { + TestContext.WriteLine("file: {0}", file); + output.PutNextEntry(file); + using (var input = File.OpenRead(file)) + { + while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, n); + } + } + } + } + + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(files.Length, TestUtilities.CountEntries(zipFileToCreate), + "Trial ({0},{1}): The zip file created has the wrong number of entries.", cycle, k); + } + } + + + private static ZipOutputStream GetZipOutputStream(bool seekable, int fileOutputOption, string zipFileToCreate) + { + if (fileOutputOption == 0) + { + Stream raw = File.Create(zipFileToCreate); + // conditionally use a non-seekable output stream + if (!seekable) + raw = new Ionic.Zip.Tests.NonSeekableOutputStream(raw); + + return new ZipOutputStream(raw); + } + + return new ZipOutputStream(zipFileToCreate); + } + + + + bool _pb2Set; + bool _pb1Set; + int _numSaving; + int _totalToSave; + + private void streams_SaveProgress(object sender, SaveProgressEventArgs e) + { + string msg; + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + //_txrx.Send("status saving started..."); + _pb1Set = false; + _numSaving = 1; + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + //_txrx.Send(String.Format("status Compressing {0}", e.CurrentEntry.FileName)); + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", e.EntriesTotal)); + _pb1Set = true; + } + _totalToSave = e.EntriesTotal; + _pb2Set = false; + break; + + case ZipProgressEventType.Saving_EntryBytesRead: + if (!_pb2Set) + { + _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); + _pb2Set = true; + } + + // _txrx.Send(String.Format("status Saving entry {0}/{1} :: {2} :: {3}/{4}mb {5:N0}%", + // _numSaving, _totalToSave, + // e.CurrentEntry.FileName, + // e.BytesTransferred/(1024*1024), e.TotalBytesToTransfer/(1024*1024), + // ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))); + msg = String.Format("pb 2 value {0}", e.BytesTransferred); + _txrx.Send(msg); + //System.Threading.Thread.Sleep(40); + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + _txrx.Send("pb 1 step"); + _numSaving++; + break; + + case ZipProgressEventType.Saving_Completed: + //_txrx.Send("status Save completed"); + _pb1Set = false; + _pb2Set = false; + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + break; + } + } + + + [TestMethod] + public void ZipFile_JitStream_CloserTwice_wi10489() + { + int fileCount = 20 + _rnd.Next(20); + string zipFileToCreate = "CloserTwice.zip"; + string dirToZip = "fodder"; + var files = TestUtilities.GenerateFilesFlat(dirToZip, fileCount, 100, 72000); + + OpenDelegate opener = (name) => + { + TestContext.WriteLine("Opening {0}", name); + Stream s = File.OpenRead(Path.Combine(dirToZip,name)); + return s; + }; + + CloseDelegate closer = (e, s) => + { + TestContext.WriteLine("Closing {0}", e); + s.Dispose(); + }; + + TestContext.WriteLine("Creating zipfile {0}", zipFileToCreate); + using (var zip = new ZipFile()) + { + foreach (var file in files) + { + zip.AddEntry(Path.GetFileName(file),opener,closer); + } + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + files.Length); + + BasicVerifyZip(zipFileToCreate); + } + + + [TestMethod] + public void JitStream_Update_wi13899() + { + int fileCount = 12 + _rnd.Next(16); + string dirToZip = "fodder"; + var files = TestUtilities.GenerateFilesFlat(dirToZip, fileCount, 100, 72000); + OpenDelegate opener = (name) => + { + TestContext.WriteLine("Opening {0}", name); + Stream s = File.OpenRead(Path.Combine(dirToZip,name)); + return s; + }; + + CloseDelegate closer = (e, s) => + { + TestContext.WriteLine("Closing {0}", e); + s.Dispose(); + }; + + // Two passes: first to call UpdateEntry() when no prior entry exists. + // Second to call UpdateEntry when a prior entry exists. + for (int j=0; j < 2; j++) + { + string zipFileToCreate = String.Format("wi13899-{0}.zip", j); + + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zipfile {0}", zipFileToCreate); + if (j!=0) + { + using (var zip = new ZipFile(zipFileToCreate)) + { + foreach (var file in files) + { + zip.AddEntry(Path.GetFileName(file), "This is the content for file " + file); + } + zip.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + files.Length); + + BasicVerifyZip(zipFileToCreate); + + TestContext.WriteLine("Updating zipfile {0}", zipFileToCreate); + } + + using (var zip = new ZipFile(zipFileToCreate)) + { + foreach (var file in files) + { + zip.UpdateEntry(Path.GetFileName(file), opener, closer); + } + zip.Save(); + } + + BasicVerifyZip(zipFileToCreate); + // verify checksum here? + } + } + + + + [TestMethod, Timeout(30 * 60 * 1000)] // in ms. 30*60*100 == 30min + public void ZipFile_PDOS_LeakTest_wi10030() + { + // Test memory growth over many many cycles. + // There was a leak in the ParallelDeflateOutputStream, where + // the PDOS was not being GC'd. This test checks for that. + // + // If the error is present, this test will either timeout or + // throw an InsufficientMemoryException (or whatever). The + // timeout occurs because GC begins to get verrrrry + // sloooooow. IF the error is not present, this test will + // complete successfully, in about 20 minutes. + // + + string zipFileToCreate = "ZipFile_PDOS_LeakTest_wi10030.zip"; + int nCycles = 4096; + int nFiles = 3; + int sizeBase = 384 * 1024; + int sizeRange = 32 * 1024; + int count = 0; + byte[] buffer = new byte[1024]; + int n; + + // fill a couple memory streams with random text + MemoryStream[] ms = new MemoryStream[nFiles]; + for (int i = 0; i < ms.Length; i++) + { + ms[i] = new MemoryStream(); + int sz = sizeBase + _rnd.Next(sizeRange); + using (Stream rtg = new Ionic.Zip.Tests.Utilities.RandomTextInputStream(sz)) + { + while ((n = rtg.Read(buffer, 0, buffer.Length)) > 0) + { + ms[i].Write(buffer, 0, n); + } + } + } + buffer = null; + + OpenDelegate opener = (x) => + { + Stream s = ms[count % ms.Length]; + s.Seek(0L, SeekOrigin.Begin); + count++; + return s; + }; + + CloseDelegate closer = (e, s) => + { + //s.Close(); + }; + + string txrxLabel = "PDOS Leak Test"; + _txrx = TestUtilities.StartProgressMonitor("ZipFile_PDOS_LeakTest_wi10030", txrxLabel, "starting up..."); + + TestContext.WriteLine("Testing for leaks...."); + + _txrx.Send(String.Format("pb 0 max {0}", nCycles)); + _txrx.Send("pb 0 value 0"); + + for (int x = 0; x < nCycles; x++) + { + if (x != 0 && x % 16 == 0) + { + TestContext.WriteLine("Cycle {0}...", x); + string status = String.Format("status Cycle {0}/{1} {2:N0}%", + x + 1, nCycles, + ((x+1)/(0.01 * nCycles))); + _txrx.Send(status); + } + + using (ZipFile zip = new ZipFile()) + { + zip.ParallelDeflateThreshold = 128 * 1024; + zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; + //zip.SaveProgress += streams_SaveProgress; + for (int y = 0; y < nFiles; y++) + { + zip.AddEntry("Entry" + y + ".txt", opener, closer); + } + zip.Comment = "Produced at " + System.DateTime.UtcNow.ToString("G"); + zip.Save(zipFileToCreate); + } + + _txrx.Send("pb 0 step"); + } + + for (int i = 0; i < ms.Length; i++) + { + ms[i].Dispose(); + ms[i] = null; + } + ms = null; + } + + + + [TestMethod] + public void ZipOutputStream_Parallel() + { + int _sizeBase = 1024 * 1024; + int _sizeRange = 256 * 1024; + //int _sizeBase = 1024 * 256; + //int _sizeRange = 256 * 12; + var sw = new System.Diagnostics.Stopwatch(); + byte[] buffer = new byte[0x8000]; + int n = 0; + TimeSpan[] ts = new TimeSpan[2]; + int nFiles = _rnd.Next(8) + 8; + //int nFiles = 2; + string[] filenames = new string[nFiles]; + string dirToZip = Path.Combine(TopLevelDir, "dirToZip"); + + + string channel = String.Format("ZOS_Parallel{0:000}", _rnd.Next(1000)); + string txrxLabel = "ZipOutputStream Parallel"; + _txrx = TestUtilities.StartProgressMonitor(channel, txrxLabel, "starting up..."); + + TestContext.WriteLine("Creating {0} fodder files...", nFiles); + Directory.CreateDirectory(dirToZip); + + _txrx.Send(String.Format("pb 0 max {0}", nFiles)); + _txrx.Send("pb 0 value 0"); + + sw.Start(); + + for (int x = 0; x < nFiles; x++) + { + string status = String.Format("status Creating file {0}/{1}", x + 1, nFiles); + _txrx.Send(status); + + filenames[x] = Path.Combine(dirToZip, String.Format("file{0:000}.txt", x)); + using (var output = File.Create(filenames[x])) + { + using (Stream input = new Ionic.Zip.Tests.Utilities.RandomTextInputStream(_sizeBase + _rnd.Next(_sizeRange))) + { + while ((n = input.Read(buffer, 0, buffer.Length)) != 0) + { + output.Write(buffer, 0, n); + } + } + } + _txrx.Send("pb 0 step"); + } + sw.Stop(); + TestContext.WriteLine("file generation took {0}", sw.Elapsed); + + _txrx.Send(String.Format("pb 0 max {0}", crypto.Length)); + _txrx.Send("pb 0 value 0"); + + for (int i = 0; i < crypto.Length; i++) + { + //int c = i; + int c = (i + 2) % crypto.Length; + + _txrx.Send(String.Format("pb 1 max {0}", compLevels.Length)); + _txrx.Send("pb 1 value 0"); + + for (int j = 0; j < compLevels.Length; j++) + { + string password = Path.GetRandomFileName(); + + // I wanna do 2 cycles if there is compression, so I can compare MT + // vs 1T compression. The first cycle will ALWAYS use the threaded + // compression, the 2nd will NEVER use it. If + // CompressionLevel==None, then just do one cycle. + // + int kCycles = (compLevels[j] == Ionic.Zlib.CompressionLevel.None) + ? 1 + : 2; + + for (int k = 0; k < kCycles; k++) + { + // Also, I use Stopwatch to time the compression, and compare. + // In light of that, I wanna do one warmup, and then one timed + // trial (for t==0..2). But here again, if CompressionLevel==None, then I + // don't want to do a timing comparison, so I don't need 2 trials. + // Therefore, in that case, the "warmup" is the only trial I want to do. + // So when k==1 and Compression==None, do no cycles at all. + // + int tCycles = (compLevels[j] == Ionic.Zlib.CompressionLevel.None) + ? ((k == 0) ? 1 : 0) + : 2; + + if (k == 0) + { + _txrx.Send(String.Format("pb 2 max {0}", kCycles * tCycles)); + _txrx.Send("pb 2 value 0"); + } + + for (int t = 0; t < tCycles; t++) + { + TestContext.WriteLine(new String('-', 72)); + string zipFileToCreate = String.Format("ZipOutputStream_Parallel.E-{0}.C-{1}.{2}.{3}timed.zip", + crypto[c].ToString(), compLevels[j].ToString(), + (compLevels[j] == Ionic.Zlib.CompressionLevel.None) + ? "NA" + : (k == 0) ? "1T" : "MT", + (t == 0) ? "not-" : ""); + + TestContext.WriteLine("Trial {0}.{1}.{2}.{3}", i, j, k, t); + TestContext.WriteLine("Create zip file {0}", zipFileToCreate); + + _txrx.Send("status " + zipFileToCreate); + + sw.Reset(); + sw.Start(); + using (var output = new ZipOutputStream(zipFileToCreate)) + { + if (k == 0) + output.ParallelDeflateThreshold = -1L; // never + else + output.ParallelDeflateThreshold = 0L; // always + + output.Password = password; + output.Encryption = crypto[c]; // maybe "None" + output.CompressionLevel = compLevels[j]; + + _txrx.Send(String.Format("pb 3 max {0}", nFiles)); + _txrx.Send("pb 3 value 0"); + + for (int x = 0; x < nFiles; x++) + { + output.PutNextEntry(Path.GetFileName(filenames[x])); + using (var input = File.OpenRead(filenames[x])) + { + while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, n); + } + } + _txrx.Send("pb 3 step"); + } + } + + sw.Stop(); + ts[k] = sw.Elapsed; + TestContext.WriteLine("compression took {0}", ts[k]); + + //if (t==0) + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(nFiles, TestUtilities.CountEntries(zipFileToCreate), + "Trial ({0}.{1}.{2}.{3}): The zip file created has the wrong number of entries.", i, j, k, t); + + _txrx.Send("pb 2 step"); + } + + } + +#if NOT_DEBUGGING + // parallel is not always faster! + if (_sizeBase > 256 * 1024 && + compLevels[j] != Ionic.Zlib.CompressionLevel.None && + compLevels[j] != Ionic.Zlib.CompressionLevel.BestSpeed && + crypto[c] != EncryptionAlgorithm.WinZipAes256 && + crypto[c] != EncryptionAlgorithm.WinZipAes128 ) + Assert.IsTrue(ts[0]>ts[1], "Whoops! Cycle {0}.{1} (crypto({4}) Comp({5})): Parallel deflate is slower ({2}<{3})", + i, j, ts[0], ts[1], + crypto[c], + compLevels[j]); +#endif + _txrx.Send("pb 1 step"); + } + _txrx.Send("pb 0 step"); + } + + _txrx.Send("stop"); + } + + + + + + [TestMethod] + public void Streams_7z_Zip_ZeroLength() + { + _Internal_Streams_7z_Zip(0, "zero"); + } + + [TestMethod] + public void Streams_7z_Zip() + { + _Internal_Streams_7z_Zip(1, "nonzero"); + } + + [TestMethod] + public void Streams_7z_Zip_Mixed() + { + _Internal_Streams_7z_Zip(2, "mixed"); + } + + [TestMethod] + public void Streams_Winzip_Zip_Mixed_Password() + { + string password = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + _Internal_Streams_WinZip_Zip(2, password, "mixed"); + } + + [TestMethod] + public void Streams_Winzip_Zip() + { + _Internal_Streams_WinZip_Zip(1, null, "nonzero"); + } + + private string CreateZeroLengthFile(int ix, string directory) + { + string nameOfFileToCreate = Path.Combine(directory, String.Format("ZeroLength{0:D4}.txt", ix)); + using (var fs = File.Create(nameOfFileToCreate)) { } + return nameOfFileToCreate; + } + + + public void _Internal_Streams_7z_Zip(int flavor, string label) + { + if (!SevenZipIsPresent) + { + TestContext.WriteLine("skipping test [_Internal_Streams_7z_Zip] : SevenZip is not present"); + return; + } + + int[] fileCounts = { 1, 2, _rnd.Next(8) + 6, _rnd.Next(18) + 16, _rnd.Next(48) + 56 }; + + for (int m = 0; m < fileCounts.Length; m++) + { + string dirToZip = String.Format("trial{0:D2}", m); + if (!Directory.Exists(dirToZip)) Directory.CreateDirectory(dirToZip); + + int fileCount = fileCounts[m]; + string zipFileToCreate = Path.Combine(TopLevelDir, + String.Format("Streams_7z_Zip.{0}.{1}.{2}.zip", flavor, label, m)); + + string[] files = null; + if (flavor == 0) + { + // zero length files + files = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + files[i] = CreateZeroLengthFile(i, dirToZip); + } + else if (flavor == 1) + files = TestUtilities.GenerateFilesFlat(dirToZip, fileCount, 100, 72000); + else + { + // mixed + files = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + { + if (_rnd.Next(3) == 0) + files[i] = CreateZeroLengthFile(i, dirToZip); + else + { + files[i] = Path.Combine(dirToZip, String.Format("nonzero{0:D4}.txt", i)); + TestUtilities.CreateAndFillFileText(files[i], _rnd.Next(60000) + 100); + } + } + } + + // Create the zip archive via 7z.exe + this.Exec(sevenZip, String.Format("a {0} {1}", zipFileToCreate, dirToZip)); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), files.Length, + "Incorrect number of entries in the zip file."); + + // extract the files + string extractDir = String.Format("extract{0:D2}", m); + byte[] buffer = new byte[2048]; + int n; + using (var raw = File.OpenRead(zipFileToCreate)) + { + using (var input = new ZipInputStream(raw)) + { + ZipEntry e; + while ((e = input.GetNextEntry()) != null) + { + TestContext.WriteLine("entry: {0}", e.FileName); + string outputPath = Path.Combine(extractDir, e.FileName); + if (e.IsDirectory) + { + // create the directory + Directory.CreateDirectory(outputPath); + } + else + { + // create the file + using (var output = File.Create(outputPath)) + { + while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, n); + } + } + } + + // we don't set the timestamps or attributes + // on the file/directory. + } + } + } + + // winzip does not include the base path in the filename; + // 7zip does. + string[] filesUnzipped = Directory.GetFiles(Path.Combine(extractDir, dirToZip)); + + // Verify the number of files extracted + Assert.AreEqual(files.Length, filesUnzipped.Length, + "Incorrect number of files extracted."); + } + } + + + public void _Internal_Streams_WinZip_Zip(int fodderOption, string password, string label) + { + if (!WinZipIsPresent) + throw new Exception("skipping test [_Internal_Streams_WinZip_Zip] : winzip is not present"); + + int[] fileCounts = { 1, 2, _rnd.Next(8) + 6, _rnd.Next(18) + 16, _rnd.Next(48) + 56 }; + + for (int m = 0; m < fileCounts.Length; m++) + { + string dirToZip = String.Format("trial{0:D2}", m); + if (!Directory.Exists(dirToZip)) Directory.CreateDirectory(dirToZip); + + int fileCount = fileCounts[m]; + string zipFileToCreate = Path.Combine(TopLevelDir, + String.Format("Streams_Winzip_Zip.{0}.{1}.{2}.zip", fodderOption, label, m)); + + string[] files = null; + if (fodderOption == 0) + { + // zero length files + files = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + files[i] = CreateZeroLengthFile(i, dirToZip); + } + else if (fodderOption == 1) + files = TestUtilities.GenerateFilesFlat(dirToZip, fileCount, 100, 72000); + else + { + // mixed + files = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + { + if (_rnd.Next(3) == 0) + files[i] = CreateZeroLengthFile(i, dirToZip); + else + { + files[i] = Path.Combine(dirToZip, String.Format("nonzero{0:D4}.txt", i)); + TestUtilities.CreateAndFillFileText(files[i], _rnd.Next(60000) + 100); + } + } + } + + // Create the zip archive via WinZip.exe + string pwdOption = String.IsNullOrEmpty(password) ? "" : "-s" + password; + string formatString = "-a -p {0} -yx {1} {2}\\*.*"; + string wzzipOut = this.Exec(wzzip, String.Format(formatString, pwdOption, zipFileToCreate, dirToZip)); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), files.Length, + "Incorrect number of entries in the zip file."); + + // extract the files + string extractDir = String.Format("extract{0:D2}", m); + Directory.CreateDirectory(extractDir); + byte[] buffer = new byte[2048]; + int n; + + using (var raw = File.OpenRead(zipFileToCreate)) + { + using (var input = new ZipInputStream(raw)) + { + input.Password = password; + ZipEntry e; + while ((e = input.GetNextEntry()) != null) + { + TestContext.WriteLine("entry: {0}", e.FileName); + string outputPath = Path.Combine(extractDir, e.FileName); + if (e.IsDirectory) + { + // create the directory + Directory.CreateDirectory(outputPath); + continue; + } + // create the file + using (var output = File.Create(outputPath)) + { + while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, n); + } + } + + // we don't set the timestamps or attributes + // on the file/directory. + } + } + } + + string[] filesUnzipped = Directory.GetFiles(extractDir); + + // Verify the number of files extracted + Assert.AreEqual(files.Length, filesUnzipped.Length, + "Incorrect number of files extracted."); + } + } + + + + + [TestMethod] + public void ZIS_Crypto_zero() + { + _Internal_Streams_ZipInput_Encryption(0); + } + + [TestMethod] + public void ZIS_Crypto_zero_subdir() + { + _Internal_Streams_ZipInput_Encryption(3); + } + + [TestMethod] + public void ZIS_Crypto_nonzero() + { + _Internal_Streams_ZipInput_Encryption(1); + } + + + [TestMethod] + public void ZIS_Crypto_nonzero_subdir() + { + _Internal_Streams_ZipInput_Encryption(4); + } + + + [TestMethod] + public void ZIS_Crypto_mixed() + { + _Internal_Streams_ZipInput_Encryption(2); + } + + + [TestMethod] + public void ZIS_Crypto_mixed_subdir() + { + _Internal_Streams_ZipInput_Encryption(5); + } + + + + + + [TestMethod] + public void ZIS_Crypto_zero_file() + { + _Internal_Streams_ZipInput_Encryption(0, 1); + } + + [TestMethod] + public void ZIS_Crypto_zero_subdir_file() + { + + _Internal_Streams_ZipInput_Encryption(3, 1); + } + + [TestMethod] + public void ZIS_Crypto_nonzero_file() + { + _Internal_Streams_ZipInput_Encryption(1, 1); + } + + + [TestMethod] + public void ZIS_Crypto_nonzero_subdir_file() + { + _Internal_Streams_ZipInput_Encryption(4, 1); + } + + + [TestMethod] + public void ZIS_Crypto_mixed_file() + { + _Internal_Streams_ZipInput_Encryption(2, 1); + } + + + [TestMethod] + public void ZIS_Crypto_mixed_subdir_file() + { + _Internal_Streams_ZipInput_Encryption(5, 1); + } + + + + public void _Internal_Streams_ZipInput_Encryption(int fodderOption) + { + _Internal_Streams_ZipInput_Encryption(fodderOption, 0); + } + + + public void _Internal_Streams_ZipInput_Encryption(int fodderOption, int fileReadOption) + { + byte[] buffer = new byte[2048]; + int n; + + int[] fileCounts = { 1, + 2, + _rnd.Next(8) + 6, + _rnd.Next(18) + 16, + _rnd.Next(48) + 56 }; + + for (int m = 0; m < fileCounts.Length; m++) + { + string password = TestUtilities.GenerateRandomPassword(); + string dirToZip = String.Format("trial{0:D2}", m); + if (!Directory.Exists(dirToZip)) Directory.CreateDirectory(dirToZip); + + int fileCount = fileCounts[m]; + TestContext.WriteLine("====="); + TestContext.WriteLine("Trial {0} filecount={1}", m, fileCount); + + var files = (new Func( () => { + if (fodderOption == 0) + { + // zero length files + var a = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + a[i] = CreateZeroLengthFile(i, dirToZip); + return a; + } + + if (fodderOption == 1) + return TestUtilities.GenerateFilesFlat(dirToZip, fileCount, 100, 72000); + + + // mixed = some zero and some not + var b = new string[fileCount]; + for (int i = 0; i < fileCount; i++) + { + if (_rnd.Next(3) == 0) + b[i] = CreateZeroLengthFile(i, dirToZip); + else + { + b[i] = Path.Combine(dirToZip, String.Format("nonzero{0:D4}.txt", i)); + TestUtilities.CreateAndFillFileText(b[i], _rnd.Next(60000) + 100); + } + } + return b; + }))(); + + + for (int i = 0; i < crypto.Length; i++) + { + EncryptionAlgorithm c = crypto[i]; + + string zipFileToCreate = + Path.Combine(TopLevelDir, + String.Format("ZIS_Crypto.{0}.count.{1:D2}.{2}.zip", + c.ToString(), fileCounts[m], fodderOption)); + + // Create the zip archive + using (var zip = new ZipFile()) + { + zip.Password = password; + zip.Encryption = c; + if (fodderOption > 2) + { + zip.AddDirectoryByName("subdir"); + zip.AddDirectory(dirToZip, "subdir"); + } + else + zip.AddDirectory(dirToZip); + + zip.Save(zipFileToCreate); + } + + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), files.Length, + "Incorrect number of entries in the zip file."); + + // extract the files + string extractDir = String.Format("extract{0:D2}.{1:D2}", m, i); + TestContext.WriteLine("Extract to: {0}", extractDir); + Directory.CreateDirectory(extractDir); + + var input = (new Func( () => { + if (fileReadOption == 0) + { + var raw = File.OpenRead(zipFileToCreate); + return new ZipInputStream(raw); + } + + return new ZipInputStream(zipFileToCreate); + }))(); + + using (input) + { + // set password if necessary + if (crypto[i] != EncryptionAlgorithm.None) + input.Password = password; + + ZipEntry e; + while ((e = input.GetNextEntry()) != null) + { + TestContext.WriteLine("entry: {0}", e.FileName); + string outputPath = Path.Combine(extractDir, e.FileName); + if (e.IsDirectory) + { + // create the directory + Directory.CreateDirectory(outputPath); + } + else + { + // emit the file + using (var output = File.Create(outputPath)) + { + while ((n = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, n); + } + } + } + } + } + + string[] filesUnzipped = (fodderOption > 2) + ? Directory.GetFiles(Path.Combine(extractDir, "subdir")) + : Directory.GetFiles(extractDir); + + // Verify the number of files extracted + Assert.AreEqual(files.Length, filesUnzipped.Length, + "Incorrect number of files extracted. ({0}!={1})", files.Length, filesUnzipped.Length); + } + } + } + + + + + + [TestMethod] + public void ASPNET_GenerateZip() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + string aspnetHost = Path.Combine(resourceDir, "AspNetHost.exe"); + Assert.IsTrue(File.Exists(aspnetHost), "file {0} does not exit.", aspnetHost); + string aspnetHostPdb = Path.Combine(resourceDir, "AspNetHost.pdb"); + + // page that generates a zip file. + string aspxPage = Path.Combine(resourceDir, "GenerateZip-cs.aspx"); + Assert.IsTrue(File.Exists(aspxPage)); + + string ionicZipDll = Path.Combine(testBin, "Ionic.Zip.dll"); + string loremFile = "LoremIpsum.txt"; + + Action copyToBin = (x) => + File.Copy(x, Path.Combine("bin", + Path.GetFileName(x))); + Directory.CreateDirectory("bin"); + copyToBin(aspnetHost); + copyToBin(aspnetHostPdb); + copyToBin(ionicZipDll); + File.Copy(aspxPage, Path.GetFileName(aspxPage)); + File.WriteAllText(loremFile, TestUtilities.LoremIpsum); + + string zipFileToCreate = "ASPX-output.out"; + string binAspNetHostExe = Path.Combine("bin", + Path.GetFileName(aspnetHost)); + string urlRequest = Path.GetFileName(aspxPage) + "?file=LoremIpsum.txt"; + + int rc = this.ExecRedirectStdOut(binAspNetHostExe, + urlRequest, + zipFileToCreate); + + Assert.AreEqual(rc, 0, "Non-zero RC: ({0})", rc); + + int nEntries = TestUtilities.CountEntries(zipFileToCreate); + Assert.AreEqual(nEntries, + 2, "wrong number of entries ({0})", nEntries); + + string extractDir = "extract"; + // read/extract the generated zip + using (var zip = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip) + { + e.Extract(extractDir); + } + } + + // compare checksums + var chk1 = TestUtilities.ComputeChecksum(loremFile); + var chk2 = TestUtilities.ComputeChecksum(Path.Combine(extractDir,loremFile)); + string s1 = TestUtilities.CheckSumToString(chk1); + string s2 = TestUtilities.CheckSumToString(chk2); + Assert.AreEqual(s1, s2, "Unexpected checksum on extracted file."); + } + + + void CopyStream(Stream source, Stream dest) + { + int n; + var buf = new byte[2048]; + while ((n= source.Read(buf, 0, buf.Length)) > 0) + { + dest.Write(buf,0,n); + } + } + + + [TestMethod] + public void ZIS_ZOS_VaryCompression() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string resourceDir = Path.Combine(testBin, "Resources"); + var filesToAdd = Directory.GetFiles(resourceDir); + + Func chooseCompression = (ix, cycle) => { + var name = Path.GetFileName(filesToAdd[ix]); + switch (cycle) + { + case 0: + return !(name.EndsWith(".zip") || + name.EndsWith(".docx") || + name.EndsWith(".xslx")); + case 1: + return ((ix%2)==0); + + default: + return (ix == filesToAdd.Length - 1); + } + }; + + // Three cycles - three different ways to vary compression + for (int k=0; k < 3; k++) + { + string zipFileToCreate = String.Format("VaryCompression-{0}.zip", k); + + TestContext.WriteLine(""); + TestContext.WriteLine("Creating zip, cycle {0}", k); + using (var fileStream = File.OpenWrite(zipFileToCreate)) + { + using (var zos = new ZipOutputStream(fileStream, true)) + { + for (int i=0; i < filesToAdd.Length; i++) + { + var file = filesToAdd[i]; + var shortName = Path.GetFileName(file); + bool compress = chooseCompression(i, k); + + if (compress) + zos.CompressionLevel = Ionic.Zlib.CompressionLevel.Default; + else + zos.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + + zos.PutNextEntry(shortName); + using (var input = File.OpenRead(file)) + { + CopyStream(input, zos); + } + } + } + } + + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting cycle {0}", k); + string extractDir = "extract-" + k; + Directory.CreateDirectory(extractDir); + using (var raw = File.OpenRead(zipFileToCreate)) + { + using (var input = new ZipInputStream(raw)) + { + ZipEntry e; + while ((e = input.GetNextEntry()) != null) + { + TestContext.WriteLine("entry: {0}", e.FileName); + string outputPath = Path.Combine(extractDir, e.FileName); + if (e.IsDirectory) + { + // create the directory + Directory.CreateDirectory(outputPath); + } + else + { + // create the file + using (var output = File.Create(outputPath)) + { + CopyStream(input,output); + } + } + } + } + } + + string[] filesUnzipped = Directory.GetFiles(extractDir); + Assert.AreEqual(filesToAdd.Length, filesUnzipped.Length, + "Incorrect number of files extracted."); + + } + } + + } +} diff --git a/dotNetZip/Zip Tests/TestUtilities.cs b/dotNetZip/Zip Tests/TestUtilities.cs new file mode 100644 index 0000000..c9bc47d --- /dev/null +++ b/dotNetZip/Zip Tests/TestUtilities.cs @@ -0,0 +1,926 @@ +// TestUtilities.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-11 07:54:52> +// +// ------------------------------------------------------------------ +// +// This module defines some utility classes used by the unit tests for +// DotNetZip. +// +// ------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Net; +using System.IO; +using Ionic.Zip; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Ionic.Zip.Tests.Utilities +{ + class TestUtilities + { + static System.Random _rnd; + static string cdir; + static TestUtilities() + { + _rnd = new System.Random(); + LoremIpsumWords = LoremIpsum.Split(" ".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries); + cdir = Directory.GetCurrentDirectory(); + } + + + + #region Test Init and Cleanup + + internal static void Initialize(out string TopLevelDir) + { + if (cdir == null) cdir = Directory.GetCurrentDirectory(); + + TopLevelDir = TestUtilities.GenerateUniquePathname("tmp"); + Directory.CreateDirectory(TopLevelDir); + Directory.SetCurrentDirectory(Path.GetDirectoryName(TopLevelDir)); + } + + internal static void Cleanup(string CurrentDir, List FilesToRemove) + { + Assert.AreNotEqual(Path.GetFileName(CurrentDir), "Temp", "at finish"); + Directory.SetCurrentDirectory(CurrentDir); + IOException GotException = null; + int Tries = 0; + do + { + try + { + GotException = null; + foreach (string filename in FilesToRemove) + { + if (Directory.Exists(filename)) + { + // turn off any ReadOnly attributes + ClearReadOnly(filename); + Directory.Delete(filename, true); + } + if (File.Exists(filename)) + { + File.Delete(filename); + } + } + Tries++; + } + catch (IOException ioexc) + { + GotException = ioexc; + // use an backoff interval before retry + System.Threading.Thread.Sleep(200 * Tries); + } + } while ((GotException != null) && (Tries < 4)); + if (GotException != null) throw GotException; + } + + + public static void ClearReadOnly(string dirname) + { + // don't traverse reparse points + if ((File.GetAttributes(dirname) & FileAttributes.ReparsePoint) != 0) + return; + + foreach (var d in Directory.GetDirectories(dirname)) + { + ClearReadOnly(d); // recurse + } + + foreach (var f in Directory.GetFiles(dirname)) + { + // clear ReadOnly and System attributes + var a = File.GetAttributes(f); + if ((a & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) + { + a ^= FileAttributes.ReadOnly; + File.SetAttributes(f, a); + } + if ((a & FileAttributes.System) == FileAttributes.System) + { + a ^= FileAttributes.System; + File.SetAttributes(f, a); + } + } + } + + + + #endregion + + + #region Helper methods + + internal static string TrimVolumeAndSwapSlashes(string pathName) + { + //return (((pathname[1] == ':') && (pathname[2] == '\\')) ? pathname.Substring(3) : pathname) + // .Replace('\\', '/'); + if (String.IsNullOrEmpty(pathName)) return pathName; + if (pathName.Length < 2) return pathName.Replace('\\', '/'); + return (((pathName[1] == ':') && (pathName[2] == '\\')) ? pathName.Substring(3) : pathName) + .Replace('\\', '/'); + } + + internal static DateTime RoundToEvenSecond(DateTime source) + { + // round to nearest second: + if ((source.Second % 2) == 1) + source += new TimeSpan(0, 0, 1); + + DateTime dtRounded = new DateTime(source.Year, source.Month, source.Day, source.Hour, source.Minute, source.Second); + //if (source.Millisecond >= 500) dtRounded = dtRounded.AddSeconds(1); + return dtRounded; + } + + + /// + /// count occurrences of sample in string s. + /// + internal static int CountOccurrences(string s, string sample) + { + int nFound = 0; + int n = 0; + do + { + n = s.IndexOf(sample,n); + if (n>0) nFound++; + n++; + } while (n>0); + return nFound; + } + + + internal static void CreateAndFillFileText(string filename, Int64 size) + { + CreateAndFillFileText(filename, size, null); + } + + + internal static void CreateAndFillFileText(string filename, + Int64 size, + Action update) + { + Int64 bytesRemaining = size; + + if (size > 128 * 1024) + { + var rnd = new System.Random(); + RandomTextGenerator rtg = new RandomTextGenerator(); + int chunkSize = 48 * 1024; + int variationSize = 2 * 1024; + var newLinePair = Encoding.ASCII.GetBytes("\n\n"); + int nCycles = 0; + // fill the file with text data, selecting large blocks at a time + var fodder = new byte[32][]; + using (var fs = File.Create(filename)) + { + do + { + int n = rnd.Next(fodder.Length); + if (fodder[n] == null) + { + string generatedText = rtg.Generate(chunkSize); + fodder[n] = Encoding.ASCII.GetBytes(generatedText); + } + + var bytes = fodder[n]; + int len = bytes.Length - rnd.Next(variationSize); + fs.Write(bytes,0,len); + bytesRemaining -= len; + fs.Write(newLinePair, 0, newLinePair.Length); + bytesRemaining -= newLinePair.Length; + nCycles++; + if ((nCycles % 1024) == 0) + { + if (update != null) + update(size - bytesRemaining); + } + } while (bytesRemaining > 0); + } + } + else + { + // fill the file with text data, selecting one word at a time + using (StreamWriter sw = File.CreateText(filename)) + { + do + { + // pick a word at random + string selectedWord = LoremIpsumWords[_rnd.Next(LoremIpsumWords.Length)]; + if (bytesRemaining < selectedWord.Length + 1) + { + sw.Write(selectedWord.Substring(0, (int)bytesRemaining)); + bytesRemaining = 0; + } + else + { + sw.Write(selectedWord); + sw.Write(" "); + bytesRemaining -= (selectedWord.Length + 1); + } + if (update != null) + update(size - bytesRemaining); + + } while (bytesRemaining > 0); + sw.Close(); + } + } + } + + internal static void CreateAndFillFileText(string Filename, + string Line, + Int64 size) + { + CreateAndFillFileText(Filename, Line, size, null); + } + + + internal static void CreateAndFillFileText(string Filename, + string Line, + Int64 size, + System.Action update) + { + Int64 bytesRemaining = size; + // fill the file by repeatedly writing out the same line + using (StreamWriter sw = File.CreateText(Filename)) + { + do + { + if (bytesRemaining < Line.Length + 2) + { + if (bytesRemaining == 1) + sw.Write(" "); + else if (bytesRemaining == 1) + sw.WriteLine(); + else + sw.WriteLine(Line.Substring(0, (int)bytesRemaining - 2)); + bytesRemaining = 0; + } + else + { + sw.WriteLine(Line); + bytesRemaining -= (Line.Length + 2); + } + if (update != null) + update(size - bytesRemaining); + } while (bytesRemaining > 0); + sw.Close(); + } + } + + internal static void CreateAndFillFileBinary(string Filename, Int64 size) + { + _CreateAndFillBinary(Filename, size, false, null); + } + + internal static void CreateAndFillFileBinary(string Filename, Int64 size, System.Action update) + { + _CreateAndFillBinary(Filename, size, false, update); + } + + internal static void CreateAndFillFileBinaryZeroes(string Filename, Int64 size, System.Action update) + { + _CreateAndFillBinary(Filename, size, true, update); + } + + delegate void ProgressUpdate(System.Int64 bytesXferred); + + private static void _CreateAndFillBinary(string filename, Int64 size, bool zeroes, System.Action update) + { + Int64 bytesRemaining = size; + // fill with binary data + int sz = 65536 * 8; + if (size < sz) sz = (int)size; + byte[] buffer = new byte[sz]; + int nCycles = 0; + using (var fileStream = File.Create(filename)) + { + while (bytesRemaining > 0) + { + int sizeOfChunkToWrite = (bytesRemaining > buffer.Length) ? buffer.Length : (int)bytesRemaining; + if (!zeroes) _rnd.NextBytes(buffer); + fileStream.Write(buffer, 0, sizeOfChunkToWrite); + bytesRemaining -= sizeOfChunkToWrite; + nCycles++; + if (size > 1024*1024) + { + if ((nCycles % 256) == 0) + { + if (update != null) + update(size - bytesRemaining); + } + } + } + fileStream.Close(); + } + } + + + internal static void CreateAndFillFile(string filename, Int64 size) + { + if (size == 0) + File.Create(filename); + else if (_rnd.Next(2) == 0) + CreateAndFillFileText(filename, size); + else + CreateAndFillFileBinary(filename, size); + } + + internal enum FileFlavor + { + Text = 0, Binary = 1, + } + + internal static void CreateAndFillFile(string filename, + Int64 size, + FileFlavor flavor) + { + if (size == 0) + File.Create(filename); + else if (flavor == FileFlavor.Text) + CreateAndFillFileText(filename, size); + else + CreateAndFillFileBinary(filename, size); + } + + internal static string CreateUniqueFile(string extension, string ContainingDirectory) + { + //string nameOfFileToCreate = GenerateUniquePathname(extension, ContainingDirectory); + string nameOfFileToCreate = Path.Combine(ContainingDirectory, String.Format("{0}.{1}", Path.GetRandomFileName(), extension)); + // create an empty file + using (var fs = File.Create(nameOfFileToCreate)) { } + return nameOfFileToCreate; + } + + internal static string CreateUniqueFile(string extension) + { + return CreateUniqueFile(extension, null); + } + + internal static string CreateUniqueFile(string extension, Int64 size) + { + return CreateUniqueFile(extension, null, size); + } + + internal static string CreateUniqueFile(string extension, string ContainingDirectory, Int64 size) + { + //string fileToCreate = GenerateUniquePathname(extension, ContainingDirectory); + string nameOfFileToCreate = Path.Combine(ContainingDirectory, String.Format("{0}.{1}", Path.GetRandomFileName(), extension)); + CreateAndFillFile(nameOfFileToCreate, size); + return nameOfFileToCreate; + } + + static System.Reflection.Assembly _a = null; + private static System.Reflection.Assembly _MyAssembly + { + get + { + if (_a == null) + { + _a = System.Reflection.Assembly.GetExecutingAssembly(); + } + return _a; + } + } + + internal static string GenerateUniquePathname(string extension) + { + return GenerateUniquePathname(extension, null); + } + + internal static string GenerateUniquePathname(string extension, string ContainingDirectory) + { + string candidate = null; + String AppName = _MyAssembly.GetName().Name; + + string parentDir = (ContainingDirectory == null) ? System.Environment.GetEnvironmentVariable("TEMP") : + ContainingDirectory; + if (parentDir == null) return null; + + int index = 0; + do + { + index++; + string Name = String.Format("{0}-{1}-{2}.{3}", + AppName, System.DateTime.Now.ToString("yyyyMMMdd-HHmmss"), index, extension); + candidate = Path.Combine(parentDir, Name); + } while (File.Exists(candidate)); + + // this file/path does not exist. It can now be created, as + // file or directory. + return candidate; + } + + internal static int CountEntries(string zipfile) + { + int entries = 0; + using (ZipFile zip = ZipFile.Read(zipfile)) + { + foreach (ZipEntry e in zip) + if (!e.IsDirectory) entries++; + } + return entries; + } + + + internal static string GetCheckSumString(string filename) + { + return CheckSumToString(ComputeChecksum(filename)); + } + + internal static string CheckSumToString(byte[] checksum) + { + var sb = new System.Text.StringBuilder(); + foreach (byte b in checksum) + sb.Append(b.ToString("x2").ToLower()); + return sb.ToString(); + } + + internal static byte[] ComputeChecksum(string filename) + { + var _md5 = System.Security.Cryptography.MD5.Create(); + using (FileStream fs = File.OpenRead(filename)) + { + return _md5.ComputeHash(fs); + } + } + + private static char GetOneRandomPasswordChar() + { + const int range = 126 - 33; + const int start = 33; + char x = '\0'; + do + { + x = (char)(_rnd.Next(range) + start); + + } while (x == '^' || x == '&' || x == '"' || x == '>' || x == '<'); + return x; + } + + internal static string GenerateRandomPassword() + { + int length = _rnd.Next(22) + 12; + return GenerateRandomPassword(length); + } + + internal static string GenerateRandomPassword(int length) + { + char[] a = new char[length]; + for (int i = 0; i < length; i++) + { + a[i] = GetOneRandomPasswordChar(); + } + + string result = new System.String(a); + return result; + } + + + public static string GenerateRandomAsciiString() + { + return GenerateRandomAsciiString(_rnd.Next(14)); + } + + public static string GenerateRandomName() + { + return + GenerateRandomUpperString(1) + + GenerateRandomLowerString(_rnd.Next(9) + 3); + } + + public static string GenerateRandomName(int length) + { + return + GenerateRandomUpperString(1) + + GenerateRandomLowerString(length - 1); + } + + public static string GenerateRandomAsciiString(int length) + { + return GenerateRandomAsciiStringImpl(length, 0); + } + + public static string GenerateRandomUpperString() + { + return GenerateRandomAsciiStringImpl(_rnd.Next(10) + 3, 65); + } + + public static string GenerateRandomUpperString(int length) + { + return GenerateRandomAsciiStringImpl(length, 65); + } + + public static string GenerateRandomLowerString(int length) + { + return GenerateRandomAsciiStringImpl(length, 97); + } + + public static string GenerateRandomLowerString() + { + return GenerateRandomAsciiStringImpl(_rnd.Next(9) + 4, 97); + } + + private static string GenerateRandomAsciiStringImpl(int length, int delta) + { + bool WantRandomized = (delta == 0); + + string result = ""; + char[] a = new char[length]; + + for (int i = 0; i < length; i++) + { + if (WantRandomized) + delta = (_rnd.Next(2) == 0) ? 65 : 97; + a[i] = GetOneRandomAsciiChar(delta); + } + + result = new System.String(a); + return result; + } + + + + private static char GetOneRandomAsciiChar(int delta) + { + // delta == 65 means uppercase + // delta == 97 means lowercase + return (char)(_rnd.Next(26) + delta); + } + + public static char GetOneRandomLowercaseAsciiChar() + { + return (char)(_rnd.Next(26) + 97); + } + + public static char GetOneRandomUppercaseAsciiChar() + { + return (char)(_rnd.Next(26) + 65); + } + + + + + internal static int GenerateFilesOneLevelDeep(TestContext tc, + string testName, + string dirToZip, + Action update, + out int subdirCount) + { + int[] settings = { 7, 6, 17, 23, 4000, 4000 }; // to randomly set dircount, filecount, and filesize + return GenerateFilesOneLevelDeep(tc, testName, dirToZip, settings, update, out subdirCount); + } + + + internal static int GenerateFilesOneLevelDeep(TestContext tc, + string testName, + string dirToZip, + int[] settings, + Action update, + out int subdirCount) + { + int entriesAdded = 0; + String filename = null; + + subdirCount = _rnd.Next(settings[0]) + settings[1]; + if (update != null) + update(0, subdirCount); + tc.WriteLine("{0}: Creating {1} subdirs.", testName, subdirCount); + for (int i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(dirToZip, String.Format("dir{0:D4}", i)); + Directory.CreateDirectory(subdir); + + int filecount = _rnd.Next(settings[2]) + settings[3]; + if (update != null) + update(1, filecount); + tc.WriteLine(":: Subdir {0}, Creating {1} files.", i, filecount); + for (int j = 0; j < filecount; j++) + { + int n = _rnd.Next(2); + filename = String.Format("file{0:D4}.{1}", j, (n == 0) ? "txt" : "bin"); + TestUtilities.CreateAndFillFile(Path.Combine(subdir, filename), + _rnd.Next(settings[4]) + settings[5], + (FileFlavor)n); + entriesAdded++; + if (update != null) + update(3, j + 1); + } + if (update != null) + update(2, i + 1); + } + if (update != null) + update(4, entriesAdded); + return entriesAdded; + } + + + internal static string[] GenerateFilesFlat(string subdir) + { + return GenerateFilesFlat(subdir, 0); + } + + internal static string[] GenerateFilesFlat(string subdir, int numFilesToCreate) + { + return GenerateFilesFlat(subdir, numFilesToCreate, 0, 0); + } + + internal static string[] GenerateFilesFlat(string subdir, int numFilesToCreate, int size) + { + return GenerateFilesFlat(subdir, numFilesToCreate, size, size); + } + + internal static string[] GenerateFilesFlat(string subdir, + int numFilesToCreate, + int lowSize, int highSize) + { + return GenerateFilesFlat(subdir, numFilesToCreate, lowSize, highSize, + null); + } + + internal static string[] GenerateFilesFlat(string subdir, + int numFilesToCreate, + int lowSize, + int highSize, + Action update) + { + if (numFilesToCreate==0) + numFilesToCreate = _rnd.Next(23) + 14; + + if (lowSize == highSize && lowSize == 0) + { + lowSize = 5000; + highSize = 39000; + } + if (!Directory.Exists(subdir)) + Directory.CreateDirectory(subdir); + + int i = 0; + Action byteUpdate = null; + if (update != null) + { + byteUpdate = new Action( x => { + update(1,i,x); + }); + } + + string[] filesToZip = new string[numFilesToCreate]; + for (i = 0; i < numFilesToCreate; i++) + { + filesToZip[i] = Path.Combine(subdir, String.Format("testfile{0:D3}.txt", i)); + var sz = _rnd.Next(highSize - lowSize) + lowSize; + if (update != null) + update(0, i, sz); + TestUtilities.CreateAndFillFileText(filesToZip[i], + sz, + byteUpdate); + if (update != null) update(2,i,numFilesToCreate); + } + return filesToZip; + } + + + internal static string GetTestBinDir(string startingPoint) + { + return GetTestDependentDir(startingPoint, "Zip Tests\\bin\\Debug"); + } + + internal static string GetTestSrcDir(string startingPoint) + { + return GetTestDependentDir(startingPoint, "Zip Tests"); + } + + private static string GetTestDependentDir(string startingPoint, string subdir) + { + var location = startingPoint; + for (int i = 0; i < 3; i++) + location = Path.GetDirectoryName(location); + + location = Path.Combine(location, subdir); + return location; + } + + + internal static Ionic.CopyData.Transceiver + StartProgressMonitor(string progressChannel, string title, string initialStatus) + { + string testBin = TestUtilities.GetTestBinDir(cdir); + string progressMonitorTool = Path.Combine(testBin, "Resources\\UnitTestProgressMonitor.exe"); + string requiredDll = Path.Combine(testBin, "Resources\\Ionic.CopyData.dll"); + Assert.IsTrue(File.Exists(progressMonitorTool), "progress monitor tool does not exist ({0})", progressMonitorTool); + Assert.IsTrue(File.Exists(requiredDll), "required DLL does not exist ({0})", requiredDll); + + // start the progress monitor + string ignored; + //this.Exec(progressMonitorTool, String.Format("-channel {0}", progressChannel), false); + TestUtilities.Exec_NoContext(progressMonitorTool, String.Format("-channel {0}", progressChannel), false, out ignored); + + var txrx = new Ionic.CopyData.Transceiver(); + System.Threading.Thread.Sleep(1000); + txrx.Channel = progressChannel; + System.Threading.Thread.Sleep(450); + txrx.Send("test " + title); + System.Threading.Thread.Sleep(120); + txrx.Send("status " + initialStatus); + return txrx; + } + + internal static int Exec_NoContext(string program, string args, out string output) + { + return Exec_NoContext(program, args, true, out output); + } + + + internal static int Exec_NoContext(string program, string args, bool waitForExit, out string output) + { + System.Diagnostics.Process p = new System.Diagnostics.Process + { + StartInfo = + { + FileName = program, + CreateNoWindow = true, + Arguments = args, + WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, + UseShellExecute = false, + } + }; + + if (waitForExit) + { + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardError = true; + // Must read at least one of the stderr or stdout asynchronously, + // to avoid deadlock. I choose to read stderr. + StringBuilder sb = new StringBuilder(); + p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler((o, e) => { + if (!String.IsNullOrEmpty(e.Data)) + sb.Append(e.Data); + }); + p.Start(); + p.BeginErrorReadLine(); + output = p.StandardOutput.ReadToEnd(); + p.WaitForExit(); + if (sb.Length > 0) + output += sb.ToString(); + output = CleanWzzipOut(output); // just in case + return p.ExitCode; + } + else + { + p.Start(); + } + output = ""; + return 0; + } + + + /// + /// The WinZip command-line tools emit dots and backspaces in the output. + /// For a large zip file, the output can be 1mb or more, of which 99% is + /// dots and backspaces. This method trims them from the output, making it + /// suitable for printing into the TestContext output. + /// + protected static string CleanWzzipOut(string txt) + { + int previousLength = 0; + int cycles = 0; + do + { + // wzzip.exe can generate long sequences of dots, followed by long + // sequences of backspaces. Don't want to replace two backspaces + // with the empty string, so replace a sequence of a non-backspace + // char followed by backspace with the empty string. Do it in + // cycles to handle those long sequences. + + cycles++; + previousLength = txt.Length; + txt = Regex.Replace(txt, "[^\u0008]\u0008", ""); + } while (previousLength != txt.Length && cycles < 80); + + return txt; + } + + #endregion + + internal static string LoremIpsum = + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer " + + "vulputate, nibh non rhoncus euismod, erat odio pellentesque lacus, sit " + + "amet convallis mi augue et odio. Phasellus cursus urna facilisis " + + "quam. Suspendisse nec metus et sapien scelerisque euismod. Nullam " + + "molestie sem quis nisl. Fusce pellentesque, ante sed semper egestas, sem " + + "nulla vestibulum nulla, quis sollicitudin leo lorem elementum " + + "wisi. Aliquam vestibulum nonummy orci. Sed in dolor sed enim ullamcorper " + + "accumsan. Duis vel nibh. Class aptent taciti sociosqu ad litora torquent " + + "per conubia nostra, per inceptos hymenaeos. Sed faucibus, enim sit amet " + + "venenatis laoreet, nisl elit posuere est, ut sollicitudin tortor velit " + + "ut ipsum. Aliquam erat volutpat. Phasellus tincidunt vehicula " + + "eros. Curabitur vitae erat. " + + "\n " + + "Quisque pharetra lacus quis sapien. Duis id est non wisi sagittis " + + "adipiscing. Nulla facilisi. Etiam quam erat, lobortis eu, facilisis nec, " + + "blandit hendrerit, metus. Fusce hendrerit. Nunc magna libero, " + + "sollicitudin non, vulputate non, ornare id, nulla. Suspendisse " + + "potenti. Nullam in mauris. Curabitur et nisl vel purus vehicula " + + "sodales. Class aptent taciti sociosqu ad litora torquent per conubia " + + "nostra, per inceptos hymenaeos. Cum sociis natoque penatibus et magnis " + + "dis parturient montes, nascetur ridiculus mus. Donec semper, arcu nec " + + "dignissim porta, eros odio tempus pede, et laoreet nibh arcu et " + + "nisl. Morbi pellentesque eleifend ante. Morbi dictum lorem non " + + "ante. Nullam et augue sit amet sapien varius mollis. " + + "\n " + + "Nulla erat lorem, fringilla eget, ultrices nec, dictum sed, " + + "sapien. Aliquam libero ligula, porttitor scelerisque, lobortis nec, " + + "dignissim eu, elit. Etiam feugiat, dui vitae laoreet faucibus, tellus " + + "urna molestie purus, sit amet pretium lorem pede in erat. Ut non libero " + + "et sapien porttitor eleifend. Vestibulum ante ipsum primis in faucibus " + + "orci luctus et ultrices posuere cubilia Curae; In at lorem et lacus " + + "feugiat iaculis. Nunc tempus eros nec arcu tristique egestas. Quisque " + + "metus arcu, pretium in, suscipit dictum, bibendum sit amet, " + + "mauris. Aliquam non urna. Suspendisse eget diam. Aliquam erat " + + "volutpat. In euismod aliquam lorem. Mauris dolor nisl, consectetuer sit " + + "amet, suscipit sodales, rutrum in, lorem. Nunc nec nisl. Nulla ante " + + "libero, aliquam porttitor, aliquet at, imperdiet sed, diam. Pellentesque " + + "tincidunt nisl et ipsum. Suspendisse purus urna, semper quis, laoreet " + + "in, vestibulum vel, arcu. Nunc elementum eros nec mauris. " + + "\n " + + "Vivamus congue pede at quam. Aliquam aliquam leo vel turpis. Ut " + + "commodo. Integer tincidunt sem a risus. Cras aliquam libero quis " + + "arcu. Integer posuere. Nulla malesuada, wisi ac elementum sollicitudin, " + + "libero libero molestie velit, eu faucibus est ante eu libero. Sed " + + "vestibulum, dolor ac ultricies consectetuer, tellus risus interdum diam, " + + "a imperdiet nibh eros eget mauris. Donec faucibus volutpat " + + "augue. Phasellus vitae arcu quis ipsum ultrices fermentum. Vivamus " + + "ultricies porta ligula. Nullam malesuada. Ut feugiat urna non " + + "turpis. Vivamus ipsum. Vivamus eleifend condimentum risus. Curabitur " + + "pede. Maecenas suscipit pretium tortor. Integer pellentesque. " + + "\n " + + "Mauris est. Aenean accumsan purus vitae ligula. Lorem ipsum dolor sit " + + "amet, consectetuer adipiscing elit. Nullam at mauris id turpis placerat " + + "accumsan. Sed pharetra metus ut ante. Aenean vel urna sit amet ante " + + "pretium dapibus. Sed nulla. Sed nonummy, lacus a suscipit semper, erat " + + "wisi convallis mi, et accumsan magna elit laoreet sem. Nam leo est, " + + "cursus ut, molestie ac, laoreet id, mauris. Suspendisse auctor nibh. " + + "\n"; + + static string[] LoremIpsumWords; + + + } + + + + public static class Extensions + { + + public static IEnumerable SplitByWords(this string subject) + { + List tokens = new List(); + Regex regex = new Regex(@"\s+"); + tokens.AddRange(regex.Split(subject)); + + return tokens; + } + + // Capitalize + public static string Capitalize(this string subject) + { + if (subject.Length < 2) return subject.ToUpper(); + return subject.Substring(0, 1).ToUpper() + + subject.Substring(1); + } + + // TrimPunctuation + public static string TrimPunctuation(this string subject) + { + while (subject.EndsWith(".") || + subject.EndsWith(",") || + subject.EndsWith(";") || + subject.EndsWith("?") || + subject.EndsWith("!")) + subject = subject.Substring(0, subject.Length - 1); + return subject; + } + } + + +} diff --git a/dotNetZip/Zip Tests/UnicodeTests.cs b/dotNetZip/Zip Tests/UnicodeTests.cs new file mode 100644 index 0000000..d7e1508 --- /dev/null +++ b/dotNetZip/Zip Tests/UnicodeTests.cs @@ -0,0 +1,686 @@ +// UnicodeTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008-2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-06 19:29:37> +// +// ------------------------------------------------------------------ +// +// This module defines the tests for the Unicode features in DotNetZip. +// +// ------------------------------------------------------------------ + + +using System; +using System.Text; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; +using System.IO; + +namespace Ionic.Zip.Tests.Unicode +{ + /// + /// Summary description for UnicodeTests + /// + [TestClass] + public class UnicodeTests : IonicTestClass + { + public UnicodeTests() : base() { } + + + [TestMethod] + public void Create_UnicodeEntries() + { + int i; + string origComment = "This is a Unicode comment. "+ + "Chinese: 弹 出 应 用 程 序 "+ + "Norwegian/Danish: æøåÆØÅ. "+ + "Portugese: Configurações."; + string[] formats = { + "弹出应用程序{0:D3}.bin", + "n.æøåÆØÅ{0:D3}.bin", + "Configurações-弹出-ÆØÅ-xx{0:D3}.bin" + }; + + for (int k = 0; k < formats.Length; k++) + { + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "files" + k); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFilesToCreate = _rnd.Next(18) + 14; + string[] filesToZip = new string[numFilesToCreate]; + for (i = 0; i < numFilesToCreate; i++) + { + filesToZip[i] = Path.Combine(subdir, String.Format(formats[k], i)); + TestUtilities.CreateAndFillFileBinary(filesToZip[i], _rnd.Next(5000) + 2000); + } + + // create a zipfile twice, once using Unicode, once without + for (int j = 0; j < 2; j++) + { + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Create_UnicodeEntries_{0}_{1}.zip", k, j)); + Assert.IsFalse(File.Exists(zipFileToCreate), "The zip file '{0}' already exists.", zipFileToCreate); + + TestContext.WriteLine("\n\nFormat {0}, trial {1}. filename: {2}...", k, j, zipFileToCreate); + string dirInArchive = String.Format("{0}-{1}", Path.GetFileName(subdir), j); + + using (ZipFile zip1 = new ZipFile()) + { +#pragma warning disable 618 + zip1.UseUnicodeAsNecessary = (j == 0); +#pragma warning restore 618 + for (i = 0; i < filesToZip.Length; i++) + { + // use the local filename (not fully qualified) + ZipEntry e = zip1.AddFile(filesToZip[i], dirInArchive); + e.Comment = String.Format("This entry encoded with {0}", (j == 0) ? "unicode" : "the default code page."); + } + zip1.Comment = origComment; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Length, + "Incorrect number of entries in the zip file."); + + i = 0; + + // verify the filenames are (or are not) unicode + + var options = new ReadOptions { + Encoding = (j == 0) ? System.Text.Encoding.UTF8 : ZipFile.DefaultEncoding + }; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate, options)) + { + foreach (ZipEntry e in zip2) + { + string fname = String.Format(formats[k], i); + if (j == 0) + { + Assert.AreEqual(fname, Path.GetFileName(e.FileName)); + } + else + { + Assert.AreNotEqual(fname, Path.GetFileName(e.FileName)); + } + i++; + } + + + // according to the spec, + // unicode is not supported on the zip archive comment! + // But this library won't enforce that. + // We will leave it up to the application. + // Assert.AreNotEqual(origComment, zip2.Comment); + + } + } + } + } + + string[] miscNameFormats = { + "file{0:D3}.bin", // keep this at index==0 + "弹出应用程序{0:D3}.bin", // Chinese + "codeplexの更新RSSを見てふと書いた投稿だったけど日本語情報がないかは調{0:D3}.bin", // Japanese + "n.æøåÆØÅ{0:D3}.bin", // greek + "Configurações-弹出-ÆØÅ-xx{0:D3}.bin", // portugese + Chinese + "¡¢£ ¥â° €Ãƒ †œ Ñ añoAbba{0:D3.bin}", //?? + "А Б В Г Д Є Ж Ѕ З И І К Л М Н О П Р С Т Ф Х Ц Ч Ш Щ Ъ ЪІ Ь Ю ІА {0:D3}.b", // Russian + "Ελληνικό αλφάβητο {0:D3}.b", + "א ב ג ד ה ו ז ח ט י " + "{0:D3}", // I don't know what language this is + }; + + + private List _CreateUnicodeFiles() + { + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "files"); + Directory.CreateDirectory(subdir); + var filesToZip = new List(); + // create a bunch of files in that subdir + int numFilesToCreate = _rnd.Next(18) + 14; + for (int i = 0; i < numFilesToCreate; i++) + { + int k = i % miscNameFormats.Length; + var f = Path.Combine(subdir, String.Format(miscNameFormats[k], i)); + filesToZip.Add(f); + TestUtilities.CreateAndFillFileBinary(f, _rnd.Next(5000) + 2000); + } + + return filesToZip; + } + + + [TestMethod] + public void Create_UnicodeEntries_Mixed() + { + var filesToZip = _CreateUnicodeFiles(); + + // Using those files create a zipfile 4 times: + // cycle 0 - UseUnicodeAsNecessary + // cycle 1 - Nothing + // cycle 2 - AlternateEncoding = UTF8, AlternateEncodingUsage = Always + // cycle 3 - AlternateEncoding = UTF8, AlternateEncodingUsage = AsNecessary + for (int j = 0; j < 4; j++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Archive-{0}.zip", j)); + Assert.IsFalse(File.Exists(zipFileToCreate), "The file already exists ({0}).", zipFileToCreate); + + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + switch (j) + { +#pragma warning disable 618 + case 0: + zip1.UseUnicodeAsNecessary = (j == 0); + break; +#pragma warning restore 618 + case 1: + // do nothing + break; + case 2: + zip1.AlternateEncoding = System.Text.Encoding.UTF8; + zip1.AlternateEncodingUsage = ZipOption.Always; + break; + case 3: + zip1.AlternateEncoding = System.Text.Encoding.UTF8; + zip1.AlternateEncodingUsage = ZipOption.AsNecessary; + break; + } + foreach (var fileToZip in filesToZip) + { + zip1.AddFile(fileToZip, ""); + } + zip1.Save(); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Count, + "Incorrect number of entries in the zip file."); + + _CheckUnicodeZip(zipFileToCreate, j); + } + } + + + + + [TestMethod] + public void Unicode_Create_ZOS_wi12634() + { + TestContext.WriteLine("==Unicode_Create_ZOS_wi12634()="); + var filesToZip = _CreateUnicodeFiles(); + byte[] buffer = new byte[2048]; + int n; + + // using those files create a zipfile twice. First cycle uses Unicode, + // 2nd cycle does not. + for (int j = 0; j < 2; j++) + { + // select the name of the zip file + var bpath = String.Format("wi12634-{0}.zip", j); + string zipFileToCreate = Path.Combine(TopLevelDir, bpath); + TestContext.WriteLine("========"); + TestContext.WriteLine("Trial {0}", j); + + Assert.IsFalse(File.Exists(zipFileToCreate), + "The zip file '{0}' already exists.", + zipFileToCreate); + TestContext.WriteLine("file {0}", zipFileToCreate); + + int excCount = 0; + + // create using ZOS + using (var ofs = File.Open(zipFileToCreate, FileMode.Create, FileAccess.ReadWrite)) + { + using (var zos = new ZipOutputStream(ofs)) + { +#pragma warning disable 618 + if (j == 0) + zos.ProvisionalAlternateEncoding = System.Text.Encoding.UTF8; +#pragma warning restore 618 + + try + { + foreach (var fileToZip in filesToZip) + { + var ename = Path.GetFileName(fileToZip); + TestContext.WriteLine("adding entry '{0}'", ename); + zos.PutNextEntry(ename); // with no path + using (var ifs = File.OpenRead(fileToZip)) + { + while ((n = ifs.Read(buffer, 0, buffer.Length)) > 0) + { + zos.Write(buffer, 0, n); + } + } + } + } + catch (System.Exception exc1) + { + TestContext.WriteLine("Exception #{0}", excCount); + TestContext.WriteLine("{0}", exc1.ToString()); + excCount++; + } + } + } + + Assert.IsTrue(excCount==0, + "Exceptions occurred during zip creation."); + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), filesToZip.Count, + "Incorrect number of entries in the zip file."); + + _CheckUnicodeZip(zipFileToCreate, j); + TestContext.WriteLine("Trial {0} file checks ok", j); + } + } + + + + [TestMethod] + public void UnicodeComment_wi10392() + { + const string zipFileToCreate = "UnicodeComment_wi10392.zip"; + const string cyrillicComment = "Hello, Привет"; + + TestContext.WriteLine("{0}", zipFileToCreate); + TestContext.WriteLine("==== creating zip"); + using (ZipFile zip1 = new ZipFile(zipFileToCreate, Encoding.UTF8)) + { + zip1.Comment = cyrillicComment; + zip1.AddEntry("entry", "this is the content of the added entry"); + zip1.Save(); + } + + string comment2 = null; + TestContext.WriteLine("==== checking zip"); + var options = new ReadOptions { + Encoding = Encoding.UTF8 + }; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate, options)) + { + comment2 = zip2.Comment; + } + + Assert.AreEqual(cyrillicComment, comment2, + "The comments are not equal."); + } + + + [TestMethod] + public void UnicodeUpdate_wi12744() + { + const string specialEntryName = "Привет.txt"; + + // two passes: one that uses the old "useUnicodeAsNecessary" property, + // and the second that uses the newer property. + for (int k=0; k < 2; k++) + { + + string zipFileToCreate = String.Format("UnicodeUpdate_wi12744-{0}.zip", k); + + TestContext.WriteLine("{0}", zipFileToCreate); + TestContext.WriteLine("==== creating zip, trial {0}", k); + using (ZipFile zip1 = new ZipFile()) + { + if (k==0) + { +#pragma warning disable 618 + zip1.UseUnicodeAsNecessary = true; +#pragma warning restore 618 + } + else + { + zip1.AlternateEncoding = System.Text.Encoding.UTF8; + zip1.AlternateEncodingUsage = ZipOption.AsNecessary; + } + + zip1.AddEntry(specialEntryName, "this is the content of the added entry"); + zip1.Save(zipFileToCreate); + } + + + TestContext.WriteLine("==== create a directory with 2 addl files in it"); + string subdir = Path.Combine(TopLevelDir, "files"+k); + Directory.CreateDirectory(subdir); + for (int i=0; i < 2; i++) + { + var filename = Path.Combine(subdir, "file" + i + ".txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(5000) + 2000); + } + + TestContext.WriteLine("==== update the zip"); + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.AddDirectory(subdir); + zip2.Save(); + } + + TestContext.WriteLine("==== check the original file in the zip"); + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + var e = zip3[specialEntryName]; + Assert.IsTrue(e!=null, "Entry not found"); + Assert.IsTrue(e.FileName == specialEntryName, "name mismatch"); + } + } + } + + + + + private void _CheckUnicodeZip(string filename, int j) + { + int i = 0; + + // Verify that the filenames do, or do not, match the + // names that were added. They will match if unicode + // was used (j!=1) or if the filename used was the first + // in the formats list (k==0). + using (ZipFile zip2 = ZipFile.Read(filename)) + { + foreach (ZipEntry e in zip2) + { + int k = i % miscNameFormats.Length; + string fname = String.Format(miscNameFormats[k], i); + if (j != 1 || k == 0) + { + Assert.AreEqual(fname, e.FileName, "cycle ({0},{1},{2})", i, j, k); + } + else + { + Assert.AreNotEqual(fname, e.FileName, "cycle ({0},{1},{2})", i, j, k); + } + i++; + } + } + } + + + struct CodepageTrial + { + public string codepage; + public string filenameFormat; + public bool exceptionExpected; // not all codepages will yield legal filenames for a given filenameFormat + public CodepageTrial(string cp, string format, bool except) + { + codepage = cp; + filenameFormat = format; + exceptionExpected = except; + } + } + + [TestMethod] + public void Create_WithSpecifiedCodepage() + { + int i; + CodepageTrial[] trials = { + new CodepageTrial( "big5", "弹出应用程序{0:D3}.bin", true), + new CodepageTrial ("big5", "您好{0:D3}.bin", false), + new CodepageTrial ("gb2312", "弹出应用程序{0:D3}.bin", false), + new CodepageTrial ("gb2312", "您好{0:D3}.bin", false), + // insert other trials here.?? + }; + + for (int k = 0; k < trials.Length; k++) + { + TestContext.WriteLine(""); + TestContext.WriteLine("---------------------Trial {0}....", k); + TestContext.WriteLine("---------------------codepage: {0}....", trials[k].codepage); + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, String.Format("trial{0}-files", k)); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFiles = _rnd.Next(3) + 3; + string[] filesToZip = new string[numFiles]; + for (i = 0; i < numFiles; i++) + { + filesToZip[i] = Path.Combine(subdir, String.Format(trials[k].filenameFormat, i)); + TestUtilities.CreateAndFillFileBinary(filesToZip[i], _rnd.Next(5000) + 2000); + } + + Directory.SetCurrentDirectory(subdir); + + // three cases: one for old-style + // ProvisionalAlternateEncoding, one for "AsNecessary" + // and one for "Always" + for (int j=0; j < 3; j++) + { + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("WithSpecifiedCodepage_{0}_{1}_{2}.zip", + k, j, trials[k].codepage)); + + TestContext.WriteLine(""); + TestContext.WriteLine("---------------Creating zip, trial ({0},{1})....", k, j); + + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + switch (j) + { + case 0: +#pragma warning disable 618 + zip1.ProvisionalAlternateEncoding = System.Text.Encoding.GetEncoding(trials[k].codepage); +#pragma warning restore 618 + break; + case 1: + zip1.AlternateEncoding = System.Text.Encoding.GetEncoding(trials[k].codepage); + zip1.AlternateEncodingUsage = ZipOption.AsNecessary; + break; + case 2: + zip1.AlternateEncoding = System.Text.Encoding.GetEncoding(trials[k].codepage); + zip1.AlternateEncodingUsage = ZipOption.Always; + break; + } + + for (i = 0; i < filesToZip.Length; i++) + { + TestContext.WriteLine("adding entry {0}", filesToZip[i]); + // use the local filename (not fully qualified) + ZipEntry e = zip1.AddFile(filesToZip[i], ""); + e.Comment = String.Format("This entry was encoded in the {0} codepage", trials[k].codepage); + } + zip1.Save(); + } + + TestContext.WriteLine("\n---------------------Extracting...."); + Directory.SetCurrentDirectory(TopLevelDir); + + try + { + // verify the filenames are (or are not) unicode + var options = new ReadOptions { + Encoding = System.Text.Encoding.GetEncoding(trials[k].codepage) + }; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate, options)) + { + foreach (ZipEntry e in zip2) + { + TestContext.WriteLine("found entry {0}", e.FileName); + e.Extract(String.Format("trial{0}-{1}-{2}-extract", k, j, trials[k].codepage)); + } + } + } + catch (Exception e1) + { + if (trials[k].exceptionExpected) + TestContext.WriteLine("caught expected exception"); + else + throw new System.Exception("while extracting", e1); + + } + } + + } + TestContext.WriteLine("\n---------------------Done."); + } + + + + [TestMethod] + public void CodePage_UpdateZip_AlternateEncoding_wi10180() + { + System.Text.Encoding JIS = System.Text.Encoding.GetEncoding("shift_jis"); + TestContext.WriteLine("The CP for JIS is: {0}", JIS.CodePage); + ReadOptions options = new ReadOptions { Encoding = JIS }; + string[] filenames = { + "日本語.txt", + "日本語テスト.txt" + }; + + // three trials: one for old-style + // ProvisionalAlternateEncoding, one for "AsNecessary" + // and one for "Always" + for (int j=0; j < 3; j++) + { + string zipFileToCreate = String.Format("wi10180-{0}.zip", j); + + // pass 1 - create it + TestContext.WriteLine("Create zip, cycle {0}...", j); + using (var zip = new ZipFile()) + { + switch (j) + { + case 0: +#pragma warning disable 618 + zip.ProvisionalAlternateEncoding = JIS; +#pragma warning restore 618 + break; + case 1: + zip.AlternateEncoding = JIS; + zip.AlternateEncodingUsage = ZipOption.AsNecessary; + break; + case 2: + zip.AlternateEncoding = JIS; + zip.AlternateEncodingUsage = ZipOption.Always; + break; + } + zip.AddEntry(filenames[0], "This is the content for entry (" + filenames[0] + ")"); + TestContext.WriteLine("adding file: {0}", filenames[0]); + zip.Save(zipFileToCreate); + } + + // pass 2 - read and update it + TestContext.WriteLine("Update zip..."); + using (var zip0 = ZipFile.Read(zipFileToCreate, options)) + { + foreach (var e in zip0) + { + TestContext.WriteLine("existing entry name: {0} encoding: {1}", + e.FileName, e.AlternateEncoding.EncodingName ); + Assert.AreEqual + (options.Encoding, e.AlternateEncoding); + } + zip0.AddEntry(filenames[1], "This is more content..." + System.DateTime.UtcNow.ToString("G")); + TestContext.WriteLine("adding file: {0}", filenames[1]); + zip0.Save(); + } + + // pass 3 - verify the filenames, again + TestContext.WriteLine("Verify zip..."); + using (var zip0 = ZipFile.Read(zipFileToCreate, options)) + { + foreach (string f in filenames) + { + Assert.AreEqual(f, zip0[f].FileName, + "The FileName was not expected, (cycle {0}) ", j); + } + } + } + } + + + + [TestMethod] + public void Unicode_AddDirectoryByName_wi8984() + { + string format = "弹出应用程序{0:D3}.dir"; // Chinese characters + System.Text.Encoding UTF8 = System.Text.Encoding.GetEncoding("UTF-8"); + + TestContext.WriteLine("== WorkItem 8984"); + // three trials: one for old-style + // ProvisionalAlternateEncoding, one for "AsNecessary" + // and one for "Always" + for (int j=0; j < 3; j++) + { + TestContext.WriteLine("Trial {0}", j); + for (int n = 1; n <= 10; n++) + { + TestContext.WriteLine("nEntries {0}", n); + var dirsAdded = new System.Collections.Generic.List(); + var zipFileToCreate = String.Format("wi8984-{0}-{1:N2}.zip", j, n); + using (ZipFile zip1 = new ZipFile(zipFileToCreate)) + { + switch (j) + { + case 0: +#pragma warning disable 618 + zip1.UseUnicodeAsNecessary = true; +#pragma warning restore 618 + break; + case 1: + zip1.AlternateEncoding = UTF8; + zip1.AlternateEncodingUsage = ZipOption.AsNecessary; + break; + case 2: + zip1.AlternateEncoding = UTF8; + zip1.AlternateEncodingUsage = ZipOption.Always; + break; + } + for (int i = 0; i < n; i++) + { + // create an arbitrary directory name, add it to the zip archive + string dirName = String.Format(format, i); + zip1.AddDirectoryByName(dirName); + dirsAdded.Add(dirName + "/"); + } + zip1.Save(); + } + + + string extractDir = String.Format("extract-{0}-{1:D3}", j, n); + int dirCount = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (var e in zip2) + { + TestContext.WriteLine("dir: {0}", e.FileName); + Assert.IsTrue(dirsAdded.Contains(e.FileName), "Cannot find the expected entry ({0})", e.FileName); + Assert.IsTrue(e.IsDirectory); + e.Extract(extractDir); + dirCount++; + } + } + Assert.AreEqual(n, dirCount); + TestContext.WriteLine(""); + } + TestContext.WriteLine(""); + } + } + + + + + } +} diff --git a/dotNetZip/Zip Tests/UpdateTests.cs b/dotNetZip/Zip Tests/UpdateTests.cs new file mode 100644 index 0000000..efa8b2a --- /dev/null +++ b/dotNetZip/Zip Tests/UpdateTests.cs @@ -0,0 +1,2176 @@ +// UpdateTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-05 16:52:59> +// +// ------------------------------------------------------------------ +// +// This module defines tests for updating zip files via DotNetZip. +// +// ------------------------------------------------------------------ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; + +namespace Ionic.Zip.Tests.Update +{ + /// + /// Summary description for UnitTest1 + /// + [TestClass] + public class UpdateTests : IonicTestClass + { + public UpdateTests() : base() { } + + [TestMethod] + public void UpdateZip_AddNewDirectory() + { + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_AddNewDirectory.zip"); + + String CommentOnArchive = "BasicTests::UpdateZip_AddNewDirectory(): This archive will be overwritten."; + + string newComment = "This comment has been OVERWRITTEN." + DateTime.Now.ToString("G"); + string dirToZip = Path.Combine(TopLevelDir, "zipup"); + + int i, j; + int entries = 0; + string subdir = null; + String filename = null; + int subdirCount = _rnd.Next(4) + 4; + for (i = 0; i < subdirCount; i++) + { + subdir = Path.Combine(dirToZip, "Directory." + i); + Directory.CreateDirectory(subdir); + + int fileCount = _rnd.Next(3) + 3; + for (j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, "file" + j + ".txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(12000) + 5000); + entries++; + } + } + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(dirToZip); + zip.Comment = CommentOnArchive; + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, + "The created Zip file has an unexpected number of entries."); + + BasicVerifyZip(zipFileToCreate); + + // Now create a new subdirectory and add that one + subdir = Path.Combine(TopLevelDir, "NewSubDirectory"); + Directory.CreateDirectory(subdir); + + filename = Path.Combine(subdir, "newfile.txt"); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(12000) + 5000); + entries++; + + using (ZipFile zip = new ZipFile(zipFileToCreate)) + { + zip.AddDirectory(subdir); + zip.Comment = newComment; + // this will add entries into the existing zip file + zip.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, + "The overwritten Zip file has the wrong number of entries."); + + using (ZipFile readzip = new ZipFile(zipFileToCreate)) + { + Assert.AreEqual(newComment, + readzip.Comment, + "The zip comment is incorrect."); + } + } + + + + [TestMethod] + public void UpdateZip_ChangeMetadata_AES() + { + Directory.SetCurrentDirectory(TopLevelDir); + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_ChangeMetadata_AES.zip"); + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(13) + 24; + //int numFilesToCreate = 2; + string filename = null; + for (int j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + //TestUtilities.CreateAndFillFileText(filename, 500); + } + + string password = Path.GetRandomFileName() + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + using (var zip = new ZipFile()) + { + zip.Password = password; + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + zip.AddFiles(Directory.GetFiles(subdir), ""); + zip.Save(zipFileToCreate); + } + + // Verify the correct number of files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), numFilesToCreate, + "Fie! The updated Zip file has the wrong number of entries."); + + // test extract (and implicitly check CRCs, passwords, etc) + VerifyZip(zipFileToCreate, password); + + byte[] buffer = new byte[_rnd.Next(10000) + 10000]; + _rnd.NextBytes(buffer); + using (var zip = ZipFile.Read(zipFileToCreate)) + { + // modify the metadata for an entry + zip[0].LastModified = DateTime.Now - new TimeSpan(7 * 31, 0, 0); + zip.Password = password; + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + zip.AddEntry(Path.GetRandomFileName(), buffer); + zip.Save(); + } + + // Verify the correct number of files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), numFilesToCreate + 1, + "Fie! The updated Zip file has the wrong number of entries."); + + // test extract (and implicitly check CRCs, passwords, etc) + VerifyZip(zipFileToCreate, password); + } + + + + private void VerifyZip(string zipfile, string password) + { + Stream bitBucket = Stream.Null; + TestContext.WriteLine("Checking file {0}", zipfile); + using (ZipFile zip = ZipFile.Read(zipfile)) + { + zip.Password = password; + zip.BufferSize = 65536; + foreach (var s in zip.EntryFileNames) + { + TestContext.WriteLine(" Entry: {0}", s); + zip[s].Extract(bitBucket); + } + } + System.Threading.Thread.Sleep(0x500); + } + + + + [TestMethod] + public void UpdateZip_RemoveEntry_ByLastModTime() + { + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_RemoveEntry_ByLastModTime.zip"); + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(13) + 24; + string filename = null; + int entriesAdded = 0; + for (int j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + int ix = 0; + System.DateTime origDate = new System.DateTime(2007, 1, 15, 12, 1, 0); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + { + ZipEntry e = zip1.AddFile(f, ""); + e.LastModified = origDate + new TimeSpan(24 * 31 * ix, 0, 0); // 31 days * number of entries + ix++; + } + zip1.Comment = "UpdateTests::UpdateZip_RemoveEntry_ByLastModTime(): This archive will soon be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + + // selectively remove a few files in the zip archive + var threshold = new TimeSpan(24 * 31 * (2 + _rnd.Next(ix - 12)), 0, 0); + int numRemoved = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + // We cannot remove the entry from the list, within the context of + // an enumeration of said list. + // So we add the doomed entry to a list to be removed + // later. + // pass 1: mark the entries for removal + var entriesToRemove = new List(); + foreach (ZipEntry e in zip2) + { + if (e.LastModified < origDate + threshold) + { + entriesToRemove.Add(e); + numRemoved++; + } + } + + // pass 2: actually remove the entry. + foreach (ZipEntry zombie in entriesToRemove) + zip2.RemoveEntry(zombie); + + zip2.Comment = "UpdateTests::UpdateZip_RemoveEntry_ByLastModTime(): This archive has been updated."; + zip2.Save(); + } + + // Verify the correct number of files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded - numRemoved, + "Fie! The updated Zip file has the wrong number of entries."); + + // verify that all entries in the archive are within the threshold + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip3) + Assert.IsTrue((e.LastModified >= origDate + threshold), + "Merde. The updated Zip file has entries that lie outside the threshold."); + } + + } + + + [TestMethod] + public void UpdateZip_RemoveEntry_ByFilename_WithPassword() + { + string password = "*!ookahoo"; + string filename = null; + int entriesToBeAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = "ByFilename_WithPassword.zip"; + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files, fill them with content + int numFilesToCreate = _rnd.Next(13) + 24; + for (j = 0; j < numFilesToCreate; j++) + { + filename = String.Format("file{0:D3}.txt", j); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + filename); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + entriesToBeAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + zip1.Password = password; + zip1.AddFiles(filenames, ""); + + zip1.Comment = "UpdateTests::UpdateZip_RemoveEntry_ByFilename_WithPassword(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesToBeAdded, + "The Zip file has the wrong number of entries."); + + + // selectively remove a few files in the zip archive + var filesToRemove = new List(); + int numToRemove = _rnd.Next(numFilesToCreate - 4) + 1; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + for (j = 0; j < numToRemove; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(numFilesToCreate)); + } while (filesToRemove.Contains(filename)); + // add this file to the list + filesToRemove.Add(filename); + zip2.RemoveEntry(filename); + } + + zip2.Comment = "This archive has been modified. Some files have been removed."; + zip2.Save(); + } + + + // extract all files, verify none should have been removed, + // and verify the contents of those that remain + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip3.EntryFileNames) + { + Assert.IsFalse(filesToRemove.Contains(s1), String.Format("File ({0}) was not expected.", s1)); + + zip3[s1].ExtractWithPassword("extract", password); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + + } + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesToBeAdded - filesToRemove.Count, + "The updated Zip file has the wrong number of entries."); + } + + + + [TestMethod] + public void UpdateZip_RenameEntry() + { + string dirToZip = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + var files = TestUtilities.GenerateFilesFlat(dirToZip, + _rnd.Next(13) + 24, + 42 * 1024 + _rnd.Next(20000)); + + // Two passes: in pass 1, simply rename the file; + // in pass 2, rename it so that it has a directory. + // This shouldn't matter, but we test it anyway. + for (int k = 0; k < 2; k++) + { + string zipFileToCreate = String.Format("UpdateZip_RenameEntry-{0}.zip", k); + TestContext.WriteLine("-----------------------------"); + TestContext.WriteLine("{0}: Trial {1}, adding {2} files into '{3}'...", + DateTime.Now.ToString("HH:mm:ss"), + k, + files.Length, + zipFileToCreate); + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + foreach (String f in files) + zip1.AddFile(f, ""); + zip1.Comment = "This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + files.Length, + "the Zip file has the wrong number of entries."); + + // selectively rename a few files in the zip archive + int renameCount = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + var toRename = new List(); + while (toRename.Count < 2) + { + foreach (ZipEntry e in zip2) + { + if (_rnd.Next(2) == 1) + toRename.Add(e); + } + } + + foreach (ZipEntry e in toRename) + { + var newname = (k == 0) + ? e.FileName + "-renamed" + : "renamed_files\\" + e.FileName; + + TestContext.WriteLine(" renaming {0} to {1}", e.FileName, newname); + e.FileName = newname; + e.Comment = "renamed"; + renameCount++; + } + + zip2.Comment = String.Format("This archive has been modified. {0} files have been renamed.", renameCount); + zip2.Save(); + } + + + // Extract all the files, verify that none have been removed, + // and verify the names of the entries. + int renameCount2 = 0; + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip3.EntryFileNames) + { + string dir = String.Format("extract{0}", k); + zip3[s1].Extract(dir); + string origFilename = Path.GetFileName((s1.Contains("renamed")) + ? s1.Replace("-renamed", "") + : s1); + + if (zip3[s1].Comment == "renamed") renameCount2++; + } + } + + Assert.AreEqual(renameCount, renameCount2, + "The updated Zip file has the wrong number of renamed entries."); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + files.Length, + "Wrong number of entries."); + } + } + + + [TestMethod] + public void UpdateZip_UpdateEntryComment() + { + for (int k = 0; k < 2; k++) + { + int j; + int entriesToBeAdded = 0; + string filename = null; + string repeatedLine = null; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("UpdateZip_UpdateEntryComment-{0}.zip", k)); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, String.Format("A{0}", k)); + Directory.CreateDirectory(subdir); + + // create a bunch of files + //int numFilesToCreate = _rnd.Next(15) + 18; + int numFilesToCreate = _rnd.Next(5) + 3; + + TestContext.WriteLine("\n-----------------------------\r\n{0}: Trial {1}, adding {2} files into '{3}'...", + DateTime.Now.ToString("HH:mm:ss"), + k, + numFilesToCreate, + zipFileToCreate); + + for (j = 0; j < numFilesToCreate; j++) + { + filename = String.Format("file{0:D3}.txt", j); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + filename); + + int filesize = _rnd.Next(34000) + 800; + + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), + repeatedLine, + filesize); + entriesToBeAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles(String.Format("A{0}", k)); + foreach (String f in filenames) + zip1.AddFile(f, ""); + + zip1.Comment = "UpdateTests::UpdateZip_UpdateEntryComment(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesToBeAdded, + "the Zip file has the wrong number of entries."); + + // update the comments for a few files in the zip archive + int updateCount = 0; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + do + { + foreach (ZipEntry e in zip2) + { + if (_rnd.Next(2) == 1) + { + if (String.IsNullOrEmpty(e.Comment)) + { + e.Comment = "This is a new comment on entry " + e.FileName; + updateCount++; + } + } + } + } while (updateCount < 2); + zip2.Comment = String.Format("This archive has been modified. Comments on {0} entries have been inserted.", updateCount); + zip2.Save(); + } + + + // Extract all files, verify that none have been removed, + // and verify the contents of those that remain. + int commentCount = 0; + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip3.EntryFileNames) + { + string dir = String.Format("extract{0}", k); + zip3[s1].Extract(dir); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine(dir, s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + + if (!String.IsNullOrEmpty(zip3[s1].Comment)) + { + commentCount++; + } + } + } + + Assert.AreEqual(updateCount, commentCount, + "The updated Zip file has the wrong number of entries with comments."); + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesToBeAdded, + "The updated Zip file has the wrong number of entries."); + } + } + + + + + [TestMethod] + public void UpdateZip_RemoveEntry_ByFilename() + { + for (int k = 0; k < 2; k++) + { + int j; + int entriesToBeAdded = 0; + string filename = null; + string repeatedLine = null; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("UpdateZip_RemoveEntry_ByFilename-{0}.zip", k)); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, String.Format("A{0}", k)); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFilesToCreate = _rnd.Next(13) + 24; + + for (j = 0; j < numFilesToCreate; j++) + { + filename = String.Format("file{0:D3}.txt", j); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + filename); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + entriesToBeAdded++; + } + + // Add the files to the zip, save the zip. + // in pass 2, remove one file, then save again. + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles(String.Format("A{0}", k)); + + foreach (String f in filenames) + zip1.AddFile(f, ""); + + zip1.Comment = "UpdateTests::UpdateZip_RemoveEntry_ByFilename(): This archive will be updated."; + zip1.Save(zipFileToCreate); + + // conditionally remove a single entry, on the 2nd trial + if (k == 1) + { + int chosen = _rnd.Next(filenames.Length); + zip1.RemoveEntry(zip1[chosen]); + zip1.Save(); + } + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesToBeAdded - k, + "Trial {0}: the Zip file has the wrong number of entries.", k); + + if (k == 0) + { + // selectively remove a few files in the zip archive + var filesToRemove = new List(); + int numToRemove = _rnd.Next(numFilesToCreate - 4) + 1; + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + for (j = 0; j < numToRemove; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(numFilesToCreate)); + } while (filesToRemove.Contains(filename)); + // add this file to the list + filesToRemove.Add(filename); + zip2.RemoveEntry(filename); + + } + + zip2.Comment = "This archive has been modified. Some files have been removed."; + zip2.Save(); + } + + + // extract all files, verify none should have been removed, + // and verify the contents of those that remain + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip3.EntryFileNames) + { + Assert.IsFalse(filesToRemove.Contains(s1), + String.Format("File ({0}) was not expected.", s1)); + + zip3[s1].Extract("extract"); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + + } + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + entriesToBeAdded - filesToRemove.Count, + "The updated Zip file has the wrong number of entries."); + } + } + } + + + + + [TestMethod] + public void UpdateZip_RemoveEntry_ViaIndexer_WithPassword() + { + string password = TestUtilities.GenerateRandomPassword(); + string filename = null; + int entriesToBeAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_RemoveEntry_ViaIndexer_WithPassword.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(13) + 14; + for (j = 0; j < numFilesToCreate; j++) + { + filename = String.Format("file{0:D3}.txt", j); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + filename); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + entriesToBeAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + zip.Password = password; + foreach (String f in filenames) + zip.AddFile(f, ""); + + zip.Comment = "UpdateTests::UpdateZip_OpenForUpdate_Password_RemoveViaIndexer(): This archive will be updated."; + zip.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(entriesToBeAdded, TestUtilities.CountEntries(zipFileToCreate), + "The Zip file has the wrong number of entries."); + + // selectively remove a few files in the zip archive + var filesToRemove = new List(); + int numToRemove = _rnd.Next(numFilesToCreate - 4); + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + for (j = 0; j < numToRemove; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(numFilesToCreate)); + } while (filesToRemove.Contains(filename)); + // add this file to the list + filesToRemove.Add(filename); + + // remove the file from the zip archive + zip2.RemoveEntry(filename); + } + + zip2.Comment = "This archive has been modified. Some files have been removed."; + zip2.Save(); + } + + // extract all files, verify none should have been removed, + // and verify the contents of those that remain + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip3.EntryFileNames) + { + Assert.IsFalse(filesToRemove.Contains(s1), String.Format("File ({0}) was not expected.", s1)); + + zip3[s1].ExtractWithPassword("extract", password); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, + sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + + } + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + entriesToBeAdded - filesToRemove.Count, + "The updated Zip file has the wrong number of entries."); + } + + + + [TestMethod] + public void UpdateZip_RemoveAllEntries() + { + string password = "Wheeee!!" + TestUtilities.GenerateRandomLowerString(7); + string filename = null; + int entriesToBeAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_RemoveAllEntries.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(13) + 14; + for (j = 0; j < numFilesToCreate; j++) + { + filename = String.Format("file{0:D3}.txt", j); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + filename); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + entriesToBeAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + zip.Password = password; + foreach (String f in filenames) + zip.AddFile(f, ""); + + zip.Comment = "UpdateTests::UpdateZip_RemoveAllEntries(): This archive will be updated."; + zip.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(entriesToBeAdded, + TestUtilities.CountEntries(zipFileToCreate), + "The Zip file has the wrong number of entries."); + + // remove all the entries from the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.RemoveSelectedEntries("*.*"); + zip2.Comment = "This archive has been modified. All the entries have been removed."; + zip2.Save(); + } + + // Verify the files are in the zip + Assert.AreEqual(0, TestUtilities.CountEntries(zipFileToCreate), + "The Zip file has the wrong number of entries."); + + + } + + + [TestMethod] + public void UpdateZip_AddFile_OldEntriesWithPassword() + { + string password = "Secret!"; + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_AddFile_OldEntriesWithPassword.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int numFilesToCreate = _rnd.Next(10) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Create the zip file + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = password; + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_AddFile_OldEntriesWithPassword(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + + // Create a bunch of new files... + var addedFiles = new List(); + int numToUpdate = _rnd.Next(numFilesToCreate - 4); + for (j = 0; j < numToUpdate; j++) + { + // select a new, uniquely named file to create + filename = String.Format("newfile{0:D3}.txt", j); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + addedFiles.Add(filename); + } + + // add each one of those new files in the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in addedFiles) + zip2.AddFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_AddFile_OldEntriesWithPassword(): This archive has been updated."; + zip2.Save(); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + entriesAdded + addedFiles.Count, + "The Zip file has the wrong number of entries."); + + + // now extract the newly-added files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in addedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].Extract("extract"); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool addedLater = false; + foreach (string s2 in addedFiles) + { + if (s2 == s1) addedLater = true; + } + if (!addedLater) + { + zip4[s1].ExtractWithPassword("extract", password); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + + [TestMethod] + public void UpdateZip_UpdateItem() + { + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_UpdateItem.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFilesToCreate = _rnd.Next(10) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("Content for Original file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Create the zip file + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateItem(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // create another subdirectory + subdir = Path.Combine(TopLevelDir, "B"); + Directory.CreateDirectory(subdir); + + // create a bunch more files + int newFileCount = numFilesToCreate + _rnd.Next(3) + 3; + for (j = 0; j < newFileCount; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("Content for the updated file {0} {1}", + Path.GetFileName(filename), + System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(1000) + 2000); + entriesAdded++; + } + + // Update those files in the zip file + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("B"); + foreach (String f in filenames) + zip1.UpdateItem(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateItem(): This archive has been updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), newFileCount, + "The Zip file has the wrong number of entries."); + + // now extract the files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in zip3.EntryFileNames) + { + repeatedLine = String.Format("Content for the updated file {0} {1}", + s, + System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].Extract("extract"); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + } + + + [TestMethod] + public void UpdateZip_AddFile_NewEntriesWithPassword() + { + string password = "V.Secret!"; + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_AddFile_NewEntriesWithPassword.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFilesToCreate = _rnd.Next(10) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Create the zip archive + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + zip.AddFiles(filenames, ""); + zip.Comment = "UpdateTests::UpdateZip_AddFile_NewEntriesWithPassword(): This archive will be updated."; + zip.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // Create a bunch of new files... + var addedFiles = new List(); + int numToUpdate = _rnd.Next(numFilesToCreate - 4); + for (j = 0; j < numToUpdate; j++) + { + // select a new, uniquely named file to create + filename = String.Format("newfile{0:D3}.txt", j); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + addedFiles.Add(filename); + } + + // add each one of those new files in the zip archive using a password + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.Password = password; + foreach (string s in addedFiles) + zip2.AddFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_AddFile_OldEntriesWithPassword(): This archive has been updated."; + zip2.Save(); + } + + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded + addedFiles.Count, + "The Zip file has the wrong number of entries."); + + + // now extract the newly-added files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in addedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].ExtractWithPassword("extract", password); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool addedLater = false; + foreach (string s2 in addedFiles) + { + if (s2 == s1) addedLater = true; + } + if (!addedLater) + { + zip4[s1].Extract("extract"); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + [TestMethod] + public void UpdateZip_AddFile_DifferentPasswords() + { + string password1 = Path.GetRandomFileName(); + string password2 = "Secret2" + Path.GetRandomFileName(); + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_AddFile_DifferentPasswords.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int numFilesToCreate = _rnd.Next(11) + 8; + for (j = 0; j < numFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = password1; + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_AddFile_DifferentPasswords(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // Create a bunch of new files... + var addedFiles = new List(); + //int numToUpdate = _rnd.Next(numFilesToCreate - 4); + int numToUpdate = 1; + for (j = 0; j < numToUpdate; j++) + { + // select a new, uniquely named file to create + filename = String.Format("newfile{0:D3}.txt", j); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + addedFiles.Add(filename); + } + + // add each one of those new files in the zip archive using a password + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.Password = password2; + foreach (string s in addedFiles) + zip2.AddFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_AddFile_OldEntriesWithPassword(): This archive has been updated."; + zip2.Save(); + } + + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded + addedFiles.Count, + "The Zip file has the wrong number of entries."); + + + // now extract the newly-added files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in addedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].ExtractWithPassword("extract", password2); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool addedLater = false; + foreach (string s2 in addedFiles) + { + if (s2 == s1) addedLater = true; + } + if (!addedLater) + { + zip4[s1].ExtractWithPassword("extract", password1); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + + + [TestMethod] + public void UpdateZip_UpdateFile_NoPasswords() + { + string filename = null; + int entriesAdded = 0; + int j = 0; + string repeatedLine = null; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_UpdateFile_NoPasswords.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int NumFilesToCreate = _rnd.Next(23) + 14; + for (j = 0; j < NumFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // create the zip archive + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateFile_NoPasswords(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "Zoiks! The Zip file has the wrong number of entries."); + + + + // create another subdirectory + subdir = Path.Combine(TopLevelDir, "updates"); + Directory.CreateDirectory(subdir); + + // Create a bunch of new files, in that new subdirectory + var UpdatedFiles = new List(); + int NumToUpdate = _rnd.Next(NumFilesToCreate - 4); + for (j = 0; j < NumToUpdate; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(NumFilesToCreate)); + } while (UpdatedFiles.Contains(filename)); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + UpdatedFiles.Add(filename); + } + + // update those files in the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + zip2.UpdateFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_UpdateFile_OldEntriesWithPassword(): This archive has been updated."; + zip2.Save(); + } + + // extract those files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].Extract("extract"); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool NotUpdated = true; + foreach (string s2 in UpdatedFiles) + { + if (s2 == s1) NotUpdated = false; + } + if (NotUpdated) + { + zip4[s1].Extract("extract"); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + [TestMethod] + public void UpdateZip_UpdateFile_2_NoPasswords() + { + string filename = null; + int entriesAdded = 0; + int j = 0; + string repeatedLine = null; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_UpdateFile_NoPasswords.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int NumFilesToCreate = _rnd.Next(23) + 14; + for (j = 0; j < NumFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // create the zip archive + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.UpdateFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateFile_NoPasswords(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "Zoiks! The Zip file has the wrong number of entries."); + + + // create another subdirectory + subdir = Path.Combine(TopLevelDir, "updates"); + Directory.CreateDirectory(subdir); + + // Create a bunch of new files, in that new subdirectory + var UpdatedFiles = new List(); + int NumToUpdate = _rnd.Next(NumFilesToCreate - 4); + for (j = 0; j < NumToUpdate; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(NumFilesToCreate)); + } while (UpdatedFiles.Contains(filename)); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + UpdatedFiles.Add(filename); + } + + // update those files in the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + zip2.UpdateFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_UpdateFile_NoPasswords(): This archive has been updated."; + zip2.Save(); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "Zoiks! The Zip file has the wrong number of entries."); + + // update those files AGAIN in the zip archive + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + zip3.UpdateFile(Path.Combine(subdir, s), ""); + zip3.Comment = "UpdateTests::UpdateZip_UpdateFile_NoPasswords(): This archive has been re-updated."; + zip3.Save(); + } + + // extract the updated files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip4[s].Extract("extract"); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + // extract all the other files and verify their contents + using (ZipFile zip5 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip5.EntryFileNames) + { + bool NotUpdated = true; + foreach (string s2 in UpdatedFiles) + { + if (s2 == s1) NotUpdated = false; + } + if (NotUpdated) + { + zip5[s1].Extract("extract"); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + + [TestMethod] + public void UpdateZip_UpdateFile_OldEntriesWithPassword() + { + string Password = "1234567"; + string filename = null; + int entriesAdded = 0; + int j = 0; + string repeatedLine = null; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_UpdateFile_OldEntriesWithPassword.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int NumFilesToCreate = _rnd.Next(23) + 14; + for (j = 0; j < NumFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Create the zip archive + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = Password; + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateFile_OldEntriesWithPassword(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the number of files in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // create another subdirectory + subdir = Path.Combine(TopLevelDir, "updates"); + Directory.CreateDirectory(subdir); + + // Create a bunch of new files, in that new subdirectory + var UpdatedFiles = new List(); + int NumToUpdate = _rnd.Next(NumFilesToCreate - 4); + for (j = 0; j < NumToUpdate; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(NumFilesToCreate)); + } while (UpdatedFiles.Contains(filename)); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + UpdatedFiles.Add(filename); + } + + // update those files in the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + zip2.UpdateFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_UpdateFile_OldEntriesWithPassword(): This archive has been updated."; + zip2.Save(); + } + + // extract those files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].Extract("extract"); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool NotUpdated = true; + foreach (string s2 in UpdatedFiles) + { + if (s2 == s1) NotUpdated = false; + } + if (NotUpdated) + { + zip4[s1].ExtractWithPassword("extract", Password); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + [TestMethod] + public void UpdateZip_UpdateFile_NewEntriesWithPassword() + { + string Password = " P@ssw$rd"; + string filename = null; + int entriesAdded = 0; + string repeatedLine = null; + int j = 0; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_UpdateFile_NewEntriesWithPassword.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int NumFilesToCreate = _rnd.Next(23) + 9; + for (j = 0; j < NumFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // create the zip archive, add those files to it + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + // no password used here. + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateFile_NewEntriesWithPassword(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // create another subdirectory + subdir = Path.Combine(TopLevelDir, "updates"); + Directory.CreateDirectory(subdir); + + // Create a bunch of new files, in that new subdirectory + var UpdatedFiles = new List(); + int NumToUpdate = _rnd.Next(NumFilesToCreate - 5); + for (j = 0; j < NumToUpdate; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(NumFilesToCreate)); + } while (UpdatedFiles.Contains(filename)); + // create the new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + UpdatedFiles.Add(filename); + } + + // update those files in the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.Password = Password; + foreach (string s in UpdatedFiles) + zip2.UpdateFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_UpdateFile_NewEntriesWithPassword(): This archive has been updated."; + zip2.Save(); + } + + // extract those files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].ExtractWithPassword("extract", Password); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool NotUpdated = true; + foreach (string s2 in UpdatedFiles) + { + if (s2 == s1) NotUpdated = false; + } + if (NotUpdated) + { + zip4[s1].Extract("extract"); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + [TestMethod] + public void UpdateZip_UpdateFile_DifferentPasswords() + { + string Password1 = "Whoofy1"; + string Password2 = "Furbakl1"; + string filename = null; + int entriesAdded = 0; + int j = 0; + string repeatedLine; + + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_UpdateFile_DifferentPasswords.zip"); + + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create a bunch of files + int NumFilesToCreate = _rnd.Next(13) + 14; + for (j = 0; j < NumFilesToCreate; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + Path.GetFileName(filename)); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // create the zip archive + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Password = Password1; + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip1.AddFile(f, ""); + zip1.Comment = "UpdateTests::UpdateZip_UpdateFile_DifferentPasswords(): This archive will be updated."; + zip1.Save(zipFileToCreate); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entriesAdded, + "The Zip file has the wrong number of entries."); + + // create another subdirectory + subdir = Path.Combine(TopLevelDir, "updates"); + Directory.CreateDirectory(subdir); + + // Create a bunch of new files, in that new subdirectory + var UpdatedFiles = new List(); + int NumToUpdate = _rnd.Next(NumFilesToCreate - 4); + for (j = 0; j < NumToUpdate; j++) + { + // select a new, uniquely named file to create + do + { + filename = String.Format("file{0:D3}.txt", _rnd.Next(NumFilesToCreate)); + } while (UpdatedFiles.Contains(filename)); + // create a new file, and fill that new file with text data + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + filename, System.DateTime.Now.ToString("yyyy-MM-dd")); + TestUtilities.CreateAndFillFileText(Path.Combine(subdir, filename), repeatedLine, _rnd.Next(34000) + 5000); + UpdatedFiles.Add(filename); + } + + // update those files in the zip archive + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + zip2.Password = Password2; + foreach (string s in UpdatedFiles) + zip2.UpdateFile(Path.Combine(subdir, s), ""); + zip2.Comment = "UpdateTests::UpdateZip_UpdateFile_DifferentPasswords(): This archive has been updated."; + zip2.Save(); + } + + // extract those files and verify their contents + using (ZipFile zip3 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s in UpdatedFiles) + { + repeatedLine = String.Format("**UPDATED** This file ({0}) has been updated on {1}.", + s, System.DateTime.Now.ToString("yyyy-MM-dd")); + zip3[s].ExtractWithPassword("extract", Password2); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(sLine, repeatedLine, + String.Format("The content of the Updated file ({0}) in the zip archive is incorrect.", s)); + } + } + + // extract all the other files and verify their contents + using (ZipFile zip4 = ZipFile.Read(zipFileToCreate)) + { + foreach (string s1 in zip4.EntryFileNames) + { + bool wasUpdated = false; + foreach (string s2 in UpdatedFiles) + { + if (s2 == s1) wasUpdated = true; + } + if (!wasUpdated) + { + // use original password + zip4[s1].ExtractWithPassword("extract", Password1); + repeatedLine = String.Format("This line is repeated over and over and over in file {0}", + s1); + + // verify the content of the updated file. + var sr = new StreamReader(Path.Combine("extract", s1)); + string sLine = sr.ReadLine(); + sr.Close(); + + Assert.AreEqual(repeatedLine, sLine, + String.Format("The content of the originally added file ({0}) in the zip archive is incorrect.", s1)); + } + } + } + } + + + [TestMethod] + [ExpectedException(typeof(System.ArgumentException))] + public void UpdateZip_AddFile_ExistingFile_Error() + { + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "UpdateZip_AddFile_ExistingFile_Error.zip"); + // create the subdirectory + string subdir = Path.Combine(TopLevelDir, "A"); + Directory.CreateDirectory(subdir); + + // create the files + int fileCount = _rnd.Next(3) + 4; + string filename = null; + int entriesAdded = 0; + for (int j = 0; j < fileCount; j++) + { + filename = Path.Combine(subdir, String.Format("file{0:D3}.txt", j)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(34000) + 5000); + entriesAdded++; + } + + // Add the files to the zip, save the zip + Directory.SetCurrentDirectory(TopLevelDir); + using (ZipFile zip = new ZipFile()) + { + String[] filenames = Directory.GetFiles("A"); + foreach (String f in filenames) + zip.AddFile(f, ""); + zip.Comment = "UpdateTests::UpdateZip_AddFile_ExistingFile_Error(): This archive will be updated."; + zip.Save(zipFileToCreate); + } + + // create and file a new file with text data + int FileToUpdate = _rnd.Next(fileCount); + filename = String.Format("file{0:D3}.txt", FileToUpdate); + string repeatedLine = String.Format("**UPDATED** This file ({0}) was updated at {1}.", + filename, + System.DateTime.Now.ToString("G")); + TestUtilities.CreateAndFillFileText(filename, repeatedLine, _rnd.Next(21567) + 23872); + + // Try to again add that file in the zip archive. This + // should fail. + using (ZipFile z = ZipFile.Read(zipFileToCreate)) + { + // Try Adding a file again. THIS SHOULD THROW. + ZipEntry e = z.AddFile(filename, ""); + z.Comment = "UpdateTests::UpdateZip_AddFile_ExistingFile_Error(): This archive has been updated."; + z.Save(); + } + } + + + [TestMethod] + public void Update_MultipleSaves_wi10319() + { + string zipFileToCreate = "MultipleSaves_wi10319.zip"; + + using (ZipFile _zipFile = new ZipFile(zipFileToCreate)) + { + using (MemoryStream data = new MemoryStream()) + { + using (StreamWriter writer = new StreamWriter(data)) + { + writer.Write("Dit is een test string."); + writer.Flush(); + + data.Seek(0, SeekOrigin.Begin); + _zipFile.AddEntry("test.txt", data); + _zipFile.Save(); + _zipFile.AddEntry("test2.txt", "Esta es un string de test"); + _zipFile.Save(); + _zipFile.AddEntry("test3.txt", "this is some content for the entry."); + _zipFile.Save(); + } + } + } + + using (ZipFile _zipFile = new ZipFile(zipFileToCreate)) + { + using (MemoryStream data = new MemoryStream()) + { + using (StreamWriter writer = new StreamWriter(data)) + { + writer.Write("Dit is een andere test string."); + writer.Flush(); + + data.Seek(0, SeekOrigin.Begin); + + _zipFile.UpdateEntry("test.txt", data); + _zipFile.Save(); + _zipFile.UpdateEntry("test2.txt", "Esta es un otro string de test"); + _zipFile.Save(); + _zipFile.UpdateEntry("test3.txt", "This is another string for content."); + _zipFile.Save(); + + } + } + } + } + + + + + [TestMethod] + public void Update_MultipleSaves_wi10694() + { + string zipFileToCreate = "Update_MultipleSaves_wi10694.zip"; + var shortDir = "fodder"; + string subdir = Path.Combine(TopLevelDir, shortDir); + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir); + + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFiles(filesToZip, "Download"); + zip1.AddFiles(filesToZip, "other"); + zip1.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 2 * filesToZip.Length, + "Incorrect number of entries in the zip file."); + + using (var zip2 = ZipFile.Read(zipFileToCreate)) + { + var entries = zip2.Entries.Where(e => e.FileName.Contains("Download")).ToArray(); + //PART1 - Add directory and save + zip2.AddDirectoryByName("XX"); + zip2.Save(); + + //PART2 - Rename paths (not related to XX directory from above) and save + foreach (var zipEntry in entries) + { + zipEntry.FileName = zipEntry.FileName.Replace("Download", "Download2"); + } + zip2.Save(); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), 2 * filesToZip.Length, + "Incorrect number of entries in the zip file."); + } + + + + [TestMethod] + public void Update_MultipleSavesWithRename_wi10544() + { + // select the name of the zip file + string zipFileToCreate = Path.Combine(TopLevelDir, "Update_MultipleSaves_wi10319.zip"); + string entryName = "Entry1.txt"; + + TestContext.WriteLine("Creating zip file... "); + using (var zip = new ZipFile()) + { + string firstline = "This is the first line in the Entry.\n"; + byte[] a = System.Text.Encoding.ASCII.GetBytes(firstline.ToCharArray()); + + zip.AddEntry(entryName, a); + zip.Save(zipFileToCreate); + } + + int N = _rnd.Next(34) + 59; + for (int i = 0; i < N; i++) + { + string tempZipFile = "AppendToEntry.zip.tmp" + i; + + TestContext.WriteLine("Update cycle {0}... ", i); + using (var zip1 = ZipFile.Read(zipFileToCreate)) + { + using (var zip = new ZipFile()) + { + zip.AddEntry(entryName, (name, stream) => + { + var src = zip1[name].OpenReader(); + int n; + byte[] b = new byte[2048]; + while ((n = src.Read(b, 0, b.Length)) > 0) + stream.Write(b, 0, n); + + string update = String.Format("Updating zip file {0} at {1}\n", i, DateTime.Now.ToString("G")); + byte[] a = System.Text.Encoding.ASCII.GetBytes(update.ToCharArray()); + stream.Write(a, 0, a.Length); + }); + + zip.Save(tempZipFile); + } + } + + File.Delete(zipFileToCreate); + System.Threading.Thread.Sleep(1400); + File.Move(tempZipFile, zipFileToCreate); + } + + } + + + [TestMethod] + public void Update_FromRoot_wi11988() + { + string zipFileToCreate = "FromRoot.zip"; + string dirToZip = "Fodder"; + var files = TestUtilities.GenerateFilesFlat(dirToZip); + string windir = System.Environment.GetEnvironmentVariable("Windir"); + string substExe = Path.Combine(Path.Combine(windir, "system32"), "subst.exe"); + Assert.IsTrue(File.Exists(substExe), "subst.exe does not exist ({0})", + substExe); + + try + { + // create a subst drive + this.Exec(substExe, "G: " + dirToZip); + + using (var zip = new ZipFile()) + { + zip.UpdateSelectedFiles("*.*", "G:\\", "", true); + zip.Save(zipFileToCreate); + } + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + files.Length); + Assert.IsTrue(files.Length > 3); + BasicVerifyZip(zipFileToCreate); + } + finally + { + // remove the virt drive + this.Exec(substExe, "/D G:"); + } + } + + } +} + diff --git a/dotNetZip/Zip Tests/WinZipAesTests.cs b/dotNetZip/Zip Tests/WinZipAesTests.cs new file mode 100644 index 0000000..41793d1 --- /dev/null +++ b/dotNetZip/Zip Tests/WinZipAesTests.cs @@ -0,0 +1,963 @@ +// WinZipAesTests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-13 21:25:38> +// +// ------------------------------------------------------------------ +// +// This module defines the tests of the WinZIP AES Encryption capability +// of DotNetZip. +// +// ------------------------------------------------------------------ + +using System; +using System.IO; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; + +namespace Ionic.Zip.Tests.WinZipAes +{ + /// + /// Summary description for WinZipAesTests + /// + [TestClass] + public class WinZipAesTests : IonicTestClass + { + public WinZipAesTests() : base() { } + + + [TestMethod] + public void WZA_CreateZip() + { + WZA_CreateZip_Impl("WZA_CreateZip", 14400, 5000); + } + + [TestMethod] + public void WZA_CreateZip_VerySmallFiles() + { + WZA_CreateZip_Impl("WZA_CreateZip_VerySmallFiles", 14, 5); + } + + + + private void WZA_CreateZip_Impl(string name, int size1, int size2) + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_CreateZip_Impl]"); + + string filename = null; + int entries = _rnd.Next(11) + 8; + var checksums = new Dictionary(); + var filesToZip = new List(); + for (int i = 0; i < entries; i++) + { + int filesize = _rnd.Next(size1) + size2; + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + TestUtilities.CreateAndFillFileBinary(filename, filesize); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + TestUtilities.CreateAndFillFileText(filename, filesize); + } + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + filesToZip.Add(filename); + } + + + Ionic.Zip.EncryptionAlgorithm[] EncOptions = { + EncryptionAlgorithm.None, + EncryptionAlgorithm.WinZipAes256, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.PkzipWeak + }; + + for (int k = 0; k < EncOptions.Length; k++) + { + + for (int m = 0; m < 2; m++) + { + //string password = TestUtilities.GenerateRandomPassword(); + string password = Path.GetRandomFileName().Replace(".", "-"); + Directory.SetCurrentDirectory(TopLevelDir); + TestContext.WriteLine("\n\n==================Trial {0}.{1}..", k, m); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("{0}-{1}-{2}.zip", name, k, m)); + + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" Password: {0}", password); + TestContext.WriteLine(" Encryption: {0}", EncOptions[k].ToString()); + TestContext.WriteLine(" NonSeekable output: {0}", (m == 0) ? "No" : "Yes"); + TestContext.WriteLine(" #entries: {0}", entries); + + string comment = String.Format("This archive uses Encryption: {0}, password({1}), NonSeekable=({2})", + EncOptions[k], password, (m == 0) ? "No" : "Yes"); + + _DotNetZip_CreateZip(filesToZip, EncOptions[k], password, comment, zipFileToCreate, (m==1)); + + if (EncOptions[k] == EncryptionAlgorithm.None) + BasicVerifyZip(zipFileToCreate); + else + BasicVerifyZip(zipFileToCreate, password); + + + TestContext.WriteLine("---------------Reading {0}...", zipFileToCreate); + System.Threading.Thread.Sleep(1200); // seems to be a race condition? sometimes? + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + string extractDir = String.Format("extract-{0}.{1}", k, m); + foreach (var e in zip2) + { + TestContext.WriteLine(" Entry: {0} c({1}) unc({2})", e.FileName, e.CompressedSize, e.UncompressedSize); + Assert.AreEqual(EncOptions[k], e.Encryption); + e.ExtractWithPassword(extractDir, password); + filename = Path.Combine(extractDir, e.FileName); + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(filename)); + Assert.IsTrue(checksums.ContainsKey(e.FileName), "Checksum is missing"); + Assert.AreEqual(checksums[e.FileName], actualCheckString, "Checksums for ({0}) do not match.", e.FileName); + TestContext.WriteLine(" Checksums match ({0}).\n", actualCheckString); + } + } + } + } + } + + private static void _DotNetZip_CreateZip(List filesToZip, + EncryptionAlgorithm encryption, + string password, + string comment, + string zipFileToCreate, + bool nonSeekable) + { + // Want to test the library when saving to non-seekable output streams. Like + // stdout or ASPNET's Response.OutputStream. This simulates it. + if (nonSeekable) + { + using (var outStream = new Ionic.Zip.Tests.NonSeekableOutputStream(File.Create(zipFileToCreate))) + { + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = encryption; + if (zip1.Encryption != EncryptionAlgorithm.None) + zip1.Password = password; + + zip1.AddFiles(filesToZip, ""); + zip1.Comment = comment; + zip1.Save(outStream); + } + } + } + else + { + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = encryption; + if (zip1.Encryption != EncryptionAlgorithm.None) + zip1.Password = password; + + zip1.AddFiles(filesToZip, ""); + zip1.Comment = comment; + zip1.Save(zipFileToCreate); + } + } + } + + + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void WZA_CreateZip_NoPassword() + { + string zipFileToCreate = "WZA_CreateZip_NoPassword.zip"; + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + int entries = _rnd.Next(11) + 8; + + string filename = null; + var checksums = new Dictionary(); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + for (int i = 0; i < entries; i++) + { + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileBinary(filename, filesize); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileText(filename, filesize); + } + zip1.AddFile(filename, ""); + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + } + + zip1.Comment = String.Format("This archive uses Encryption: {0}, no password!", zip1.Encryption); + // With no password, we expect no encryption in the output. + zip1.Save(zipFileToCreate); + } + + #if NOT + WinzipVerify(zipFileToCreate); + + // validate all the checksums + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + { + if (!e.IsDirectory) + { + e.Extract("unpack"); + string PathToExtractedFile = Path.Combine("unpack", e.FileName); + + Assert.IsTrue(e.Encryption == EncryptionAlgorithm.None); + Assert.IsTrue(checksums.ContainsKey(e.FileName)); + + // verify the checksum of the file is correct + string expectedCheckString = checksums[e.FileName]; + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(PathToExtractedFile)); + Assert.AreEqual(expectedCheckString, actualCheckString, "Unexpected checksum on extracted filesystem file ({0}).", PathToExtractedFile); + } + } + } + #endif + + } + + + + [TestMethod] + public void WZA_CreateZip_DirectoriesOnly() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_CreateZip_DirectoriesOnly]"); + + string zipFileToCreate = "WZA_CreateZip_DirectoriesOnly.zip"; + Assert.IsFalse(File.Exists(zipFileToCreate)); + + string password = TestUtilities.GenerateRandomPassword(); + string dirToZip = Path.Combine(TopLevelDir, "zipthis"); + Directory.CreateDirectory(dirToZip); + + int entries = 0; + int subdirCount = _rnd.Next(8) + 8; + + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" Password: {0}", password); + TestContext.WriteLine(" #directories: {0}", subdirCount); + + for (int i = 0; i < subdirCount; i++) + { + string subdir = Path.Combine(dirToZip, "EmptyDir" + i); + Directory.CreateDirectory(subdir); + } + + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.Password = password; + zip1.AddDirectory(Path.GetFileName(dirToZip)); + zip1.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries); + } + + + + [TestMethod] + public void WZA_CreateZip_ZeroLengthFiles_256() + { + string password = TestUtilities.GenerateRandomPassword(12); + _Internal_CreateZip_ZeroLengthFiles(password, EncryptionAlgorithm.WinZipAes256); + } + [TestMethod] + public void WZA_CreateZip_ZeroLengthFiles_128() + { + string password = TestUtilities.GenerateRandomPassword(12); + _Internal_CreateZip_ZeroLengthFiles(password, EncryptionAlgorithm.WinZipAes128); + } + + [TestMethod] + public void WZA_CreateZip_ZeroLengthFiles_NoPassword_256() + { + _Internal_CreateZip_ZeroLengthFiles(null, EncryptionAlgorithm.WinZipAes256); + } + [TestMethod] + public void WZA_CreateZip_ZeroLengthFiles_NoPassword_128() + { + _Internal_CreateZip_ZeroLengthFiles(null, EncryptionAlgorithm.WinZipAes128); + } + + public void _Internal_CreateZip_ZeroLengthFiles(string password, EncryptionAlgorithm algorithm) + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [_Internal_CreateZip_ZeroLengthFiles]"); + + string zipFileToCreate = "WZA_CreateZip_ZeroLengthFiles.zip"; + Assert.IsFalse(File.Exists(zipFileToCreate)); + + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" Password: {0}", password); + + // create a bunch of zero-length files + int entries = _rnd.Next(21) + 5; + int i; + string[] filesToZip = new string[entries]; + for (i = 0; i < entries; i++) + filesToZip[i] = TestUtilities.CreateUniqueFile("zerolength", TopLevelDir); + + using (ZipFile zip = new ZipFile()) + { + zip.Encryption = algorithm; + zip.Password = password; + zip.AddFiles(filesToZip); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), + filesToZip.Length); + } + + + + private void WinzipCreate(string zipfile, string fileOrDir, string encryptionArg, string password) + { + string[] files = { fileOrDir }; + WinzipCreate(zipfile, files, encryptionArg, password); + } + + private void WinzipCreate(string zipfile, IEnumerable files, string encryptionArg, string password) + { + string args = null; + if (password == null) + { + args = String.Format("-a -whs {0}", zipfile); + } + else + { + args = String.Format("-a -whs -s\"{0}\" {1} {2}", password, encryptionArg, zipfile); + } + + // This had better not be too long a list, otherwise the cmd + // line length limit will be exceeded. To avoid that, could + // use directory names, but.... for now let's just hope. + foreach (var f in files) + args += " " + f; + + string wzzipOut = this.Exec(wzzip, args); + TestContext.WriteLine(wzzipOut); + } + + + + + [TestMethod] + public void WZA_ReadEncryptedZips() + { + _Internal_ReadEncryptedZips(true); + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void WZA_ReadZip_Fail_BadPassword() + { + _Internal_ReadEncryptedZips(false); + } + + + private void _Internal_ReadEncryptedZips(bool correctPw) + { + if (!WinZipIsPresent) + throw new Exception("no winzip!"); + + string[] cryptoArg = new string[] { "-ycAES128", "-ycAES256", }; + for (int m = 0; m < cryptoArg.Length; m++) + { + Directory.SetCurrentDirectory(TopLevelDir); + + // get a set of files to zip up + string subdir = Path.Combine(TopLevelDir, "files" + m); + string[] filesToZip; + Dictionary checksums; + Compatibility.CreateFilesAndChecksums(subdir, out filesToZip, out checksums); + string password = TestUtilities.GenerateRandomPassword(); + string[] dirsToZip = new string[] + { + subdir + "\\*.*", + }; + string zipFileToCreate = String.Format("WZA_ReadZips-{0}.zip", m); + WinzipCreate(zipFileToCreate, dirsToZip, cryptoArg[m], password); + + _Internal_ReadZip(zipFileToCreate, (correctPw) ? password : null, filesToZip.Length); + } + } + + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void WZA_ReadZip_Fail_NoPassword_128() + { + string password = TestUtilities.GenerateRandomPassword(); + GenerateFiles_CreateZip("-ycAES128", password, 1); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void WZA_ReadZip_Fail_NoPassword_256() + { + string password = TestUtilities.GenerateRandomPassword(); + GenerateFiles_CreateZip("-ycAES256", password, 1); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void WZA_ReadZip_Fail_WrongPassword() + { + string password = TestUtilities.GenerateRandomPassword(); + GenerateFiles_CreateZip("-ycAES256", password, 2); + } + + [TestMethod] + [ExpectedException(typeof(Ionic.Zip.BadPasswordException))] + public void WZA_ReadZip_Fail_WrongMethod() + { + string password = TestUtilities.GenerateRandomPassword(); + GenerateFiles_CreateZip("-ycAES256", password, 3); + } + + + public void GenerateFiles_CreateZip(string cryptoArg, string password, int pwFlavor) + { + // This method generates files, then zips them up using WinZip, then tries + // to unzip using DotNetZip. It is parameterized to test both success and + // failure cases. If pwFlavor is zero, then it uses the correct password to + // unzip, and everything should work. If pwFlavor is non-zero then it uses + // some incorrect password, either null or a bogus string, and generates a failure. + + if (!WinZipIsPresent) + throw new Exception("no winzip! [GenerateFiles_CreateZip]"); + + Directory.SetCurrentDirectory(TopLevelDir); + // get a set of files to zip up + string subdir = Path.Combine(TopLevelDir, "files"); + + string[] filesToZip = TestUtilities.GenerateFilesFlat(subdir); + string zipFileToCreate = "GenerateFiles_CreateZip.zip"; + + WinzipCreate(zipFileToCreate, subdir, cryptoArg, password); + + string pwForReading = (pwFlavor == 0) + ? password + : (pwFlavor == 1) + ? null + : (pwFlavor == 2) + ? "-wrongpassword-" + : TestUtilities.GenerateRandomPassword(); + + _Internal_ReadZip(zipFileToCreate, pwForReading, filesToZip.Length); + } + + + + int zipCount = 0; + private void _Internal_ReadZip(string zipFileToRead, string password, int expectedFilesExtracted) + { + Directory.SetCurrentDirectory(TopLevelDir); + + Assert.IsTrue(File.Exists(zipFileToRead), "The zip file '{0}' does not exist.", zipFileToRead); + + // extract all the files + int actualFilesExtracted = 0; + string extractDir = String.Format("Extract{0}", zipCount++); + + using (ZipFile zip2 = ZipFile.Read(zipFileToRead)) + { + //zip2.Password = password; + foreach (ZipEntry e in zip2) + { + if (!e.IsDirectory) + { + if (password == "-null-") + e.Extract(extractDir); + else + e.ExtractWithPassword(extractDir, password); + actualFilesExtracted++; + } + } + } + Assert.AreEqual(expectedFilesExtracted, actualFilesExtracted); + } + + + [TestMethod] + public void WZA_OneZeroByteFile_wi11131() + { + string zipF = "WZA_OneZeroByteFile_wi11131.zip"; + TestContext.WriteLine("Create file {0}", zipF); + using (ZipFile zipFile = new ZipFile()) + { + zipFile.Encryption = EncryptionAlgorithm.WinZipAes256; + zipFile.Password = TestUtilities.GenerateRandomPassword(); + zipFile.AddEntry("dummy", new byte[0]); + using (var fs = File.Create(zipF)) + { + zipFile.Save(fs); + } + } + + BasicVerifyZip(zipF); + Assert.AreEqual(1, TestUtilities.CountEntries(zipF)); + } + + + [TestMethod] + public void WZA_CreateZip_NoCompression() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_CreateZip_NoCompression]"); + + string zipFileToCreate = "WZA_CreateZip_NoCompression.zip"; + string password = TestUtilities.GenerateRandomPassword(); + + TestContext.WriteLine("======================================="); + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" Password: {0}", password); + int entries = _rnd.Next(21) + 5; + + string filename = null; + var checksums = new Dictionary(); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.Password = password; + zip1.CompressionLevel = Ionic.Zlib.CompressionLevel.None; + + for (int i = 0; i < entries; i++) + { + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileBinary(filename, filesize); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileText(filename, filesize); + } + zip1.AddFile(filename, ""); + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + } + + zip1.Comment = String.Format("This archive uses Encryption({0}) password({1}) no compression.", zip1.Encryption, password); + zip1.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + + // validate all the checksums + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + { + if (!e.IsDirectory) + { + Assert.AreEqual(0, (short)e.CompressionMethod); + e.ExtractWithPassword("unpack", password); + string PathToExtractedFile = Path.Combine("unpack", e.FileName); + Assert.IsTrue(checksums.ContainsKey(e.FileName)); + + // verify the checksum of the file is correct + string expectedCheckString = checksums[e.FileName]; + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(PathToExtractedFile)); + Assert.AreEqual(expectedCheckString, actualCheckString, "Unexpected checksum on extracted filesystem file ({0}).", PathToExtractedFile); + } + } + } + } + + + + [TestMethod] + public void WZA_CreateZip_EmptyPassword() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_CreateZip_EmptyPassword]"); + + // Using a blank password, eh? + // Just what exactly is this *supposed* to do? + // + string zipFileToCreate = "WZA_CreateZip_EmptyPassword.zip"; + string password = ""; + + TestContext.WriteLine("======================================="); + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" Password: '{0}'", password); + int entries = _rnd.Next(21) + 5; + + string filename = null; + var checksums = new Dictionary(); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.Password = password; + + for (int i = 0; i < entries; i++) + { + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileBinary(filename, filesize); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileText(filename, filesize); + } + zip1.AddFile(filename, ""); + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + } + + zip1.Comment = String.Format("This archive uses Encryption({0}) password({1}) no compression.", zip1.Encryption, password); + zip1.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + + // validate all the checksums + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + foreach (ZipEntry e in zip2) + { + if (!e.IsDirectory) + { + e.ExtractWithPassword("unpack", password); + string PathToExtractedFile = Path.Combine("unpack", e.FileName); + Assert.IsTrue(checksums.ContainsKey(e.FileName)); + + // verify the checksum of the file is correct + string expectedCheckString = checksums[e.FileName]; + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(PathToExtractedFile)); + Assert.AreEqual(expectedCheckString, actualCheckString, "Unexpected checksum on extracted filesystem file ({0}).", PathToExtractedFile); + } + } + } + } + + + [TestMethod] + public void WZA_RemoveEntryAndSave() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_RemoveEntryAndSave]"); + + // make a few text files + string[] TextFiles = new string[5]; + for (int i = 0; i < TextFiles.Length; i++) + { + TextFiles[i] = Path.Combine(TopLevelDir, String.Format("TextFile{0}.txt", i)); + TestUtilities.CreateAndFillFileText(TextFiles[i], _rnd.Next(4000) + 5000); + } + TestContext.WriteLine(new String('=', 66)); + TestContext.WriteLine("RemoveEntryAndSave()"); + string password = Path.GetRandomFileName(); + for (int k = 0; k < 2; k++) + { + TestContext.WriteLine(new String('-', 55)); + TestContext.WriteLine("Trial {0}", k); + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("RemoveEntryAndSave-{0}.zip", k)); + + // create the zip: add some files, and Save() it + using (ZipFile zip = new ZipFile()) + { + if (k == 1) + { + TestContext.WriteLine("Specifying a password..."); + zip.Password = password; + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + } + for (int i = 0; i < TextFiles.Length; i++) + zip.AddFile(TextFiles[i], ""); + + zip.AddEntry("Readme.txt", "This is the content of the file. Ho ho ho!"); + TestContext.WriteLine("Save..."); + zip.Save(zipFileToCreate); + } + + if (k == 1) + BasicVerifyZip(zipFileToCreate, password); + + // remove a file and re-Save + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + int entryToRemove = _rnd.Next(TextFiles.Length); + TestContext.WriteLine("Removing an entry...: {0}", Path.GetFileName(TextFiles[entryToRemove])); + zip2.RemoveEntry(Path.GetFileName(TextFiles[entryToRemove])); + zip2.Save(); + } + + // Verify the files are in the zip + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), TextFiles.Length, + String.Format("Trial {0}: The Zip file has the wrong number of entries.", k)); + + if (k == 1) + BasicVerifyZip(zipFileToCreate, password); + } + } + + + [TestMethod] + public void WZA_SmallBuffers_wi7967() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_SmallBuffers_wi7967]"); + + Directory.SetCurrentDirectory(TopLevelDir); + + string password = Path.GetRandomFileName() + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + int[] sizes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 21, 35, 93 }; + for (int i = 0; i < sizes.Length; i++) + { + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("WZA_SmallBuffers_wi7967-{0}.zip", i)); + //MemoryStream zippedStream = new MemoryStream(); + byte[] buffer = new byte[sizes[i]]; + _rnd.NextBytes(buffer); + MemoryStream source = new MemoryStream(buffer); + + using (var zip = new ZipFile()) + { + source.Seek(0, SeekOrigin.Begin); + zip.Password = password; + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + zip.AddEntry(Path.GetRandomFileName(), source); + zip.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + } + } + + + + [TestMethod] + public void WZA_InMemory_wi8493() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_InMemory_wi8493]"); + + string password = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + using (MemoryStream ms = new MemoryStream()) + { + for (int m = 0; m < 2; m++) + { + string zipFileToCreate = + String.Format("WZA_InMemory_wi8493-{0}.zip", m); + + using (var zip = new ZipFile()) + { + zip.Password = password; + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + zip.AddEntry(Path.GetRandomFileName(), "Hello, World!"); + if (m==1) + zip.Save(ms); + else + zip.Save(zipFileToCreate); + } + + if (m==1) + File.WriteAllBytes(zipFileToCreate,ms.ToArray()); + + BasicVerifyZip(zipFileToCreate, password); + } + } + } + + + [TestMethod] + public void WZA_InMemory_wi8493a() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_InMemory_wi8493a]"); + + string zipFileToCreate = "WZA_InMemory_wi8493a.zip"; + string password = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + + string[] TextFiles = new string[25 + _rnd.Next(8)]; + for (int i = 0; i < TextFiles.Length; i++) + { + TextFiles[i] = Path.Combine(TopLevelDir, String.Format("TextFile{0}.txt", i)); + TestUtilities.CreateAndFillFileText(TextFiles[i], _rnd.Next(14000) + 13000); + } + + using (MemoryStream ms = new MemoryStream()) + { + using (var zip = new ZipFile()) + { + zip.Password = password; + zip.Encryption = EncryptionAlgorithm.WinZipAes256; + zip.AddEntry("Readme.txt", "Hello, World! ABC ABC ABC ABC ABCDE ABC ABCDEF ABC ABCD"); + zip.AddFiles(TextFiles, "files"); + zip.Save(ms); + } + File.WriteAllBytes(zipFileToCreate,ms.ToArray()); + + BasicVerifyZip(zipFileToCreate, password); + } + } + + + [TestMethod] + public void WZA_MacCheck_ZeroLengthEntry_wi13892() + { + if (!WinZipIsPresent) + throw new Exception("no winzip!"); + + // This zipfile has some zero-length entries. Previously + // DotNetZip was throwing a spurious MAC mismatch error on + // those zero-length entries. + string baseFileName = "wi13892.zip"; + string extractDir = "extract"; + string password = "C-XPSQ5-BRT5302-"; + + string sourceDir = CurrentDir; + for (int i = 0; i < 3; i++) + sourceDir = Path.GetDirectoryName(sourceDir); + + string fqFileName = Path.Combine(Path.Combine(sourceDir, + "Zip Tests\\bin\\Debug\\zips"), + baseFileName); + + TestContext.WriteLine("Reading zip file: '{0}'", fqFileName); + using (ZipFile zip = ZipFile.Read(fqFileName)) + { + zip.Password = password; + foreach (ZipEntry e in zip) + { + TestContext.WriteLine("{1,-22} {2,9} {3,5:F0}% {4,9} {5,3} {6:X8} {0}", + e.FileName, + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + e.UncompressedSize, + e.CompressionRatio, + e.CompressedSize, + (e.UsesEncryption) ? "Y" : "N", + e.Crc); + e.Extract(extractDir); + } + } + } + + + + + + + [TestMethod] + public void WZA_Update_SwitchCompression() + { + if (!WinZipIsPresent) + throw new Exception("no winzip! [WZA_Update_SwitchCompression]"); + + string zipFileToCreate = "WZA_Update_SwitchCompression.zip"; + string password = TestUtilities.GenerateRandomPassword(); + + TestContext.WriteLine("======================================="); + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" Password: {0}", password); + int entries = _rnd.Next(21) + 5; + + string filename = null; + var checksums = new Dictionary(); + using (ZipFile zip1 = new ZipFile()) + { + zip1.Encryption = EncryptionAlgorithm.WinZipAes256; + zip1.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression; + zip1.Password = password; + + for (int i = 0; i < entries; i++) + { + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileBinary(filename, filesize); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + int filesize = _rnd.Next(144000) + 5000; + TestUtilities.CreateAndFillFileText(filename, filesize); + } + zip1.AddFile(filename, ""); + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + } + + zip1.Comment = String.Format("This archive uses Encryption({0}) password({1}) no compression.", zip1.Encryption, password); + TestContext.WriteLine("{0}", zip1.Comment); + TestContext.WriteLine("Saving the zip..."); + zip1.Save(zipFileToCreate); + } + + BasicVerifyZip(zipFileToCreate, password); + + TestContext.WriteLine("======================================="); + TestContext.WriteLine("Updating the zip file"); + + // Update the zip file + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + for (int j = 0; j < 5; j++) + { + zip[j].Password = password; + zip[j].CompressionMethod = 0; + } + zip.Save(); // this should succeed + } + + } + + + } +} diff --git a/dotNetZip/Zip Tests/Zip Tests.csproj b/dotNetZip/Zip Tests/Zip Tests.csproj new file mode 100644 index 0000000..057820f --- /dev/null +++ b/dotNetZip/Zip Tests/Zip Tests.csproj @@ -0,0 +1,234 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {549466CE-5CA6-4904-BA44-58141544BE70} + Library + Properties + Ionic.Zip.Tests + Ionic.Zip.Tests + ..\Ionic.snk + v4.0 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + AnyCPU + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + False + ..\..\..\..\..\vsp\UnitTestProgressMonitor\CopyDataChannel\bin\Debug\Ionic.CopyData.dll + + + + + False + ..\..\..\..\..\..\GAC\GAC_MSIL\Microsoft.VisualStudio.Zip.9.0\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Zip.9.0.dll + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Zip DLL + + + {A22C89E0-B5D4-4881-A61F-4B1FD82F2453} + UnZip + + + {98008721-C4DD-4F34-B3AE-A3453E29BB65} + ZipIt + + + + + Ionic.snk + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Zip Tests/Zip64Tests.cs b/dotNetZip/Zip Tests/Zip64Tests.cs new file mode 100644 index 0000000..3323afd --- /dev/null +++ b/dotNetZip/Zip Tests/Zip64Tests.cs @@ -0,0 +1,1747 @@ +// Zip64Tests.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-10 20:31:24> +// +// ------------------------------------------------------------------ +// +// This module defines the tests for the ZIP64 capability within DotNetZip. These +// tests can take a long time to run, as the files can be quite large - 10g or +// more. Merely generating the content for these tests can take an hour. Most tests +// in the DotNetZip test suite are self-standing - they generate the content they +// need, and then remove it after completion, either success or failure. With ZIP64, +// because content creation is expensive, for update operations this module uses a +// cache of large zip files. See _CreateHugeZipfiles(). The method looks for +// large files in a well-known location on the filesystem, in fodderDir. +// +// ------------------------------------------------------------------ + + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Ionic.Zip; +using Ionic.Zip.Tests.Utilities; + + +namespace Ionic.Zip.Tests.Zip64 +{ + [TestClass] + public class Zip64Tests : IonicTestClass + { + string fodderDir = "c:\\users\\dino\\Downloads"; + string homeDir = System.Environment.GetEnvironmentVariable("TEMP"); + + public Zip64Tests() : base() { } + + private static string[] _HugeZipFiles; + private string[] GetHugeZipFiles() + { + if (_HugeZipFiles == null) + { + _HugeZipFiles = _CreateHugeZipfiles(); + } + return _HugeZipFiles; + } + + + + [ClassCleanup()] + public static void MyClassCleanup() + { + if (_HugeZipFiles != null) + { + // Keep this huge zip file around, because it takes so much + // time to create it. But Delete the directory if one of the files no + // longer exists. + if (!File.Exists(_HugeZipFiles[0]) || + !File.Exists(_HugeZipFiles[1])) + { + //File.Delete(_HugeZipFile); + string d= Path.GetDirectoryName(_HugeZipFiles[0]); + if (Directory.Exists(d)) + Directory.Delete(d, true); + } + } + } + + EncryptionAlgorithm[] crypto = + { + EncryptionAlgorithm.None, + EncryptionAlgorithm.PkzipWeak, + EncryptionAlgorithm.WinZipAes128, + EncryptionAlgorithm.WinZipAes256, + }; + + Ionic.Zlib.CompressionLevel[] compLevels = + { + Ionic.Zlib.CompressionLevel.None, + Ionic.Zlib.CompressionLevel.BestSpeed, + Ionic.Zlib.CompressionLevel.Default, + Ionic.Zlib.CompressionLevel.BestCompression, + }; + + Zip64Option[] z64 = + { + Zip64Option.Never, + Zip64Option.AsNecessary, + Zip64Option.Always, + }; + + + private Object LOCK = new Object(); + + + /// + /// Create 2 large zip64 zip files - one from DNZ, one from WinZip. Each + /// test that updates a zip file should use both. There are slight + /// differences between a zip from DNZ and one from WinZip, specifically + /// regarding metadata. These differences should be inconsequential for + /// updates of zips, and that is what some of the zip64 tests seek to + /// verify. + /// + private string[] _CreateHugeZipfiles() + { + string[] zipsToCreate = { "Zip64Test-createdBy-WZ.zip", + "Zip64Test-createdBy-DNZ.zip" }; + + // lock in case more than one test calls this at a time. + lock (LOCK) + { + TestContext.WriteLine("CreateHugeZipFiles"); + TestContext.WriteLine("Start - " + DateTime.Now.ToString("G")); + // STEP 1: + // look for existing directories, and re-use the large zip files + // there, if it exists, and if it is large enough. + string testDir = null; + var filesToAdd = new List(); + var oldDirs = Directory.GetDirectories(homeDir, "*.Zip64Tests"); + string zipFileToCreate = null; + List found = null; + + // first pass to check if any dirs, have both files, + // second pass to check if any dirs have one file plus fodder files. + for (int pass=0; pass < 2; pass++) + { + foreach (var dir in oldDirs) + { + found = new List(); + for (int m=0; m < zipsToCreate.Length; m++) + { + zipFileToCreate = Path.Combine(dir, zipsToCreate[m]); + if (File.Exists(zipFileToCreate)) + { + TestContext.WriteLine("File exists: {0}", zipFileToCreate); + FileInfo fi = new FileInfo(zipFileToCreate); + if (fi.Length < (long)System.UInt32.MaxValue) + { + TestContext.WriteLine("deleting file (too small): {0}", zipFileToCreate); + File.Delete(zipFileToCreate); + } + else found.Add(m); + } + } + + int fc = found.Count(); + switch (fc) + { + case 0: + case 1: + // check for fodder files + testDir = dir; + string fdir = Path.Combine(dir,"dir"); + if (Directory.Exists(fdir)) + { + var fodderFiles = Directory.GetFiles(fdir, "*.txt"); + if (fodderFiles == null || fodderFiles.Length <= 6) + try { Directory.Delete(dir, true); } catch { } + } + else try { Directory.Delete(dir, true); } catch { } + break; + case 2: + // found both large zips, so use them. + zipsToCreate[0] = Path.Combine(dir, zipsToCreate[0]); + zipsToCreate[1] = Path.Combine(dir, zipsToCreate[1]); + TestContext.WriteLine("Using the existing zips in: {0}", dir); + return zipsToCreate; + } + + if (pass == 1 && Directory.Exists(dir) && fc==1) + { + // on pass 2, take 1st dir with at least one zip + break; + } + } + } + + // remember the current directory so we can restore later + string originalDir = Directory.GetCurrentDirectory(); + // CurrentDir is the dir that holds the test temp directory (or directorIES) + Directory.SetCurrentDirectory(CurrentDir); + + if (!Directory.Exists(testDir)) + { + // create the dir if it does not exist + string pname = Path.GetFileName(TestUtilities.GenerateUniquePathname("Zip64Tests")); + testDir = Path.Combine(homeDir, pname); + Directory.CreateDirectory(testDir); + Directory.SetCurrentDirectory(testDir); + } + else + { + Directory.SetCurrentDirectory(testDir); + string fdir = Path.Combine(testDir,"dir"); + filesToAdd.AddRange(Directory.GetFiles(fdir, "*.txt")); + } + + TestContext.WriteLine("Creating new zip files..."); + + // create a huge ZIP64 archive with a true 64-bit offset. + _txrx = TestUtilities.StartProgressMonitor("Zip64_Setup", + "Zip64 Test Setup", + "Creating files"); + + //Directory.SetCurrentDirectory(testDir); + + // create a directory with some files in it, to zip + string dirToZip = "dir"; + Directory.CreateDirectory(dirToZip); + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + _txrx.Send("bars 3"); + System.Threading.Thread.Sleep(220); + _txrx.Send("pb 0 max 4"); + System.Threading.Thread.Sleep(220); + int numFilesToAdd = _rnd.Next(4) + 7; + _txrx.Send("pb 1 max " + numFilesToAdd); + + // These params define the size range for the large, random text + // files that are created below. Creating files this size takes + // about 1 minute per file + _sizeBase = 0x16000000; + _sizeRandom = 0x20000000; + //_sizeBase = 0x160000; + //_sizeRandom = 0x200000; + if (filesToAdd.Count() == 0) + { + int n; + var buf = new byte[2048]; + for (int i = 0; i < numFilesToAdd; i++) + { + System.Threading.Thread.Sleep(220); + _txrx.Send("title Zip64 Create Huge Zip files"); // in case it was missed + System.Threading.Thread.Sleep(220); + int fnameLength = _rnd.Next(25) + 6; + string filename = TestUtilities.GenerateRandomName(fnameLength) + + ".txt"; + _txrx.Send(String.Format("status create {0} ({1}/{2})", filename, i+1, numFilesToAdd)); + int totalSize = _sizeBase + _rnd.Next(_sizeRandom); + System.Threading.Thread.Sleep(220); + _txrx.Send(String.Format("pb 2 max {0}", totalSize)); + System.Threading.Thread.Sleep(220); + _txrx.Send("pb 2 value 0"); + int writtenSoFar = 0; + int cycles = 0; + using (var input = new Ionic.Zip.Tests.Utilities.RandomTextInputStream(totalSize)) + { + using (var output = File.Create(Path.Combine(dirToZip,filename))) + { + while ((n = input.Read(buf,0,buf.Length)) > 0) + { + output.Write(buf,0,n); + writtenSoFar+=n; + cycles++; + if (cycles % 640 == 0) + { + _txrx.Send(String.Format("pb 2 value {0}", writtenSoFar)); + } + } + } + } + filesToAdd.Add(filename); + _txrx.Send("pb 1 step"); + } + } + + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(220); + _txrx.Send("pb 1 value 0"); + + // Add links to a few very large files into the same directory. We + // do this because creating such large files from nothing would take + // a very very long time. + if (CreateLinksToLargeFiles(dirToZip)) + return null; + + Directory.SetCurrentDirectory(testDir); // again + + if (found == null || !found.Contains(0)) + { + // create a zip file, using WinZip + // This will take 50 minutes or so, no progress updates possible. + System.Threading.Thread.Sleep(220); + _txrx.Send("title Zip64 Create Huge Zip files"); // in case it was missed + System.Threading.Thread.Sleep(220); + _txrx.Send("pb 2 value 0"); + zipFileToCreate = zipsToCreate[0]; + zipsToCreate[0] = Path.Combine(testDir, zipsToCreate[0]); + + // wzzip.exe will create a zip64 file automatically, as necessary. + // There is no explicit switch required. + // switches: + // -a add + // -r recurse + // -p store folder names + // -yx store extended timestamps + var sb1 = new System.Text.StringBuilder(); + sb1.Append("-a -p -r -yx \"") + .Append(zipFileToCreate) + .Append("\" \"") + .Append(dirToZip) + .Append("\" "); + + string args = sb1.ToString(); + System.Threading.Thread.Sleep(220); + _txrx.Send("status wzzip.exe " + args); + TestContext.WriteLine("Exec: wzzip {0}", args); + string wzzipOut = this.Exec(wzzip, args); + TestContext.WriteLine("Done with wzzip.exe"); + _txrx.Send("status wzzip.exe: Done"); + } + + if (found == null || !found.Contains(1)) + { + // Create a zip file using DotNetZip + // This will take 50 minutes or so. + // pb1 and pb2 will be set in the {Add,Save}Progress handlers + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + _txrx.Send("status Saving the zip..."); + System.Threading.Thread.Sleep(120); + _txrx.Send(String.Format("pb 1 max {0}", numFilesToAdd + Directory.GetFiles(dirToZip).Length)); + _testTitle = "Zip64 Create Huge Zip files"; // used in Zip64_SaveProgress + _pb1Set = false; + zipFileToCreate = Path.Combine(testDir, zipsToCreate[1]); + zipsToCreate[1] = zipFileToCreate; + using (ZipFile zip = new ZipFile()) + { + zip.SaveProgress += Zip64SaveProgress; + zip.AddProgress += Zip64AddProgress; + zip.UpdateDirectory(dirToZip, ""); + foreach (var e in zip) + { + if (e.FileName.EndsWith(".pst") || + e.FileName.EndsWith(".ost") || + e.FileName.EndsWith(".zip")) + e.CompressionMethod = CompressionMethod.None; + } + + zip.UseZip64WhenSaving = Zip64Option.Always; + // use large buffer to speed up save for large files: + zip.BufferSize = 1024 * 756; + zip.CodecBufferSize = 1024 * 128; + zip.Save(zipFileToCreate); + } + } + + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + + // Delete the fodder dir only if we have both zips. + // This is helpful when modifying or editing this method. + // With repeated runs you don't have to re-create all the data + // each time. + if (File.Exists(zipsToCreate[0]) && File.Exists(zipsToCreate[1])) + Directory.Delete(dirToZip, true); + + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + + _txrx.Send("stop"); + + // restore the cwd: + Directory.SetCurrentDirectory(originalDir); + + TestContext.WriteLine("All done - " + + DateTime.Now.ToString("G")); + + return zipsToCreate; + } + } + + + + private bool CreateLinksToLargeFiles(string dirForLinks) + { + var candidates = from fi in (from fn in Directory.GetFiles(fodderDir) + select new FileInfo(fn)) + where fi.Length > 0x10000000 + orderby fi.Length descending + select fi; + + if (candidates.Count() < 3) + { + TestContext.WriteLine("Found {0} files, not enough to proceed.", + candidates.Count()); + return true; + } + TestContext.WriteLine("Found {0} large files, which seems enough to proceed.", + candidates.Count()); + + string current = Directory.GetCurrentDirectory(); + _txrx.Send("status Creating links"); + string subdir = Path.Combine(dirForLinks, "00-largelinks"); + if (Directory.Exists(subdir)) + Directory.Delete(subdir, true); + Directory.CreateDirectory(subdir); + Directory.SetCurrentDirectory(subdir); + var w = System.Environment.GetEnvironmentVariable("Windir"); + Assert.IsTrue(Directory.Exists(w), "%windir% does not exist ({0})", w); + var fsutil = Path.Combine(Path.Combine(w, "system32"), "fsutil.exe"); + Assert.IsTrue(File.Exists(fsutil), "fsutil.exe does not exist ({0})", fsutil); + string ignored; + Int64 totalLength = 0; + int cycle = 0; + const Int64 threshold = (long)(11L * 1024 * 1024 * 1024); + while (totalLength < threshold) + { + cycle++; + foreach (var fi in candidates) + { + string cmd = String.Format("hardlink create \"{0}-Copy{1}{2}\" \"{3}\"", + Path.GetFileNameWithoutExtension(fi.Name), + cycle, + Path.GetExtension(fi.Name), + Path.Combine(fodderDir,fi.Name)); + TestContext.WriteLine("Command: fsutil {0}", cmd); + _txrx.Send("status " + cmd); + TestUtilities.Exec_NoContext(fsutil, cmd, out ignored); + totalLength += fi.Length; + if (totalLength > threshold) + break; // enough + } + } + Directory.SetCurrentDirectory(current); + return false; + } + + + + + [TestMethod] + public void Zip64_Create() + { + Zip64Option[] Options = { Zip64Option.Always, + Zip64Option.Never, + Zip64Option.AsNecessary }; + for (int k = 0; k < Options.Length; k++) + { + string filename = null; + Directory.SetCurrentDirectory(TopLevelDir); + TestContext.WriteLine("\n\n==================Trial {0}...", k); + string zipFileToCreate = String.Format("Zip64_Create-{0}.zip", k); + + TestContext.WriteLine("Creating file {0}", zipFileToCreate); + TestContext.WriteLine(" ZIP64 option: {0}", Options[k].ToString()); + int entries = _rnd.Next(5) + 13; + var checksums = new Dictionary(); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < entries; i++) + { + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + int filesize = _rnd.Next(44000) + 5000; + TestUtilities.CreateAndFillFileBinary(filename, filesize); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + int filesize = _rnd.Next(44000) + 5000; + TestUtilities.CreateAndFillFileText(filename, filesize); + } + zip1.AddFile(filename, ""); + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + } + + zip1.UseZip64WhenSaving = Options[k]; + zip1.Comment = String.Format("This archive uses zip64 option: {0}", Options[k].ToString()); + zip1.Save(zipFileToCreate); + + if (Options[k] == Zip64Option.Always) + Assert.IsTrue(zip1.OutputUsedZip64.Value); + else if (Options[k] == Zip64Option.Never) + Assert.IsFalse(zip1.OutputUsedZip64.Value); + } + + BasicVerifyZip(zipFileToCreate); + + TestContext.WriteLine("---------------Reading {0}...", zipFileToCreate); + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + string extractDir = String.Format("extract{0}", k); + foreach (var e in zip2) + { + TestContext.WriteLine(" Entry: {0} c({1}) unc({2})", e.FileName, e.CompressedSize, e.UncompressedSize); + + e.Extract(extractDir); + filename = Path.Combine(extractDir, e.FileName); + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(filename)); + Assert.IsTrue(checksums.ContainsKey(e.FileName), "Checksum is missing"); + Assert.AreEqual(checksums[e.FileName], actualCheckString, "Checksums for ({0}) do not match.", e.FileName); + TestContext.WriteLine(" Checksums match ({0}).\n", actualCheckString); + } + } + } + } + + + + [TestMethod] + public void Zip64_Convert() + { + string trialDescription = "Trial {0}/{1}: create archive as 'zip64={2}', then open it and re-save with 'zip64={3}'"; + Zip64Option[] z64a = { + Zip64Option.Never, + Zip64Option.Always, + Zip64Option.AsNecessary}; + + // ?? + for (int u = 0; u < 2; u++) + { + for (int m = 0; m < z64a.Length; m++) + { + for (int n = 0; n < z64a.Length; n++) + { + int k = m * z64a.Length + n; + + string filename = null; + Directory.SetCurrentDirectory(TopLevelDir); + TestContext.WriteLine("\n\n==================Trial {0}...", k); + + TestContext.WriteLine(trialDescription, k, (z64a.Length * z64a.Length) - 1, z64a[m], z64a[n]); + + string zipFileToCreate = Path.Combine(TopLevelDir, String.Format("Zip64_Convert-{0}.A.zip", k)); + + int entries = _rnd.Next(8) + 6; + //int entries = 2; + TestContext.WriteLine("Creating file {0}, zip64={1}, {2} entries", + Path.GetFileName(zipFileToCreate), z64a[m].ToString(), entries); + + var checksums = new Dictionary(); + using (ZipFile zip1 = new ZipFile()) + { + for (int i = 0; i < entries; i++) + { + if (_rnd.Next(2) == 1) + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.bin", i)); + TestUtilities.CreateAndFillFileBinary(filename, _rnd.Next(44000) + 5000); + } + else + { + filename = Path.Combine(TopLevelDir, String.Format("Data{0}.txt", i)); + TestUtilities.CreateAndFillFileText(filename, _rnd.Next(44000) + 5000); + } + zip1.AddFile(filename, ""); + + var chk = TestUtilities.ComputeChecksum(filename); + checksums.Add(Path.GetFileName(filename), TestUtilities.CheckSumToString(chk)); + } + + TestContext.WriteLine("---------------Saving to {0} with Zip64={1}...", + Path.GetFileName(zipFileToCreate), z64a[m].ToString()); + zip1.UseZip64WhenSaving = z64a[m]; + zip1.Comment = String.Format("This archive uses Zip64Option={0}", z64a[m].ToString()); + zip1.Save(zipFileToCreate); + } + + + Assert.AreEqual(TestUtilities.CountEntries(zipFileToCreate), entries, + "The Zip file has the wrong number of entries."); + + + string newFile = zipFileToCreate.Replace(".A.", ".B."); + using (ZipFile zip2 = ZipFile.Read(zipFileToCreate)) + { + TestContext.WriteLine("---------------Extracting {0} ...", + Path.GetFileName(zipFileToCreate)); + string extractDir = String.Format("extract-{0}-{1}.A", k, u); + foreach (var e in zip2) + { + TestContext.WriteLine(" {0} crc({1:X8}) c({2:X8}) unc({3:X8})", e.FileName, e.Crc, e.CompressedSize, e.UncompressedSize); + + e.Extract(extractDir); + filename = Path.Combine(extractDir, e.FileName); + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(filename)); + Assert.IsTrue(checksums.ContainsKey(e.FileName), "Checksum is missing"); + Assert.AreEqual(checksums[e.FileName], actualCheckString, "Checksums for ({0}) do not match.", e.FileName); + } + + if (u==1) + { + TestContext.WriteLine("---------------Updating: Renaming an entry..."); + zip2[4].FileName += ".renamed"; + + string entriesToRemove = (_rnd.Next(2) == 0) ? "*.txt" : "*.bin"; + TestContext.WriteLine("---------------Updating: Removing {0} entries...", entriesToRemove); + zip2.RemoveSelectedEntries(entriesToRemove); + } + + TestContext.WriteLine("---------------Saving to {0} with Zip64={1}...", + Path.GetFileName(newFile), z64a[n].ToString()); + + zip2.UseZip64WhenSaving = z64a[n]; + zip2.Comment = String.Format("This archive uses Zip64Option={0}", z64a[n].ToString()); + zip2.Save(newFile); + } + + + + using (ZipFile zip3 = ZipFile.Read(newFile)) + { + TestContext.WriteLine("---------------Extracting {0} ...", + Path.GetFileName(newFile)); + string extractDir = String.Format("extract-{0}-{1}.B", k, u); + foreach (var e in zip3) + { + TestContext.WriteLine(" {0} crc({1:X8}) c({2:X8}) unc({3:X8})", e.FileName, e.Crc, e.CompressedSize, e.UncompressedSize); + + e.Extract(extractDir); + filename = Path.Combine(extractDir, e.FileName); + string actualCheckString = TestUtilities.CheckSumToString(TestUtilities.ComputeChecksum(filename)); + if (!e.FileName.EndsWith(".renamed")) + { + Assert.IsTrue(checksums.ContainsKey(e.FileName), "Checksum is missing"); + Assert.AreEqual(checksums[e.FileName], actualCheckString, "Checksums for ({0}) do not match.", e.FileName); + } + } + } + } + } + } + } + + + bool _pb2Set; + bool _pb1Set; + string _testTitle; + int _sizeBase; + int _sizeRandom; + int _numSaving; + int _totalToSave; + int _spCycles; + private void Zip64SaveProgress(object sender, SaveProgressEventArgs e) + { + string msg; + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + _txrx.Send("status saving started..."); + _pb1Set = false; + _numSaving= 1; + break; + + case ZipProgressEventType.Saving_BeforeWriteEntry: + _txrx.Send(String.Format("status Compressing {0}", e.CurrentEntry.FileName)); + _spCycles = 0; + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", e.EntriesTotal)); + _pb1Set = true; + } + _totalToSave = e.EntriesTotal; + _pb2Set = false; + break; + + case ZipProgressEventType.Saving_EntryBytesRead: + _spCycles++; + if ((_spCycles % 128) == 0) + { + if (!_pb2Set) + { + _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); + _pb2Set = true; + } + _txrx.Send(String.Format("status Saving entry {0}/{1} :: {2} :: {3}/{4}mb {5:N0}%", + _numSaving, _totalToSave, + e.CurrentEntry.FileName, + e.BytesTransferred/(1024*1024), e.TotalBytesToTransfer/(1024*1024), + ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))); + msg = String.Format("pb 2 value {0}", e.BytesTransferred); + _txrx.Send(msg); + } + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + _txrx.Send("test " + _testTitle); // just in case it was missed + _txrx.Send("pb 1 step"); + _numSaving++; + break; + + case ZipProgressEventType.Saving_Completed: + _txrx.Send("status Save completed"); + _pb1Set = false; + _pb2Set = false; + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + break; + } + } + + + + void Zip64AddProgress(object sender, AddProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Adding_Started: + _txrx.Send("status Adding files to the zip..."); + break; + case ZipProgressEventType.Adding_AfterAddEntry: + _txrx.Send(String.Format("status Adding file {0}", + e.CurrentEntry.FileName)); + break; + case ZipProgressEventType.Adding_Completed: + _txrx.Send("status Added all files"); + break; + } + } + + + + private int _numExtracted; + private int _epCycles; + private int _numFilesToExtract; + void Zip64ExtractProgress(object sender, ExtractProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Extracting_BeforeExtractEntry: + if (!_pb1Set) + { + _txrx.Send(String.Format("pb 1 max {0}", _numFilesToExtract)); + _pb1Set = true; + } + _pb2Set = false; + _epCycles = 0; + break; + + case ZipProgressEventType.Extracting_EntryBytesWritten: + _epCycles++; + if ((_epCycles % 512) == 0) + { + if (!_pb2Set) + { + _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); + _pb2Set = true; + } + _txrx.Send(String.Format("status {0} entry {1}/{2} :: {3} :: {4}/{5}mb :: {6:N0}%", + verb, + _numExtracted, _numFilesToExtract, + e.CurrentEntry.FileName, + e.BytesTransferred/(1024*1024), + e.TotalBytesToTransfer/(1024*1024), + ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer) + )); + string msg = String.Format("pb 2 value {0}", e.BytesTransferred); + _txrx.Send(msg); + } + break; + + case ZipProgressEventType.Extracting_AfterExtractEntry: + _numExtracted++; + if (_numFilesToExtract < 1024 || (_numExtracted % 128) == 0) + { + _txrx.Send("test " + _testTitle); // just in case it was missed + while (_numExtracted > _numFilesToExtract) _numExtracted--; + _txrx.Send("pb 1 value " + _numExtracted); + if (_numExtracted == _numFilesToExtract) + { + _txrx.Send("status All done " + verb); + } + else + { + _txrx.Send(String.Format("status {0} entry {1}/{2} {3:N0}%", + verb, + _numExtracted, _numFilesToExtract, + _numExtracted / (0.01 *_numFilesToExtract))); + } + } + break; + } + } + + + + string verb; + + private void Zip64VerifyZip(string zipfile) + { + _pb1Set = false; + Stream bitBucket = Stream.Null; + TestContext.WriteLine(""); + TestContext.WriteLine("Checking file {0}", zipfile); + verb = "Verifying"; + using (ZipFile zip = ZipFile.Read(zipfile)) + { + // large buffer better for large files + zip.BufferSize = 65536*4; // 65536 * 8 = 512k + _numFilesToExtract = zip.Entries.Count; + _numExtracted= 1; + zip.ExtractProgress += Zip64ExtractProgress; + foreach (var s in zip.EntryFileNames) + { + TestContext.WriteLine(" Entry: {0}", s); + zip[s].Extract(bitBucket); + } + } + System.Threading.Thread.Sleep(0x500); + } + + + + [Timeout(3 * 60*60*1000), TestMethod] // 60*60*1000 = 1hr + public void Zip64_Update_WZ() + { + // this should take about an hour + string[] zipFilesToUpdate = GetHugeZipFiles(); + Assert.IsFalse(zipFilesToUpdate == null, "No files were created."); + // this should take a little less than an hour + Zip64UpdateAddFiles(zipFilesToUpdate[0], "WinZip"); + } + + + [Timeout(3 * 60*60*1000), TestMethod] // 60*60*1000 = 1hr + public void Zip64_Update_DNZ() + { + // this should take about an hour + string[] zipFilesToUpdate = GetHugeZipFiles(); + Assert.IsFalse(zipFilesToUpdate == null, "No files were created."); + // this should take a little less than an hour + Zip64UpdateAddFiles(zipFilesToUpdate[1], "DNZ"); + } + + + private void Zip64UpdateAddFiles(string zipFileToUpdate, string marker) + { + _txrx = TestUtilities.StartProgressMonitor("Zip64-Update", + "Zip64 Update - " + marker, + "Starting up..."); + + int numUpdates = 2; + int baseSize = _rnd.Next(0x1000ff) + 80000; + System.Threading.Thread.Sleep(120); + // pb 0: numUpdates + before+after verify steps + _txrx.Send( String.Format("pb 0 max {0}", numUpdates + 2)); + string workingZipFile = "Z64Update." + marker + ".zip"; + _testTitle = "Zip64 Update - " + marker + " - initial verify"; + _txrx.Send("pb 0 value 0"); + Assert.IsTrue(File.Exists(zipFileToUpdate), + "The required ZIP file does not exist ({0})", + zipFileToUpdate); + + // make sure the zip is larger than the 4.2gb size + FileInfo fi = new FileInfo(zipFileToUpdate); + Assert.IsTrue(fi.Length > (long)System.UInt32.MaxValue, + "The zip file ({0}) is not large enough.", + zipFileToUpdate); + + // this usually takes 10-12 minutes + TestContext.WriteLine("Verifying the zip - " + + DateTime.Now.ToString("G")); + _txrx.Send("status Verifying the zip"); + Zip64VerifyZip(zipFileToUpdate); + + _txrx.Send("pb 0 value 1"); + + var sw = new StringWriter(); + for (int j=0; j < numUpdates; j++) + { + _testTitle = String.Format("Zip64 Update - {0} - ({1}/{2})", + marker, j+1, numUpdates); + _pb1Set = false; + System.Threading.Thread.Sleep(220); + _txrx.Send("test " + _testTitle); + // create another folder with a single file in it + string subdir = String.Format("newfolder-{0}", j); + Directory.CreateDirectory(subdir); + string fileName = Path.Combine(subdir, + System.Guid.NewGuid().ToString() + ".txt"); + long size = baseSize + _rnd.Next(28000); + TestUtilities.CreateAndFillFileText(fileName, size); + + TestContext.WriteLine(""); + TestContext.WriteLine("Updating the zip file, cycle {0}...{1}", + j, DateTime.Now.ToString("G")); + _txrx.Send("status Updating the zip file..."); + // update the zip with that new folder+file + // will take a long time for large files + using (ZipFile zip = ZipFile.Read(zipFileToUpdate)) + { + zip.SaveProgress += Zip64SaveProgress; + zip.StatusMessageTextWriter = sw; + zip.UpdateDirectory(subdir, subdir); + zip.UseZip64WhenSaving = Zip64Option.Always; + zip.BufferSize = 65536*8; // 65536 * 8 = 512k + zip.Save(workingZipFile); + } + + TestContext.WriteLine("Save complete " + + DateTime.Now.ToString("G")); + zipFileToUpdate = workingZipFile; // for subsequent updates + // emit status into the log if available + string status = sw.ToString(); + if (status != null && status != "") + { + var lines = status.Split('\n'); + TestContext.WriteLine("status: (" + + DateTime.Now.ToString("G") + ")"); + foreach (string line in lines) + TestContext.WriteLine(line); + } + + _txrx.Send("pb 0 value " + (j+2)); + } + + System.Threading.Thread.Sleep(120); + + // make sure the zip is larger than the 4.2gb size + fi = new FileInfo(workingZipFile); + Assert.IsTrue(fi.Length > (long)System.UInt32.MaxValue, + "The zip file ({0}) is not large enough.", + workingZipFile); + + TestContext.WriteLine(""); + TestContext.WriteLine("Verifying the zip again... " + + DateTime.Now.ToString("G")); + _txrx.Send("status Verifying the zip again..."); + _testTitle = String.Format("Zip64 Update - {0} - final verify", + marker); + _pb1Set = false; + System.Threading.Thread.Sleep(220); + _txrx.Send("test " + _testTitle); + Zip64VerifyZip(workingZipFile); + + _txrx.Send( String.Format("pb 0 value {0}", numUpdates + 1)); + } + + + + [TestMethod] + public void Zip64_Winzip_Unzip_OneFile() + { + string testBin = TestUtilities.GetTestBinDir(CurrentDir); + string fileToZip = Path.Combine(testBin, "Ionic.Zip.dll"); + + Directory.SetCurrentDirectory(TopLevelDir); + + for (int p=0; p < compLevels.Length; p++) + { + for (int n=0; n < crypto.Length; n++) + { + for (int m=0; m < z64.Length; m++) + { + string zipFile = String.Format("WZ-Unzip.OneFile.{0}.{1}.{2}.zip", + compLevels[p].ToString(), + crypto[n].ToString(), + z64[m].ToString()); + string password = Path.GetRandomFileName(); + + TestContext.WriteLine("================================="); + TestContext.WriteLine("Creating {0}...", Path.GetFileName(zipFile)); + TestContext.WriteLine("Encryption:{0} Zip64:{1} pw={2} compLevel={3}", + crypto[n].ToString(), z64[m].ToString(), password, compLevels[p].ToString()); + + using (var zip = new ZipFile()) + { + zip.Comment = String.Format("Encryption={0} Zip64={1} pw={2}", + crypto[n].ToString(), z64[m].ToString(), password); + zip.Encryption = crypto[n]; + zip.Password = password; + zip.CompressionLevel = compLevels[p]; + zip.UseZip64WhenSaving = z64[m]; + zip.AddFile(fileToZip, "file"); + zip.Save(zipFile); + } + + TestContext.WriteLine("Unzipping with WinZip..."); + + string extractDir = String.Format("extract.{0}.{1}.{2}",p,n,m); + Directory.CreateDirectory(extractDir); + + // this will throw if the command has a non-zero exit code. + this.Exec(wzunzip, + String.Format("-s{0} -d {1} {2}\\", password, zipFile, extractDir)); + } + } + } + } + + + + [Timeout((int)(1 * 60*60*1000)), TestMethod] // in milliseconds. + public void Zip64_Winzip_Unzip_Huge() + { + string[] zipFilesToExtract = GetHugeZipFiles(); // may take a long time + int baseSize = _rnd.Next(0x1000ff) + 80000; + + _txrx = TestUtilities.StartProgressMonitor("Zip64-WinZip-Unzip", + "Zip64 WinZip unzip Huge", + "Setting up..."); + + string extractDir = "extract"; + Directory.SetCurrentDirectory(TopLevelDir); + Directory.CreateDirectory(extractDir); + + _txrx.Send("pb 0 max " + zipFilesToExtract.Length); + + for (int k=0; k < zipFilesToExtract.Length; k++) + { + string zipFileToExtract = zipFilesToExtract[k]; + Assert.IsTrue(File.Exists(zipFileToExtract), + "required ZIP file does not exist ({0})", + zipFileToExtract); + + System.Threading.Thread.Sleep(120); + _txrx.Send("pb 1 max 3"); + System.Threading.Thread.Sleep(120); + _txrx.Send("pb 1 value 0"); + + // make sure the zip is larger than the 4.2gb size + FileInfo fi = new FileInfo(zipFileToExtract); + Assert.IsTrue(fi.Length > (long)System.UInt32.MaxValue, + "The zip file ({0}) is not large enough.", + zipFileToExtract); + + _txrx.Send("pb 1 step"); + _txrx.Send("status Counting entries in the zip file..."); + + int numEntries = TestUtilities.CountEntries(zipFileToExtract); + + _txrx.Send("status Using WinZip to list the entries..."); + + // Examine and unpack the zip archive via WinZip + // first, examine the zip entry metadata: + string wzzipOut = this.Exec(wzzip, "-vt " + zipFileToExtract); + TestContext.WriteLine(wzzipOut); + + int x = 0; + int y = 0; + int wzzipEntryCount=0; + string textToLookFor= "Filename: "; + TestContext.WriteLine("================"); + TestContext.WriteLine("Files listed by WinZip:"); + while (true) + { + x = wzzipOut.IndexOf(textToLookFor, y); + if (x < 0) break; + y = wzzipOut.IndexOf("\n", x); + string name = wzzipOut.Substring(x + textToLookFor.Length, y-x-1).Trim(); + TestContext.WriteLine(" {0}", name); + if (!name.EndsWith("\\")) + { + wzzipEntryCount++; + if (wzzipEntryCount > numEntries * 3) throw new Exception("too many entries!"); + } + } + + TestContext.WriteLine("================"); + Assert.AreEqual(numEntries, wzzipEntryCount, + "Unexpected number of entries found by WinZip."); + + _txrx.Send("pb 1 step"); + System.Threading.Thread.Sleep(120); + + _txrx.Send(String.Format("pb 1 max {0}", numEntries*2)); + x=0; y = 0; + _txrx.Send("status Extracting the entries..."); + int nCycles = 0; + while (true) + { + _txrx.Send("test Zip64 WinZip unzip - " + + Path.GetFileName(zipFileToExtract)); + x = wzzipOut.IndexOf(textToLookFor, y); + if (x < 0) break; + if (nCycles > numEntries * 4) throw new Exception("too many entries?"); + y = wzzipOut.IndexOf("\n", x); + string name = wzzipOut.Substring(x + textToLookFor.Length, y-x-1).Trim(); + if (!name.EndsWith("\\")) + { + nCycles++; + _txrx.Send(String.Format("status Extracting {1}/{2} :: {0}", name, nCycles, wzzipEntryCount)); + this.Exec(wzunzip, + String.Format("-d {0} {1}\\ \"{2}\"", + Path.GetFileName(zipFileToExtract), + extractDir, name)); + string path = Path.Combine(extractDir, name); + _txrx.Send("pb 1 step"); + Assert.IsTrue(File.Exists(path), "extracted file ({0}) does not exist", path); + File.Delete(path); + System.Threading.Thread.Sleep(120); + _txrx.Send("pb 1 step"); + } + } + + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + } + } + + + + + private void CreateLargeFiles(int numFilesToAdd, int baseSize, string dir) + { + bool firstFileDone = false; + string fileName = ""; + long fileSize = 0; + + _txrx.Send(String.Format("pb 1 max {0}", numFilesToAdd)); + + Action progressUpdate = (x) => + { + _txrx.Send(String.Format("pb 2 value {0}", x)); + _txrx.Send(String.Format("status Creating {0}, [{1}/{2}] ({3:N0}%)", + fileName, x, fileSize, ((double)x)/ (0.01 * fileSize) )); + }; + + // It takes some time to create a large file. And we need + // a bunch of them. + for (int i = 0; i < numFilesToAdd; i++) + { + // randomly select binary or text + int n = _rnd.Next(2); + fileName = string.Format("Pippo{0}.{1}", i, (n==0) ? "bin" : "txt" ); + if (i != 0) + { + int x = _rnd.Next(6); + if (x != 0) + { + string folderName = string.Format("folder{0}", x); + fileName = Path.Combine(folderName, fileName); + if (!Directory.Exists(Path.Combine(dir, folderName))) + Directory.CreateDirectory(Path.Combine(dir, folderName)); + } + } + fileName = Path.Combine(dir, fileName); + // first file is 2x larger + fileSize = (firstFileDone) ? (baseSize + _rnd.Next(0x880000)) : (2*baseSize); + _txrx.Send(String.Format("pb 2 max {0}", fileSize)); + if (n==0) + TestUtilities.CreateAndFillFileBinary(fileName, fileSize, progressUpdate); + else + TestUtilities.CreateAndFillFileText(fileName, fileSize, progressUpdate); + firstFileDone = true; + _txrx.Send("pb 1 step"); + } + } + + + + [Timeout((int)(4 * 60*60*1000)), TestMethod] // 60*60*1000 == 1 hr + public void Zip64_Winzip_Zip_Huge() + { + // This TestMethod tests if DNZ can read a huge (>4.2gb) zip64 file + // created by winzip. + int baseSize = _rnd.Next(80000) + 0x1000ff; + _txrx = TestUtilities.StartProgressMonitor("Zip64-WinZip-Zip-Huge", + "Zip64_Winzip_Zip_Huge()", + "Creating links"); + string contentDir = "fodder"; + //Directory.SetCurrentDirectory(TopLevelDir); + Directory.CreateDirectory(contentDir); + + _txrx.Send("pb 0 max 5"); + + if (CreateLinksToLargeFiles(contentDir)) + return; + + TestContext.WriteLine("Creating large files..." + + DateTime.Now.ToString("G")); + + CreateLargeFiles(_rnd.Next(4) + 4, baseSize, contentDir); + _txrx.Send("pb 0 step"); + + TestContext.WriteLine("Creating a new Zip with winzip - " + + DateTime.Now.ToString("G")); + + var fileList = Directory.GetFiles(contentDir, "*.*", SearchOption.AllDirectories); + + // create a zip archive via WinZip + string wzzipOut= null; + string zipFileToCreate = "Zip64-WinZip-Zip-Huge.zip"; + int nCycles= 0; + _txrx.Send(String.Format("pb 1 max {0}", fileList.Length)); + System.Threading.Thread.Sleep(120); + _txrx.Send("pb 2 value 0"); + + // Add one file at a time, invoking wzzip.exe for each. After it + // completes, delete the just-added file. This allows coarse-grained + // status updates in the progress window. Not sure about the exact + // impact on disk space, or execution time; my observation is that the + // time-cost to add one entry increases, as the zip file gets + // larger. Each successive cycle takes a little longer. It's tolerable + // I guess. A tradeoff to get visual progress feedback. + foreach (var filename in fileList) + { + nCycles++; + _txrx.Send(String.Format("status wzzip.exe adding {0}...({1}/{2})", filename, nCycles, fileList.Length+1)); + wzzipOut = this.Exec(wzzip, String.Format("-a -p -r -yx \"{0}\" \"{1}\"", + zipFileToCreate, + filename)); + TestContext.WriteLine(wzzipOut); + _txrx.Send("pb 1 step"); + System.Threading.Thread.Sleep(420); + File.Delete(filename); + } + + // Create one additional small text file and add it to the zip. For + // this test, it must be added last, at the end of the ZIP file. + TestContext.WriteLine("Inserting one additional file with wzzip.exe - " + + DateTime.Now.ToString("G")); + nCycles++; + var newfile = Path.Combine(contentDir, "zzz-" + Path.GetRandomFileName() + ".txt"); + _txrx.Send(String.Format("status adding {0}...({1}/{2})", newfile, nCycles, fileList.Length+1)); + int filesize = _rnd.Next(50000) + 440000; + TestUtilities.CreateAndFillFileText(newfile, filesize); + wzzipOut = this.Exec(wzzip, String.Format("-a -p -r -yx \"{0}\" \"{1}\"", zipFileToCreate, newfile)); + TestContext.WriteLine(wzzipOut); + _txrx.Send("pb 1 step"); + System.Threading.Thread.Sleep(120); + File.Delete(newfile); + + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + + // make sure the zip is larger than the 4.2gb size + FileInfo fi = new FileInfo(zipFileToCreate); + Assert.IsTrue(fi.Length > (long)System.UInt32.MaxValue, + "The zip file ({0}) is not large enough.", + zipFileToCreate); + + // Now use DotNetZip to extract the large zip file to the bit bucket. + TestContext.WriteLine("Verifying the new Zip with DotNetZip - " + + DateTime.Now.ToString("G")); + _txrx.Send("status Verifying the zip"); + verb = "verifying"; + _testTitle = "Zip64 Winzip Zip Huge - final verify"; + Zip64VerifyZip(zipFileToCreate); + + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + } + + + + [TestMethod, Timeout((int)(2 * 60*60*1000))] // 60*60*1000 = 1 hr + public void Zip64_Winzip_Setup() + { + // Not really a test. This thing just sets up the big zip file. + TestContext.WriteLine("This test merely checks for existence of two large zip"); + TestContext.WriteLine("files, in a well-known place, and creates them as"); + TestContext.WriteLine("necessary. The zips are then used by other tests."); + TestContext.WriteLine(" "); + GetHugeZipFiles(); // usually takes about an hour + } + + + private void EmitStatus(String s) + { + TestContext.WriteLine("status:"); + foreach (string line in s.Split('\n')) + TestContext.WriteLine(line); + } + + + [TestMethod, Timeout(1 * 60*60*1000)] + public void Zip64_Over_4gb() + { + Int64 desiredSize= System.UInt32.MaxValue; + desiredSize+= System.Int32.MaxValue/4; + desiredSize+= _rnd.Next(0x1000000); + _testTitle = "Zip64 Create/Zip/Extract a file > 4.2gb"; + + _txrx = TestUtilities.StartProgressMonitor("Zip64-Over-4gb", + _testTitle, + "starting up..."); + + string zipFileToCreate = Path.Combine(TopLevelDir, "Zip64_Over_4gb.zip"); + Directory.SetCurrentDirectory(TopLevelDir); + string nameOfFodderFile="VeryVeryLargeFile.txt"; + string nameOfExtractedFile = nameOfFodderFile + ".extracted"; + + // Steps in this test: 4 + _txrx.Send("pb 0 max 4"); + + TestContext.WriteLine(""); + TestContext.WriteLine("Creating a large file..." + + DateTime.Now.ToString("G")); + + // create a very large file + Action progressUpdate = (x) => + { + _txrx.Send(String.Format("pb 1 value {0}", x)); + _txrx.Send(String.Format("status Creating {0}, [{1}/{2}mb] ({3:N0}%)", + nameOfFodderFile, + x/(1024*1024), + desiredSize/(1024*1024), + ((double)x)/ (0.01 * desiredSize))); + }; + + // This takes a few minutes... + _txrx.Send(String.Format("pb 1 max {0}", desiredSize)); + TestUtilities.CreateAndFillFileText(nameOfFodderFile, + desiredSize, + progressUpdate); + + // make sure it is larger than 4.2gb + FileInfo fi = new FileInfo(nameOfFodderFile); + Assert.IsTrue(fi.Length > (long)System.UInt32.MaxValue, + "The fodder file ({0}) is not large enough.", + nameOfFodderFile); + + TestContext.WriteLine(""); + TestContext.WriteLine("computing checksum..." + + DateTime.Now.ToString("G")); + _txrx.Send("status computing checksum..."); + var chk1 = TestUtilities.ComputeChecksum(nameOfFodderFile); + + _txrx.Send("pb 0 step"); + + var sw = new StringWriter(); + using (var zip = new ZipFile()) + { + zip.StatusMessageTextWriter = sw; + zip.UseZip64WhenSaving = Zip64Option.Always; + zip.BufferSize = 65536*8; // 65536 * 8 = 512k + zip.SaveProgress += Zip64SaveProgress; + var e = zip.AddFile(nameOfFodderFile, ""); + _txrx.Send("status Saving......"); + TestContext.WriteLine("zipping one file......" + + DateTime.Now.ToString("G")); + zip.Save(zipFileToCreate); + } + + EmitStatus(sw.ToString()); + + File.Delete(nameOfFodderFile); + TestContext.WriteLine(""); + TestContext.WriteLine("Extracting the zip..." + + DateTime.Now.ToString("G")); + _txrx.Send("status Extracting the file..."); + _txrx.Send("pb 0 step"); + + var options = new ReadOptions { StatusMessageWriter= new StringWriter() }; + verb = "Extracting"; + _pb1Set = false; + using (var zip = ZipFile.Read(zipFileToCreate, options)) + { + Assert.AreEqual(1, zip.Entries.Count, + "Incorrect number of entries in the zip file"); + zip.ExtractProgress += Zip64ExtractProgress; + _numFilesToExtract = zip.Entries.Count; + _numExtracted= 1; + ZipEntry e = zip[0]; + e.FileName = nameOfExtractedFile; + _txrx.Send("status extracting......"); + e.Extract(); + } + + EmitStatus(options.StatusMessageWriter.ToString()); + _txrx.Send("pb 0 step"); + System.Threading.Thread.Sleep(120); + + TestContext.WriteLine(""); + TestContext.WriteLine("computing checksum..." + + DateTime.Now.ToString("G")); + _txrx.Send("status computing checksum..."); + var chk2 = TestUtilities.ComputeChecksum(nameOfExtractedFile); + Assert.AreEqual(TestUtilities.CheckSumToString(chk1), + TestUtilities.CheckSumToString(chk2), + "Checksum mismatch"); + _txrx.Send("pb 0 step"); + } + + + [TestMethod, Timeout(1 * 60*60*1000)] + public void Z64_ManyEntries_NoEncryption_DefaultCompression_AsNecessary() + { + _Zip64_Over65534Entries(Zip64Option.AsNecessary, EncryptionAlgorithm.None, Ionic.Zlib.CompressionLevel.Default); + } + + [TestMethod, Timeout(1 * 60*60*1000)] + public void Z64_ManyEntries_PkZipEncryption_DefaultCompression_AsNecessary() + { + _Zip64_Over65534Entries(Zip64Option.AsNecessary, EncryptionAlgorithm.PkzipWeak, Ionic.Zlib.CompressionLevel.Default); + } + + [TestMethod, Timeout(2 * 60*60*1000)] + public void Z64_ManyEntries_WinZipEncryption_DefaultCompression_AsNecessary() + { + _Zip64_Over65534Entries(Zip64Option.AsNecessary, EncryptionAlgorithm.WinZipAes256, Ionic.Zlib.CompressionLevel.Default); + } + + + [TestMethod, Timeout(1 * 60*60*1000)] + public void Z64_ManyEntries_NoEncryption_DefaultCompression_Always() + { + _Zip64_Over65534Entries(Zip64Option.Always, EncryptionAlgorithm.None, Ionic.Zlib.CompressionLevel.Default); + } + + [TestMethod, Timeout(1 * 60*60*1000)] + public void Z64_ManyEntries_PkZipEncryption_DefaultCompression_Always() + { + _Zip64_Over65534Entries(Zip64Option.Always, EncryptionAlgorithm.PkzipWeak, Ionic.Zlib.CompressionLevel.Default); + } + + [TestMethod, Timeout(2 * 60*60*1000)] + public void Z64_ManyEntries_WinZipEncryption_DefaultCompression_Always() + { + _Zip64_Over65534Entries(Zip64Option.Always, EncryptionAlgorithm.WinZipAes256, Ionic.Zlib.CompressionLevel.Default); + } + + + + + [TestMethod, Timeout(30 * 60*1000)] + [ExpectedException(typeof(Ionic.Zip.ZipException))] + public void Z64_ManyEntries_NOZIP64() + { + _Zip64_Over65534Entries(Zip64Option.Never, EncryptionAlgorithm.None, Ionic.Zlib.CompressionLevel.Default); + } + + + void _Zip64_Over65534Entries(Zip64Option z64option, + EncryptionAlgorithm encryption, + Ionic.Zlib.CompressionLevel compression) + { + // Emitting a zip file with > 65534 entries requires the use of ZIP64 in + // the central directory. + int numTotalEntries = _rnd.Next(4616)+65534; + //int numTotalEntries = _rnd.Next(461)+6534; + //int numTotalEntries = _rnd.Next(46)+653; + string enc = encryption.ToString(); + if (enc.StartsWith("WinZip")) enc = enc.Substring(6); + else if (enc.StartsWith("Pkzip")) enc = enc.Substring(0,5); + string zipFileToCreate = String.Format("Zip64.ZF_Over65534.{0}.{1}.{2}.zip", + z64option.ToString(), + enc, + compression.ToString()); + + _testTitle = String.Format("ZipFile #{0} 64({1}) E({2}), C({3})", + numTotalEntries, + z64option.ToString(), + enc, + compression.ToString()); + _txrx = TestUtilities.StartProgressMonitor(zipFileToCreate, + _testTitle, + "starting up..."); + + _txrx.Send("pb 0 max 4"); // 3 stages: AddEntry, Save, Verify + _txrx.Send("pb 0 value 0"); + + string password = Path.GetRandomFileName(); + + string statusString = String.Format("status Encrypt:{0} Compress:{1}...", + enc, + compression.ToString()); + + int numSaved = 0; + var saveProgress = new EventHandler( (sender, e) => { + switch (e.EventType) + { + case ZipProgressEventType.Saving_Started: + _txrx.Send("status saving..."); + _txrx.Send("pb 1 max " + numTotalEntries); + numSaved= 0; + break; + + case ZipProgressEventType.Saving_AfterWriteEntry: + numSaved++; + if ((numSaved % 128) == 0) + { + _txrx.Send("pb 1 value " + numSaved); + _txrx.Send(String.Format("status Saving entry {0}/{1} ({2:N0}%)", + numSaved, numTotalEntries, + numSaved / (0.01 * numTotalEntries) + )); + } + break; + + case ZipProgressEventType.Saving_Completed: + _txrx.Send("status Save completed"); + _txrx.Send("pb 1 max 1"); + _txrx.Send("pb 1 value 1"); + break; + } + }); + + string contentFormatString = + "This is the content for entry #{0}.\r\n\r\n" + + "AAAAAAA BBBBBB AAAAA BBBBB AAAAA BBBBB AAAAA\r\n"+ + "AAAAAAA BBBBBB AAAAA BBBBB AAAAA BBBBB AAAAA\r\n"; + _txrx.Send(statusString); + int dirCount= 0; + using (var zip = new ZipFile()) + { + _txrx.Send(String.Format("pb 1 max {0}", numTotalEntries)); + _txrx.Send("pb 1 value 0"); + + zip.Password = password; + zip.Encryption = encryption; + zip.CompressionLevel = compression; + zip.SaveProgress += saveProgress; + zip.UseZip64WhenSaving = z64option; + // save space when saving the file: + zip.EmitTimesInWindowsFormatWhenSaving = false; + zip.EmitTimesInUnixFormatWhenSaving = false; + + // add files: + for (int m=0; m(numTotalEntries-dirCount, + TestUtilities.CountEntries(zipFileToCreate)); + _txrx.Send("pb 0 step"); + } + + + + [Timeout(3 * 60*60*1000), TestMethod] // 60*60*1000 = 1 hr + public void Zip64_UpdateEntryComment_wi9214_WZ() + { + // Should take 2.5 hrs when creating the huge files, about 1 hr when the + // files already exist. + string[] zipFilesToUpdate = GetHugeZipFiles(); + Assert.IsTrue(File.Exists(zipFilesToUpdate[0]), + "The required ZIP file does not exist ({0})", + zipFilesToUpdate[0]); + Z64UpdateHugeZipWithComment(zipFilesToUpdate[0], "WinZip"); + } + + [Timeout(3 * 60*60*1000), TestMethod] // 60*60*1000 = 1 hr + public void Zip64_UpdateEntryComment_wi9214_DNZ() + { + // Should take 2.5 hrs when creating the huge files, about 1 hr when the + // files already exist. + string[] zipFilesToUpdate = GetHugeZipFiles(); + Assert.IsTrue(File.Exists(zipFilesToUpdate[1]), + "The required ZIP file does not exist ({0})", + zipFilesToUpdate[1]); + Z64UpdateHugeZipWithComment(zipFilesToUpdate[1], "DNZ"); + } + + + void Z64UpdateHugeZipWithComment(string zipFileToUpdate, string marker) + { + // Test whether opening a huge zip64 file and then re-saving, allows the + // file to remain valid. Must use a huge zip64 file over 4gb in order + // to verify this, and at least one entry must be > 4gb uncompressed. + // Want to check that UseZip64WhenSaving is automatically selected as + // appropriate. + string zipFileToCreate = "update-huge-zip.zip"; + + string newComment = "This is an updated comment on the first entry"+ + "in the zip that is larger than 4gb. (" + + DateTime.Now.ToString("u") +")"; + + // start the progress monitor + _txrx = TestUtilities.StartProgressMonitor("Zip64-update", + "Zip64 update", + "Checking file..."); + + // make sure the zip is larger than the 4.2gb size + FileInfo fi = new FileInfo(zipFileToUpdate); + Assert.IsTrue(fi.Length > (long)System.UInt32.MaxValue, + "The zip file ({0}) is not large enough.", + zipFileToUpdate); + TestContext.WriteLine("Verifying the zip file..." + + DateTime.Now.ToString("G")); + System.Threading.Thread.Sleep(220); + _txrx.Send("status Verifying the zip"); + System.Threading.Thread.Sleep(220); + _txrx.Send("title Zip64 Update Entry Comment wi9214"); + + // According to workitem 9214, the comment must be modified + // on an entry that is larger than 4gb (uncompressed). + // Check that here. + using (ZipFile zip = ZipFile.Read(zipFileToUpdate)) + { + ZipEntry bigEntry = null; + foreach (var e2 in zip) + { + if (e2.UncompressedSize > (long)System.UInt32.MaxValue) + { + bigEntry = e2; + break; + } + } + Assert.IsTrue(bigEntry != null && + bigEntry.UncompressedSize > (long)System.UInt32.MaxValue, + "Minimum size constraint not met."); + } + + // Verify the zip is correct, can be extracted. + // This will take some time for a large zip. + // (+1 to _numFilesToExtract for the directory) + _numFilesToExtract = TestUtilities.CountEntries(zipFileToUpdate) + 1; + _numExtracted= 1; + verb = "extract"; + _pb1Set = false; + + // _testTitle is used in Zip64{Save,Extract}Progress + _testTitle = "Zip64 Update Entry Comment - " + marker; + + var extract1 = BasicVerifyZip(zipFileToUpdate, null, false, Zip64ExtractProgress); + + _txrx.Send("status removing the extract directory..."); + Directory.Delete(extract1, true); + + TestContext.WriteLine("Updating the zip file..." + + DateTime.Now.ToString("G")); + _txrx.Send("status Updating the zip file..."); + + // update the zip with one small change: a new comment on + // the biggest entry. + var sw = new StringWriter(); + using (ZipFile zip = ZipFile.Read(zipFileToUpdate)) + { + // required: the option must be set automatically and intelligently + Assert.IsTrue(zip.UseZip64WhenSaving == Zip64Option.Always, + "The UseZip64WhenSaving option is set incorrectly ({0})", + zip.UseZip64WhenSaving); + + // according to workitem 9214, the comment must be modified + // on an entry that is larger than 4gb (uncompressed) + ZipEntry bigEntry = null; + foreach (var e2 in zip) + { + if (e2.UncompressedSize > (long)System.UInt32.MaxValue) + { + bigEntry = e2; + break; + } + } + // redundant with the check above, but so what? + Assert.IsTrue(bigEntry != null && + bigEntry.UncompressedSize > (long)System.UInt32.MaxValue, + "Minimum size constraint not met."); + + bigEntry.Comment = newComment; + zip.SaveProgress += Zip64SaveProgress; + zip.StatusMessageTextWriter = sw; + zip.Save(zipFileToCreate); + } + string status = sw.ToString(); + if (status != null && status != "") + { + var lines = status.Split('\n'); + TestContext.WriteLine("status: (" + + DateTime.Now.ToString("G") + ")"); + foreach (string line in lines) + TestContext.WriteLine(line); + } + + TestContext.WriteLine("Verifying the updated zip... " + + DateTime.Now.ToString("G")); + _txrx.Send("status Verifying the updated zip"); + Zip64VerifyZip(zipFileToCreate); // can take an hour or more + + // finally, verify that the modified comment is correct. + _txrx.Send("status checking the updated comment"); + using (ZipFile zip = ZipFile.Read(zipFileToCreate)) + { + // check that the z64 option is set automatically and intelligently + Assert.IsTrue(zip.UseZip64WhenSaving == Zip64Option.Always, + "The UseZip64WhenSaving option is set incorrectly ({0})", + zip.UseZip64WhenSaving); + + ZipEntry e = null; + foreach (var e2 in zip) + { + if (e2.UncompressedSize > (long)System.UInt32.MaxValue) + { + e = e2; + break; + } + } + Assert.IsTrue(e != null && e.UncompressedSize > (long)System.UInt32.MaxValue, + "No entry in the zip file is large enough."); + Assert.AreEqual(newComment, e.Comment, "The comment on the entry is unexpected."); + TestContext.WriteLine("The comment on the entry is {0}", e.Comment); + } + TestContext.WriteLine("All done... " + + DateTime.Now.ToString("G")); + } + + + + } + +} diff --git a/dotNetZip/Zip Tests/zips/Book1.xlsx b/dotNetZip/Zip Tests/zips/Book1.xlsx new file mode 100644 index 0000000..05986c6 Binary files /dev/null and b/dotNetZip/Zip Tests/zips/Book1.xlsx differ diff --git a/dotNetZip/Zip Tests/zips/Calendar.apk b/dotNetZip/Zip Tests/zips/Calendar.apk new file mode 100644 index 0000000..407cd65 Binary files /dev/null and b/dotNetZip/Zip Tests/zips/Calendar.apk differ diff --git a/dotNetZip/Zip Tests/zips/Vanishing Oatmeal Cookies.docx b/dotNetZip/Zip Tests/zips/Vanishing Oatmeal Cookies.docx new file mode 100644 index 0000000..7fc21dc Binary files /dev/null and b/dotNetZip/Zip Tests/zips/Vanishing Oatmeal Cookies.docx differ diff --git a/dotNetZip/Zip Tests/zips/appnote-iz-latest.zip b/dotNetZip/Zip Tests/zips/appnote-iz-latest.zip new file mode 100644 index 0000000..0453a3e Binary files /dev/null and b/dotNetZip/Zip Tests/zips/appnote-iz-latest.zip differ diff --git a/dotNetZip/Zip Tests/zips/plot.dwf b/dotNetZip/Zip Tests/zips/plot.dwf new file mode 100644 index 0000000..7d4b958 Binary files /dev/null and b/dotNetZip/Zip Tests/zips/plot.dwf differ diff --git a/dotNetZip/Zip Tests/zips/wi10330-badzip.zip b/dotNetZip/Zip Tests/zips/wi10330-badzip.zip new file mode 100644 index 0000000..4fb412f Binary files /dev/null and b/dotNetZip/Zip Tests/zips/wi10330-badzip.zip differ diff --git a/dotNetZip/Zip Tests/zips/wi11056.dwf b/dotNetZip/Zip Tests/zips/wi11056.dwf new file mode 100644 index 0000000..3da296a Binary files /dev/null and b/dotNetZip/Zip Tests/zips/wi11056.dwf differ diff --git a/dotNetZip/Zip Tests/zips/wi13668-bad-pwd-472713.zip b/dotNetZip/Zip Tests/zips/wi13668-bad-pwd-472713.zip new file mode 100644 index 0000000..1625380 Binary files /dev/null and b/dotNetZip/Zip Tests/zips/wi13668-bad-pwd-472713.zip differ diff --git a/dotNetZip/Zip Tests/zips/wi13892.zip b/dotNetZip/Zip Tests/zips/wi13892.zip new file mode 100644 index 0000000..a79b792 Binary files /dev/null and b/dotNetZip/Zip Tests/zips/wi13892.zip differ diff --git a/dotNetZip/Zip Tests/zips/winzip-sfx.exe b/dotNetZip/Zip Tests/zips/winzip-sfx.exe new file mode 100644 index 0000000..7563916 Binary files /dev/null and b/dotNetZip/Zip Tests/zips/winzip-sfx.exe differ diff --git a/dotNetZip/Zip/ComHelper.cs b/dotNetZip/Zip/ComHelper.cs new file mode 100644 index 0000000..385cef2 --- /dev/null +++ b/dotNetZip/Zip/ComHelper.cs @@ -0,0 +1,116 @@ +// ComHelper.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-June-13 17:04:06> +// +// ------------------------------------------------------------------ +// +// This module defines a COM Helper class. +// +// Created: Tue, 08 Sep 2009 22:03 +// + +using Interop=System.Runtime.InteropServices; + +namespace Ionic.Zip +{ + /// + /// This class exposes a set of COM-accessible wrappers for static + /// methods available on the ZipFile class. You don't need this + /// class unless you are using DotNetZip from a COM environment. + /// + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000F")] + [System.Runtime.InteropServices.ComVisible(true)] +#if !NETCF + [System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)] +#endif + + public class ComHelper + { + /// + /// A wrapper for ZipFile.IsZipFile(string) + /// + /// The filename to of the zip file to check. + /// true if the file contains a valid zip file. + public bool IsZipFile(string filename) + { + return ZipFile.IsZipFile(filename); + } + + /// + /// A wrapper for ZipFile.IsZipFile(string, bool) + /// + /// + /// We cannot use "overloaded" Method names in COM interop. + /// So, here, we use a unique name. + /// + /// The filename to of the zip file to check. + /// true if the file contains a valid zip file. + public bool IsZipFileWithExtract(string filename) + { + return ZipFile.IsZipFile(filename, true); + } + +#if !NETCF + /// + /// A wrapper for ZipFile.CheckZip(string) + /// + /// The filename to of the zip file to check. + /// + /// true if the named zip file checks OK. Otherwise, false. + public bool CheckZip(string filename) + { + return ZipFile.CheckZip(filename); + } + + /// + /// A COM-friendly wrapper for the static method . + /// + /// + /// The filename to of the zip file to check. + /// + /// The password to check. + /// + /// true if the named zip file checks OK. Otherwise, false. + public bool CheckZipPassword(string filename, string password) + { + return ZipFile.CheckZipPassword(filename, password); + } + + /// + /// A wrapper for ZipFile.FixZipDirectory(string) + /// + /// The filename to of the zip file to fix. + public void FixZipDirectory(string filename) + { + ZipFile.FixZipDirectory(filename); + } +#endif + + /// + /// A wrapper for ZipFile.LibraryVersion + /// + /// + /// the version number on the DotNetZip assembly, formatted as a string. + /// + public string GetZipLibraryVersion() + { + return ZipFile.LibraryVersion.ToString(); + } + + } +} \ No newline at end of file diff --git a/dotNetZip/Zip/EncryptionAlgorithm.cs b/dotNetZip/Zip/EncryptionAlgorithm.cs new file mode 100644 index 0000000..66b4f40 --- /dev/null +++ b/dotNetZip/Zip/EncryptionAlgorithm.cs @@ -0,0 +1,135 @@ +// EncryptionAlgorithm.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-October-21 17:24:45> +// +// ------------------------------------------------------------------ +// +// This module defines the EncryptionAgorithm enum +// +// +// ------------------------------------------------------------------ + + +namespace Ionic.Zip +{ + /// + /// An enum that provides the various encryption algorithms supported by this + /// library. + /// + /// + /// + /// + /// + /// PkzipWeak implies the use of Zip 2.0 encryption, which is known to be + /// weak and subvertible. + /// + /// + /// + /// A note on interoperability: Values of PkzipWeak and None are + /// specified in PKWARE's zip + /// specification, and are considered to be "standard". Zip archives + /// produced using these options will be interoperable with many other zip tools + /// and libraries, including Windows Explorer. + /// + /// + /// + /// Values of WinZipAes128 and WinZipAes256 are not part of the Zip + /// specification, but rather imply the use of a vendor-specific extension from + /// WinZip. If you want to produce interoperable Zip archives, do not use these + /// values. For example, if you produce a zip archive using WinZipAes256, you + /// will be able to open it in Windows Explorer on Windows XP and Vista, but you + /// will not be able to extract entries; trying this will lead to an "unspecified + /// error". For this reason, some people have said that a zip archive that uses + /// WinZip's AES encryption is not actually a zip archive at all. A zip archive + /// produced this way will be readable with the WinZip tool (Version 11 and + /// beyond). + /// + /// + /// + /// There are other third-party tools and libraries, both commercial and + /// otherwise, that support WinZip's AES encryption. These will be able to read + /// AES-encrypted zip archives produced by DotNetZip, and conversely applications + /// that use DotNetZip to read zip archives will be able to read AES-encrypted + /// archives produced by those tools or libraries. Consult the documentation for + /// those other tools and libraries to find out if WinZip's AES encryption is + /// supported. + /// + /// + /// + /// In case you care: According to the WinZip specification, the + /// actual AES key used is derived from the via an + /// algorithm that complies with RFC 2898, using an iteration + /// count of 1000. The algorithm is sometimes referred to as PBKDF2, which stands + /// for "Password Based Key Derivation Function #2". + /// + /// + /// + /// A word about password strength and length: The AES encryption technology is + /// very good, but any system is only as secure as the weakest link. If you want + /// to secure your data, be sure to use a password that is hard to guess. To make + /// it harder to guess (increase its "entropy"), you should make it longer. If + /// you use normal characters from an ASCII keyboard, a password of length 20 will + /// be strong enough that it will be impossible to guess. For more information on + /// that, I'd encourage you to read this + /// article. + /// + /// + /// + /// The WinZip AES algorithms are not supported with the version of DotNetZip that + /// runs on the .NET Compact Framework. This is because .NET CF lacks the + /// HMACSHA1 class that is required for producing the archive. + /// + /// + public enum EncryptionAlgorithm + { + /// + /// No encryption at all. + /// + None = 0, + + /// + /// Traditional or Classic pkzip encryption. + /// + PkzipWeak, + +#if AESCRYPTO + /// + /// WinZip AES encryption (128 key bits). + /// + WinZipAes128, + + /// + /// WinZip AES encryption (256 key bits). + /// + WinZipAes256, +#endif + + /// + /// An encryption algorithm that is not supported by DotNetZip. + /// + Unsupported = 4, + + + // others... not implemented (yet?) + } + +} diff --git a/dotNetZip/Zip/Events.cs b/dotNetZip/Zip/Events.cs new file mode 100644 index 0000000..e51ff78 --- /dev/null +++ b/dotNetZip/Zip/Events.cs @@ -0,0 +1,684 @@ +// Events.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2006, 2007, 2008, 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 12:26:24> +// +// ------------------------------------------------------------------ +// +// This module defines events used by the ZipFile class. +// +// + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ionic.Zip +{ + /// + /// Delegate in which the application writes the ZipEntry content for the named entry. + /// + /// + /// The name of the entry that must be written. + /// The stream to which the entry data should be written. + /// + /// + /// When you add an entry and specify a WriteDelegate, via , the application + /// code provides the logic that writes the entry data directly into the zip file. + /// + /// + /// + /// + /// This example shows how to define a WriteDelegate that obtains a DataSet, and then + /// writes the XML for the DataSet into the zip archive. There's no need to + /// save the XML to a disk file first. + /// + /// + /// private void WriteEntry (String filename, Stream output) + /// { + /// DataSet ds1 = ObtainDataSet(); + /// ds1.WriteXml(output); + /// } + /// + /// private void Run() + /// { + /// using (var zip = new ZipFile()) + /// { + /// zip.AddEntry(zipEntryName, WriteEntry); + /// zip.Save(zipFileName); + /// } + /// } + /// + /// + /// + /// Private Sub WriteEntry (ByVal filename As String, ByVal output As Stream) + /// DataSet ds1 = ObtainDataSet() + /// ds1.WriteXml(stream) + /// End Sub + /// + /// Public Sub Run() + /// Using zip = New ZipFile + /// zip.AddEntry(zipEntryName, New WriteDelegate(AddressOf WriteEntry)) + /// zip.Save(zipFileName) + /// End Using + /// End Sub + /// + /// + /// + public delegate void WriteDelegate(string entryName, System.IO.Stream stream); + + + /// + /// Delegate in which the application opens the stream, just-in-time, for the named entry. + /// + /// + /// + /// The name of the ZipEntry that the application should open the stream for. + /// + /// + /// + /// When you add an entry via , the application code provides the logic that + /// opens and closes the stream for the given ZipEntry. + /// + /// + /// + public delegate System.IO.Stream OpenDelegate(string entryName); + + /// + /// Delegate in which the application closes the stream, just-in-time, for the named entry. + /// + /// + /// + /// The name of the ZipEntry that the application should close the stream for. + /// + /// + /// The stream to be closed. + /// + /// + /// When you add an entry via , the application code provides the logic that + /// opens and closes the stream for the given ZipEntry. + /// + /// + /// + public delegate void CloseDelegate(string entryName, System.IO.Stream stream); + + /// + /// Delegate for the callback by which the application tells the + /// library the CompressionLevel to use for a file. + /// + /// + /// + /// + /// Using this callback, the application can, for example, specify that + /// previously-compressed files (.mp3, .png, .docx, etc) should use a + /// CompressionLevel of None, or can set the compression level based + /// on any other factor. + /// + /// + /// + public delegate Ionic.Zlib.CompressionLevel SetCompressionCallback(string localFileName, string fileNameInArchive); + + /// + /// In an EventArgs type, indicates which sort of progress event is being + /// reported. + /// + /// + /// There are events for reading, events for saving, and events for + /// extracting. This enumeration allows a single EventArgs type to be sued to + /// describe one of multiple subevents. For example, a SaveProgress event is + /// invoked before, after, and during the saving of a single entry. The value + /// of an enum with this type, specifies which event is being triggered. The + /// same applies to Extraction, Reading and Adding events. + /// + public enum ZipProgressEventType + { + /// + /// Indicates that a Add() operation has started. + /// + Adding_Started, + + /// + /// Indicates that an individual entry in the archive has been added. + /// + Adding_AfterAddEntry, + + /// + /// Indicates that a Add() operation has completed. + /// + Adding_Completed, + + /// + /// Indicates that a Read() operation has started. + /// + Reading_Started, + + /// + /// Indicates that an individual entry in the archive is about to be read. + /// + Reading_BeforeReadEntry, + + /// + /// Indicates that an individual entry in the archive has just been read. + /// + Reading_AfterReadEntry, + + /// + /// Indicates that a Read() operation has completed. + /// + Reading_Completed, + + /// + /// The given event reports the number of bytes read so far + /// during a Read() operation. + /// + Reading_ArchiveBytesRead, + + /// + /// Indicates that a Save() operation has started. + /// + Saving_Started, + + /// + /// Indicates that an individual entry in the archive is about to be written. + /// + Saving_BeforeWriteEntry, + + /// + /// Indicates that an individual entry in the archive has just been saved. + /// + Saving_AfterWriteEntry, + + /// + /// Indicates that a Save() operation has completed. + /// + Saving_Completed, + + /// + /// Indicates that the zip archive has been created in a + /// temporary location during a Save() operation. + /// + Saving_AfterSaveTempArchive, + + /// + /// Indicates that the temporary file is about to be renamed to the final archive + /// name during a Save() operation. + /// + Saving_BeforeRenameTempArchive, + + /// + /// Indicates that the temporary file is has just been renamed to the final archive + /// name during a Save() operation. + /// + Saving_AfterRenameTempArchive, + + /// + /// Indicates that the self-extracting archive has been compiled + /// during a Save() operation. + /// + Saving_AfterCompileSelfExtractor, + + /// + /// The given event is reporting the number of source bytes that have run through the compressor so far + /// during a Save() operation. + /// + Saving_EntryBytesRead, + + /// + /// Indicates that an entry is about to be extracted. + /// + Extracting_BeforeExtractEntry, + + /// + /// Indicates that an entry has just been extracted. + /// + Extracting_AfterExtractEntry, + + /// + /// Indicates that extraction of an entry would overwrite an existing + /// filesystem file. You must use + /// + /// ExtractExistingFileAction.InvokeExtractProgressEvent in the call + /// to ZipEntry.Extract() in order to receive this event. + /// + Extracting_ExtractEntryWouldOverwrite, + + /// + /// The given event is reporting the number of bytes written so far for + /// the current entry during an Extract() operation. + /// + Extracting_EntryBytesWritten, + + /// + /// Indicates that an ExtractAll operation is about to begin. + /// + Extracting_BeforeExtractAll, + + /// + /// Indicates that an ExtractAll operation has completed. + /// + Extracting_AfterExtractAll, + + /// + /// Indicates that an error has occurred while saving a zip file. + /// This generally means the file cannot be opened, because it has been + /// removed, or because it is locked by another process. It can also + /// mean that the file cannot be Read, because of a range lock conflict. + /// + Error_Saving, + } + + + /// + /// Provides information about the progress of a save, read, or extract operation. + /// This is a base class; you will probably use one of the classes derived from this one. + /// + public class ZipProgressEventArgs : EventArgs + { + private int _entriesTotal; + private bool _cancel; + private ZipEntry _latestEntry; + private ZipProgressEventType _flavor; + private String _archiveName; + private Int64 _bytesTransferred; + private Int64 _totalBytesToTransfer; + + + internal ZipProgressEventArgs() { } + + internal ZipProgressEventArgs(string archiveName, ZipProgressEventType flavor) + { + this._archiveName = archiveName; + this._flavor = flavor; + } + + /// + /// The total number of entries to be saved or extracted. + /// + public int EntriesTotal + { + get { return _entriesTotal; } + set { _entriesTotal = value; } + } + + /// + /// The name of the last entry saved or extracted. + /// + public ZipEntry CurrentEntry + { + get { return _latestEntry; } + set { _latestEntry = value; } + } + + /// + /// In an event handler, set this to cancel the save or extract + /// operation that is in progress. + /// + public bool Cancel + { + get { return _cancel; } + set { _cancel = _cancel || value; } + } + + /// + /// The type of event being reported. + /// + public ZipProgressEventType EventType + { + get { return _flavor; } + set { _flavor = value; } + } + + /// + /// Returns the archive name associated to this event. + /// + public String ArchiveName + { + get { return _archiveName; } + set { _archiveName = value; } + } + + + /// + /// The number of bytes read or written so far for this entry. + /// + public Int64 BytesTransferred + { + get { return _bytesTransferred; } + set { _bytesTransferred = value; } + } + + + + /// + /// Total number of bytes that will be read or written for this entry. + /// This number will be -1 if the value cannot be determined. + /// + public Int64 TotalBytesToTransfer + { + get { return _totalBytesToTransfer; } + set { _totalBytesToTransfer = value; } + } + } + + + + /// + /// Provides information about the progress of a Read operation. + /// + public class ReadProgressEventArgs : ZipProgressEventArgs + { + + internal ReadProgressEventArgs() { } + + private ReadProgressEventArgs(string archiveName, ZipProgressEventType flavor) + : base(archiveName, flavor) + { } + + internal static ReadProgressEventArgs Before(string archiveName, int entriesTotal) + { + var x = new ReadProgressEventArgs(archiveName, ZipProgressEventType.Reading_BeforeReadEntry); + x.EntriesTotal = entriesTotal; + return x; + } + + internal static ReadProgressEventArgs After(string archiveName, ZipEntry entry, int entriesTotal) + { + var x = new ReadProgressEventArgs(archiveName, ZipProgressEventType.Reading_AfterReadEntry); + x.EntriesTotal = entriesTotal; + x.CurrentEntry = entry; + return x; + } + + internal static ReadProgressEventArgs Started(string archiveName) + { + var x = new ReadProgressEventArgs(archiveName, ZipProgressEventType.Reading_Started); + return x; + } + + internal static ReadProgressEventArgs ByteUpdate(string archiveName, ZipEntry entry, Int64 bytesXferred, Int64 totalBytes) + { + var x = new ReadProgressEventArgs(archiveName, ZipProgressEventType.Reading_ArchiveBytesRead); + x.CurrentEntry = entry; + x.BytesTransferred = bytesXferred; + x.TotalBytesToTransfer = totalBytes; + return x; + } + + internal static ReadProgressEventArgs Completed(string archiveName) + { + var x = new ReadProgressEventArgs(archiveName, ZipProgressEventType.Reading_Completed); + return x; + } + + } + + + /// + /// Provides information about the progress of a Add operation. + /// + public class AddProgressEventArgs : ZipProgressEventArgs + { + internal AddProgressEventArgs() { } + + private AddProgressEventArgs(string archiveName, ZipProgressEventType flavor) + : base(archiveName, flavor) + { } + + internal static AddProgressEventArgs AfterEntry(string archiveName, ZipEntry entry, int entriesTotal) + { + var x = new AddProgressEventArgs(archiveName, ZipProgressEventType.Adding_AfterAddEntry); + x.EntriesTotal = entriesTotal; + x.CurrentEntry = entry; + return x; + } + + internal static AddProgressEventArgs Started(string archiveName) + { + var x = new AddProgressEventArgs(archiveName, ZipProgressEventType.Adding_Started); + return x; + } + + internal static AddProgressEventArgs Completed(string archiveName) + { + var x = new AddProgressEventArgs(archiveName, ZipProgressEventType.Adding_Completed); + return x; + } + + } + + /// + /// Provides information about the progress of a save operation. + /// + public class SaveProgressEventArgs : ZipProgressEventArgs + { + private int _entriesSaved; + + /// + /// Constructor for the SaveProgressEventArgs. + /// + /// the name of the zip archive. + /// whether this is before saving the entry, or after + /// The total number of entries in the zip archive. + /// Number of entries that have been saved. + /// The entry involved in the event. + internal SaveProgressEventArgs(string archiveName, bool before, int entriesTotal, int entriesSaved, ZipEntry entry) + : base(archiveName, (before) ? ZipProgressEventType.Saving_BeforeWriteEntry : ZipProgressEventType.Saving_AfterWriteEntry) + { + this.EntriesTotal = entriesTotal; + this.CurrentEntry = entry; + this._entriesSaved = entriesSaved; + } + + internal SaveProgressEventArgs() { } + + internal SaveProgressEventArgs(string archiveName, ZipProgressEventType flavor) + : base(archiveName, flavor) + { } + + + internal static SaveProgressEventArgs ByteUpdate(string archiveName, ZipEntry entry, Int64 bytesXferred, Int64 totalBytes) + { + var x = new SaveProgressEventArgs(archiveName, ZipProgressEventType.Saving_EntryBytesRead); + x.ArchiveName = archiveName; + x.CurrentEntry = entry; + x.BytesTransferred = bytesXferred; + x.TotalBytesToTransfer = totalBytes; + return x; + } + + internal static SaveProgressEventArgs Started(string archiveName) + { + var x = new SaveProgressEventArgs(archiveName, ZipProgressEventType.Saving_Started); + return x; + } + + internal static SaveProgressEventArgs Completed(string archiveName) + { + var x = new SaveProgressEventArgs(archiveName, ZipProgressEventType.Saving_Completed); + return x; + } + + /// + /// Number of entries saved so far. + /// + public int EntriesSaved + { + get { return _entriesSaved; } + } + } + + + /// + /// Provides information about the progress of the extract operation. + /// + public class ExtractProgressEventArgs : ZipProgressEventArgs + { + private int _entriesExtracted; + private string _target; + + /// + /// Constructor for the ExtractProgressEventArgs. + /// + /// the name of the zip archive. + /// whether this is before saving the entry, or after + /// The total number of entries in the zip archive. + /// Number of entries that have been extracted. + /// The entry involved in the event. + /// The location to which entries are extracted. + internal ExtractProgressEventArgs(string archiveName, bool before, int entriesTotal, int entriesExtracted, ZipEntry entry, string extractLocation) + : base(archiveName, (before) ? ZipProgressEventType.Extracting_BeforeExtractEntry : ZipProgressEventType.Extracting_AfterExtractEntry) + { + this.EntriesTotal = entriesTotal; + this.CurrentEntry = entry; + this._entriesExtracted = entriesExtracted; + this._target = extractLocation; + } + + internal ExtractProgressEventArgs(string archiveName, ZipProgressEventType flavor) + : base(archiveName, flavor) + { } + + internal ExtractProgressEventArgs() + { } + + + internal static ExtractProgressEventArgs BeforeExtractEntry(string archiveName, ZipEntry entry, string extractLocation) + { + var x = new ExtractProgressEventArgs + { + ArchiveName = archiveName, + EventType = ZipProgressEventType.Extracting_BeforeExtractEntry, + CurrentEntry = entry, + _target = extractLocation, + }; + return x; + } + + internal static ExtractProgressEventArgs ExtractExisting(string archiveName, ZipEntry entry, string extractLocation) + { + var x = new ExtractProgressEventArgs + { + ArchiveName = archiveName, + EventType = ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite, + CurrentEntry = entry, + _target = extractLocation, + }; + return x; + } + + internal static ExtractProgressEventArgs AfterExtractEntry(string archiveName, ZipEntry entry, string extractLocation) + { + var x = new ExtractProgressEventArgs + { + ArchiveName = archiveName, + EventType = ZipProgressEventType.Extracting_AfterExtractEntry, + CurrentEntry = entry, + _target = extractLocation, + }; + return x; + } + + internal static ExtractProgressEventArgs ExtractAllStarted(string archiveName, string extractLocation) + { + var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_BeforeExtractAll); + x._target = extractLocation; + return x; + } + + internal static ExtractProgressEventArgs ExtractAllCompleted(string archiveName, string extractLocation) + { + var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_AfterExtractAll); + x._target = extractLocation; + return x; + } + + + internal static ExtractProgressEventArgs ByteUpdate(string archiveName, ZipEntry entry, Int64 bytesWritten, Int64 totalBytes) + { + var x = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_EntryBytesWritten); + x.ArchiveName = archiveName; + x.CurrentEntry = entry; + x.BytesTransferred = bytesWritten; + x.TotalBytesToTransfer = totalBytes; + return x; + } + + + + /// + /// Number of entries extracted so far. This is set only if the + /// EventType is Extracting_BeforeExtractEntry or Extracting_AfterExtractEntry, and + /// the Extract() is occurring witin the scope of a call to ExtractAll(). + /// + public int EntriesExtracted + { + get { return _entriesExtracted; } + } + + /// + /// Returns the extraction target location, a filesystem path. + /// + public String ExtractLocation + { + get { return _target; } + } + + } + + + + /// + /// Provides information about the an error that occurred while zipping. + /// + public class ZipErrorEventArgs : ZipProgressEventArgs + { + private Exception _exc; + private ZipErrorEventArgs() { } + internal static ZipErrorEventArgs Saving(string archiveName, ZipEntry entry, Exception exception) + { + var x = new ZipErrorEventArgs + { + EventType = ZipProgressEventType.Error_Saving, + ArchiveName = archiveName, + CurrentEntry = entry, + _exc = exception + }; + return x; + } + + /// + /// Returns the exception that occurred, if any. + /// + public Exception @Exception + { + get { return _exc; } + } + + /// + /// Returns the name of the file that caused the exception, if any. + /// + public String FileName + { + get { return CurrentEntry.LocalFileName; } + } + } + + +} diff --git a/dotNetZip/Zip/Exceptions.cs b/dotNetZip/Zip/Exceptions.cs new file mode 100644 index 0000000..9f67077 --- /dev/null +++ b/dotNetZip/Zip/Exceptions.cs @@ -0,0 +1,300 @@ +// Exceptions.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008, 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-12 12:19:10> +// +// ------------------------------------------------------------------ +// +// This module defines exceptions used in the class library. +// + + + +using System; +using System.Collections.Generic; +using System.Text; +#if !NETCF +using System.Runtime.Serialization; +#endif + +namespace Ionic.Zip +{ + ///// + ///// Base exception type for all custom exceptions in the Zip library. It acts as a marker class. + ///// + //[AttributeUsage(AttributeTargets.Class)] + //public class ZipExceptionAttribute : Attribute { } + + + + /// + /// Issued when an ZipEntry.ExtractWithPassword() method is invoked + /// with an incorrect password. + /// +#if !SILVERLIGHT + [Serializable] +#endif + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000B")] + public class BadPasswordException : ZipException + { + /// + /// Default ctor. + /// + public BadPasswordException() { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + public BadPasswordException(String message) + : base(message) + { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + /// The innerException for this exception. + public BadPasswordException(String message, Exception innerException) + : base(message, innerException) + { + } + + +#if ! (NETCF || SILVERLIGHT) + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The serialization info for the exception. + /// The streaming context from which to deserialize. + protected BadPasswordException(SerializationInfo info, StreamingContext context) + : base(info, context) + { } +#endif + + } + + /// + /// Indicates that a read was attempted on a stream, and bad or incomplete data was + /// received. + /// +#if !SILVERLIGHT + [Serializable] +#endif + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000A")] + public class BadReadException : ZipException + { + /// + /// Default ctor. + /// + public BadReadException() { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + public BadReadException(String message) + : base(message) + { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + /// The innerException for this exception. + public BadReadException(String message, Exception innerException) + : base(message, innerException) + { + } + +#if ! (NETCF || SILVERLIGHT) + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The serialization info for the exception. + /// The streaming context from which to deserialize. + protected BadReadException(SerializationInfo info, StreamingContext context) + : base(info, context) + { } +#endif + + } + + + + /// + /// Issued when an CRC check fails upon extracting an entry from a zip archive. + /// +#if !SILVERLIGHT + [Serializable] +#endif + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d00009")] + public class BadCrcException : ZipException + { + /// + /// Default ctor. + /// + public BadCrcException() { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + public BadCrcException(String message) + : base(message) + { } + + +#if ! (NETCF || SILVERLIGHT) + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The serialization info for the exception. + /// The streaming context from which to deserialize. + protected BadCrcException(SerializationInfo info, StreamingContext context) + : base(info, context) + { } +#endif + + } + + + /// + /// Issued when errors occur saving a self-extracting archive. + /// +#if !SILVERLIGHT + [Serializable] +#endif + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d00008")] + public class SfxGenerationException : ZipException + { + /// + /// Default ctor. + /// + public SfxGenerationException() { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + public SfxGenerationException(String message) + : base(message) + { } + +#if ! (NETCF || SILVERLIGHT) + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The serialization info for the exception. + /// The streaming context from which to deserialize. + protected SfxGenerationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { } +#endif + + } + + + /// + /// Indicates that an operation was attempted on a ZipFile which was not possible + /// given the state of the instance. For example, if you call Save() on a ZipFile + /// which has no filename set, you can get this exception. + /// +#if !SILVERLIGHT + [Serializable] +#endif + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d00007")] + public class BadStateException : ZipException + { + /// + /// Default ctor. + /// + public BadStateException() { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + public BadStateException(String message) + : base(message) + { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + /// The innerException for this exception. + public BadStateException(String message, Exception innerException) + : base(message, innerException) + {} + +#if ! (NETCF || SILVERLIGHT) + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The serialization info for the exception. + /// The streaming context from which to deserialize. + protected BadStateException(SerializationInfo info, StreamingContext context) + : base(info, context) + { } +#endif + + } + + /// + /// Base class for all exceptions defined by and throw by the Zip library. + /// +#if !SILVERLIGHT + [Serializable] +#endif + [System.Runtime.InteropServices.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d00006")] + public class ZipException : Exception + { + /// + /// Default ctor. + /// + public ZipException() { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + public ZipException(String message) : base(message) { } + + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The message in the exception. + /// The innerException for this exception. + public ZipException(String message, Exception innerException) + : base(message, innerException) + { } + +#if ! (NETCF || SILVERLIGHT) + /// + /// Come on, you know how exceptions work. Why are you looking at this documentation? + /// + /// The serialization info for the exception. + /// The streaming context from which to deserialize. + protected ZipException(SerializationInfo info, StreamingContext context) + : base(info, context) + { } +#endif + + } + +} diff --git a/dotNetZip/Zip/ExtractExistingFileAction.cs b/dotNetZip/Zip/ExtractExistingFileAction.cs new file mode 100644 index 0000000..2de229f --- /dev/null +++ b/dotNetZip/Zip/ExtractExistingFileAction.cs @@ -0,0 +1,85 @@ +// ExtractExistingFileAction.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-August-25 08:44:37> +// +// ------------------------------------------------------------------ +// +// This module defines the ExtractExistingFileAction enum +// +// +// ------------------------------------------------------------------ + + +namespace Ionic.Zip +{ + + /// + /// An enum for the options when extracting an entry would overwrite an existing file. + /// + /// + /// + /// + /// This enum describes the actions that the library can take when an + /// Extract() or ExtractWithPassword() method is called to extract an + /// entry to a filesystem, and the extraction would overwrite an existing filesystem + /// file. + /// + /// + /// + public enum ExtractExistingFileAction + { + /// + /// Throw an exception when extraction would overwrite an existing file. (For + /// COM clients, this is a 0 (zero).) + /// + Throw, + + /// + /// When extraction would overwrite an existing file, overwrite the file silently. + /// The overwrite will happen even if the target file is marked as read-only. + /// (For COM clients, this is a 1.) + /// + OverwriteSilently, + + /// + /// When extraction would overwrite an existing file, don't overwrite the file, silently. + /// (For COM clients, this is a 2.) + /// + DoNotOverwrite, + + /// + /// When extraction would overwrite an existing file, invoke the ExtractProgress + /// event, using an event type of . In + /// this way, the application can decide, just-in-time, whether to overwrite the + /// file. For example, a GUI application may wish to pop up a dialog to allow + /// the user to choose. You may want to examine the property before making + /// the decision. If, after your processing in the Extract progress event, you + /// want to NOT extract the file, set + /// on the ZipProgressEventArgs.CurrentEntry to DoNotOverwrite. + /// If you do want to extract the file, set ZipEntry.ExtractExistingFile + /// to OverwriteSilently. If you want to cancel the Extraction, set + /// ZipProgressEventArgs.Cancel to true. Cancelling differs from using + /// DoNotOverwrite in that a cancel will not extract any further entries, if + /// there are any. (For COM clients, the value of this enum is a 3.) + /// + InvokeExtractProgressEvent, + } + +} diff --git a/dotNetZip/Zip/FileSelector.cs b/dotNetZip/Zip/FileSelector.cs new file mode 100644 index 0000000..874eb1b --- /dev/null +++ b/dotNetZip/Zip/FileSelector.cs @@ -0,0 +1,1608 @@ +//#define SelectorTrace + +// FileSelector.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved: <2011-August-05 11:03:11> +// +// ------------------------------------------------------------------ +// +// This module implements a "file selector" that finds files based on a +// set of inclusion criteria, including filename, size, file time, and +// potentially file attributes. The criteria are given in a string with +// a simple expression language. Examples: +// +// find all .txt files: +// name = *.txt +// +// shorthand for the above +// *.txt +// +// all files modified after January 1st, 2009 +// mtime > 2009-01-01 +// +// All .txt files modified after the first of the year +// name = *.txt AND mtime > 2009-01-01 +// +// All .txt files modified after the first of the year, or any file with the archive bit set +// (name = *.txt AND mtime > 2009-01-01) or (attribtues = A) +// +// All .txt files or any file greater than 1mb in size +// (name = *.txt or size > 1mb) +// +// and so on. +// ------------------------------------------------------------------ + + +using System; +using System.IO; +using System.Text; +using System.Reflection; +using System.ComponentModel; +using System.Text.RegularExpressions; +using System.Collections.Generic; +#if SILVERLIGHT +using System.Linq; +#endif + +namespace Ionic +{ + + /// + /// Enumerates the options for a logical conjunction. This enum is intended for use + /// internally by the FileSelector class. + /// + internal enum LogicalConjunction + { + NONE, + AND, + OR, + XOR, + } + + internal enum WhichTime + { + atime, + mtime, + ctime, + } + + + internal enum ComparisonOperator + { + [Description(">")] + GreaterThan, + [Description(">=")] + GreaterThanOrEqualTo, + [Description("<")] + LesserThan, + [Description("<=")] + LesserThanOrEqualTo, + [Description("=")] + EqualTo, + [Description("!=")] + NotEqualTo + } + + + internal abstract partial class SelectionCriterion + { + internal virtual bool Verbose + { + get;set; + } + internal abstract bool Evaluate(string filename); + + [System.Diagnostics.Conditional("SelectorTrace")] + protected static void CriterionTrace(string format, params object[] args) + { + //System.Console.WriteLine(" " + format, args); + } + } + + + internal partial class SizeCriterion : SelectionCriterion + { + internal ComparisonOperator Operator; + internal Int64 Size; + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("size ").Append(EnumUtil.GetDescription(Operator)).Append(" ").Append(Size.ToString()); + return sb.ToString(); + } + + internal override bool Evaluate(string filename) + { + System.IO.FileInfo fi = new System.IO.FileInfo(filename); + CriterionTrace("SizeCriterion::Evaluate('{0}' [{1}])", + filename, this.ToString()); + return _Evaluate(fi.Length); + } + + private bool _Evaluate(Int64 Length) + { + bool result = false; + switch (Operator) + { + case ComparisonOperator.GreaterThanOrEqualTo: + result = Length >= Size; + break; + case ComparisonOperator.GreaterThan: + result = Length > Size; + break; + case ComparisonOperator.LesserThanOrEqualTo: + result = Length <= Size; + break; + case ComparisonOperator.LesserThan: + result = Length < Size; + break; + case ComparisonOperator.EqualTo: + result = Length == Size; + break; + case ComparisonOperator.NotEqualTo: + result = Length != Size; + break; + default: + throw new ArgumentException("Operator"); + } + return result; + } + + } + + + + internal partial class TimeCriterion : SelectionCriterion + { + internal ComparisonOperator Operator; + internal WhichTime Which; + internal DateTime Time; + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append(Which.ToString()).Append(" ").Append(EnumUtil.GetDescription(Operator)).Append(" ").Append(Time.ToString("yyyy-MM-dd-HH:mm:ss")); + return sb.ToString(); + } + + internal override bool Evaluate(string filename) + { + DateTime x; + switch (Which) + { + case WhichTime.atime: + x = System.IO.File.GetLastAccessTime(filename).ToUniversalTime(); + break; + case WhichTime.mtime: + x = System.IO.File.GetLastWriteTime(filename).ToUniversalTime(); + break; + case WhichTime.ctime: + x = System.IO.File.GetCreationTime(filename).ToUniversalTime(); + break; + default: + throw new ArgumentException("Operator"); + } + CriterionTrace("TimeCriterion({0},{1})= {2}", filename, Which.ToString(), x); + return _Evaluate(x); + } + + + private bool _Evaluate(DateTime x) + { + bool result = false; + switch (Operator) + { + case ComparisonOperator.GreaterThanOrEqualTo: + result = (x >= Time); + break; + case ComparisonOperator.GreaterThan: + result = (x > Time); + break; + case ComparisonOperator.LesserThanOrEqualTo: + result = (x <= Time); + break; + case ComparisonOperator.LesserThan: + result = (x < Time); + break; + case ComparisonOperator.EqualTo: + result = (x == Time); + break; + case ComparisonOperator.NotEqualTo: + result = (x != Time); + break; + default: + throw new ArgumentException("Operator"); + } + + CriterionTrace("TimeCriterion: {0}", result); + return result; + } + } + + + + internal partial class NameCriterion : SelectionCriterion + { + private Regex _re; + private String _regexString; + internal ComparisonOperator Operator; + private string _MatchingFileSpec; + internal virtual string MatchingFileSpec + { + set + { + // workitem 8245 + if (Directory.Exists(value)) + { + _MatchingFileSpec = ".\\" + value + "\\*.*"; + } + else + { + _MatchingFileSpec = value; + } + + _regexString = "^" + + Regex.Escape(_MatchingFileSpec) + .Replace(@"\\\*\.\*", @"\\([^\.]+|.*\.[^\\\.]*)") + .Replace(@"\.\*", @"\.[^\\\.]*") + .Replace(@"\*", @".*") + //.Replace(@"\*", @"[^\\\.]*") // ill-conceived + .Replace(@"\?", @"[^\\\.]") + + "$"; + + CriterionTrace("NameCriterion regexString({0})", _regexString); + + _re = new Regex(_regexString, RegexOptions.IgnoreCase); + } + } + + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("name ").Append(EnumUtil.GetDescription(Operator)) + .Append(" '") + .Append(_MatchingFileSpec) + .Append("'"); + return sb.ToString(); + } + + + internal override bool Evaluate(string filename) + { + CriterionTrace("NameCriterion::Evaluate('{0}' pattern[{1}])", + filename, _MatchingFileSpec); + return _Evaluate(filename); + } + + private bool _Evaluate(string fullpath) + { + CriterionTrace("NameCriterion::Evaluate({0})", fullpath); + // No slash in the pattern implicitly means recurse, which means compare to + // filename only, not full path. + String f = (_MatchingFileSpec.IndexOf('\\') == -1) + ? System.IO.Path.GetFileName(fullpath) + : fullpath; // compare to fullpath + + bool result = _re.IsMatch(f); + + if (Operator != ComparisonOperator.EqualTo) + result = !result; + return result; + } + } + + + internal partial class TypeCriterion : SelectionCriterion + { + private char ObjectType; // 'D' = Directory, 'F' = File + internal ComparisonOperator Operator; + internal string AttributeString + { + get + { + return ObjectType.ToString(); + } + set + { + if (value.Length != 1 || + (value[0]!='D' && value[0]!='F')) + throw new ArgumentException("Specify a single character: either D or F"); + ObjectType = value[0]; + } + } + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("type ").Append(EnumUtil.GetDescription(Operator)).Append(" ").Append(AttributeString); + return sb.ToString(); + } + + internal override bool Evaluate(string filename) + { + CriterionTrace("TypeCriterion::Evaluate({0})", filename); + + bool result = (ObjectType == 'D') + ? Directory.Exists(filename) + : File.Exists(filename); + + if (Operator != ComparisonOperator.EqualTo) + result = !result; + return result; + } + } + + +#if !SILVERLIGHT + internal partial class AttributesCriterion : SelectionCriterion + { + private FileAttributes _Attributes; + internal ComparisonOperator Operator; + internal string AttributeString + { + get + { + string result = ""; + if ((_Attributes & FileAttributes.Hidden) != 0) + result += "H"; + if ((_Attributes & FileAttributes.System) != 0) + result += "S"; + if ((_Attributes & FileAttributes.ReadOnly) != 0) + result += "R"; + if ((_Attributes & FileAttributes.Archive) != 0) + result += "A"; + if ((_Attributes & FileAttributes.ReparsePoint) != 0) + result += "L"; + if ((_Attributes & FileAttributes.NotContentIndexed) != 0) + result += "I"; + return result; + } + + set + { + _Attributes = FileAttributes.Normal; + foreach (char c in value.ToUpper()) + { + switch (c) + { + case 'H': + if ((_Attributes & FileAttributes.Hidden) != 0) + throw new ArgumentException(String.Format("Repeated flag. ({0})", c), "value"); + _Attributes |= FileAttributes.Hidden; + break; + + case 'R': + if ((_Attributes & FileAttributes.ReadOnly) != 0) + throw new ArgumentException(String.Format("Repeated flag. ({0})", c), "value"); + _Attributes |= FileAttributes.ReadOnly; + break; + + case 'S': + if ((_Attributes & FileAttributes.System) != 0) + throw new ArgumentException(String.Format("Repeated flag. ({0})", c), "value"); + _Attributes |= FileAttributes.System; + break; + + case 'A': + if ((_Attributes & FileAttributes.Archive) != 0) + throw new ArgumentException(String.Format("Repeated flag. ({0})", c), "value"); + _Attributes |= FileAttributes.Archive; + break; + + case 'I': + if ((_Attributes & FileAttributes.NotContentIndexed) != 0) + throw new ArgumentException(String.Format("Repeated flag. ({0})", c), "value"); + _Attributes |= FileAttributes.NotContentIndexed; + break; + + case 'L': + if ((_Attributes & FileAttributes.ReparsePoint) != 0) + throw new ArgumentException(String.Format("Repeated flag. ({0})", c), "value"); + _Attributes |= FileAttributes.ReparsePoint; + break; + + default: + throw new ArgumentException(value); + } + } + } + } + + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("attributes ").Append(EnumUtil.GetDescription(Operator)).Append(" ").Append(AttributeString); + return sb.ToString(); + } + + private bool _EvaluateOne(FileAttributes fileAttrs, FileAttributes criterionAttrs) + { + bool result = false; + if ((_Attributes & criterionAttrs) == criterionAttrs) + result = ((fileAttrs & criterionAttrs) == criterionAttrs); + else + result = true; + return result; + } + + + + internal override bool Evaluate(string filename) + { + // workitem 10191 + if (Directory.Exists(filename)) + { + // Directories don't have file attributes, so the result + // of an evaluation is always NO. This gets negated if + // the operator is NotEqualTo. + return (Operator != ComparisonOperator.EqualTo); + } +#if NETCF + FileAttributes fileAttrs = NetCfFile.GetAttributes(filename); +#else + FileAttributes fileAttrs = System.IO.File.GetAttributes(filename); +#endif + + return _Evaluate(fileAttrs); + } + + private bool _Evaluate(FileAttributes fileAttrs) + { + bool result = _EvaluateOne(fileAttrs, FileAttributes.Hidden); + if (result) + result = _EvaluateOne(fileAttrs, FileAttributes.System); + if (result) + result = _EvaluateOne(fileAttrs, FileAttributes.ReadOnly); + if (result) + result = _EvaluateOne(fileAttrs, FileAttributes.Archive); + if (result) + result = _EvaluateOne(fileAttrs, FileAttributes.NotContentIndexed); + if (result) + result = _EvaluateOne(fileAttrs, FileAttributes.ReparsePoint); + + if (Operator != ComparisonOperator.EqualTo) + result = !result; + + return result; + } + } +#endif + + + internal partial class CompoundCriterion : SelectionCriterion + { + internal LogicalConjunction Conjunction; + internal SelectionCriterion Left; + + private SelectionCriterion _Right; + internal SelectionCriterion Right + { + get { return _Right; } + set + { + _Right = value; + if (value == null) + Conjunction = LogicalConjunction.NONE; + else if (Conjunction == LogicalConjunction.NONE) + Conjunction = LogicalConjunction.AND; + } + } + + + internal override bool Evaluate(string filename) + { + bool result = Left.Evaluate(filename); + switch (Conjunction) + { + case LogicalConjunction.AND: + if (result) + result = Right.Evaluate(filename); + break; + case LogicalConjunction.OR: + if (!result) + result = Right.Evaluate(filename); + break; + case LogicalConjunction.XOR: + result ^= Right.Evaluate(filename); + break; + default: + throw new ArgumentException("Conjunction"); + } + return result; + } + + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("(") + .Append((Left != null) ? Left.ToString() : "null") + .Append(" ") + .Append(Conjunction.ToString()) + .Append(" ") + .Append((Right != null) ? Right.ToString() : "null") + .Append(")"); + return sb.ToString(); + } + } + + + + /// + /// FileSelector encapsulates logic that selects files from a source - a zip file + /// or the filesystem - based on a set of criteria. This class is used internally + /// by the DotNetZip library, in particular for the AddSelectedFiles() methods. + /// This class can also be used independently of the zip capability in DotNetZip. + /// + /// + /// + /// + /// + /// The FileSelector class is used internally by the ZipFile class for selecting + /// files for inclusion into the ZipFile, when the method, or one of + /// its overloads, is called. It's also used for the methods. Typically, an + /// application that creates or manipulates Zip archives will not directly + /// interact with the FileSelector class. + /// + /// + /// + /// Some applications may wish to use the FileSelector class directly, to + /// select files from disk volumes based on a set of criteria, without creating or + /// querying Zip archives. The file selection criteria include: a pattern to + /// match the filename; the last modified, created, or last accessed time of the + /// file; the size of the file; and the attributes of the file. + /// + /// + /// + /// Consult the documentation for + /// for more information on specifying the selection criteria. + /// + /// + /// + public partial class FileSelector + { + internal SelectionCriterion _Criterion; + +#if NOTUSED + /// + /// The default constructor. + /// + /// + /// Typically, applications won't use this constructor. Instead they'll + /// call the constructor that accepts a selectionCriteria string. If you + /// use this constructor, you'll want to set the SelectionCriteria + /// property on the instance before calling SelectFiles(). + /// + protected FileSelector() { } +#endif + /// + /// Constructor that allows the caller to specify file selection criteria. + /// + /// + /// + /// + /// This constructor allows the caller to specify a set of criteria for + /// selection of files. + /// + /// + /// + /// See for a description of + /// the syntax of the selectionCriteria string. + /// + /// + /// + /// By default the FileSelector will traverse NTFS Reparse Points. To + /// change this, use FileSelector(String, bool). + /// + /// + /// + /// The criteria for file selection. + public FileSelector(String selectionCriteria) + : this(selectionCriteria, true) + { + } + + /// + /// Constructor that allows the caller to specify file selection criteria. + /// + /// + /// + /// + /// This constructor allows the caller to specify a set of criteria for + /// selection of files. + /// + /// + /// + /// See for a description of + /// the syntax of the selectionCriteria string. + /// + /// + /// + /// The criteria for file selection. + /// + /// whether to traverse NTFS reparse points (junctions). + /// + public FileSelector(String selectionCriteria, bool traverseDirectoryReparsePoints) + { + if (!String.IsNullOrEmpty(selectionCriteria)) + _Criterion = _ParseCriterion(selectionCriteria); + TraverseReparsePoints = traverseDirectoryReparsePoints; + } + + + + /// + /// The string specifying which files to include when retrieving. + /// + /// + /// + /// + /// Specify the criteria in statements of 3 elements: a noun, an operator, + /// and a value. Consider the string "name != *.doc" . The noun is + /// "name". The operator is "!=", implying "Not Equal". The value is + /// "*.doc". That criterion, in English, says "all files with a name that + /// does not end in the .doc extension." + /// + /// + /// + /// Supported nouns include "name" (or "filename") for the filename; + /// "atime", "mtime", and "ctime" for last access time, last modfied time, + /// and created time of the file, respectively; "attributes" (or "attrs") + /// for the file attributes; "size" (or "length") for the file length + /// (uncompressed); and "type" for the type of object, either a file or a + /// directory. The "attributes", "type", and "name" nouns all support = + /// and != as operators. The "size", "atime", "mtime", and "ctime" nouns + /// support = and !=, and >, >=, <, <= as well. The times are + /// taken to be expressed in local time. + /// + /// + /// + /// Specify values for the file attributes as a string with one or more of + /// the characters H,R,S,A,I,L in any order, implying file attributes of + /// Hidden, ReadOnly, System, Archive, NotContextIndexed, and ReparsePoint + /// (symbolic link) respectively. + /// + /// + /// + /// To specify a time, use YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as + /// the format. If you omit the HH:mm:ss portion, it is assumed to be + /// 00:00:00 (midnight). + /// + /// + /// + /// The value for a size criterion is expressed in integer quantities of + /// bytes, kilobytes (use k or kb after the number), megabytes (m or mb), + /// or gigabytes (g or gb). + /// + /// + /// + /// The value for a name is a pattern to match against the filename, + /// potentially including wildcards. The pattern follows CMD.exe glob + /// rules: * implies one or more of any character, while ? implies one + /// character. If the name pattern contains any slashes, it is matched to + /// the entire filename, including the path; otherwise, it is matched + /// against only the filename without the path. This means a pattern of + /// "*\*.*" matches all files one directory level deep, while a pattern of + /// "*.*" matches all files in all directories. + /// + /// + /// + /// To specify a name pattern that includes spaces, use single quotes + /// around the pattern. A pattern of "'* *.*'" will match all files that + /// have spaces in the filename. The full criteria string for that would + /// be "name = '* *.*'" . + /// + /// + /// + /// The value for a type criterion is either F (implying a file) or D + /// (implying a directory). + /// + /// + /// + /// Some examples: + /// + /// + /// + /// + /// criteria + /// Files retrieved + /// + /// + /// + /// name != *.xls + /// any file with an extension that is not .xls + /// + /// + /// + /// + /// name = *.mp3 + /// any file with a .mp3 extension. + /// + /// + /// + /// + /// *.mp3 + /// (same as above) any file with a .mp3 extension. + /// + /// + /// + /// + /// attributes = A + /// all files whose attributes include the Archive bit. + /// + /// + /// + /// + /// attributes != H + /// all files whose attributes do not include the Hidden bit. + /// + /// + /// + /// + /// mtime > 2009-01-01 + /// all files with a last modified time after January 1st, 2009. + /// + /// + /// + /// + /// ctime > 2009/01/01-03:00:00 + /// all files with a created time after 3am (local time), + /// on January 1st, 2009. + /// + /// + /// + /// + /// size > 2gb + /// all files whose uncompressed size is greater than 2gb. + /// + /// + /// + /// + /// type = D + /// all directories in the filesystem. + /// + /// + /// + /// + /// + /// You can combine criteria with the conjunctions AND, OR, and XOR. Using + /// a string like "name = *.txt AND size >= 100k" for the + /// selectionCriteria retrieves entries whose names end in .txt, and whose + /// uncompressed size is greater than or equal to 100 kilobytes. + /// + /// + /// + /// For more complex combinations of criteria, you can use parenthesis to + /// group clauses in the boolean logic. Absent parenthesis, the + /// precedence of the criterion atoms is determined by order of + /// appearance. Unlike the C# language, the AND conjunction does not take + /// precendence over the logical OR. This is important only in strings + /// that contain 3 or more criterion atoms. In other words, "name = *.txt + /// and size > 1000 or attributes = H" implies "((name = *.txt AND size + /// > 1000) OR attributes = H)" while "attributes = H OR name = *.txt + /// and size > 1000" evaluates to "((attributes = H OR name = *.txt) + /// AND size > 1000)". When in doubt, use parenthesis. + /// + /// + /// + /// Using time properties requires some extra care. If you want to + /// retrieve all entries that were last updated on 2009 February 14, + /// specify "mtime >= 2009-02-14 AND mtime < 2009-02-15". Read this + /// to say: all files updated after 12:00am on February 14th, until + /// 12:00am on February 15th. You can use the same bracketing approach to + /// specify any time period - a year, a month, a week, and so on. + /// + /// + /// + /// The syntax allows one special case: if you provide a string with no + /// spaces, it is treated as a pattern to match for the filename. + /// Therefore a string like "*.xls" will be equivalent to specifying "name + /// = *.xls". This "shorthand" notation does not work with compound + /// criteria. + /// + /// + /// + /// There is no logic in this class that insures that the inclusion + /// criteria are internally consistent. For example, it's possible to + /// specify criteria that says the file must have a size of less than 100 + /// bytes, as well as a size that is greater than 1000 bytes. Obviously + /// no file will ever satisfy such criteria, but this class does not check + /// for or detect such inconsistencies. + /// + /// + /// + /// + /// + /// Thrown in the setter if the value has an invalid syntax. + /// + public String SelectionCriteria + { + get + { + if (_Criterion == null) return null; + return _Criterion.ToString(); + } + set + { + if (value == null) _Criterion = null; + else if (value.Trim() == "") _Criterion = null; + else + _Criterion = _ParseCriterion(value); + } + } + + /// + /// Indicates whether searches will traverse NTFS reparse points, like Junctions. + /// + public bool TraverseReparsePoints + { + get; set; + } + + + private enum ParseState + { + Start, + OpenParen, + CriterionDone, + ConjunctionPending, + Whitespace, + } + + + private static class RegexAssertions + { + public static readonly String PrecededByOddNumberOfSingleQuotes = "(?<=(?:[^']*'[^']*')*'[^']*)"; + public static readonly String FollowedByOddNumberOfSingleQuotesAndLineEnd = "(?=[^']*'(?:[^']*'[^']*')*[^']*$)"; + + public static readonly String PrecededByEvenNumberOfSingleQuotes = "(?<=(?:[^']*'[^']*')*[^']*)"; + public static readonly String FollowedByEvenNumberOfSingleQuotesAndLineEnd = "(?=(?:[^']*'[^']*')*[^']*$)"; + } + + + private static string NormalizeCriteriaExpression(string source) + { + // The goal here is to normalize the criterion expression. At output, in + // the transformed criterion string, every significant syntactic element + // - a property element, grouping paren for the boolean logic, operator + // ( = < > != ), conjunction, or property value - will be separated from + // its neighbors by at least one space. Thus, + // + // before after + // ------------------------------------------------------------------- + // name=*.txt name = *.txt + // (size>100)AND(name=*.txt) ( size > 100 ) AND ( name = *.txt ) + // + // This is relatively straightforward using regular expression + // replacement. This method applies a distinct regex pattern and + // corresponding replacement string for each one of a number of cases: + // an open paren followed by a word; a word followed by a close-paren; a + // pair of open parens; a close paren followed by a word (which should + // then be followed by an open paren). And so on. These patterns and + // replacements are all stored in prPairs. By applying each of these + // regex replacements in turn, we get the transformed string. Easy. + // + // The resulting "normalized" criterion string, is then used as the + // subject that gets parsed, by splitting the string into tokens that + // are separated by spaces. Here, there's a twist. The spaces within + // single-quote delimiters do not delimit distinct tokens. So, this + // normalization method temporarily replaces those spaces with + // ASCII 6 (0x06), a control character which is not a legal + // character in a filename. The parsing logic that happens later will + // revert that change, restoring the original value of the filename + // specification. + // + // To illustrate, for a "before" string of [(size>100)AND(name='Name + // (with Parens).txt')] , the "after" string is [( size > 100 ) AND + // ( name = 'Name\u0006(with\u0006Parens).txt' )]. + // + + string[][] prPairs = + { + // A. opening double parens - insert a space between them + new string[] { @"([^']*)\(\(([^']+)", "$1( ($2" }, + + // B. closing double parens - insert a space between + new string[] { @"(.)\)\)", "$1) )" }, + + // C. single open paren with a following word - insert a space between + new string[] { @"\((\S)", "( $1" }, + + // D. single close paren with a preceding word - insert a space between the two + new string[] { @"(\S)\)", "$1 )" }, + + // E. close paren at line start?, insert a space before the close paren + // this seems like a degenerate case. I don't recall why it's here. + new string[] { @"^\)", " )" }, + + // F. a word (likely a conjunction) followed by an open paren - insert a space between + new string[] { @"(\S)\(", "$1 (" }, + + // G. single close paren followed by word - insert a paren after close paren + new string[] { @"\)(\S)", ") $1" }, + + // H. insert space between = and a following single quote + //new string[] { @"(=|!=)('[^']*')", "$1 $2" }, + new string[] { @"(=)('[^']*')", "$1 $2" }, + + // I. insert space between property names and the following operator + //new string[] { @"([^ ])([><(?:!=)=])", "$1 $2" }, + new string[] { @"([^ !><])(>|<|!=|=)", "$1 $2" }, + + // J. insert spaces between operators and the following values + //new string[] { @"([><(?:!=)=])([^ ])", "$1 $2" }, + new string[] { @"(>|<|!=|=)([^ =])", "$1 $2" }, + + // K. replace fwd slash with backslash + new string[] { @"/", "\\" }, + }; + + string interim = source; + + for (int i=0; i < prPairs.Length; i++) + { + //char caseIdx = (char)('A' + i); + string pattern = RegexAssertions.PrecededByEvenNumberOfSingleQuotes + + prPairs[i][0] + + RegexAssertions.FollowedByEvenNumberOfSingleQuotesAndLineEnd; + + interim = Regex.Replace(interim, pattern, prPairs[i][1]); + } + + // match a fwd slash, followed by an odd number of single quotes. + // This matches fwd slashes only inside a pair of single quote delimiters, + // eg, a filename. This must be done as well as the case above, to handle + // filenames specified inside quotes as well as filenames without quotes. + var regexPattern = @"/" + + RegexAssertions.FollowedByOddNumberOfSingleQuotesAndLineEnd; + // replace with backslash + interim = Regex.Replace(interim, regexPattern, "\\"); + + // match a space, followed by an odd number of single quotes. + // This matches spaces only inside a pair of single quote delimiters. + regexPattern = " " + + RegexAssertions.FollowedByOddNumberOfSingleQuotesAndLineEnd; + + // Replace all spaces that appear inside single quotes, with + // ascii 6. This allows a split on spaces to get tokens in + // the expression. The split will not split any filename or + // wildcard that appears within single quotes. After tokenizing, we + // need to replace ascii 6 with ascii 32 to revert the + // spaces within quotes. + return Regex.Replace(interim, regexPattern, "\u0006"); + } + + + private static SelectionCriterion _ParseCriterion(String s) + { + if (s == null) return null; + + // inject spaces after open paren and before close paren, etc + s = NormalizeCriteriaExpression(s); + + // no spaces in the criteria is shorthand for filename glob + if (s.IndexOf(" ") == -1) + s = "name = " + s; + + // split the expression into tokens + string[] tokens = s.Trim().Split(' ', '\t'); + + if (tokens.Length < 3) throw new ArgumentException(s); + + SelectionCriterion current = null; + + LogicalConjunction pendingConjunction = LogicalConjunction.NONE; + + ParseState state; + var stateStack = new System.Collections.Generic.Stack(); + var critStack = new System.Collections.Generic.Stack(); + stateStack.Push(ParseState.Start); + + for (int i = 0; i < tokens.Length; i++) + { + string tok1 = tokens[i].ToLower(); + switch (tok1) + { + case "and": + case "xor": + case "or": + state = stateStack.Peek(); + if (state != ParseState.CriterionDone) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + if (tokens.Length <= i + 3) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + pendingConjunction = (LogicalConjunction)Enum.Parse(typeof(LogicalConjunction), tokens[i].ToUpper(), true); + current = new CompoundCriterion { Left = current, Right = null, Conjunction = pendingConjunction }; + stateStack.Push(state); + stateStack.Push(ParseState.ConjunctionPending); + critStack.Push(current); + break; + + case "(": + state = stateStack.Peek(); + if (state != ParseState.Start && state != ParseState.ConjunctionPending && state != ParseState.OpenParen) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + if (tokens.Length <= i + 4) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + stateStack.Push(ParseState.OpenParen); + break; + + case ")": + state = stateStack.Pop(); + if (stateStack.Peek() != ParseState.OpenParen) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + stateStack.Pop(); + stateStack.Push(ParseState.CriterionDone); + break; + + case "atime": + case "ctime": + case "mtime": + if (tokens.Length <= i + 2) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + DateTime t; + try + { + t = DateTime.ParseExact(tokens[i + 2], "yyyy-MM-dd-HH:mm:ss", null); + } + catch (FormatException) + { + try + { + t = DateTime.ParseExact(tokens[i + 2], "yyyy/MM/dd-HH:mm:ss", null); + } + catch (FormatException) + { + try + { + t = DateTime.ParseExact(tokens[i + 2], "yyyy/MM/dd", null); + } + catch (FormatException) + { + try + { + t = DateTime.ParseExact(tokens[i + 2], "MM/dd/yyyy", null); + } + catch (FormatException) + { + t = DateTime.ParseExact(tokens[i + 2], "yyyy-MM-dd", null); + } + } + } + } + t= DateTime.SpecifyKind(t, DateTimeKind.Local).ToUniversalTime(); + current = new TimeCriterion + { + Which = (WhichTime)Enum.Parse(typeof(WhichTime), tokens[i], true), + Operator = (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), tokens[i + 1]), + Time = t + }; + i += 2; + stateStack.Push(ParseState.CriterionDone); + break; + + + case "length": + case "size": + if (tokens.Length <= i + 2) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + Int64 sz = 0; + string v = tokens[i + 2]; + if (v.ToUpper().EndsWith("K")) + sz = Int64.Parse(v.Substring(0, v.Length - 1)) * 1024; + else if (v.ToUpper().EndsWith("KB")) + sz = Int64.Parse(v.Substring(0, v.Length - 2)) * 1024; + else if (v.ToUpper().EndsWith("M")) + sz = Int64.Parse(v.Substring(0, v.Length - 1)) * 1024 * 1024; + else if (v.ToUpper().EndsWith("MB")) + sz = Int64.Parse(v.Substring(0, v.Length - 2)) * 1024 * 1024; + else if (v.ToUpper().EndsWith("G")) + sz = Int64.Parse(v.Substring(0, v.Length - 1)) * 1024 * 1024 * 1024; + else if (v.ToUpper().EndsWith("GB")) + sz = Int64.Parse(v.Substring(0, v.Length - 2)) * 1024 * 1024 * 1024; + else sz = Int64.Parse(tokens[i + 2]); + + current = new SizeCriterion + { + Size = sz, + Operator = (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), tokens[i + 1]) + }; + i += 2; + stateStack.Push(ParseState.CriterionDone); + break; + + case "filename": + case "name": + { + if (tokens.Length <= i + 2) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + ComparisonOperator c = + (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), tokens[i + 1]); + + if (c != ComparisonOperator.NotEqualTo && c != ComparisonOperator.EqualTo) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + string m = tokens[i + 2]; + + // handle single-quoted filespecs (used to include + // spaces in filename patterns) + if (m.StartsWith("'") && m.EndsWith("'")) + { + // trim off leading and trailing single quotes and + // revert the control characters to spaces. + m = m.Substring(1, m.Length - 2) + .Replace("\u0006", " "); + } + + // if (m.StartsWith("'")) + // m = m.Replace("\u0006", " "); + + current = new NameCriterion + { + MatchingFileSpec = m, + Operator = c + }; + i += 2; + stateStack.Push(ParseState.CriterionDone); + } + break; + +#if !SILVERLIGHT + case "attrs": + case "attributes": +#endif + case "type": + { + if (tokens.Length <= i + 2) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + + ComparisonOperator c = + (ComparisonOperator)EnumUtil.Parse(typeof(ComparisonOperator), tokens[i + 1]); + + if (c != ComparisonOperator.NotEqualTo && c != ComparisonOperator.EqualTo) + throw new ArgumentException(String.Join(" ", tokens, i, tokens.Length - i)); + +#if SILVERLIGHT + current = (SelectionCriterion) new TypeCriterion + { + AttributeString = tokens[i + 2], + Operator = c + }; +#else + current = (tok1 == "type") + ? (SelectionCriterion) new TypeCriterion + { + AttributeString = tokens[i + 2], + Operator = c + } + : (SelectionCriterion) new AttributesCriterion + { + AttributeString = tokens[i + 2], + Operator = c + }; +#endif + i += 2; + stateStack.Push(ParseState.CriterionDone); + } + break; + + case "": + // NOP + stateStack.Push(ParseState.Whitespace); + break; + + default: + throw new ArgumentException("'" + tokens[i] + "'"); + } + + state = stateStack.Peek(); + if (state == ParseState.CriterionDone) + { + stateStack.Pop(); + if (stateStack.Peek() == ParseState.ConjunctionPending) + { + while (stateStack.Peek() == ParseState.ConjunctionPending) + { + var cc = critStack.Pop() as CompoundCriterion; + cc.Right = current; + current = cc; // mark the parent as current (walk up the tree) + stateStack.Pop(); // the conjunction is no longer pending + + state = stateStack.Pop(); + if (state != ParseState.CriterionDone) + throw new ArgumentException("??"); + } + } + else stateStack.Push(ParseState.CriterionDone); // not sure? + } + + if (state == ParseState.Whitespace) + stateStack.Pop(); + } + + return current; + } + + + /// + /// Returns a string representation of the FileSelector object. + /// + /// The string representation of the boolean logic statement of the file + /// selection criteria for this instance. + public override String ToString() + { + return "FileSelector("+_Criterion.ToString()+")"; + } + + + private bool Evaluate(string filename) + { + // dinoch - Thu, 11 Feb 2010 18:34 + SelectorTrace("Evaluate({0})", filename); + bool result = _Criterion.Evaluate(filename); + return result; + } + + [System.Diagnostics.Conditional("SelectorTrace")] + private void SelectorTrace(string format, params object[] args) + { + if (_Criterion != null && _Criterion.Verbose) + System.Console.WriteLine(format, args); + } + + /// + /// Returns the names of the files in the specified directory + /// that fit the selection criteria specified in the FileSelector. + /// + /// + /// + /// This is equivalent to calling + /// with recurseDirectories = false. + /// + /// + /// + /// The name of the directory over which to apply the FileSelector + /// criteria. + /// + /// + /// + /// A collection of strings containing fully-qualified pathnames of files + /// that match the criteria specified in the FileSelector instance. + /// + public System.Collections.Generic.ICollection SelectFiles(String directory) + { + return SelectFiles(directory, false); + } + + + /// + /// Returns the names of the files in the specified directory that fit the + /// selection criteria specified in the FileSelector, optionally recursing + /// through subdirectories. + /// + /// + /// + /// This method applies the file selection criteria contained in the + /// FileSelector to the files contained in the given directory, and + /// returns the names of files that conform to the criteria. + /// + /// + /// + /// The name of the directory over which to apply the FileSelector + /// criteria. + /// + /// + /// + /// Whether to recurse through subdirectories when applying the file + /// selection criteria. + /// + /// + /// + /// A collection of strings containing fully-qualified pathnames of files + /// that match the criteria specified in the FileSelector instance. + /// + public System.Collections.ObjectModel.ReadOnlyCollection + SelectFiles(String directory, + bool recurseDirectories) + { + if (_Criterion == null) + throw new ArgumentException("SelectionCriteria has not been set"); + + var list = new List(); + try + { + if (Directory.Exists(directory)) + { + String[] filenames = Directory.GetFiles(directory); + + // add the files: + foreach (String filename in filenames) + { + if (Evaluate(filename)) + list.Add(filename); + } + + if (recurseDirectories) + { + // add the subdirectories: + String[] dirnames = Directory.GetDirectories(directory); + foreach (String dir in dirnames) + { + if (this.TraverseReparsePoints +#if !SILVERLIGHT + || ((File.GetAttributes(dir) & FileAttributes.ReparsePoint) == 0) +#endif + ) + { + // workitem 10191 + if (Evaluate(dir)) list.Add(dir); + list.AddRange(this.SelectFiles(dir, recurseDirectories)); + } + } + } + } + } + // can get System.UnauthorizedAccessException here + catch (System.UnauthorizedAccessException) + { + } + catch (System.IO.IOException) + { + } + + return list.AsReadOnly(); + } + } + + + + /// + /// Summary description for EnumUtil. + /// + internal sealed class EnumUtil + { + private EnumUtil() { } + /// + /// Returns the value of the DescriptionAttribute if the specified Enum + /// value has one. If not, returns the ToString() representation of the + /// Enum value. + /// + /// The Enum to get the description for + /// + internal static string GetDescription(System.Enum value) + { + FieldInfo fi = value.GetType().GetField(value.ToString()); + var attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); + if (attributes.Length > 0) + return attributes[0].Description; + else + return value.ToString(); + } + + /// + /// Converts the string representation of the name or numeric value of one + /// or more enumerated constants to an equivalent enumerated object. + /// Note: use the DescriptionAttribute on enum values to enable this. + /// + /// The System.Type of the enumeration. + /// + /// A string containing the name or value to convert. + /// + /// + internal static object Parse(Type enumType, string stringRepresentation) + { + return Parse(enumType, stringRepresentation, false); + } + + +#if SILVERLIGHT + public static System.Enum[] GetEnumValues(Type type) + { + if (!type.IsEnum) + throw new ArgumentException("not an enum"); + + return ( + from field in type.GetFields(BindingFlags.Public | BindingFlags.Static) + where field.IsLiteral + select (System.Enum)field.GetValue(null) + ).ToArray(); + } + + public static string[] GetEnumStrings() + { + var type = typeof(T); + if (!type.IsEnum) + throw new ArgumentException("not an enum"); + + return ( + from field in type.GetFields(BindingFlags.Public | BindingFlags.Static) + where field.IsLiteral + select field.Name + ).ToArray(); + } +#endif + + /// + /// Converts the string representation of the name or numeric value of one + /// or more enumerated constants to an equivalent enumerated object. A + /// parameter specified whether the operation is case-sensitive. Note: + /// use the DescriptionAttribute on enum values to enable this. + /// + /// The System.Type of the enumeration. + /// + /// A string containing the name or value to convert. + /// + /// + /// Whether the operation is case-sensitive or not. + /// + internal static object Parse(Type enumType, string stringRepresentation, bool ignoreCase) + { + if (ignoreCase) + stringRepresentation = stringRepresentation.ToLower(); + +#if SILVERLIGHT + foreach (System.Enum enumVal in GetEnumValues(enumType)) +#else + foreach (System.Enum enumVal in System.Enum.GetValues(enumType)) +#endif + { + string description = GetDescription(enumVal); + if (ignoreCase) + description = description.ToLower(); + if (description == stringRepresentation) + return enumVal; + } + + return System.Enum.Parse(enumType, stringRepresentation, ignoreCase); + } + } + + +#if DEMO + public class DemonstrateFileSelector + { + private string _directory; + private bool _recurse; + private bool _traverse; + private bool _verbose; + private string _selectionCriteria; + private FileSelector f; + + public DemonstrateFileSelector() + { + this._directory = "."; + this._recurse = true; + } + + public DemonstrateFileSelector(string[] args) : this() + { + for (int i = 0; i < args.Length; i++) + { + switch(args[i]) + { + case"-?": + Usage(); + Environment.Exit(0); + break; + case "-d": + i++; + if (args.Length <= i) + throw new ArgumentException("-directory"); + this._directory = args[i]; + break; + case "-norecurse": + this._recurse = false; + break; + + case "-j-": + this._traverse = false; + break; + + case "-j+": + this._traverse = true; + break; + + case "-v": + this._verbose = true; + break; + + default: + if (this._selectionCriteria != null) + throw new ArgumentException(args[i]); + this._selectionCriteria = args[i]; + break; + } + + if (this._selectionCriteria != null) + this.f = new FileSelector(this._selectionCriteria); + } + } + + + public static void Main(string[] args) + { + try + { + Console.WriteLine(); + new DemonstrateFileSelector(args).Run(); + } + catch (Exception exc1) + { + Console.WriteLine("Exception: {0}", exc1.ToString()); + Usage(); + } + } + + + public void Run() + { + if (this.f == null) + this.f = new FileSelector("name = *.jpg AND (size > 1000 OR atime < 2009-02-14-01:00:00)"); + + this.f.TraverseReparsePoints = _traverse; + this.f.Verbose = this._verbose; + Console.WriteLine(); + Console.WriteLine(new String(':', 88)); + Console.WriteLine("Selecting files:\n" + this.f.ToString()); + var files = this.f.SelectFiles(this._directory, this._recurse); + if (files.Count == 0) + { + Console.WriteLine("no files."); + } + else + { + Console.WriteLine("files: {0}", files.Count); + foreach (string file in files) + { + Console.WriteLine(" " + file); + } + } + } + + public static void Usage() + { + Console.WriteLine("FileSelector: select files based on selection criteria.\n"); + Console.WriteLine("Usage:\n FileSelector [options]\n" + + "\n" + + " -d directory to select from (Default .)\n" + + " -norecurse don't recurse into subdirs\n" + + " -j- don't traverse junctions\n" + + " -v verbose output\n"); + } + } + +#endif + + + +} + + diff --git a/dotNetZip/Zip/Migrated rules for Zip DLL.ruleset b/dotNetZip/Zip/Migrated rules for Zip DLL.ruleset new file mode 100644 index 0000000..e84dcd6 --- /dev/null +++ b/dotNetZip/Zip/Migrated rules for Zip DLL.ruleset @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zip/OffsetStream.cs b/dotNetZip/Zip/OffsetStream.cs new file mode 100644 index 0000000..525019a --- /dev/null +++ b/dotNetZip/Zip/OffsetStream.cs @@ -0,0 +1,114 @@ +// OffsetStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-August-27 12:50:35> +// +// ------------------------------------------------------------------ +// +// This module defines logic for handling reading of zip archives embedded +// into larger streams. The initial position of the stream serves as +// the base offset for all future Seek() operations. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; + +namespace Ionic.Zip +{ + internal class OffsetStream : System.IO.Stream, System.IDisposable + { + private Int64 _originalPosition; + private Stream _innerStream; + + public OffsetStream(Stream s) + : base() + { + _originalPosition = s.Position; + _innerStream = s; + } + + public override int Read(byte[] buffer, int offset, int count) + { + return _innerStream.Read(buffer, offset, count); + } + + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + + public override bool CanRead + { + get { return _innerStream.CanRead; } + } + + public override bool CanSeek + { + get { return _innerStream.CanSeek; } + } + + public override bool CanWrite + { + get { return false; } + } + + public override void Flush() + { + _innerStream.Flush(); + } + + public override long Length + { + get + { + return _innerStream.Length; + } + } + + public override long Position + { + get { return _innerStream.Position - _originalPosition; } + set { _innerStream.Position = _originalPosition + value; } + } + + + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + return _innerStream.Seek(_originalPosition + offset, origin) - _originalPosition; + } + + + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + void IDisposable.Dispose() + { + Close(); + } + + public override void Close() + { + base.Close(); + } + + } + +} \ No newline at end of file diff --git a/dotNetZip/Zip/PackResources.vbs b/dotNetZip/Zip/PackResources.vbs new file mode 100644 index 0000000..2e248ee --- /dev/null +++ b/dotNetZip/Zip/PackResources.vbs @@ -0,0 +1,238 @@ +' PackResources.vbs +' ------------------------------------------------------------------ +' +' Copyright (c) 2010 Dino Chiesa +' All rights reserved. +' +' This code module is part of DotNetZip, a zipfile class library. +' +' ------------------------------------------------------------------ +' +' This code is licensed under the Microsoft Public License. +' See the file License.txt for the license details. +' More info on: http://dotnetzip.codeplex.com +' +' ------------------------------------------------------------------ +' +' last saved (in emacs): +' Time-stamp: <2011-July-23 20:02:17> +' +' ------------------------------------------------------------------ +' +' This is a script file that packs the resources files into a zip, +' for inclusion into the zip dll. +' +' This script assumes it will be run by Visual Studio, as a prebuild +' script, starting with the current directory of +' {DotNetZip}\Zip Partial DLL\bin\{Debug,Release} +' +' Wed, 10 Feb 2010 12:24 +' +' ------------------------------------------------------------------ + + +Sub NewZip(pathToZipFile) + + WScript.Echo "Creating a new zip file (" & pathToZipFile & ") " + + Dim fso + Set fso = CreateObject("Scripting.FileSystemObject") + Dim file + Set file = fso.CreateTextFile(pathToZipFile) + + '' this is the content for an empty zip file + file.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0) + + file.Close + Set fso = Nothing + Set file = Nothing + + WScript.Sleep 500 + +End Sub + + + +Function DatesAreSubstantiallyDifferent(d1, d2) + + Dim result + Dim s + + ''WScript.Echo "d1= " & d1 + ''WScript.Echo "d2= " & d2 + + '' http://www.w3schools.com/vbscript/func_datediff.asp + s = DateDiff("s",d1,d2) + ''WScript.Echo "s= " & s + + '' 2 seconds or less in either direction is ok. + If (s < 3 AND s > -3) Then + result = False + Else + result = True + End If + + DatesAreSubstantiallyDifferent = result + +End Function + + + + + +Sub CreateZip(pathToZipFile, dirToZip) + + Dim fso + Set fso= Wscript.CreateObject("Scripting.FileSystemObject") + + Dim fullPathToZipFile + fullPathToZipFile = fso.GetAbsolutePathName(pathToZipFile) + + Dim fullDirToZip + fullDirToZip = fso.GetAbsolutePathName(dirToZip) + + If Not fso.FolderExists(fullDirToZip) Then + WScript.Echo "The directory to zip does not exist." + Exit Sub + End If + + WScript.Echo "Checking zip " & fullPathToZipFile + WScript.Echo " against directory " & fullDirToZip + + dim sa + set sa = CreateObject("Shell.Application") + + + ' http://msdn.microsoft.com/en-us/library/bb787866(VS.85).aspx + ' =============================================================== + ' 4 = do not display a progress box + ' 16 = Respond with "Yes to All" for any dialog box that is displayed. + ' 128 = Perform the operation on files only if a wildcard file name (*.*) is specified. + ' 256 = Display a progress dialog box but do not show the file names. + ' 2048 = Version 4.71. Do not copy the security attributes of the file. + ' 4096 = Only operate in the local directory. Don't operate recursively into subdirectories. + + Dim fcount + fcount = 0 + + Dim needRepack + needRepack = -1 + Dim zip + Dim folder, file, builtpath, pass, d1, d2, folderItem + Set folder = fso.GetFolder(fullDirToZip) + + '' do this in 2 passes. First pass checks if any file in the zip has been updated. + '' 2nd pass is performed only if necessary, and actually copies all the files into the new zip. + + pass = 0 + Do Until pass > 1 + + For Each file in folder.Files + '' check or zip any file that is not .zip, not .resx and not ending in ~ (emacs backup file) + If (Right(file.name,4) <> ".zip" AND Right(file.name,5) <> ".resx" AND Right(file.name,1) <> "~") Then + builtpath = fso.BuildPath(fullDirToZip, file.Name) + If (pass = 0) Then + If (needRepack = -1) Then + '' first file only + If Not fso.FileExists(fullPathToZipFile) Then + WScript.Echo "The zip file does not exist." + '' no zip means, always need to repack + needRepack = 1 + Else + Set zip = sa.NameSpace(fullPathToZipFile) + needRepack = 0 + End If + End If + + '' only check if we need to repack this file, if + '' necessary; in other words, if none of the prior + '' files need to be repacked. + If (needRepack = 0) Then + '' check if the file has been updated + d1 = file.DateLastModified + Set folderItem = zip.ParseName(file.Name) + If (Not folderItem Is Nothing) Then + d2 = folderItem.ModifyDate + Set folderItem = Nothing + Else + '' dummy + d2 = "01/01/2001 6:05:00 PM" + End If + + If DatesAreSubstantiallyDifferent(d1,d2) Then + needRepack = 1 + End If + End If + + Else + '' pass = 1 + If (fcount = 0) Then + Wscript.Sleep(400) + End If + WScript.Echo builtpath + zip.CopyHere builtpath, 0 + fcount = fcount + 1 + '' Delay between each item. With no, the zip fails with + '' "file not found" or "No Read Permission" or some other + '' spurious error. + Wscript.Sleep(450) + End If + + End If + Next + + If (pass = 0) Then + If (needRepack <> 0) Then + '' reaching pass 1 means we delete and re-create the zip file + WScript.Echo "The resources zip needs to be re-packed. " + Set zip = Nothing + If fso.FileExists(fullPathToZipFile) Then + WScript.Echo "That zip file already exists - deleting it." + fso.DeleteFile fullPathToZipFile + '' give it time to be really deleted + Wscript.Sleep(2400) + End If + NewZip fullPathToZipFile + Set zip = sa.NameSpace(fullPathToZipFile) + Else + WScript.Echo "The resources zip does not need to be updated." + '' insure we skip the 2nd pass. + pass = pass + 1 + End If + + Else + '' the zip process is asynchronous. wait for completion, + '' but don't wait forever. + Dim sLoop + sLoop = 0 + WScript.Echo "Verifying the count..." + Do Until fcount <= zip.Items.Count + Wscript.Sleep(400) + sLoop = sLoop + 1 + If ((sLoop Mod 6) = 0) Then + WScript.Echo " have " & zip.items.Count & " items so far, need " & fcount + ElseIf sLoop > 80 Then + WScript.Echo "Giving up..." + Set zip = Nothing + Wscript.Sleep(1200) + If fso.FileExists(fullPathToZipFile) Then + fso.DeleteFile fullPathToZipFile + End If + Err.Raise 1460, "PackResources.vbs/CreateZip", "Timeout waiting for ZIP completion" + End If + Loop + End If + pass = pass + 1 + + Loop + + Set fso = Nothing + Set sa = Nothing + Set zip = Nothing + Set folder = Nothing + +End Sub + + + +CreateZip "..\..\Resources\zippedResources.zip", "..\..\Resources" diff --git a/dotNetZip/Zip/Properties/AssemblyInfo.cs b/dotNetZip/Zip/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..12afa8a Binary files /dev/null and b/dotNetZip/Zip/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zip/Resources/CommandLineSelfExtractorStub.cs b/dotNetZip/Zip/Resources/CommandLineSelfExtractorStub.cs new file mode 100644 index 0000000..d776f3e --- /dev/null +++ b/dotNetZip/Zip/Resources/CommandLineSelfExtractorStub.cs @@ -0,0 +1,627 @@ +// CommandLineSelfExtractorStub.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-June-18 20:58:45> +// +// ------------------------------------------------------------------ +// +// This is a the source module that implements the stub of a +// command-line self-extracting Zip archive - the code included in all +// command-line SFX files. This code is included as a resource into the +// DotNetZip DLL, and then is compiled at runtime when a SFX is saved. +// +// ------------------------------------------------------------------ + + +namespace Ionic.Zip +{ + // include the using statements inside the namespace declaration, + // because source code will be concatenated together before + // compilation. + using System; + using System.Reflection; + using System.Resources; + using System.IO; + using System.Collections.Generic; + using System.Diagnostics; + using Ionic.Zip; + + public class CommandLineSelfExtractor + { + const string DllResourceName = "Ionic.Zip.dll"; + + string TargetDirectory = "@@EXTRACTLOCATION"; + string PostUnpackCmdLine = "@@POST_UNPACK_CMD_LINE"; + bool ReplacedEnvVarsForTargetDirectory; + bool ReplacedEnvVarsForCmdLine; + bool ListOnly; + bool Verbose; + bool ReallyVerbose; + bool RemoveFilesAfterExe; + bool SkipPostUnpackCommand; + string Password = null; + + // cannot include the following line, because of our use of + // the AssemblyResolver event. + + //Ionic.Zip.ExtractExistingFileAction Overwrite; + int Overwrite; + + // Attention: it isn't possible, with the design of this class as it is + // now, to have a member variable of a type from the Ionic.Zip assembly. + // The class design registers an assembly resolver, but apparently NOT in + // time to allow the assembly to be used in private instance variables. + + private bool PostUnpackCmdLineIsSet() + { + // What is going on here? + // The PostUnpackCmdLine is initialized to a particular value, then + // we test to see if it begins with the first two chars of that value, + // and ends with the last part of the value. Why? + + // Here's the thing. In order to insure the code is right, this module has + // to compile as it is, as a standalone module. But then, inside + // DotNetZip, when generating an SFX, we do a text.Replace on the source + // code, potentially replacing @@POST_UNPACK_CMD_LINE with an actual value. + // The test here checks to see if it has been set. + + bool result = !(PostUnpackCmdLine.StartsWith("@@") && + PostUnpackCmdLine.EndsWith("POST_UNPACK_CMD_LINE")); + + if (result && ReplacedEnvVarsForCmdLine == false) + { + PostUnpackCmdLine= ReplaceEnvVars(PostUnpackCmdLine); + ReplacedEnvVarsForCmdLine = true; + } + + return result; + } + + + private bool TargetDirectoryIsSet() + { + bool result = !(TargetDirectory.StartsWith("@@") && + TargetDirectory.EndsWith("EXTRACTLOCATION")); + + if (result && ReplacedEnvVarsForTargetDirectory == false) + { + TargetDirectory= ReplaceEnvVars(TargetDirectory); + ReplacedEnvVarsForTargetDirectory = true; + } + return result; + } + + + + private string ReplaceEnvVars(string s) + { + System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables(); + foreach (System.Collections.DictionaryEntry de in envVars) + { + string t = "%" + de.Key + "%"; + s= s.Replace(t, de.Value as String); + } + + return s; + } + + + private bool SetRemoveFilesFlag() + { + bool result = false; + Boolean.TryParse("@@REMOVE_AFTER_EXECUTE", out result); + RemoveFilesAfterExe = result; + return result; + } + + + private bool SetVerboseFlag() + { + bool result = false; + Boolean.TryParse("@@QUIET", out result); + Verbose = !result; + return Verbose; + } + + private int SetOverwriteBehavior() + { + Int32 result = 0; + Int32.TryParse("@@EXTRACT_EXISTING_FILE", out result); + Overwrite = (int) result; + return result; + } + + + // ctor + private CommandLineSelfExtractor() + { + SetRemoveFilesFlag(); + SetVerboseFlag(); + SetOverwriteBehavior(); + PostUnpackCmdLineIsSet(); + TargetDirectoryIsSet(); + } + + + // ctor + public CommandLineSelfExtractor(string[] args) : this() + { + string specifiedDirectory = null; + for (int i = 0; i < args.Length; i++) + { + switch (args[i]) + { + case "-d": + i++; + if (args.Length <= i) + { + Console.WriteLine("please supply a directory.\n"); + GiveUsageAndExit(); + } + if (specifiedDirectory != null) + { + Console.WriteLine("You already provided a directory.\n"); + GiveUsageAndExit(); + } + specifiedDirectory = args[i]; + break; + case "-p": + i++; + if (args.Length <= i) + { + Console.WriteLine("please supply a password.\n"); + GiveUsageAndExit(); + } + if (Password != null) + { + Console.WriteLine("You already provided a password.\n"); + GiveUsageAndExit(); + } + Password = args[i]; + break; + case "-o": + Overwrite = 1; + //WantOverwrite = ExtractExistingFileAction.OverwriteSilently; + break; + case "-n": + Overwrite= 2; + //WantOverwrite = ExtractExistingFileAction.DoNotOverwrite; + break; + case "-l": + ListOnly = true; + break; + case "-r+": + RemoveFilesAfterExe = true; + break; + case "-r-": + RemoveFilesAfterExe = false; + break; + case "-x": + SkipPostUnpackCommand = true; + break; + case "-?": + GiveUsageAndExit(); + break; + case "-v-": + Verbose = false; + break; + case "-v+": + if (Verbose) + ReallyVerbose = true; + else + Verbose = true; + break; + default: + Console.WriteLine("unrecognized argument: '{0}'\n", args[i]); + GiveUsageAndExit(); + break; + } + } + + + if (!ListOnly) + { + if (specifiedDirectory!=null) + TargetDirectory = specifiedDirectory; + else if (!TargetDirectoryIsSet()) + TargetDirectory = "."; // cwd + } + + if (ListOnly && ((Overwrite!= 0) || (specifiedDirectory != null))) + { + Console.WriteLine("Inconsistent options.\n"); + GiveUsageAndExit(); + } + } + + + // workitem 8988 + private string[] SplitCommandLine(string cmdline) + { + // if the first char is NOT a double-quote, then just split the line + if (cmdline[0]!='"') + return cmdline.Split( new char[] {' '}, 2); + + // the first char is double-quote. Need to verify that there's another one. + int ix = cmdline.IndexOf('"', 1); + if (ix == -1) return null; // no double-quote - FAIL + + // if the double-quote is the last char, then just return an array of ONE string + if (ix+1 == cmdline.Length) return new string[] { cmdline.Substring(1,ix-1) }; + + if (cmdline[ix+1]!= ' ') return null; // no space following the double-quote - FAIL + + // there's definitely another double quote, followed by a space + string[] args = new string[2]; + args[0] = cmdline.Substring(1,ix-1); + while (cmdline[ix+1]==' ') ix++; // go to next non-space char + args[1] = cmdline.Substring(ix+1); + return args; + } + + + static CommandLineSelfExtractor() + { + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(Resolver); + } + + + static System.Reflection.Assembly Resolver(object sender, ResolveEventArgs args) + { + // super defensive + Assembly a1 = Assembly.GetExecutingAssembly(); + if (a1==null) + throw new Exception("GetExecutingAssembly returns null."); + + string[] tokens = args.Name.Split(','); + String[] names = a1.GetManifestResourceNames(); + + if (names==null) + throw new Exception("GetManifestResourceNames returns null."); + + // workitem 7978 + Stream s = null; + foreach (string n in names) + { + string root = n.Substring(0,n.Length-4); + string ext = n.Substring(n.Length-3); + if (root.Equals(tokens[0]) && ext.ToLower().Equals("dll")) + { + s= a1.GetManifestResourceStream(n); + if (s!=null) break; + } + } + + if (s==null) + throw new Exception(String.Format("GetManifestResourceStream returns null. Available resources: [{0}]", + String.Join("|", names))); + + byte[] block = new byte[s.Length]; + + if (block==null) + throw new Exception(String.Format("Cannot allocated buffer of length({0}).", s.Length)); + + s.Read(block, 0, block.Length); + Assembly a2 = Assembly.Load(block); + if (a2==null) + throw new Exception("Assembly.Load(block) returns null"); + + return a2; + } + + + + public int Run() + { + //System.Diagnostics.Debugger.Break(); + + List itemsExtracted= new List(); + + global::Ionic.Zip.ExtractExistingFileAction WantOverwrite = + (Ionic.Zip.ExtractExistingFileAction) Overwrite; + + // There way this works: the EXE is a ZIP file. So + // read from the location of the assembly, in other words the path to the exe. + Assembly a = Assembly.GetExecutingAssembly(); + + int rc = 0; + try + { + // workitem 7067 + using (global::Ionic.Zip.ZipFile zip = global::Ionic.Zip.ZipFile.Read(a.Location)) + { + if (Verbose) + Console.WriteLine("Command-Line Self Extractor generated by DotNetZip."); + + if (!ListOnly) + { + if (Verbose) + { + Console.Write("Extracting to {0}", TargetDirectory); + System.Console.WriteLine(" (Existing file action: {0})", WantOverwrite.ToString()); + } + } + + bool header = true; + foreach (global::Ionic.Zip.ZipEntry entry in zip) + { + if (ListOnly || ReallyVerbose) + { + if (header) + { + System.Console.WriteLine("Extracting Zip file: {0}", zip.Name); + if ((zip.Comment != null) && (zip.Comment != "")) + System.Console.WriteLine("Comment: {0}", zip.Comment); + + System.Console.WriteLine("\n{1,-22} {2,9} {3,5} {4,9} {5,3} {6,8} {0}", + "Filename", "Modified", "Size", "Ratio", "Packed", "pw?", "CRC"); + System.Console.WriteLine(new System.String('-', 80)); + header = false; + } + + System.Console.WriteLine("{1,-22} {2,9} {3,5:F0}% {4,9} {5,3} {6:X8} {0}", + entry.FileName, + entry.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + entry.UncompressedSize, + entry.CompressionRatio, + entry.CompressedSize, + (entry.UsesEncryption) ? "Y" : "N", + entry.Crc); + + } + + if (!ListOnly) + { + if (Verbose && !ReallyVerbose) + System.Console.WriteLine(" {0}", entry.FileName); + + if (entry.Encryption == global::Ionic.Zip.EncryptionAlgorithm.None) + { + try + { + entry.Extract(TargetDirectory, WantOverwrite); + itemsExtracted.Add(entry.FileName); + } + catch (Exception ex1) + { + Console.WriteLine(" Error -- {0}", ex1.Message); + rc++; + } + } + else + { + if (Password == null) + { + Console.WriteLine("Cannot extract entry {0} without a password.", entry.FileName); + rc++; + } + else + { + try + { + entry.ExtractWithPassword(TargetDirectory, WantOverwrite, Password); + itemsExtracted.Add(entry.FileName); + } + catch (Exception ex2) + { + Console.WriteLine(" Error -- {0}", ex2.Message); + rc++; + } + } + } + } + } + } + } + catch (Exception) + { + Console.WriteLine("The self-extracting zip file is corrupted."); + return 4; + } + + if (rc != 0) return rc; + + + // potentially execute the embedded command + if (PostUnpackCmdLineIsSet() && !SkipPostUnpackCommand) + { + if (ListOnly) + { + Console.WriteLine("\nExecute on unpack: {0}", PostUnpackCmdLine); + } + else + { + try + { + string[] args = SplitCommandLine(PostUnpackCmdLine); + + if (args!= null && args.Length > 0) + { + if (Verbose) + System.Console.WriteLine("Running command: {0}", PostUnpackCmdLine); + + ProcessStartInfo startInfo = new ProcessStartInfo(args[0]); + startInfo.WorkingDirectory = TargetDirectory; + startInfo.CreateNoWindow = true; + if (args.Length > 1) startInfo.Arguments = args[1]; + + using (Process p = Process.Start(startInfo)) + { + if (p!=null) + { + p.WaitForExit(); + rc = p.ExitCode; + // workitem 8925 + if (p.ExitCode == 0) + { + if (RemoveFilesAfterExe) + { + foreach (string s in itemsExtracted) + { + string fullPath = Path.Combine(TargetDirectory,s); + try + { + if (File.Exists(fullPath)) + File.Delete(fullPath); + else if (Directory.Exists(fullPath)) + Directory.Delete(fullPath, true); + } + catch + { + } + } + } + } + } + } + + + } + } + catch (Exception exc1) + { + System.Console.WriteLine("{0}", exc1); + rc = 5; + } + + } + } + + return rc; + } + + + + private void GiveUsageAndExit() + { + Assembly a = Assembly.GetExecutingAssembly(); + string s = Path.GetFileName(a.Location); + Console.WriteLine("DotNetZip Command-Line Self Extractor, see http://DotNetZip.codeplex.com/"); + Console.WriteLine("Copyright (c) 2008-2011 Dino Chiesa."); + + Console.WriteLine("usage:\n {0} [-p ] [-d ]", s); + + string more = " Extracts entries from the archive. If any files to be extracted already\n" + + " exist, the program will stop.\n\n Additional Options:\n" + + "{0}" + + "{1}" + + "{2}" + + "{3}"; + + string overwriteString = + String.Format(" -o overwrite any existing files upon extraction{0}.\n" + + " -n do not overwrite any existing files upon extraction{1}.\n", + (Overwrite == 1) ? " (default)" : "", + (Overwrite == 2) ? " (default)" : ""); + + string removeString = PostUnpackCmdLineIsSet() + ? String.Format(" -r+ remove files after the optional post-unpack exe completes{0}.\n" + + " -r- don't remove files after the optional post-unpack exe completes{1}.\n", + RemoveFilesAfterExe ? " (default)" : "", + RemoveFilesAfterExe ? "" : " (default)") + : ""; + + string verbString = String.Format(" -v- turn OFF verbose messages{0}.\n"+ + " -v+ turn ON verbose messages{1}.\n", + Verbose ? "" : " (default)", + Verbose ? " (default)" : ""); + + string cmdString = PostUnpackCmdLineIsSet() + ? String.Format(" -x don't run the post-unpack exe.\n [cmd is: {0}]\n", + PostUnpackCmdLine) + : "" ; + + Console.WriteLine(more, overwriteString, removeString, cmdString, verbString); + + + if (TargetDirectoryIsSet()) + Console.WriteLine(" default extract dir: [{0}]\n", TargetDirectory); + + + Console.WriteLine(" {0} -l", s); + Console.WriteLine(" Lists entries in the archive."); + FreeConsole(); + Environment.Exit(1); + } + + + [STAThread] + public static int Main(string[] args) + { + int left = 0; + int top = 0; + try + { + left = Console.CursorLeft; + top = Console.CursorTop; + } + catch { } // suppress + + bool wantPause = (left==0 && top==0); + int rc = 0; + try + { + CommandLineSelfExtractor me = new CommandLineSelfExtractor(args); + + // Hide my own console window if there is no parent console + // (which means, it was launched rom explorer). + if (!me.Verbose) + { + IntPtr myHandle = Process.GetCurrentProcess().MainWindowHandle; + ShowWindow(myHandle, SW_HIDE); + } + + rc = me.Run(); + + // If there was an error, and this is a new console, and + // we're still displaying the console, then do a + // ReadLine. This gives the user a chance to read the + // window error messages before dismissing. + if (rc != 0 && wantPause && me.Verbose) + { + //Console.WriteLine("rc({0}) wantPause({1}) verbose({2})", rc, wantPause, me.Verbose); + Console.Write(" to continue..."); + Console.ReadLine(); + } + + } + catch (System.Exception exc1) + { + Console.WriteLine("Exception while extracting: {0}", exc1.ToString()); + rc = 255; + } + + FreeConsole(); + return rc; + } + + private static readonly int SW_HIDE= 0; + + [System.Runtime.InteropServices.DllImport("user32.dll")] + private static extern Boolean ShowWindow(IntPtr hWnd, Int32 nCmdShow); + + [System.Runtime.InteropServices.DllImport("kernel32.dll")] + private static extern bool AttachConsole(int pid); + + [System.Runtime.InteropServices.DllImport("kernel32.dll")] + private static extern bool AllocConsole(); + + [System.Runtime.InteropServices.DllImport("kernel32.dll")] + private static extern bool FreeConsole(); + + } +} diff --git a/dotNetZip/Zip/Resources/FolderBrowserDialogEx.cs b/dotNetZip/Zip/Resources/FolderBrowserDialogEx.cs new file mode 100644 index 0000000..42421d5 --- /dev/null +++ b/dotNetZip/Zip/Resources/FolderBrowserDialogEx.cs @@ -0,0 +1,548 @@ +// FolderBrowserDialogEx.cs +// +// A replacement for the builtin System.Windows.Forms.FolderBrowserDialog class. +// This one includes an edit box, and also displays the full path in the edit box. +// +// based on code from http://support.microsoft.com/default.aspx?scid=kb;[LN];306285 +// +// 20 Feb 2009 +// +// ======================================================================================== +// Example usage: +// +// string _folderName = "c:\\dinoch"; +// private void button1_Click(object sender, EventArgs e) +// { +// _folderName = (System.IO.Directory.Exists(_folderName)) ? _folderName : ""; +// var dlg1 = new Ionic.Utils.FolderBrowserDialogEx +// { +// Description = "Select a folder for the extracted files:", +// ShowNewFolderButton = true, +// ShowEditBox = true, +// //NewStyle = false, +// SelectedPath = _folderName, +// ShowFullPathInEditBox= false, +// }; +// dlg1.RootFolder = System.Environment.SpecialFolder.MyComputer; +// +// var result = dlg1.ShowDialog(); +// +// if (result == DialogResult.OK) +// { +// _folderName = dlg1.SelectedPath; +// this.label1.Text = "The folder selected was: "; +// this.label2.Text = _folderName; +// } +// } +// + + +namespace Ionic.Utils +{ +using System; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using System.ComponentModel; +using System.Security.Permissions; +using System.Security; +using System.Threading; + + //[Designer("System.Windows.Forms.Design.FolderBrowserDialogDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DefaultEvent("HelpRequest"), SRDescription("DescriptionFolderBrowserDialog"), DefaultProperty("SelectedPath")] + public class FolderBrowserDialogEx : System.Windows.Forms.CommonDialog + { + private static readonly int MAX_PATH = 260; + + // Fields + private PInvoke.BrowseFolderCallbackProc _callback; + private string _descriptionText; + private Environment.SpecialFolder _rootFolder; + private string _selectedPath; + private bool _selectedPathNeedsCheck; + private bool _showNewFolderButton; + private bool _showEditBox; + private bool _showBothFilesAndFolders; + private bool _newStyle = true; + private bool _showFullPathInEditBox = true; + private bool _dontIncludeNetworkFoldersBelowDomainLevel; + private int _uiFlags; + private IntPtr _hwndEdit; + private IntPtr _rootFolderLocation; + + // Events + //[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler HelpRequest + { + add + { + base.HelpRequest += value; + } + remove + { + base.HelpRequest -= value; + } + } + + // ctor + public FolderBrowserDialogEx() + { + this.Reset(); + } + + // Factory Methods + public static FolderBrowserDialogEx PrinterBrowser() + { + FolderBrowserDialogEx x = new FolderBrowserDialogEx(); + // avoid MBRO comppiler warning when passing _rootFolderLocation as a ref: + x.BecomePrinterBrowser(); + return x; + } + + public static FolderBrowserDialogEx ComputerBrowser() + { + FolderBrowserDialogEx x = new FolderBrowserDialogEx(); + // avoid MBRO comppiler warning when passing _rootFolderLocation as a ref: + x.BecomeComputerBrowser(); + return x; + } + + + // Helpers + private void BecomePrinterBrowser() + { + _uiFlags += BrowseFlags.BIF_BROWSEFORPRINTER; + Description = "Select a printer:"; + PInvoke.Shell32.SHGetSpecialFolderLocation(IntPtr.Zero, CSIDL.PRINTERS, ref this._rootFolderLocation); + ShowNewFolderButton = false; + ShowEditBox = false; + } + + private void BecomeComputerBrowser() + { + _uiFlags += BrowseFlags.BIF_BROWSEFORCOMPUTER; + Description = "Select a computer:"; + PInvoke.Shell32.SHGetSpecialFolderLocation(IntPtr.Zero, CSIDL.NETWORK, ref this._rootFolderLocation); + ShowNewFolderButton = false; + ShowEditBox = false; + } + + + private class CSIDL + { + public const int PRINTERS = 4; + public const int NETWORK = 0x12; + } + + private class BrowseFlags + { + public const int BIF_DEFAULT = 0x0000; + public const int BIF_BROWSEFORCOMPUTER = 0x1000; + public const int BIF_BROWSEFORPRINTER = 0x2000; + public const int BIF_BROWSEINCLUDEFILES = 0x4000; + public const int BIF_BROWSEINCLUDEURLS = 0x0080; + public const int BIF_DONTGOBELOWDOMAIN = 0x0002; + public const int BIF_EDITBOX = 0x0010; + public const int BIF_NEWDIALOGSTYLE = 0x0040; + public const int BIF_NONEWFOLDERBUTTON = 0x0200; + public const int BIF_RETURNFSANCESTORS = 0x0008; + public const int BIF_RETURNONLYFSDIRS = 0x0001; + public const int BIF_SHAREABLE = 0x8000; + public const int BIF_STATUSTEXT = 0x0004; + public const int BIF_UAHINT = 0x0100; + public const int BIF_VALIDATE = 0x0020; + public const int BIF_NOTRANSLATETARGETS = 0x0400; + } + + private static class BrowseForFolderMessages + { + // messages FROM the folder browser + public const int BFFM_INITIALIZED = 1; + public const int BFFM_SELCHANGED = 2; + public const int BFFM_VALIDATEFAILEDA = 3; + public const int BFFM_VALIDATEFAILEDW = 4; + public const int BFFM_IUNKNOWN = 5; + + // messages TO the folder browser + public const int BFFM_SETSTATUSTEXT = 0x464; + public const int BFFM_ENABLEOK = 0x465; + public const int BFFM_SETSELECTIONA = 0x466; + public const int BFFM_SETSELECTIONW = 0x467; + } + + private int FolderBrowserCallback(IntPtr hwnd, int msg, IntPtr lParam, IntPtr lpData) + { + switch (msg) + { + case BrowseForFolderMessages.BFFM_INITIALIZED: + if (this._selectedPath.Length != 0) + { + PInvoke.User32.SendMessage(new HandleRef(null, hwnd), BrowseForFolderMessages.BFFM_SETSELECTIONW, 1, this._selectedPath); + if (this._showEditBox && this._showFullPathInEditBox) + { + // get handle to the Edit box inside the Folder Browser Dialog + _hwndEdit = PInvoke.User32.FindWindowEx(new HandleRef(null, hwnd), IntPtr.Zero, "Edit", null); + PInvoke.User32.SetWindowText(_hwndEdit, this._selectedPath); + } + } + break; + + case BrowseForFolderMessages.BFFM_SELCHANGED: + IntPtr pidl = lParam; + if (pidl != IntPtr.Zero) + { + if (((_uiFlags & BrowseFlags.BIF_BROWSEFORPRINTER) == BrowseFlags.BIF_BROWSEFORPRINTER) || + ((_uiFlags & BrowseFlags.BIF_BROWSEFORCOMPUTER) == BrowseFlags.BIF_BROWSEFORCOMPUTER)) + { + // we're browsing for a printer or computer, enable the OK button unconditionally. + PInvoke.User32.SendMessage(new HandleRef(null, hwnd), BrowseForFolderMessages.BFFM_ENABLEOK, 0, 1); + } + else + { + IntPtr pszPath = Marshal.AllocHGlobal(MAX_PATH * Marshal.SystemDefaultCharSize); + bool haveValidPath = PInvoke.Shell32.SHGetPathFromIDList(pidl, pszPath); + String displayedPath = Marshal.PtrToStringAuto(pszPath); + Marshal.FreeHGlobal(pszPath); + // whether to enable the OK button or not. (if file is valid) + PInvoke.User32.SendMessage(new HandleRef(null, hwnd), BrowseForFolderMessages.BFFM_ENABLEOK, 0, haveValidPath ? 1 : 0); + + // Maybe set the Edit Box text to the Full Folder path + if (haveValidPath && !String.IsNullOrEmpty(displayedPath)) + { + if (_showEditBox && _showFullPathInEditBox) + { + if (_hwndEdit != IntPtr.Zero) + PInvoke.User32.SetWindowText(_hwndEdit, displayedPath); + } + + if ((_uiFlags & BrowseFlags.BIF_STATUSTEXT) == BrowseFlags.BIF_STATUSTEXT) + PInvoke.User32.SendMessage(new HandleRef(null, hwnd), BrowseForFolderMessages.BFFM_SETSTATUSTEXT, 0, displayedPath); + } + } + } + break; + } + return 0; + } + + private static PInvoke.IMalloc GetSHMalloc() + { + PInvoke.IMalloc[] ppMalloc = new PInvoke.IMalloc[1]; + PInvoke.Shell32.SHGetMalloc(ppMalloc); + return ppMalloc[0]; + } + + public override void Reset() + { + this._rootFolder = (Environment.SpecialFolder)0; + this._descriptionText = string.Empty; + this._selectedPath = string.Empty; + this._selectedPathNeedsCheck = false; + this._showNewFolderButton = true; + this._showEditBox = true; + this._newStyle = true; + this._dontIncludeNetworkFoldersBelowDomainLevel = false; + this._hwndEdit = IntPtr.Zero; + this._rootFolderLocation = IntPtr.Zero; + } + + protected override bool RunDialog(IntPtr hWndOwner) + { + bool result = false; + if (_rootFolderLocation == IntPtr.Zero) + { + PInvoke.Shell32.SHGetSpecialFolderLocation(hWndOwner, (int)this._rootFolder, ref _rootFolderLocation); + if (_rootFolderLocation == IntPtr.Zero) + { + PInvoke.Shell32.SHGetSpecialFolderLocation(hWndOwner, 0, ref _rootFolderLocation); + if (_rootFolderLocation == IntPtr.Zero) + { + throw new InvalidOperationException("FolderBrowserDialogNoRootFolder"); + } + } + } + _hwndEdit = IntPtr.Zero; + //_uiFlags = 0; + if (_dontIncludeNetworkFoldersBelowDomainLevel) + _uiFlags += BrowseFlags.BIF_DONTGOBELOWDOMAIN; + if (this._newStyle) + _uiFlags += BrowseFlags.BIF_NEWDIALOGSTYLE; + if (!this._showNewFolderButton) + _uiFlags += BrowseFlags.BIF_NONEWFOLDERBUTTON; + if (this._showEditBox) + _uiFlags += BrowseFlags.BIF_EDITBOX; + if (this._showBothFilesAndFolders) + _uiFlags += BrowseFlags.BIF_BROWSEINCLUDEFILES; + + + if (Control.CheckForIllegalCrossThreadCalls && (Application.OleRequired() != ApartmentState.STA)) + { + throw new ThreadStateException("DebuggingException: ThreadMustBeSTA"); + } + IntPtr pidl = IntPtr.Zero; + IntPtr hglobal = IntPtr.Zero; + IntPtr pszPath = IntPtr.Zero; + try + { + PInvoke.BROWSEINFO browseInfo = new PInvoke.BROWSEINFO(); + hglobal = Marshal.AllocHGlobal(MAX_PATH * Marshal.SystemDefaultCharSize); + pszPath = Marshal.AllocHGlobal(MAX_PATH * Marshal.SystemDefaultCharSize); + this._callback = new PInvoke.BrowseFolderCallbackProc(this.FolderBrowserCallback); + browseInfo.pidlRoot = _rootFolderLocation; + browseInfo.Owner = hWndOwner; + browseInfo.pszDisplayName = hglobal; + browseInfo.Title = this._descriptionText; + browseInfo.Flags = _uiFlags; + browseInfo.callback = this._callback; + browseInfo.lParam = IntPtr.Zero; + browseInfo.iImage = 0; + pidl = PInvoke.Shell32.SHBrowseForFolder(browseInfo); + if (((_uiFlags & BrowseFlags.BIF_BROWSEFORPRINTER) == BrowseFlags.BIF_BROWSEFORPRINTER) || + ((_uiFlags & BrowseFlags.BIF_BROWSEFORCOMPUTER) == BrowseFlags.BIF_BROWSEFORCOMPUTER)) + { + this._selectedPath = Marshal.PtrToStringAuto(browseInfo.pszDisplayName); + result = true; + } + else + { + if (pidl != IntPtr.Zero) + { + PInvoke.Shell32.SHGetPathFromIDList(pidl, pszPath); + this._selectedPathNeedsCheck = true; + this._selectedPath = Marshal.PtrToStringAuto(pszPath); + result = true; + } + } + } + finally + { + PInvoke.IMalloc sHMalloc = GetSHMalloc(); + sHMalloc.Free(_rootFolderLocation); + _rootFolderLocation = IntPtr.Zero; + if (pidl != IntPtr.Zero) + { + sHMalloc.Free(pidl); + } + if (pszPath != IntPtr.Zero) + { + Marshal.FreeHGlobal(pszPath); + } + if (hglobal != IntPtr.Zero) + { + Marshal.FreeHGlobal(hglobal); + } + this._callback = null; + } + return result; + } + + // Properties + //[SRDescription("FolderBrowserDialogDescription"), SRCategory("CatFolderBrowsing"), Browsable(true), DefaultValue(""), Localizable(true)] + + /// + /// This description appears near the top of the dialog box, providing direction to the user. + /// + public string Description + { + get + { + return this._descriptionText; + } + set + { + this._descriptionText = (value == null) ? string.Empty : value; + } + } + + //[Localizable(false), SRCategory("CatFolderBrowsing"), SRDescription("FolderBrowserDialogRootFolder"), TypeConverter(typeof(SpecialFolderEnumConverter)), Browsable(true), DefaultValue(0)] + public Environment.SpecialFolder RootFolder + { + get + { + return this._rootFolder; + } + set + { + if (!Enum.IsDefined(typeof(Environment.SpecialFolder), value)) + { + throw new InvalidEnumArgumentException("value", (int)value, typeof(Environment.SpecialFolder)); + } + this._rootFolder = value; + } + } + + //[Browsable(true), SRDescription("FolderBrowserDialogSelectedPath"), SRCategory("CatFolderBrowsing"), DefaultValue(""), Editor("System.Windows.Forms.Design.SelectedPathEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor)), Localizable(true)] + + /// + /// Set or get the selected path. + /// + public string SelectedPath + { + get + { + if (((this._selectedPath != null) && (this._selectedPath.Length != 0)) && this._selectedPathNeedsCheck) + { + new FileIOPermission(FileIOPermissionAccess.PathDiscovery, this._selectedPath).Demand(); + this._selectedPathNeedsCheck = false; + } + return this._selectedPath; + } + set + { + this._selectedPath = (value == null) ? string.Empty : value; + this._selectedPathNeedsCheck = true; + } + } + + //[SRDescription("FolderBrowserDialogShowNewFolderButton"), Localizable(false), Browsable(true), DefaultValue(true), SRCategory("CatFolderBrowsing")] + + /// + /// Enable or disable the "New Folder" button in the browser dialog. + /// + public bool ShowNewFolderButton + { + get + { + return this._showNewFolderButton; + } + set + { + this._showNewFolderButton = value; + } + } + + /// + /// Show an "edit box" in the folder browser. + /// + /// + /// The "edit box" normally shows the name of the selected folder. + /// The user may also type a pathname directly into the edit box. + /// + /// + public bool ShowEditBox + { + get + { + return this._showEditBox; + } + set + { + this._showEditBox = value; + } + } + + /// + /// Set whether to use the New Folder Browser dialog style. + /// + /// + /// The new style is resizable and includes a "New Folder" button. + /// + public bool NewStyle + { + get + { + return this._newStyle; + } + set + { + this._newStyle = value; + } + } + + + public bool DontIncludeNetworkFoldersBelowDomainLevel + { + get { return _dontIncludeNetworkFoldersBelowDomainLevel; } + set { _dontIncludeNetworkFoldersBelowDomainLevel = value; } + } + + /// + /// Show the full path in the edit box as the user selects it. + /// + /// + /// This works only if ShowEditBox is also set to true. + /// + public bool ShowFullPathInEditBox + { + get { return _showFullPathInEditBox; } + set { _showFullPathInEditBox = value; } + } + + public bool ShowBothFilesAndFolders + { + get { return _showBothFilesAndFolders; } + set { _showBothFilesAndFolders = value; } + } + } + + + + internal static class PInvoke + { + static PInvoke() { } + + public delegate int BrowseFolderCallbackProc(IntPtr hwnd, int msg, IntPtr lParam, IntPtr lpData); + + internal static class User32 + { + [DllImport("user32.dll", CharSet = CharSet.Auto)] + public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, string lParam); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, int lParam); + + [DllImport("user32.dll", SetLastError = true)] + //public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); + //public static extern IntPtr FindWindowEx(HandleRef hwndParent, HandleRef hwndChildAfter, string lpszClass, string lpszWindow); + public static extern IntPtr FindWindowEx(HandleRef hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); + + [DllImport("user32.dll", SetLastError = true)] + public static extern Boolean SetWindowText(IntPtr hWnd, String text); + } + + [ComImport, Guid("00000002-0000-0000-c000-000000000046"), SuppressUnmanagedCodeSecurity, InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IMalloc + { + [PreserveSig] + IntPtr Alloc(int cb); + [PreserveSig] + IntPtr Realloc(IntPtr pv, int cb); + [PreserveSig] + void Free(IntPtr pv); + [PreserveSig] + int GetSize(IntPtr pv); + [PreserveSig] + int DidAlloc(IntPtr pv); + [PreserveSig] + void HeapMinimize(); + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + public class BROWSEINFO + { + public IntPtr Owner; + public IntPtr pidlRoot; + public IntPtr pszDisplayName; + public string Title; + public int Flags; + public BrowseFolderCallbackProc callback; + public IntPtr lParam; + public int iImage; + } + + + + [SuppressUnmanagedCodeSecurity] + internal static class Shell32 + { + // Methods + [DllImport("shell32.dll", CharSet = CharSet.Auto)] + public static extern IntPtr SHBrowseForFolder([In] PInvoke.BROWSEINFO lpbi); + [DllImport("shell32.dll")] + public static extern int SHGetMalloc([Out, MarshalAs(UnmanagedType.LPArray)] PInvoke.IMalloc[] ppMalloc); + [DllImport("shell32.dll", CharSet = CharSet.Auto)] + public static extern bool SHGetPathFromIDList(IntPtr pidl, IntPtr pszPath); + [DllImport("shell32.dll")] + public static extern int SHGetSpecialFolderLocation(IntPtr hwnd, int csidl, ref IntPtr ppidl); + } + + } +} diff --git a/dotNetZip/Zip/Resources/PasswordDialog.Designer.cs b/dotNetZip/Zip/Resources/PasswordDialog.Designer.cs new file mode 100644 index 0000000..dc3bfc6 --- /dev/null +++ b/dotNetZip/Zip/Resources/PasswordDialog.Designer.cs @@ -0,0 +1,126 @@ +namespace Ionic.Zip.Forms +{ + partial class PasswordDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PasswordDialog)); + this.button1 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.prompt = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(218, 35); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(38, 23); + this.button1.TabIndex = 10; + this.button1.Text = "OK"; + this.toolTip1.SetToolTip(this.button1, "Use the specirfied password for extraction of this entry and subsequent entries."); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.btnOk_Click); + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point(12, 37); + this.textBox1.Name = "textBox1"; + this.textBox1.PasswordChar = '*'; + this.textBox1.Size = new System.Drawing.Size(200, 20); + this.textBox1.TabIndex = 0; + // + // prompt + // + this.prompt.AutoSize = true; + this.prompt.Location = new System.Drawing.Point(12, 15); + this.prompt.Name = "prompt"; + this.prompt.Size = new System.Drawing.Size(138, 13); + this.prompt.TabIndex = 20; + this.prompt.Text = "Enter the password for Xxxx"; + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.Location = new System.Drawing.Point(311, 35); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(58, 23); + this.btnCancel.TabIndex = 30; + this.btnCancel.Text = "Cancel"; + this.toolTip1.SetToolTip(this.btnCancel, "Cancel extraction of this and all subsequent entries"); + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.Location = new System.Drawing.Point(261, 35); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(45, 23); + this.button2.TabIndex = 20; + this.button2.Text = "Skip"; + this.toolTip1.SetToolTip(this.button2, "Skip extraction of this entry"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // PasswordDialog + // + this.AcceptButton = this.button1; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(381, 69); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.prompt); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "PasswordDialog"; + this.Text = "Password for zip extraction?"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label prompt; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.ToolTip toolTip1; + } +} \ No newline at end of file diff --git a/dotNetZip/Zip/Resources/PasswordDialog.cs b/dotNetZip/Zip/Resources/PasswordDialog.cs new file mode 100644 index 0000000..53cb5c7 --- /dev/null +++ b/dotNetZip/Zip/Resources/PasswordDialog.cs @@ -0,0 +1,79 @@ +// PasswordDialog.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// + +namespace Ionic.Zip.Forms +{ + using System; + using System.Collections.Generic; + using System.Windows.Forms; + + public partial class PasswordDialog : Form + { + public enum PasswordDialogResult { OK, Skip, Cancel }; + + public PasswordDialog() + { + InitializeComponent(); + this.textBox1.Focus(); + } + + public PasswordDialogResult Result + { + get + { + return _result; + } + } + + public string EntryName + { + set + { + prompt.Text = "Enter the password for " + value; + } + } + public string Password + { + get + { + return textBox1.Text; + } + } + + private void btnOk_Click(object sender, EventArgs e) + { + _result = PasswordDialogResult.OK; + this.Close(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + _result = PasswordDialogResult.Cancel; + this.Close(); + } + private void button2_Click(object sender, EventArgs e) + { + _result = PasswordDialogResult.Skip; + this.Close(); + } + + + private PasswordDialogResult _result; + + + } +} diff --git a/dotNetZip/Zip/Resources/PasswordDialog.resx b/dotNetZip/Zip/Resources/PasswordDialog.resx new file mode 100644 index 0000000..1f4b4fb --- /dev/null +++ b/dotNetZip/Zip/Resources/PasswordDialog.resx @@ -0,0 +1,1398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAoAMDAQAAEABABoBgAApgAAACAgEAABAAQA6AIAAA4HAAAQEBAAAQAEACgBAAD2CQAAMDAAAAEA + CACoDgAAHgsAACAgAAABAAgAqAgAAMYZAAAQEAAAAQAIAGgFAABuIgAAAAAAAAEAIAD1xgAA1icAADAw + AAABACAAqCUAAMvuAAAgIAAAAQAgAKgQAABzFAEAEBAAAAEAIABoBAAAGyUBACgAAAAwAAAAYAAAAAEA + BAAAAAAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDA + wAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAAAAg3EzAAAAAAAAAAAAAAAAAAAAAA + AIczEzEzM3FwAAAAAAAAAAAAAAAAAABzEzMTMzczFzczAAAAAAAAAAAAAAAAAHM4NzNzd3t4uLc3NwAA + AAAAAAAAAAAIMTe4t4uLi3e3mIuDMwAAAAAAAAAAAAcxe4uIi3mDebeTO3t7eQAAAAAAAAAABzN7eLiI + tbc5NzEzc3l4OAAAAAAAAAAAA4t4uIt4MzMzMzNzOLM5twAAAAAAAAAAB7i4i3e4lzd7d7e3i3gzMwAA + AAAAAAAACIt7mLh4uLe3e3mLmLeDeQAAAAAAAAAACLd4t4uPg4mJtTM3N5O3twAAAAAAAAAAC3e4i4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A + AAAAAAAAAAAAAAM4t7e3txc3AAAAAAAAAAAAAAAAAAAAAABze4j3EzOAAAAAAAAAAAAAAAAAAAAAAAAA + NTMTM4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///4H///AAD//AAH//8AAP/A + AAP//wAA/wAAAP//AAD4AAAA//8AAOAAAAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP// + AACAAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAA + AAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP// + AACAAAAH//8AAIAAAB///wAA8AAcH///AAD8H/wf//8AAPwf/B///wAA/B/8H///AAD8H/wf//8AAPwf + /B///wAA/B/8H///AAD8H/wf//8AAPwf/B///wAA/B/8H///AAD8H/wf//8AAPwf+B///wAA/A/4H/// + AAD8B/Af//8AAP4D4D///wAA/gAAP///AAD/AAB///8AAP+AAP///wAA/8AB////AAD/8Af///8AAP// + /////wAAKAAAACAAAABAAAAAAQAEAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACA + gACAAAAAgACAAICAAACAgIAAwMDAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAACHMxISEA + AAAAAAAAAAAAAzM3c3ODNwAAAAAAAAAAcxg3uYt7g3MwAAAAAAAAcze/e3ezk4t5cAAAAAAAAzi4iLWz + U3N5t7AAAAAAAAOLd7gzc7c7iDcwAAAAAAADiYt4i3eYN7i3MAAAAAAAA3uIiDl7M5OJN4AAAAAAAAOL + e7i3Nzg4uDMwAAAAAAAHt3iIi4t7c4t7cAAAAAAAA4uLiDk3k5OJN7AAAAAAAAOHuHi3N7d7iDNwAAAA + AAAHt4uIi4t7e4t5MAAAAAAAA4uIiLU5c5N5N4AAAAAAAAOIuL97i4uIuLMwAAAAA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AAAAAAAAAAAAAAAABfJD1wh5CRZBcWKSmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAEAxKiEWExkqYwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//+B///wAA//wAB///AAD/wAAD//8AAP8A + AAD//wAA+AAAAP//AADgAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP// + AACAAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAA + AAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAAP//AACAAAAA//8AAIAAAAD//wAAgAAAB/// + AACAAAAf//8AAPAAHB///wAA/B/8H///AAD8H/wf//8AAPwf/B///wAA/B/8H///AAD8H/wf//8AAPwf + /B///wAA/B/8H///AAD8H/wf//8AAPwf/B///wAA/B/8H///AAD8H/gf//8AAPwP+B///wAA/AfwH/// + AAD+A+A///8AAP4AAD///wAA/wAAf///AAD/gAD///8AAP/AAf///wAA//AH////AAD///////8AACgA + AAAgAAAAQAAAAAEACAAAAAAAAAQAAAAAAAAAAAAAAAEAAAABAAAAAAAACjFDAAszRQANPlQADUBXAA5D + WwAUQ1gAEEtlABtPZQAQTmgAEVJtABVRbAAfUWkAElVyABRWcwASV3UAElh1AB5ZdwASWngAE1x6ABRd + ewATXXwALGB5ABRhggAVZYYAG2aFABVniQAVaYoAFmqMABZtjwAbbI0AH2yNABlvkQAacJIAHHKUAB51 + lgAzcYoAL3OSACF2mAAieJkAJHqbACR7nAAmfJ0AKH6fADJ5mQA4f54AKX+gAFd0ggBCepQAKoChACyB + ogAug6QAL4SlADCFpgAxhqgAM4ipADSJqgA2i6wAN4ytADiNrgA6j7AAO5CxADyRsgA+k7QAP5S1AEeG + owBIiqcATY6pAFCPq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AXnovpcfZLr/m8JxCo4QqFTsir64tIxvPnAWG+1kZPIX + fIJr9hYxMzMFz3Otlh823heCo1wuY35hPs0cUPT7fVxYXrYdeZWEUlJrpc9TSt84VbzwoZ/513/fvOv4 + yjOioLvrLpiPfeVUcsNrDz5eKuz8cxqv7wch+yilghACgpQcpASCcxQ9gmYnRhSnZceXmbKEEEitEPSb + 2LtnBzxPgFABQhg4IwiCPpSUMEa5Otm45bEvHP6TO+56Mr70p00wjtgSBuD61vf5ymnewRk/xBknruuh + WCqh0+nioYdP4NyFEMkQj13wCA7s8DA/PwXf80ZWfiE4SuUy5ufnUS6nacN+gOULy+h2OoiTBCpJYqnk + nV2y60c/dfenT/z739t4VvTzd931pP74Zx/ufObGqb+uCOeMhrmZErjGGII8QwAwRuGwCM2uhFRp+vIS + D8BmCxKpUCqQlOD0QCgDJVZb0Ov3IZUixhAPrvfIT73zpkfuuOP4xAvYIviONq98PsEYELlzx15OnRcy + zqkQHIVCAWEQYHFxEeeWQyTx4H51HYK5aQfz81Mo+D4oZaCE5it/qVTC/NwcSuUKCOVI4girqyvodDp2 + Ew8pg0SqD0WU/eS7fu2OM3fccYm2Ps8gCGDe+18e7LVnwz+jlPxAItUKAJP6AWCMw/VcNBpTWGg4cJ3R + KG8TewBtgG5f4t4HnsT6+hpk3AeMARMeypUKyqUSHCHABfdU0v2988efKj57VzvBM42xNwAfet/Nro7O + /QllpMwoA2UMgMHa2jqeOruKbqCgYd1+wYBamWPvzjpKRT8v4QVsy+1isYi5uXmUyuVUKhyj1Wyi1W4j + iRPIOO5LFR01G73/+53/7h87347Vfybx7nffk9B9X75fubXXx4lcMRgE+4wy+J6HvTunUC1zZIkNRoFK + icERg7oDAEgksNGK8fDDjyII+jDaOjScC9TrU3AcW/XIOZua8wv/8gtHbt5S2aPtjLE3AEDTo5xfy7mg + lBIIIdBut9HpdHBhXSJJss67gO9R7Nnholz2wbnIRTa28s5Ho9GwbD91AGPQ7/ewtraGKIwgkzjQOvkN + cYH9w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AAAAAAAAAAAAA + AAAAUXyX/2TI6P9Xd5D/AAAAAAAAAAAAAAAARXWT/zOr1/9Ee5v/AAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAFN9mP9lyej/VniR/wAAAAAAAAAAAAAAAEZ0kv8zrNn/Pnqb/wAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAABTfZj/Zcno/1Z4kf8AAAAAAAAAAAAAAABGdJL/M6zZ/z56m/8AAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAVoCY/2TI5v9dg5v/AAAAAAAAAAAAAAAASImp/zS04f9bfpj/AAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAFN9mNltx+P/bbHJ/3WZrv97l6r/WZOu/zSx3P8Qndj/U32Y2QAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB7l6poU32Y/2vD3/9zy+T/a8Ld/06w0v8Qndj/U32Y/3uXqmgA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHuXqmhZgZvZVniS/1N2j/9Ud5H/U32Y2XuXqmgA + AAAAAAAAAAAAAAAAAAAAAAAAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAIADAACAAwAAgAMAAOOPAADj + jwAA448AAOOPAADgDwAA4A8AAPAfAAA= + + + \ No newline at end of file diff --git a/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.Designer.cs b/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.Designer.cs new file mode 100644 index 0000000..98e6de7 --- /dev/null +++ b/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.Designer.cs @@ -0,0 +1,287 @@ +namespace Ionic.Zip +{ + partial class WinFormsSelfExtractorStub + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinFormsSelfExtractorStub)); + this.btnExtract = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.txtExtractDirectory = new System.Windows.Forms.TextBox(); + this.lblExtractDir = new System.Windows.Forms.Label(); + this.btnDirBrowse = new System.Windows.Forms.Button(); + this.chk_OpenExplorer = new System.Windows.Forms.CheckBox(); + this.chk_ExeAfterUnpack = new System.Windows.Forms.CheckBox(); + this.txtPostUnpackCmdLine = new System.Windows.Forms.TextBox(); + this.chk_Remove = new System.Windows.Forms.CheckBox(); + this.lblComment = new System.Windows.Forms.Label(); + this.txtComment = new System.Windows.Forms.TextBox(); + this.btnContents = new System.Windows.Forms.Button(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.progressBar2 = new System.Windows.Forms.ProgressBar(); + this.lblStatus = new System.Windows.Forms.Label(); + this.comboExistingFileAction = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btnExtract + // + this.btnExtract.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnExtract.Location = new System.Drawing.Point(331, 268); + this.btnExtract.Name = "btnExtract"; + this.btnExtract.Size = new System.Drawing.Size(60, 23); + this.btnExtract.TabIndex = 0; + this.btnExtract.Text = "Extract"; + this.btnExtract.UseVisualStyleBackColor = true; + this.btnExtract.Click += new System.EventHandler(this.btnExtract_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.Location = new System.Drawing.Point(397, 268); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(60, 23); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // txtExtractDirectory + // + this.txtExtractDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtExtractDirectory.Location = new System.Drawing.Point(8, 125); + this.txtExtractDirectory.Name = "txtExtractDirectory"; + this.txtExtractDirectory.Size = new System.Drawing.Size(417, 20); + this.txtExtractDirectory.TabIndex = 2; + // + // lblExtractDir + // + this.lblExtractDir.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblExtractDir.AutoSize = true; + this.lblExtractDir.Location = new System.Drawing.Point(5, 109); + this.lblExtractDir.Name = "lblExtractDir"; + this.lblExtractDir.Size = new System.Drawing.Size(100, 13); + this.lblExtractDir.TabIndex = 3; + this.lblExtractDir.Text = "Extract to Directory:"; + // + // btnDirBrowse + // + this.btnDirBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnDirBrowse.Location = new System.Drawing.Point(431, 122); + this.btnDirBrowse.Name = "btnDirBrowse"; + this.btnDirBrowse.Size = new System.Drawing.Size(25, 23); + this.btnDirBrowse.TabIndex = 4; + this.btnDirBrowse.Text = "..."; + this.btnDirBrowse.UseVisualStyleBackColor = true; + this.btnDirBrowse.Click += new System.EventHandler(this.btnDirBrowse_Click); + // + // chk_OpenExplorer + // + this.chk_OpenExplorer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.chk_OpenExplorer.AutoSize = true; + this.chk_OpenExplorer.Checked = true; + this.chk_OpenExplorer.CheckState = System.Windows.Forms.CheckState.Checked; + this.chk_OpenExplorer.Location = new System.Drawing.Point(8, 151); + this.chk_OpenExplorer.Name = "chk_OpenExplorer"; + this.chk_OpenExplorer.Size = new System.Drawing.Size(152, 17); + this.chk_OpenExplorer.TabIndex = 13; + this.chk_OpenExplorer.Text = "Open Explorer after extract"; + this.chk_OpenExplorer.UseVisualStyleBackColor = true; + // + // chk_ExeAfterUnpack + // + this.chk_ExeAfterUnpack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.chk_ExeAfterUnpack.AutoSize = true; + this.chk_ExeAfterUnpack.Checked = true; + this.chk_ExeAfterUnpack.CheckState = System.Windows.Forms.CheckState.Checked; + this.chk_ExeAfterUnpack.Location = new System.Drawing.Point(8, 192); + this.chk_ExeAfterUnpack.Name = "chk_ExeAfterUnpack"; + this.chk_ExeAfterUnpack.Size = new System.Drawing.Size(131, 17); + this.chk_ExeAfterUnpack.TabIndex = 15; + this.chk_ExeAfterUnpack.Text = "Execute after unpack:"; + this.chk_ExeAfterUnpack.UseVisualStyleBackColor = true; + this.chk_ExeAfterUnpack.CheckedChanged += new System.EventHandler(this.chk_ExeAfterUnpack_CheckedChanged); + // + // txtPostUnpackCmdLine + // + this.txtPostUnpackCmdLine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtPostUnpackCmdLine.Location = new System.Drawing.Point(145, 190); + this.txtPostUnpackCmdLine.Name = "txtPostUnpackCmdLine"; + this.txtPostUnpackCmdLine.ReadOnly = true; + this.txtPostUnpackCmdLine.Size = new System.Drawing.Size(312, 20); + this.txtPostUnpackCmdLine.TabIndex = 16; + // + // chk_Remove + // + this.chk_Remove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.chk_Remove.AutoSize = true; + this.chk_Remove.Location = new System.Drawing.Point(8, 212); + this.chk_Remove.Name = "chk_Remove"; + this.chk_Remove.Size = new System.Drawing.Size(271, 17); + this.chk_Remove.TabIndex = 17; + this.chk_Remove.Text = "Remove files after executing post-unpack command"; + this.chk_Remove.UseVisualStyleBackColor = true; + // + // lblComment + // + this.lblComment.AutoSize = true; + this.lblComment.Location = new System.Drawing.Point(5, 6); + this.lblComment.Name = "lblComment"; + this.lblComment.Size = new System.Drawing.Size(75, 13); + this.lblComment.TabIndex = 8; + this.lblComment.Text = "Zip Comment: "; + // + // txtComment + // + this.txtComment.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtComment.Location = new System.Drawing.Point(8, 22); + this.txtComment.Multiline = true; + this.txtComment.Name = "txtComment"; + this.txtComment.ReadOnly = true; + this.txtComment.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtComment.Size = new System.Drawing.Size(448, 82); + this.txtComment.TabIndex = 9; + // + // btnContents + // + this.btnContents.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnContents.Location = new System.Drawing.Point(235, 268); + this.btnContents.Name = "btnContents"; + this.btnContents.Size = new System.Drawing.Size(90, 23); + this.btnContents.TabIndex = 20; + this.btnContents.Text = "Show Contents"; + this.btnContents.UseVisualStyleBackColor = true; + this.btnContents.Click += new System.EventHandler(this.btnContents_Click); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(8, 237); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(449, 10); + this.progressBar1.TabIndex = 11; + this.progressBar1.TabStop = false; + // + // progressBar2 + // + this.progressBar2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar2.Location = new System.Drawing.Point(8, 252); + this.progressBar2.Name = "progressBar2"; + this.progressBar2.Size = new System.Drawing.Size(449, 11); + this.progressBar2.TabIndex = 12; + this.progressBar2.TabStop = false; + // + // lblStatus + // + this.lblStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(9, 273); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(0, 13); + this.lblStatus.TabIndex = 13; + // + // comboExistingFileAction + // + this.comboExistingFileAction.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.comboExistingFileAction.FormattingEnabled = true; + this.comboExistingFileAction.Location = new System.Drawing.Point(116, 167); + this.comboExistingFileAction.Name = "comboExistingFileAction"; + this.comboExistingFileAction.Size = new System.Drawing.Size(104, 21); + this.comboExistingFileAction.TabIndex = 21; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 172); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 22; + this.label1.Text = "Existing File Action:"; + // + // WinFormsSelfExtractorStub + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(468, 300); + this.Controls.Add(this.label1); + this.Controls.Add(this.comboExistingFileAction); + this.Controls.Add(this.chk_Remove); + this.Controls.Add(this.chk_ExeAfterUnpack); + this.Controls.Add(this.txtPostUnpackCmdLine); + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.progressBar2); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.btnContents); + this.Controls.Add(this.txtComment); + this.Controls.Add(this.lblComment); + this.Controls.Add(this.chk_OpenExplorer); + this.Controls.Add(this.btnDirBrowse); + this.Controls.Add(this.lblExtractDir); + this.Controls.Add(this.txtExtractDirectory); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnExtract); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(1024, 400); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(484, 336); + this.Name = "WinFormsSelfExtractorStub"; + this.Text = "This text will be replaced at runtime"; + this.Shown += new System.EventHandler(this.Form_Shown); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnExtract; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnDirBrowse; + private System.Windows.Forms.Button btnContents; + private System.Windows.Forms.TextBox txtExtractDirectory; + private System.Windows.Forms.Label lblExtractDir; + private System.Windows.Forms.CheckBox chk_OpenExplorer; + private System.Windows.Forms.Label lblComment; + private System.Windows.Forms.TextBox txtComment; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.ProgressBar progressBar2; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.TextBox txtPostUnpackCmdLine; + private System.Windows.Forms.CheckBox chk_ExeAfterUnpack; + private System.Windows.Forms.CheckBox chk_Remove; + private System.Windows.Forms.ComboBox comboExistingFileAction; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.cs b/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.cs new file mode 100644 index 0000000..e67363a --- /dev/null +++ b/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.cs @@ -0,0 +1,1087 @@ +// WinFormsSelfExtractorStub.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008, 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-30 15:48:47> +// +// ------------------------------------------------------------------ +// +// Implements the "stub" of a WinForms self-extracting Zip archive. This +// code is included in all GUI SFX files. It is included as a resource +// into the DotNetZip DLL, and then is compiled at runtime when a SFX is +// saved. This code runs when the SFX is run. +// +// ------------------------------------------------------------------ + +namespace Ionic.Zip +{ + // The using statements must be inside the namespace scope, because when the SFX is being + // generated, this module gets concatenated with other source code and then compiled. + + using System; + using System.Reflection; + using System.IO; + using System.Collections.Generic; + using System.Windows.Forms; + using System.Diagnostics; + using System.Threading; // ThreadPool, WaitCallback + using Ionic.Zip; + using Ionic.Zip.Forms; + + public partial class WinFormsSelfExtractorStub : Form + { + private const string DllResourceName = "Ionic.Zip.dll"; + private int entryCount; + private int Overwrite; + private bool Interactive; + private ManualResetEvent postUpackExeDone; + + delegate void ExtractEntryProgress(ExtractProgressEventArgs e); + + void _SetDefaultExtractLocation() + { + // Design Note: + + // What follows may look odd. The textbox is set to a particular value. + // Then the value is tested, and if the value begins with the first part + // of the string and ends with the last part, and if it does, then we + // change the value. When would that not get replaced? + // + + // Well, here's the thing. This module has to compile as it is, as a + // standalone sample. But then, inside DotNetZip, when generating an SFX, + // we do a text.Replace on @@EXTRACTLOCATION and insert a different value. + + // So the effect is, with a straight compile, the value gets + // SpecialFolder.Personal. If you replace @@EXTRACTLOCATION with + // something else, it stays and does not get replaced. + + this.txtExtractDirectory.Text = "@@EXTRACTLOCATION"; + + this.txtExtractDirectory.Text = ReplaceEnvVars(this.txtExtractDirectory.Text); + + + if (this.txtExtractDirectory.Text.StartsWith("@@") && + this.txtExtractDirectory.Text.EndsWith("EXTRACTLOCATION")) + { + this.txtExtractDirectory.Text = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), + ZipName); + } + } + + + // workitem 8893 + private string ReplaceEnvVars(string v) + { + string s= v; + System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables(); + foreach (System.Collections.DictionaryEntry de in envVars) + { + string t = "%" + de.Key + "%"; + s= s.Replace(t, de.Value as String); + } + + return s; + } + + + private bool SetInteractiveFlag() + { + bool result = false; + Boolean.TryParse("@@QUIET", out result); + Interactive = !result; + return Interactive; + } + + private int SetOverwriteBehavior() + { + Int32 result = 0; + Int32.TryParse("@@EXTRACT_EXISTING_FILE", out result); + Overwrite = result; + return result; + } + + + private bool PostUnpackCmdLineIsSet() + { + string s = txtPostUnpackCmdLine.Text; + bool result = !(s.StartsWith("@@") && s.EndsWith("POST_UNPACK_CMD_LINE")); + return result; + } + + + + void _SetPostUnpackCmdLine() + { + // See the design note in _SetDefaultExtractLocation() for + // an explanation of what is going on here. + + this.txtPostUnpackCmdLine.Text = "@@POST_UNPACK_CMD_LINE"; + + this.txtPostUnpackCmdLine.Text = ReplaceEnvVars(this.txtPostUnpackCmdLine.Text); + + if (this.txtPostUnpackCmdLine.Text.StartsWith("@@") && + this.txtPostUnpackCmdLine.Text.EndsWith("POST_UNPACK_CMD_LINE")) + { + // If there is nothing set for the CMD to execute after unpack, then + // disable all the UI associated to that bit. + txtPostUnpackCmdLine.Enabled = txtPostUnpackCmdLine.Visible = false; + chk_ExeAfterUnpack.Enabled = chk_ExeAfterUnpack.Visible = false; + // workitem 8925 + this.chk_Remove.Enabled = this.chk_Remove.Visible = false; + + // adjust the position of all the remaining UI + int delta = this.progressBar1.Location.Y - this.chk_ExeAfterUnpack.Location.Y ; + + this.MinimumSize = new System.Drawing.Size(this.MinimumSize.Width, this.MinimumSize.Height - (delta -4)); + + //MoveDown(this.chk_Overwrite, delta); + MoveDown(this.comboExistingFileAction, delta); + MoveDown(this.label1, delta); + MoveDown(this.chk_OpenExplorer, delta); + MoveDown(this.btnDirBrowse, delta); + MoveDown(this.txtExtractDirectory, delta); + MoveDown(this.lblExtractDir, delta); + + // finally, adjust the size of the form + this.Size = new System.Drawing.Size(this.Width, this.Height - (delta-4)); + + // Add the size to the txtComment, because it is anchored to the bottom. + // When we shrink the size of the form, the txtComment shrinks also. + // No need for that. + this.txtComment.Size = new System.Drawing.Size(this.txtComment.Width, + this.txtComment.Height + delta); + } + else + { + // workitem 8925 + // there is a comment line. Do we also want to remove files after executing it? + bool result = false; + Boolean.TryParse("@@REMOVE_AFTER_EXECUTE", out result); + this.chk_Remove.Checked = result; + } + + } + + + private void MoveDown (System.Windows.Forms.Control c, int delta) + { + c.Location = new System.Drawing.Point(c.Location.X, c.Location.Y + delta); + } + + private void FixTitle() + { + string foo = "@@SFX_EXE_WINDOW_TITLE"; + if (foo.StartsWith("@@") && foo.EndsWith("SFX_EXE_WINDOW_TITLE")) + { + this.Text = String.Format("DotNetZip v{0} Self-extractor (www.codeplex.com/DotNetZip)", + Ionic.Zip.ZipFile.LibraryVersion.ToString()); + } + else this.Text = foo; + } + + + private void HideComment() + { + int smallerHeight = this.MinimumSize.Height - (this.txtComment.Height+this.lblComment.Height+5); + + lblComment.Visible = false; + txtComment.Visible = false; + + this.MinimumSize = new System.Drawing.Size(this.MinimumSize.Width, smallerHeight); + this.MaximumSize = new System.Drawing.Size(this.MaximumSize.Width, this.MinimumSize.Height); + + this.Size = new System.Drawing.Size(this.Width, this.MinimumSize.Height); + } + + + private void InitExtractExistingFileList() + { + List _ExtractActionNames = new List(Enum.GetNames(typeof(Ionic.Zip.ExtractExistingFileAction))); + foreach (String name in _ExtractActionNames) + { + if (!name.StartsWith("Invoke")) + { + if (name.StartsWith("Throw")) + comboExistingFileAction.Items.Add("Stop"); + else + comboExistingFileAction.Items.Add(name); + } + } + + comboExistingFileAction.SelectedIndex = Overwrite; + } + + + public WinFormsSelfExtractorStub() + { + InitializeComponent(); + FixTitle(); + _setCancel = true; + entryCount= 0; + _SetDefaultExtractLocation(); + _SetPostUnpackCmdLine(); + SetInteractiveFlag(); + SetOverwriteBehavior(); + InitExtractExistingFileList(); + + try + { + if (!String.IsNullOrEmpty(zip.Comment)) + { + txtComment.Text = zip.Comment; + } + else + { + HideComment(); + } + } + catch (Exception e1) + { + // why would this ever fail? Not sure. + this.lblStatus.Text = "exception while resetting size: " + e1.ToString(); + + HideComment(); + } + } + + + + + static WinFormsSelfExtractorStub() + { + // This is important to resolve the Ionic.Zip.dll inside the extractor. + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(Resolver); + } + + + static System.Reflection.Assembly Resolver(object sender, ResolveEventArgs args) + { + // super defensive + Assembly a1 = Assembly.GetExecutingAssembly(); + if (a1==null) + throw new Exception("GetExecutingAssembly returns null."); + + string[] tokens = args.Name.Split(','); + + String[] names = a1.GetManifestResourceNames(); + + if (names==null) + throw new Exception("GetManifestResourceNames returns null."); + + // workitem 7978 + Stream s = null; + foreach (string n in names) + { + string root = n.Substring(0,n.Length-4); + string ext = n.Substring(n.Length-3); + if (root.Equals(tokens[0]) && ext.ToLower().Equals("dll")) + { + s= a1.GetManifestResourceStream(n); + if (s!=null) break; + } + } + + if (s==null) + throw new Exception(String.Format("GetManifestResourceStream returns null. Available resources: [{0}]", + String.Join("|", names))); + + byte[] block = new byte[s.Length]; + + if (block==null) + throw new Exception(String.Format("Cannot allocated buffer of length({0}).", s.Length)); + + s.Read(block, 0, block.Length); + Assembly a2 = Assembly.Load(block); + if (a2==null) + throw new Exception("Assembly.Load(block) returns null"); + + return a2; + } + + + + + private void Form_Shown(object sender, EventArgs e) + { + if (!Interactive) + { + RemoveInteractiveComponents(); + KickoffExtract(); + } + } + + + private void RemoveInteractiveComponents() + { + if (this.btnContents.Visible) + { + txtPostUnpackCmdLine.Enabled = txtPostUnpackCmdLine.Visible = false; + chk_ExeAfterUnpack.Enabled = chk_ExeAfterUnpack.Visible = false; + chk_Remove.Enabled = chk_Remove.Visible = false; + comboExistingFileAction.Enabled = comboExistingFileAction.Visible = false; + label1.Enabled = label1.Visible = false; + chk_OpenExplorer.Checked = false; + chk_OpenExplorer.Enabled = chk_OpenExplorer.Visible = false; + btnDirBrowse.Enabled = btnDirBrowse.Visible = false; + btnContents.Enabled = btnContents.Visible = false; + btnExtract.Enabled = btnExtract.Visible = false; + + // adjust the position of all the remaining UI + int delta = this.progressBar1.Location.Y - this.chk_OpenExplorer.Location.Y ; + + this.MinimumSize = new System.Drawing.Size(this.MinimumSize.Width, this.MinimumSize.Height - (delta -4)); + MoveDown(this.txtExtractDirectory, delta); + MoveDown(this.lblExtractDir, delta); + + // finally, adjust the size of the form + this.Size = new System.Drawing.Size(this.Width, this.Height - (delta-4)); + + if (txtComment.Visible) + this.txtComment.Size = new System.Drawing.Size(this.txtComment.Width, + this.txtComment.Height + delta); + } + } + + + // workitem 8925 + private void chk_ExeAfterUnpack_CheckedChanged(object sender, EventArgs e) + { + this.chk_Remove.Enabled = (this.chk_ExeAfterUnpack.Checked); + } + + + private void btnDirBrowse_Click(object sender, EventArgs e) + { + Ionic.Utils.FolderBrowserDialogEx dlg1 = new Ionic.Utils.FolderBrowserDialogEx(); + dlg1.Description = "Select a folder for the extracted files:"; + dlg1.ShowNewFolderButton = true; + dlg1.ShowEditBox = true; + //dlg1.NewStyle = false; + if (Directory.Exists(txtExtractDirectory.Text)) + dlg1.SelectedPath = txtExtractDirectory.Text; + else + { + string d = txtExtractDirectory.Text; + while (d.Length > 2 && !Directory.Exists(d)) + { + d = Path.GetDirectoryName(d); + } + if (d.Length < 2) + dlg1.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); + else + dlg1.SelectedPath = d; + } + + dlg1.ShowFullPathInEditBox = true; + + //dlg1.RootFolder = System.Environment.SpecialFolder.MyComputer; + + // Show the FolderBrowserDialog. + DialogResult result = dlg1.ShowDialog(); + if (result == DialogResult.OK) + { + txtExtractDirectory.Text = dlg1.SelectedPath; + } + } + + + private void btnExtract_Click(object sender, EventArgs e) + { + KickoffExtract(); + } + + + private void KickoffExtract() + { + // disable most of the UI: + this.btnContents.Enabled = false; + this.btnExtract.Enabled = false; + this.chk_OpenExplorer.Enabled = false; + this.comboExistingFileAction.Enabled = false; + this.label1.Enabled = false; + this.chk_ExeAfterUnpack.Enabled = false; + this.chk_Remove.Enabled = false; // workitem 8925 + this.txtExtractDirectory.Enabled = false; + this.txtPostUnpackCmdLine.Enabled = false; + this.btnDirBrowse.Enabled = false; + this.btnExtract.Text = "Extracting..."; + + ThreadPool.QueueUserWorkItem(new WaitCallback(DoExtract), null); + + //System.Threading.Thread _workerThread = new System.Threading.Thread(this.DoExtract); + //_workerThread.Name = "Zip Extractor thread"; + //_workerThread.Start(null); + + this.Cursor = Cursors.WaitCursor; + } + + + + + private void DoExtract(Object obj) + { + List itemsExtracted = new List(); + string targetDirectory = txtExtractDirectory.Text; + global::Ionic.Zip.ExtractExistingFileAction WantOverwrite = (Ionic.Zip.ExtractExistingFileAction) Overwrite; + bool extractCancelled = false; + System.Collections.Generic.List didNotOverwrite = + new System.Collections.Generic.List(); + _setCancel = false; + string currentPassword = ""; + SetProgressBars(); + + try + { + // zip has already been set, when opening the exe. + + zip.ExtractProgress += ExtractProgress; + foreach (global::Ionic.Zip.ZipEntry entry in zip) + { + if (_setCancel) { extractCancelled = true; break; } + if (entry.Encryption == global::Ionic.Zip.EncryptionAlgorithm.None) + { + try + { + entry.Extract(targetDirectory, WantOverwrite); + entryCount++; + itemsExtracted.Add(entry.FileName); + } + catch (Exception ex1) + { + if (WantOverwrite != global::Ionic.Zip.ExtractExistingFileAction.OverwriteSilently + && ex1.Message.Contains("already exists.")) + { + // The file exists, but the user did not ask for overwrite. + didNotOverwrite.Add(" " + entry.FileName); + } + else if (WantOverwrite == global::Ionic.Zip.ExtractExistingFileAction.OverwriteSilently || + ex1.Message.Contains("already exists.")) + { + DialogResult result = MessageBox.Show(String.Format("Failed to extract entry {0} -- {1}", entry.FileName, ex1.Message), + String.Format("Error Extracting {0}", entry.FileName), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); + + if (result == DialogResult.Cancel) + { + _setCancel = true; + break; + } + } + } + } + else + { + bool done = false; + while (!done) + { + if (currentPassword == "") + { + string t = PromptForPassword(entry.FileName); + if (t == "") + { + done = true; // escape ExtractWithPassword loop + continue; + } + currentPassword = t; + } + + if (currentPassword == null) // cancel all + { + _setCancel = true; + currentPassword = ""; + break; + } + + try + { + entry.ExtractWithPassword(targetDirectory, WantOverwrite, currentPassword); + entryCount++; + itemsExtracted.Add(entry.FileName); + done= true; + } + catch (Exception ex2) + { + // Retry here in the case of bad password. + if (ex2 as Ionic.Zip.BadPasswordException != null) + { + currentPassword = ""; + continue; // loop around, ask for password again + } + else if (WantOverwrite != global::Ionic.Zip.ExtractExistingFileAction.OverwriteSilently + && ex2.Message.Contains("already exists.")) + { + // The file exists, but the user did not ask for overwrite. + didNotOverwrite.Add(" " + entry.FileName); + done = true; + } + else if (WantOverwrite == global::Ionic.Zip.ExtractExistingFileAction.OverwriteSilently + && !ex2.Message.Contains("already exists.")) + { + DialogResult result = MessageBox.Show(String.Format("Failed to extract the password-encrypted entry {0} -- {1}", entry.FileName, ex2.Message.ToString()), + String.Format("Error Extracting {0}", entry.FileName), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); + + done= true; + if (result == DialogResult.Cancel) + { + _setCancel = true; + break; + } + } + } // catch + } // while + } // else (encryption) + } // foreach + + } + catch (Exception) + { + MessageBox.Show("The self-extracting zip file is corrupted.", + "Error Extracting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); + Application.Exit(); + } + + + // optionally provide a status report + if (didNotOverwrite.Count > 0) + { + UnzipStatusReport f = new UnzipStatusReport(); + if (didNotOverwrite.Count == 1) + f.Header = "This file was not extracted because the target file already exists:"; + else + f.Header = String.Format("These {0} files were not extracted because the target files already exist:", + didNotOverwrite.Count); + f.Message = String.Join("\r\n", didNotOverwrite.ToArray()); + f.ShowDialog(); + } + + SetUiDone(); + + if (extractCancelled) return; + + + // optionally open explorer + if (chk_OpenExplorer.Checked) + { + string w = System.Environment.GetEnvironmentVariable("WINDIR"); + if (w == null) w = "c:\\windows"; + try + { + Process.Start(Path.Combine(w, "explorer.exe"), targetDirectory); + } + catch { } + } + + + // optionally execute a command + postUpackExeDone = new ManualResetEvent(false); + if (this.chk_ExeAfterUnpack.Checked && PostUnpackCmdLineIsSet()) + { + try + { + string[] cmd = SplitCommandLine(txtPostUnpackCmdLine.Text); + if (cmd != null && cmd.Length > 0) + { + object[] args = { cmd, + this.chk_Remove.Checked, + itemsExtracted, + targetDirectory + }; + ThreadPool.QueueUserWorkItem(new WaitCallback(StartPostUnpackProc), args); + } + else postUpackExeDone.Set(); + + // else, nothing. + } + catch { postUpackExeDone.Set(); } + } + else postUpackExeDone.Set(); + + // quit if this is non-interactive + if (!Interactive) + { + postUpackExeDone.WaitOne(); + Application.Exit(); + } + } + + + + + // workitem 8925 + private delegate void StatusProvider(string h, string m); + + private void ProvideStatus(string header, string message) + { + if (this.InvokeRequired) + { + this.Invoke(new StatusProvider(this.ProvideStatus), new object[] { header, message }); + } + else + { + UnzipStatusReport f = new UnzipStatusReport(); + f.Header= header; + f.Message= message; + f.ShowDialog(); + } + } + + + + // workitem 8925 + private void StartPostUnpackProc(object arg) + { + Object[] args = (object[]) arg; + String[] cmd = (String[]) args[0]; + bool removeAfter = (bool) args[1]; + + List itemsToRemove = (List) args[2]; + String basePath = (String) args[3] ; + + ProcessStartInfo startInfo = new ProcessStartInfo(cmd[0]); + startInfo.WorkingDirectory = basePath; + startInfo.CreateNoWindow = true; + if (cmd.Length > 1) + { + startInfo.Arguments = cmd[1]; + } + + try + { + // Process is IDisposable + using (Process p = Process.Start(startInfo)) + { + if (p!=null) + { + p.WaitForExit(); + if (p.ExitCode == 0) + { + if (removeAfter) + { + List failedToRemove = new List(); + foreach (string s in itemsToRemove) + { + string fullPath = Path.Combine(basePath,s); + try + { + if (File.Exists(fullPath)) + File.Delete(fullPath); + else if (Directory.Exists(fullPath)) + Directory.Delete(fullPath, true); + } + catch + { + failedToRemove.Add(s); + } + + if (failedToRemove.Count > 0) + { + string header = (failedToRemove.Count == 1) + ? "This file was not removed:" + : String.Format("These {0} files were not removed:", + failedToRemove.Count); + + string message = String.Join("\r\n", failedToRemove.ToArray()); + ProvideStatus(header, message); + } + } + } + } + else + { + ProvideStatus("Error Running Post-Unpack command", + String.Format("Post-extract command failed, exit code {0}", p.ExitCode)); + } + } + } + } + catch (Exception exc1) + { + ProvideStatus("Error Running Post-Unpack command", + String.Format("The post-extract command failed: {0}", exc1.Message)); + } + + postUpackExeDone.Set(); + } + + + + + private void SetUiDone() + { + if (this.btnExtract.InvokeRequired) + { + this.btnExtract.Invoke(new MethodInvoker(this.SetUiDone)); + } + else + { + this.lblStatus.Text = String.Format("Finished extracting {0} entries.", entryCount); + btnExtract.Text = "Extracted."; + btnExtract.Enabled = false; + btnCancel.Text = "Quit"; + _setCancel = true; + this.Cursor = Cursors.Default; + } + } + + + + private void ExtractProgress(object sender, ExtractProgressEventArgs e) + { + if (e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) + { + StepEntryProgress(e); + } + + else if (e.EventType == ZipProgressEventType.Extracting_AfterExtractEntry) + { + StepArchiveProgress(e); + } + if (_setCancel) + e.Cancel = true; + } + + + private void StepArchiveProgress(ExtractProgressEventArgs e) + { + if (this.progressBar1.InvokeRequired) + { + this.progressBar2.Invoke(new ExtractEntryProgress(this.StepArchiveProgress), new object[] { e }); + } + else + { + this.progressBar1.PerformStep(); + + // reset the progress bar for the entry: + this.progressBar2.Value = this.progressBar2.Maximum = 1; + this.lblStatus.Text = ""; + this.Update(); + } + } + + private void StepEntryProgress(ExtractProgressEventArgs e) + { + if (this.progressBar2.InvokeRequired) + { + this.progressBar2.Invoke(new ExtractEntryProgress(this.StepEntryProgress), new object[] { e }); + } + else + { + if (this.progressBar2.Maximum == 1) + { + // reset + Int64 max = e.TotalBytesToTransfer; + _progress2MaxFactor = 0; + while (max > System.Int32.MaxValue) + { + max /= 2; + _progress2MaxFactor++; + } + this.progressBar2.Maximum = (int)max; + this.lblStatus.Text = String.Format("Extracting {0}/{1}: {2} ...", + this.progressBar1.Value, zip.Entries.Count, e.CurrentEntry.FileName); + } + + int xferred = (int)(e.BytesTransferred >> _progress2MaxFactor); + + this.progressBar2.Value = (xferred >= this.progressBar2.Maximum) + ? this.progressBar2.Maximum + : xferred; + + this.Update(); + } + } + + private void SetProgressBars() + { + if (this.progressBar1.InvokeRequired) + { + this.progressBar1.Invoke(new MethodInvoker(this.SetProgressBars)); + } + else + { + this.progressBar1.Value = 0; + this.progressBar1.Maximum = zip.Entries.Count; + this.progressBar1.Minimum = 0; + this.progressBar1.Step = 1; + this.progressBar2.Value = 0; + this.progressBar2.Minimum = 0; + this.progressBar2.Maximum = 1; // will be set later, for each entry. + this.progressBar2.Step = 1; + } + } + + private String ZipName + { + get + { + return Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().Location); + } + } + + private Stream ZipStream + { + get + { + if (_s != null) return _s; + Assembly a = Assembly.GetExecutingAssembly(); + + // workitem 7067 + _s= File.OpenRead(a.Location); + + return _s; + } + } + + private ZipFile zip + { + get + { + if (_zip == null) + _zip = global::Ionic.Zip.ZipFile.Read(ZipStream); + return _zip; + } + } + + private string PromptForPassword(string entryName) + { + PasswordDialog dlg1 = new PasswordDialog(); + dlg1.EntryName = entryName; + + // ask for password in a loop until user enters a proper one, + // or clicks skip or cancel. + bool done= false; + do { + dlg1.ShowDialog(); + done = (dlg1.Result != PasswordDialog.PasswordDialogResult.OK || + dlg1.Password != ""); + } while (!done); + + if (dlg1.Result == PasswordDialog.PasswordDialogResult.OK) + return dlg1.Password; + + else if (dlg1.Result == PasswordDialog.PasswordDialogResult.Skip) + return ""; + + // cancel + return null; + } + + private void btnCancel_Click(object sender, EventArgs e) + { + if (_setCancel == false) + _setCancel = true; + else + Application.Exit(); + } + + // workitem 6413 + private void btnContents_Click(object sender, EventArgs e) + { + ZipContentsDialog dlg1 = new ZipContentsDialog(); + dlg1.ZipFile = zip; + dlg1.ShowDialog(); + return; + } + + // workitem 8988 + private string[] SplitCommandLine(string cmdline) + { + // if the first char is NOT a double-quote, then just split the line + if (cmdline[0]!='"') + return cmdline.Split( new char[] {' '}, 2); + + // the first char is double-quote. Need to verify that there's another one. + int ix = cmdline.IndexOf('"', 1); + if (ix == -1) return null; // no double-quote - FAIL + + // if the double-quote is the last char, then just return an array of ONE string + if (ix+1 == cmdline.Length) return new string[] { cmdline.Substring(1,ix-1) }; + + if (cmdline[ix+1]!= ' ') return null; // no space following the double-quote - FAIL + + // there's definitely another double quote, followed by a space + string[] args = new string[2]; + args[0] = cmdline.Substring(1,ix-1); + while (cmdline[ix+1]==' ') ix++; // go to next non-space char + args[1] = cmdline.Substring(ix+1); + return args; + } + + + private int _progress2MaxFactor; + private bool _setCancel; + Stream _s; + global::Ionic.Zip.ZipFile _zip; + + } + + + + public class UnzipStatusReport : Form + { + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tbMessage; + private System.Windows.Forms.Button btnOK; + + public UnzipStatusReport() + { + InitializeComponent(); + } + + + private void UnzipStatusReport_Load(object sender, EventArgs e) + { + this.Text = "DotNetZip: Unzip status report..."; + } + + + private void btnOK_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + this.Close(); + } + + public string Message + { + set + { + this.tbMessage.Text = value; + this.tbMessage.Select(0,0); + } + get + { + return this.tbMessage.Text; + } + } + + public string Header + { + set + { + this.label1.Text = value; + } + get + { + return this.label1.Text; + } + } + + + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.label1 = new System.Windows.Forms.Label(); + this.tbMessage = new System.Windows.Forms.TextBox(); + this.btnOK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(50, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Status"; + // + // tbMessage + // + this.tbMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right) + | System.Windows.Forms.AnchorStyles.Bottom))); + this.tbMessage.Location = new System.Drawing.Point(20, 31); + this.tbMessage.Name = "tbMessage"; + this.tbMessage.Multiline = true; + this.tbMessage.ScrollBars = ScrollBars.Vertical; + this.tbMessage.ReadOnly = true; + this.tbMessage.Size = new System.Drawing.Size(340, 110); + this.tbMessage.TabIndex = 10; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point(290, 156); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(82, 24); + this.btnOK.TabIndex = 20; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // UnzipStatusReport + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(380, 190); + this.Controls.Add(this.label1); + this.Controls.Add(this.tbMessage); + this.Controls.Add(this.btnOK); + this.Name = "UnzipStatusReport"; + this.Text = "Not Unzipped"; + this.Load += new System.EventHandler(this.UnzipStatusReport_Load); + this.ResumeLayout(false); + this.PerformLayout(); + } + } + + + class WinFormsSelfExtractorStubProgram + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // For Debugging +// if ( !AttachConsole(-1) ) // Attach to a parent process console +// AllocConsole(); // Alloc a new console + + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new WinFormsSelfExtractorStub()); + } + + [System.Runtime.InteropServices.DllImport("kernel32.dll")] + private static extern bool AllocConsole(); + + [System.Runtime.InteropServices.DllImport("kernel32.dll")] + private static extern bool AttachConsole(int pid); + + + } +} diff --git a/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.resx b/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.resx new file mode 100644 index 0000000..e3fee67 --- /dev/null +++ b/dotNetZip/Zip/Resources/WinFormsSelfExtractorStub.resx @@ -0,0 +1,1119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAoAMDAQAAEABABoBgAApgAAACAgEAABAAQA6AIAAA4HAAAQEBAAAQAEACgBAAD2CQAAMDAAAAEA + CACoDgAAHgsAACAgAAABAAgAqAgAAMYZAAAQEAAAAQAIAGgFAABuIgAAAAAAAAEAIABJhgAA1icAADAw + AAABACAAqCUAAB+uAAAgIAAAAQAgAKgQAADH0wAAEBAAAAEAIABoBAAAb+QAACgAAAAwAAAAYAAAAAEA + BAAAAAAAgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDA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4v7+I+/ + v7+IiOhYiPuAAAAAAAAAAAAACIiPiL+I+Ii4iIgov/iAAAAAAAAAAAAACIv7+PiL+/iIiIhYiIuAAAAA + AAAAAAAAD4iPv7+Ij7+4+I8oiPiAAAAAAAAAAAAACIv4+Ii/iIj4j/h4v/uAAAAAAAAAAAAACIiL+/j7 + +/v4j/84+PiAAAAAAAAAAAAAD4v/j4v/j4+/j494v/vwAAAAAAAAAAAACIiIv4+L+/iIhnh4j/iwAAAA + AAAAAAAAD4v4+L+Pj7+/h3h4v/iAAAAAAAAAAAAACIiIv/i/v4+IiHeP//vwAAAAAAAAAAAAD4v4+L/4 + +Iv4+HeI+PiwAAAAAAAAAAAACIiL+Pi/v4+IiHh4i4jwAAAAAAAAAAAAD4v/i/j4+L+/iDeL/wAAAAAA + AAAAAAAACIiL/4v4v4+IgAAAAAAAAAAAAAAAAAAACIiPiI+P8AAAAAAAAAAAAAAAAAAAAAAAD4iIAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD///////8AAP// + /////wAA////////AAD///////8AAP///h///wAA///gD///AAD//gAB//8AAP/gAAH//wAA/gAAAf// + AADgAAAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAA + AAH//wAAgAAAAf//AACAAAAB//8AAIAAAAH//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAA + AAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAA///8AAIAAH////wAAgAf/////AACD//////8AAP// + /////wAAKAAAACAAAABAAAAAAQAEAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAA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3N3d3Nzc3HlSGuBTztvx+bjOAAAAAAAAAAAA + AAAAAAAAAAAAAADW3czc3d3d3d3d3d3c3dzd23mDF11a2Pr9+b7OAAAAAAAAAAAAAAAAAAAAAAAAAADW + 3svd3d3d3d3d3dzd3dzd3erhDl5m7PHw3r7OAAAAAAAAAAAAAAAAAAAAAAAAAADW3czc3d3d3d3d3d3d + 3dze3t7lHHQn0NLQyszuAAAAAAAAAAAAAAAAAAAAAAAAAADW3c7d3d3d3d3d3d3d3d3d3dRxEiSO0dbu + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAADW3tPd3d3d3d3d3t3X19fX2u0AAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAADa3d3e3dje1t7W7e4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADW + 1trW7gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////wAA////////AAD///////8AAP// + /////wAA////////AAD///4f//8AAP//4A///wAA//4AAf//AAD/4AAB//8AAP4AAAH//wAA4AAAAf// + AACAAAAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAAAAH//wAAgAAAAf//AACAAAAB//8AAIAA + AAH//wAAgAAAAf//AACAAAAB//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAA + AAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB///AACAAAAH//8AAIAAAAf//wAAgAAAB/// + AACAAAAH//8AAIAAAAf//wAAgAAAP///AACAAB////8AAIAH/////wAAg///////AAD///////8AACgA + AAAgAAAAQAAAAAEACAAAAAAAAAQAAAAAAAAAAAAAAAEAAAABAAAAAAA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4twOuW1117l8cce + 4ntf/0dcu/wo65vnWVnd/v/be/No2a76vvOz9xlrvPPwZr2neUKIwWCQ9ADZBjz0crq9ArFst0k3lpNO + YscYZwXhtbKyLLo72I693B0bMIG2jQ3dxCTGkMTGIxgxGIEQCKQn6c3TnW/dms64+49zqupU1Tl16456 + 0qvvWlV1hn323ufU+f6+vz0zPjlHeeIAhmHGqwEJZPdc4OnPo/2TJL8EqSGEzsaGQ63mUsoXAWXQ/a5m + PYws8vcaibTrrkvs7XwA0VZCfFXfC5lNjh4VTVQobln1M8m/16qflreeOPZB9ZPHlVJRRWAQks/l8X0P + z3NxHCeqkI179hmGxeJSBV0/HVX46RpHjxxkekJhiYs465epr0gWzlnk8mM0Fr/IbNHE0LUelm3yPIQA + ZDQwSeoIYdKohZz6zhXGJgoQjSPx2Vzhh91up5zYv269gn1aGKRro3u/i1zJ391W/c7x9PEAqZkerPqk + GbSsOFPi2IHq9+WjN46M5y6EQMafsfFJNC0aERgGHq7r4nkejuOiFHh+SKNRRamAMFT4nsf8bInpyWje + fyEESikMI6BknWasnMM0k8uBZak+icq+SPUROkIarK66nH1ukeLkIfKFJl5doWtGcGg2p11caGT1B9iu + Idhs/yWPvW8GpPdpDvNs91L1N4+HrHDJIy9YRd+wqp8ehwA0TWAYGvWlJ9hwcmhGDrswhmUXKdpFymOS + 5779efLFcSambgClaDSqIGBiLMeBuRJjJRtDF9GKQUJgWRqFvEnO1pEy495Ub04kSB2kjgp1zp9ZZ3lh + GduG8vgctn4VPI+cnWvcfdNY7uJCo94T6aAmwCzypz2g69YQ7EszYL9q9210h1MMJv+uqH5/PN2bWeTf + DdVPj78/Txlx9F3fm3ZKHPEhIcAwNIoFE3/5CepXa1RqIV5goKSN0GykMKmuXuDGEyeQVg1RuJHZ2XlM + w8S2dAp5g4kxi1zOQKlolmFNiqhDkRFNFDrwmbTUX2ogDVwHnj+1QL22RrEAhWKBQrGEra8TBgbFcpmp + MTNHNC/AMDX/vcfTCD7II8i67iWHfTIA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AAAAAAAAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACA + AwAAgAcAAIAHAACABwAAgAcAAIAHAAD//wAA + + + \ No newline at end of file diff --git a/dotNetZip/Zip/Resources/ZipContentsDialog.Designer.cs b/dotNetZip/Zip/Resources/ZipContentsDialog.Designer.cs new file mode 100644 index 0000000..b6c59d7 --- /dev/null +++ b/dotNetZip/Zip/Resources/ZipContentsDialog.Designer.cs @@ -0,0 +1,79 @@ +namespace Ionic.Zip.Forms +{ + partial class ZipContentsDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WinFormsSelfExtractorStub)); + this.listView1 = new System.Windows.Forms.ListView(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView1.Location = new System.Drawing.Point(12, 12); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(700, 287); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView1_ColumnClick); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(637, 305); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 1; + this.button1.Text = "Close"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // ZipContentsDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(724, 340); + this.Controls.Add(this.button1); + this.Controls.Add(this.listView1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ZipContentsDialog"; + this.Text = "Contents of the zip archive"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.Button button1; + } +} \ No newline at end of file diff --git a/dotNetZip/Zip/Resources/ZipContentsDialog.cs b/dotNetZip/Zip/Resources/ZipContentsDialog.cs new file mode 100644 index 0000000..7197a71 --- /dev/null +++ b/dotNetZip/Zip/Resources/ZipContentsDialog.cs @@ -0,0 +1,226 @@ +// ZipContentsDialog.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// + +namespace Ionic.Zip.Forms +{ + using System; + using System.Collections.Generic; + using System.Windows.Forms; + using Ionic.Zip; + + public partial class ZipContentsDialog : Form + { + public ZipContentsDialog() + { + InitializeComponent(); + FixTitle(); + } + + private void FixTitle() + { + this.Text = String.Format("Contents of the zip archive (DotNetZip v{0})", + Ionic.Zip.ZipFile.LibraryVersion.ToString()); + } + + public ZipFile ZipFile + { + set + { + listView1.Clear(); + listView1.BeginUpdate(); + + string[] columnHeaders = new string[] { "name", "lastmod", "original", "ratio", "compressed", "enc?", "CRC" }; + foreach (string label in columnHeaders) + { + SortableColumnHeader ch = new SortableColumnHeader(label); + if (label != "name" && label != "lastmod") + ch.TextAlign = HorizontalAlignment.Right; + listView1.Columns.Add(ch); + } + + foreach (ZipEntry e in value) + { + ListViewItem item = new ListViewItem(e.FileName); + + string[] subitems = new string[] { + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + e.UncompressedSize.ToString(), + String.Format("{0,5:F0}%", e.CompressionRatio), + e.CompressedSize.ToString(), + (e.UsesEncryption) ? "Y" : "N", + String.Format("{0:X8}", e.Crc)}; + + foreach (String s in subitems) + { + ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(); + subitem.Text = s; + item.SubItems.Add(subitem); + } + + this.listView1.Items.Add(item); + } + + listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); + + // adjust size of the entire form + int aggWidth= 0; + for (int i = 0; i < this.listView1.Columns.Count; i++) + { + aggWidth += this.listView1.Columns[i].Width + 1; + } + // plus a fudge factor + //aggWidth += this.listView1.Columns[this.listView1.Columns.Count - 1].Width / 2 + this.listView1.Location.X * 4; + aggWidth += this.listView1.Location.X * 4 + 4; + this.Size = new System.Drawing.Size(aggWidth, this.Height); + + this.listView1.EndUpdate(); + } + } + + + + + private void button1_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void listView1_ColumnClick(object sender, ColumnClickEventArgs e) + { + // Create an instance of the ColHeader class. + SortableColumnHeader clickedCol = (SortableColumnHeader)this.listView1.Columns[e.Column]; + + // Set the ascending property to sort in the opposite order. + clickedCol.SortAscending = !clickedCol.SortAscending; + + // Get the number of items in the list. + int numItems = this.listView1.Items.Count; + + // Turn off display while data is repoplulated. + this.listView1.BeginUpdate(); + + // Populate an ArrayList with a SortWrapper of each list item. + List list = new List(); + for (int i = 0; i < numItems; i++) + { + list.Add(new ItemWrapper(this.listView1.Items[i], e.Column)); + } + + if (e.Column == 2 || e.Column == 4) + list.Sort(new ItemWrapper.NumericComparer(clickedCol.SortAscending)); + else + list.Sort(new ItemWrapper.StringComparer(clickedCol.SortAscending)); + + // Clear the list, and repopulate with the sorted items. + this.listView1.Items.Clear(); + for (int i = 0; i < numItems; i++) + this.listView1.Items.Add(list[i].Item); + + // Turn display back on. + this.listView1.EndUpdate(); + } + + } + + + + // The ColHeader class is a ColumnHeader object with an + // added property for determining an ascending or descending sort. + // True specifies an ascending order, false specifies a descending order. + public class SortableColumnHeader : ColumnHeader + { + public bool SortAscending; + public SortableColumnHeader(string text) + { + this.Text = text; + this.SortAscending = true; + } + } + + + // An instance of the SortWrapper class is created for + // each item and added to the ArrayList for sorting. + public class ItemWrapper + { + internal ListViewItem Item; + internal int Column; + + // A SortWrapper requires the item and the index of the clicked column. + public ItemWrapper(ListViewItem item, int column) + { + Item = item; + Column = column; + } + + // Text property for getting the text of an item. + public string Text + { + get { return Item.SubItems[Column].Text; } + } + + // Implementation of the IComparer + public class StringComparer : IComparer + { + bool ascending; + + // Constructor requires the sort order; + // true if ascending, otherwise descending. + public StringComparer(bool asc) + { + this.ascending = asc; + } + + // Implemnentation of the IComparer:Compare + // method for comparing two objects. + public int Compare(ItemWrapper xItem, ItemWrapper yItem) + { + string xText = xItem.Item.SubItems[xItem.Column].Text; + string yText = yItem.Item.SubItems[yItem.Column].Text; + return xText.CompareTo(yText) * (this.ascending ? 1 : -1); + } + } + + public class NumericComparer : IComparer + { + bool ascending; + + // Constructor requires the sort order; + // true if ascending, otherwise descending. + public NumericComparer(bool asc) + { + this.ascending = asc; + } + + // Implemnentation of the IComparer:Compare + // method for comparing two objects. + public int Compare(ItemWrapper xItem, ItemWrapper yItem) + { + int x = 0, y = 0; + try + { + x = Int32.Parse(xItem.Item.SubItems[xItem.Column].Text); + y = Int32.Parse(yItem.Item.SubItems[yItem.Column].Text); + } + catch + { + } + return (x - y) * (this.ascending ? 1 : -1); + } + } + } + +} diff --git a/dotNetZip/Zip/Resources/ZipContentsDialog.resx b/dotNetZip/Zip/Resources/ZipContentsDialog.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/dotNetZip/Zip/Resources/ZipContentsDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotNetZip/Zip/Resources/zippedFile.ico b/dotNetZip/Zip/Resources/zippedFile.ico new file mode 100644 index 0000000..b39623c Binary files /dev/null and b/dotNetZip/Zip/Resources/zippedFile.ico differ diff --git a/dotNetZip/Zip/Shared.cs b/dotNetZip/Zip/Shared.cs new file mode 100644 index 0000000..cdc7161 --- /dev/null +++ b/dotNetZip/Zip/Shared.cs @@ -0,0 +1,901 @@ +// Shared.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2006-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-02 19:41:01> +// +// ------------------------------------------------------------------ +// +// This module defines some shared utility classes and methods. +// +// Created: Tue, 27 Mar 2007 15:30 +// + +using System; +using System.IO; +using System.Security.Permissions; + +namespace Ionic.Zip +{ + /// + /// Collects general purpose utility methods. + /// + internal static class SharedUtilities + { + /// private null constructor + //private SharedUtilities() { } + + // workitem 8423 + public static Int64 GetFileLength(string fileName) + { + if (!File.Exists(fileName)) + throw new System.IO.FileNotFoundException(fileName); + + long fileLength = 0L; + FileShare fs = FileShare.ReadWrite; +#if !NETCF + // FileShare.Delete is not defined for the Compact Framework + fs |= FileShare.Delete; +#endif + using (var s = File.Open(fileName, FileMode.Open, FileAccess.Read, fs)) + { + fileLength = s.Length; + } + return fileLength; + } + + + [System.Diagnostics.Conditional("NETCF")] + public static void Workaround_Ladybug318918(Stream s) + { + // This is a workaround for this issue: + // https://connect.microsoft.com/VisualStudio/feedback/details/318918 + // It's required only on NETCF. + s.Flush(); + } + + +#if LEGACY + /// + /// Round the given DateTime value to an even second value. + /// + /// + /// + /// + /// Round up in the case of an odd second value. The rounding does not consider + /// fractional seconds. + /// + /// + /// This is useful because the Zip spec allows storage of time only to the nearest + /// even second. So if you want to compare the time of an entry in the archive with + /// it's actual time in the filesystem, you need to round the actual filesystem + /// time, or use a 2-second threshold for the comparison. + /// + /// + /// This is most nautrally an extension method for the DateTime class but this + /// library is built for .NET 2.0, not for .NET 3.5; This means extension methods + /// are a no-no. + /// + /// + /// The DateTime value to round + /// The ruonded DateTime value + public static DateTime RoundToEvenSecond(DateTime source) + { + // round to nearest second: + if ((source.Second % 2) == 1) + source += new TimeSpan(0, 0, 1); + + DateTime dtRounded = new DateTime(source.Year, source.Month, source.Day, source.Hour, source.Minute, source.Second); + //if (source.Millisecond >= 500) dtRounded = dtRounded.AddSeconds(1); + return dtRounded; + } +#endif + +#if YOU_LIKE_REDUNDANT_CODE + internal static string NormalizePath(string path) + { + // remove leading single dot slash + if (path.StartsWith(".\\")) path = path.Substring(2); + + // remove intervening dot-slash + path = path.Replace("\\.\\", "\\"); + + // remove double dot when preceded by a directory name + var re = new System.Text.RegularExpressions.Regex(@"^(.*\\)?([^\\\.]+\\\.\.\\)(.+)$"); + path = re.Replace(path, "$1$3"); + return path; + } +#endif + + private static System.Text.RegularExpressions.Regex doubleDotRegex1 = + new System.Text.RegularExpressions.Regex(@"^(.*/)?([^/\\.]+/\\.\\./)(.+)$"); + + private static string SimplifyFwdSlashPath(string path) + { + if (path.StartsWith("./")) path = path.Substring(2); + path = path.Replace("/./", "/"); + + // Replace foo/anything/../bar with foo/bar + path = doubleDotRegex1.Replace(path, "$1$3"); + return path; + } + + + /// + /// Utility routine for transforming path names from filesystem format (on Windows that means backslashes) to + /// a format suitable for use within zipfiles. This means trimming the volume letter and colon (if any) And + /// swapping backslashes for forward slashes. + /// + /// source path. + /// transformed path + public static string NormalizePathForUseInZipFile(string pathName) + { + // boundary case + if (String.IsNullOrEmpty(pathName)) return pathName; + + // trim volume if necessary + if ((pathName.Length >= 2) && ((pathName[1] == ':') && (pathName[2] == '\\'))) + pathName = pathName.Substring(3); + + // swap slashes + pathName = pathName.Replace('\\', '/'); + + // trim all leading slashes + while (pathName.StartsWith("/")) pathName = pathName.Substring(1); + + return SimplifyFwdSlashPath(pathName); + } + + + static System.Text.Encoding ibm437 = System.Text.Encoding.GetEncoding("IBM437"); + static System.Text.Encoding utf8 = System.Text.Encoding.GetEncoding("UTF-8"); + + internal static byte[] StringToByteArray(string value, System.Text.Encoding encoding) + { + byte[] a = encoding.GetBytes(value); + return a; + } + internal static byte[] StringToByteArray(string value) + { + return StringToByteArray(value, ibm437); + } + + //internal static byte[] Utf8StringToByteArray(string value) + //{ + // return StringToByteArray(value, utf8); + //} + + //internal static string StringFromBuffer(byte[] buf, int maxlength) + //{ + // return StringFromBuffer(buf, maxlength, ibm437); + //} + + internal static string Utf8StringFromBuffer(byte[] buf) + { + return StringFromBuffer(buf, utf8); + } + + internal static string StringFromBuffer(byte[] buf, System.Text.Encoding encoding) + { + // this form of the GetString() method is required for .NET CF compatibility + string s = encoding.GetString(buf, 0, buf.Length); + return s; + } + + + internal static int ReadSignature(System.IO.Stream s) + { + int x = 0; + try { x = _ReadFourBytes(s, "n/a"); } + catch (BadReadException) { } + return x; + } + + + internal static int ReadEntrySignature(System.IO.Stream s) + { + // handle the case of ill-formatted zip archives - includes a data descriptor + // when none is expected. + int x = 0; + try + { + x = _ReadFourBytes(s, "n/a"); + if (x == ZipConstants.ZipEntryDataDescriptorSignature) + { + // advance past data descriptor - 12 bytes if not zip64 + s.Seek(12, SeekOrigin.Current); + // workitem 10178 + Workaround_Ladybug318918(s); + x = _ReadFourBytes(s, "n/a"); + if (x != ZipConstants.ZipEntrySignature) + { + // Maybe zip64 was in use for the prior entry. + // Therefore, skip another 8 bytes. + s.Seek(8, SeekOrigin.Current); + // workitem 10178 + Workaround_Ladybug318918(s); + x = _ReadFourBytes(s, "n/a"); + if (x != ZipConstants.ZipEntrySignature) + { + // seek back to the first spot + s.Seek(-24, SeekOrigin.Current); + // workitem 10178 + Workaround_Ladybug318918(s); + x = _ReadFourBytes(s, "n/a"); + } + } + } + } + catch (BadReadException) { } + return x; + } + + + internal static int ReadInt(System.IO.Stream s) + { + return _ReadFourBytes(s, "Could not read block - no data! (position 0x{0:X8})"); + } + + private static int _ReadFourBytes(System.IO.Stream s, string message) + { + int n = 0; + byte[] block = new byte[4]; +#if NETCF + // workitem 9181 + // Reading here in NETCF sometimes reads "backwards". Seems to happen for + // larger files. Not sure why. Maybe an error in caching. If the data is: + // + // 00100210: 9efa 0f00 7072 6f6a 6563 742e 6963 7750 ....project.icwP + // 00100220: 4b05 0600 0000 0006 0006 0091 0100 008e K............... + // 00100230: 0010 0000 00 ..... + // + // ...and the stream Position is 10021F, then a Read of 4 bytes is returning + // 50776369, instead of 06054b50. This seems to happen the 2nd time Read() + // is called from that Position.. + // + // submitted to connect.microsoft.com + // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=318918#tabs + // + for (int i = 0; i < block.Length; i++) + { + n+= s.Read(block, i, 1); + } +#else + n = s.Read(block, 0, block.Length); +#endif + if (n != block.Length) throw new BadReadException(String.Format(message, s.Position)); + int data = unchecked((((block[3] * 256 + block[2]) * 256) + block[1]) * 256 + block[0]); + return data; + } + + + + /// + /// Finds a signature in the zip stream. This is useful for finding + /// the end of a zip entry, for example, or the beginning of the next ZipEntry. + /// + /// + /// + /// + /// Scans through 64k at a time. + /// + /// + /// + /// If the method fails to find the requested signature, the stream Position + /// after completion of this method is unchanged. If the method succeeds in + /// finding the requested signature, the stream position after completion is + /// direct AFTER the signature found in the stream. + /// + /// + /// + /// The stream to search + /// The 4-byte signature to find + /// The number of bytes read + internal static long FindSignature(System.IO.Stream stream, int SignatureToFind) + { + long startingPosition = stream.Position; + + int BATCH_SIZE = 65536; // 8192; + byte[] targetBytes = new byte[4]; + targetBytes[0] = (byte)(SignatureToFind >> 24); + targetBytes[1] = (byte)((SignatureToFind & 0x00FF0000) >> 16); + targetBytes[2] = (byte)((SignatureToFind & 0x0000FF00) >> 8); + targetBytes[3] = (byte)(SignatureToFind & 0x000000FF); + byte[] batch = new byte[BATCH_SIZE]; + int n = 0; + bool success = false; + do + { + n = stream.Read(batch, 0, batch.Length); + if (n != 0) + { + for (int i = 0; i < n; i++) + { + if (batch[i] == targetBytes[3]) + { + long curPosition = stream.Position; + stream.Seek(i - n, System.IO.SeekOrigin.Current); + // workitem 10178 + Workaround_Ladybug318918(stream); + + // workitem 7711 + int sig = ReadSignature(stream); + + success = (sig == SignatureToFind); + if (!success) + { + stream.Seek(curPosition, System.IO.SeekOrigin.Begin); + // workitem 10178 + Workaround_Ladybug318918(stream); + } + else + break; // out of for loop + } + } + } + else break; + if (success) break; + + } while (true); + + if (!success) + { + stream.Seek(startingPosition, System.IO.SeekOrigin.Begin); + // workitem 10178 + Workaround_Ladybug318918(stream); + return -1; // or throw? + } + + // subtract 4 for the signature. + long bytesRead = (stream.Position - startingPosition) - 4; + + return bytesRead; + } + + + // If I have a time in the .NET environment, and I want to use it for + // SetWastWriteTime() etc, then I need to adjust it for Win32. + internal static DateTime AdjustTime_Reverse(DateTime time) + { + if (time.Kind == DateTimeKind.Utc) return time; + DateTime adjusted = time; + if (DateTime.Now.IsDaylightSavingTime() && !time.IsDaylightSavingTime()) + adjusted = time - new System.TimeSpan(1, 0, 0); + + else if (!DateTime.Now.IsDaylightSavingTime() && time.IsDaylightSavingTime()) + adjusted = time + new System.TimeSpan(1, 0, 0); + + return adjusted; + } + +#if NECESSARY + // If I read a time from a file with GetLastWriteTime() (etc), I need + // to adjust it for display in the .NET environment. + internal static DateTime AdjustTime_Forward(DateTime time) + { + if (time.Kind == DateTimeKind.Utc) return time; + DateTime adjusted = time; + if (DateTime.Now.IsDaylightSavingTime() && !time.IsDaylightSavingTime()) + adjusted = time + new System.TimeSpan(1, 0, 0); + + else if (!DateTime.Now.IsDaylightSavingTime() && time.IsDaylightSavingTime()) + adjusted = time - new System.TimeSpan(1, 0, 0); + + return adjusted; + } +#endif + + + internal static DateTime PackedToDateTime(Int32 packedDateTime) + { + // workitem 7074 & workitem 7170 + if (packedDateTime == 0xFFFF || packedDateTime == 0) + return new System.DateTime(1995, 1, 1, 0, 0, 0, 0); // return a fixed date when none is supplied. + + Int16 packedTime = unchecked((Int16)(packedDateTime & 0x0000ffff)); + Int16 packedDate = unchecked((Int16)((packedDateTime & 0xffff0000) >> 16)); + + int year = 1980 + ((packedDate & 0xFE00) >> 9); + int month = (packedDate & 0x01E0) >> 5; + int day = packedDate & 0x001F; + + int hour = (packedTime & 0xF800) >> 11; + int minute = (packedTime & 0x07E0) >> 5; + //int second = packedTime & 0x001F; + int second = (packedTime & 0x001F) * 2; + + // validation and error checking. + // this is not foolproof but will catch most errors. + if (second >= 60) { minute++; second = 0; } + if (minute >= 60) { hour++; minute = 0; } + if (hour >= 24) { day++; hour = 0; } + + DateTime d = System.DateTime.Now; + bool success= false; + try + { + d = new System.DateTime(year, month, day, hour, minute, second, 0); + success= true; + } + catch (System.ArgumentOutOfRangeException) + { + if (year == 1980 && (month == 0 || day == 0)) + { + try + { + d = new System.DateTime(1980, 1, 1, hour, minute, second, 0); + success= true; + } + catch (System.ArgumentOutOfRangeException) + { + try + { + d = new System.DateTime(1980, 1, 1, 0, 0, 0, 0); + success= true; + } + catch (System.ArgumentOutOfRangeException) { } + + } + } + // workitem 8814 + // my god, I can't believe how many different ways applications + // can mess up a simple date format. + else + { + try + { + while (year < 1980) year++; + while (year > 2030) year--; + while (month < 1) month++; + while (month > 12) month--; + while (day < 1) day++; + while (day > 28) day--; + while (minute < 0) minute++; + while (minute > 59) minute--; + while (second < 0) second++; + while (second > 59) second--; + d = new System.DateTime(year, month, day, hour, minute, second, 0); + success= true; + } + catch (System.ArgumentOutOfRangeException) { } + } + } + if (!success) + { + string msg = String.Format("y({0}) m({1}) d({2}) h({3}) m({4}) s({5})", year, month, day, hour, minute, second); + throw new ZipException(String.Format("Bad date/time format in the zip file. ({0})", msg)); + + } + // workitem 6191 + //d = AdjustTime_Reverse(d); + d = DateTime.SpecifyKind(d, DateTimeKind.Local); + return d; + } + + + internal + static Int32 DateTimeToPacked(DateTime time) + { + // The time is passed in here only for purposes of writing LastModified to the + // zip archive. It should always be LocalTime, but we convert anyway. And, + // since the time is being written out, it needs to be adjusted. + + time = time.ToLocalTime(); + // workitem 7966 + //time = AdjustTime_Forward(time); + + // see http://www.vsft.com/hal/dostime.htm for the format + UInt16 packedDate = (UInt16)((time.Day & 0x0000001F) | ((time.Month << 5) & 0x000001E0) | (((time.Year - 1980) << 9) & 0x0000FE00)); + UInt16 packedTime = (UInt16)((time.Second / 2 & 0x0000001F) | ((time.Minute << 5) & 0x000007E0) | ((time.Hour << 11) & 0x0000F800)); + + Int32 result = (Int32)(((UInt32)(packedDate << 16)) | packedTime); + return result; + } + + + /// + /// Create a pseudo-random filename, suitable for use as a temporary + /// file, and open it. + /// + /// + /// + /// The System.IO.Path.GetRandomFileName() method is not available on + /// the Compact Framework, so this library provides its own substitute + /// on NETCF. + /// + /// + /// This method produces a filename of the form + /// DotNetZip-xxxxxxxx.tmp, where xxxxxxxx is replaced by randomly + /// chosen characters, and creates that file. + /// + /// + public static void CreateAndOpenUniqueTempFile(string dir, + out Stream fs, + out string filename) + { + // workitem 9763 + // http://dotnet.org.za/markn/archive/2006/04/15/51594.aspx + // try 3 times: + for (int i = 0; i < 3; i++) + { + try + { + filename = Path.Combine(dir, InternalGetTempFileName()); + fs = new FileStream(filename, FileMode.CreateNew); + return; + } + catch (IOException) + { + if (i == 2) throw; + } + } + throw new IOException(); + } + +#if NETCF || SILVERLIGHT + public static string InternalGetTempFileName() + { + return "DotNetZip-" + GenerateRandomStringImpl(8,0) + ".tmp"; + } + + internal static string GenerateRandomStringImpl(int length, int delta) + { + bool WantMixedCase = (delta == 0); + System.Random rnd = new System.Random(); + + string result = ""; + char[] a = new char[length]; + + for (int i = 0; i < length; i++) + { + // delta == 65 means uppercase + // delta == 97 means lowercase + if (WantMixedCase) + delta = (rnd.Next(2) == 0) ? 65 : 97; + a[i] = (char)(rnd.Next(26) + delta); + } + + result = new System.String(a); + return result; + } +#else + public static string InternalGetTempFileName() + { + return "DotNetZip-" + Path.GetRandomFileName().Substring(0, 8) + ".tmp"; + } + +#endif + + + /// + /// Workitem 7889: handle ERROR_LOCK_VIOLATION during read + /// + /// + /// This could be gracefully handled with an extension attribute, but + /// This assembly is built for .NET 2.0, so I cannot use them. + /// + internal static int ReadWithRetry(System.IO.Stream s, byte[] buffer, int offset, int count, string FileName) + { + int n = 0; + bool done = false; +#if !NETCF && !SILVERLIGHT + int retries = 0; +#endif + do + { + try + { + n = s.Read(buffer, offset, count); + done = true; + } +#if NETCF || SILVERLIGHT + catch (System.IO.IOException) + { + throw; + } +#else + catch (System.IO.IOException ioexc1) + { + // Check if we can call GetHRForException, + // which makes unmanaged code calls. + var p = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); + if (p.IsUnrestricted()) + { + uint hresult = _HRForException(ioexc1); + if (hresult != 0x80070021) // ERROR_LOCK_VIOLATION + throw new System.IO.IOException(String.Format("Cannot read file {0}", FileName), ioexc1); + retries++; + if (retries > 10) + throw new System.IO.IOException(String.Format("Cannot read file {0}, at offset 0x{1:X8} after 10 retries", FileName, offset), ioexc1); + + // max time waited on last retry = 250 + 10*550 = 5.75s + // aggregate time waited after 10 retries: 250 + 55*550 = 30.5s + System.Threading.Thread.Sleep(250 + retries * 550); + } + else + { + // The permission.Demand() failed. Therefore, we cannot call + // GetHRForException, and cannot do the subtle handling of + // ERROR_LOCK_VIOLATION. Just bail. + throw; + } + } +#endif + } + while (!done); + + return n; + } + + +#if !NETCF + // workitem 8009 + // + // This method must remain separate. + // + // Marshal.GetHRForException() is needed to do special exception handling for + // the read. But, that method requires UnmanagedCode permissions, and is marked + // with LinkDemand for UnmanagedCode. In an ASP.NET medium trust environment, + // where UnmanagedCode is restricted, will generate a SecurityException at the + // time of JIT of the method that calls a method that is marked with LinkDemand + // for UnmanagedCode. The SecurityException, if it is restricted, will occur + // when this method is JITed. + // + // The Marshal.GetHRForException() is factored out of ReadWithRetry in order to + // avoid the SecurityException at JIT compile time. Because _HRForException is + // called only when the UnmanagedCode is allowed. This means .NET never + // JIT-compiles this method when UnmanagedCode is disallowed, and thus never + // generates the JIT-compile time exception. + // +#endif + private static uint _HRForException(System.Exception ex1) + { + return unchecked((uint)System.Runtime.InteropServices.Marshal.GetHRForException(ex1)); + } + + } + + + + /// + /// A decorator stream. It wraps another stream, and performs bookkeeping + /// to keep track of the stream Position. + /// + /// + /// + /// In some cases, it is not possible to get the Position of a stream, let's + /// say, on a write-only output stream like ASP.NET's + /// Response.OutputStream, or on a different write-only stream + /// provided as the destination for the zip by the application. In this + /// case, programmers can use this counting stream to count the bytes read + /// or written. + /// + /// + /// Consider the scenario of an application that saves a self-extracting + /// archive (SFX), that uses a custom SFX stub. + /// + /// + /// Saving to a filesystem file, the application would open the + /// filesystem file (getting a FileStream), save the custom sfx stub + /// into it, and then call ZipFile.Save(), specifying the same + /// FileStream. ZipFile.Save() does the right thing for the zipentry + /// offsets, by inquiring the Position of the FileStream before writing + /// any data, and then adding that initial offset into any ZipEntry + /// offsets in the zip directory. Everything works fine. + /// + /// + /// Now suppose the application is an ASPNET application and it saves + /// directly to Response.OutputStream. It's not possible for DotNetZip to + /// inquire the Position, so the offsets for the SFX will be wrong. + /// + /// + /// The workaround is for the application to use this class to wrap + /// HttpResponse.OutputStream, then write the SFX stub and the ZipFile + /// into that wrapper stream. Because ZipFile.Save() can inquire the + /// Position, it will then do the right thing with the offsets. + /// + /// + public class CountingStream : System.IO.Stream + { + // workitem 12374: this class is now public + private System.IO.Stream _s; + private Int64 _bytesWritten; + private Int64 _bytesRead; + private Int64 _initialOffset; + + /// + /// The constructor. + /// + /// The underlying stream + public CountingStream(System.IO.Stream stream) + : base() + { + _s = stream; + try + { + _initialOffset = _s.Position; + } + catch + { + _initialOffset = 0L; + } + } + + /// + /// Gets the wrapped stream. + /// + public Stream WrappedStream + { + get + { + return _s; + } + } + + /// + /// The count of bytes written out to the stream. + /// + public Int64 BytesWritten + { + get { return _bytesWritten; } + } + + /// + /// the count of bytes that have been read from the stream. + /// + public Int64 BytesRead + { + get { return _bytesRead; } + } + + /// + /// Adjust the byte count on the stream. + /// + /// + /// + /// the number of bytes to subtract from the count. + /// + /// + /// + /// + /// Subtract delta from the count of bytes written to the stream. + /// This is necessary when seeking back, and writing additional data, + /// as happens in some cases when saving Zip files. + /// + /// + public void Adjust(Int64 delta) + { + _bytesWritten -= delta; + if (_bytesWritten < 0) + throw new InvalidOperationException(); + if (_s as CountingStream != null) + ((CountingStream)_s).Adjust(delta); + } + + /// + /// The read method. + /// + /// The buffer to hold the data read from the stream. + /// the offset within the buffer to copy the first byte read. + /// the number of bytes to read. + /// the number of bytes read, after decryption and decompression. + public override int Read(byte[] buffer, int offset, int count) + { + int n = _s.Read(buffer, offset, count); + _bytesRead += n; + return n; + } + + /// + /// Write data into the stream. + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (count == 0) return; + _s.Write(buffer, offset, count); + _bytesWritten += count; + } + + /// + /// Whether the stream can be read. + /// + public override bool CanRead + { + get { return _s.CanRead; } + } + + /// + /// Whether it is possible to call Seek() on the stream. + /// + public override bool CanSeek + { + get { return _s.CanSeek; } + } + + /// + /// Whether it is possible to call Write() on the stream. + /// + public override bool CanWrite + { + get { return _s.CanWrite; } + } + + /// + /// Flushes the underlying stream. + /// + public override void Flush() + { + _s.Flush(); + } + + /// + /// The length of the underlying stream. + /// + public override long Length + { + get { return _s.Length; } // bytesWritten?? + } + + /// + /// Returns the sum of number of bytes written, plus the initial + /// offset before writing. + /// + public long ComputedPosition + { + get { return _initialOffset + _bytesWritten; } + } + + + /// + /// The Position of the stream. + /// + public override long Position + { + get { return _s.Position; } + set + { + _s.Seek(value, System.IO.SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_s); + } + } + + /// + /// Seek in the stream. + /// + /// the offset point to seek to + /// the reference point from which to seek + /// The new position + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + return _s.Seek(offset, origin); + } + + /// + /// Set the length of the underlying stream. Be careful with this! + /// + /// + /// the length to set on the underlying stream. + public override void SetLength(long value) + { + _s.SetLength(value); + } + } + + +} diff --git a/dotNetZip/Zip/WinZipAes.cs b/dotNetZip/Zip/WinZipAes.cs new file mode 100644 index 0000000..a316b91 --- /dev/null +++ b/dotNetZip/Zip/WinZipAes.cs @@ -0,0 +1,941 @@ +//#define Trace + +// WinZipAes.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-12 13:42:06> +// +// ------------------------------------------------------------------ +// +// This module defines the classes for dealing with WinZip's AES encryption, +// according to the specifications for the format available on WinZip's website. +// +// Created: January 2009 +// +// ------------------------------------------------------------------ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Security.Cryptography; + +#if AESCRYPTO +namespace Ionic.Zip +{ + /// + /// This is a helper class supporting WinZip AES encryption. + /// This class is intended for use only by the DotNetZip library. + /// + /// + /// + /// Most uses of the DotNetZip library will not involve direct calls into + /// the WinZipAesCrypto class. Instead, the WinZipAesCrypto class is + /// instantiated and used by the ZipEntry() class when WinZip AES + /// encryption or decryption on an entry is employed. + /// + internal class WinZipAesCrypto + { + internal byte[] _Salt; + internal byte[] _providedPv; + internal byte[] _generatedPv; + internal int _KeyStrengthInBits; + private byte[] _MacInitializationVector; + private byte[] _StoredMac; + private byte[] _keyBytes; + private Int16 PasswordVerificationStored; + private Int16 PasswordVerificationGenerated; + private int Rfc2898KeygenIterations = 1000; + private string _Password; + private bool _cryptoGenerated ; + + private WinZipAesCrypto(string password, int KeyStrengthInBits) + { + _Password = password; + _KeyStrengthInBits = KeyStrengthInBits; + } + + public static WinZipAesCrypto Generate(string password, int KeyStrengthInBits) + { + WinZipAesCrypto c = new WinZipAesCrypto(password, KeyStrengthInBits); + + int saltSizeInBytes = c._KeyStrengthInBytes / 2; + c._Salt = new byte[saltSizeInBytes]; + Random rnd = new Random(); + rnd.NextBytes(c._Salt); + return c; + } + + + + public static WinZipAesCrypto ReadFromStream(string password, int KeyStrengthInBits, Stream s) + { + // from http://www.winzip.com/aes_info.htm + // + // Size(bytes) Content + // ----------------------------------- + // Variable Salt value + // 2 Password verification value + // Variable Encrypted file data + // 10 Authentication code + // + // ZipEntry.CompressedSize represents the size of all of those elements. + + // salt size varies with key length: + // 128 bit key => 8 bytes salt + // 192 bits => 12 bytes salt + // 256 bits => 16 bytes salt + + WinZipAesCrypto c = new WinZipAesCrypto(password, KeyStrengthInBits); + + int saltSizeInBytes = c._KeyStrengthInBytes / 2; + c._Salt = new byte[saltSizeInBytes]; + c._providedPv = new byte[2]; + + s.Read(c._Salt, 0, c._Salt.Length); + s.Read(c._providedPv, 0, c._providedPv.Length); + + c.PasswordVerificationStored = (Int16)(c._providedPv[0] + c._providedPv[1] * 256); + if (password != null) + { + c.PasswordVerificationGenerated = (Int16)(c.GeneratedPV[0] + c.GeneratedPV[1] * 256); + if (c.PasswordVerificationGenerated != c.PasswordVerificationStored) + throw new BadPasswordException("bad password"); + } + + return c; + } + + public byte[] GeneratedPV + { + get + { + if (!_cryptoGenerated) _GenerateCryptoBytes(); + return _generatedPv; + } + } + + + public byte[] Salt + { + get + { + return _Salt; + } + } + + + private int _KeyStrengthInBytes + { + get + { + return _KeyStrengthInBits / 8; + + } + } + + public int SizeOfEncryptionMetadata + { + get + { + // 10 bytes after, (n-10) before the compressed data + return _KeyStrengthInBytes / 2 + 10 + 2; + } + } + + public string Password + { + set + { + _Password = value; + if (_Password != null) + { + PasswordVerificationGenerated = (Int16)(GeneratedPV[0] + GeneratedPV[1] * 256); + if (PasswordVerificationGenerated != PasswordVerificationStored) + throw new Ionic.Zip.BadPasswordException(); + } + } + private get + { + return _Password; + } + } + + + private void _GenerateCryptoBytes() + { + //Console.WriteLine(" provided password: '{0}'", _Password); + + System.Security.Cryptography.Rfc2898DeriveBytes rfc2898 = + new System.Security.Cryptography.Rfc2898DeriveBytes(_Password, Salt, Rfc2898KeygenIterations); + + _keyBytes = rfc2898.GetBytes(_KeyStrengthInBytes); // 16 or 24 or 32 ??? + _MacInitializationVector = rfc2898.GetBytes(_KeyStrengthInBytes); + _generatedPv = rfc2898.GetBytes(2); + + _cryptoGenerated = true; + } + + + public byte[] KeyBytes + { + get + { + if (!_cryptoGenerated) _GenerateCryptoBytes(); + return _keyBytes; + } + } + + + public byte[] MacIv + { + get + { + if (!_cryptoGenerated) _GenerateCryptoBytes(); + return _MacInitializationVector; + } + } + + public byte[] CalculatedMac; + + + public void ReadAndVerifyMac(System.IO.Stream s) + { + bool invalid = false; + + // read integrityCheckVector. + // caller must ensure that the file pointer is in the right spot! + _StoredMac = new byte[10]; // aka "authentication code" + s.Read(_StoredMac, 0, _StoredMac.Length); + + if (_StoredMac.Length != CalculatedMac.Length) + invalid = true; + + if (!invalid) + { + for (int i = 0; i < _StoredMac.Length; i++) + { + if (_StoredMac[i] != CalculatedMac[i]) + invalid = true; + } + } + + if (invalid) + throw new Ionic.Zip.BadStateException("The MAC does not match."); + } + + } + + + #region DONT_COMPILE_BUT_KEEP_FOR_POTENTIAL_FUTURE_USE +#if NO + internal class Util + { + private static void _Format(System.Text.StringBuilder sb1, + byte[] b, + int offset, + int length) + { + + System.Text.StringBuilder sb2 = new System.Text.StringBuilder(); + sb1.Append("0000 "); + int i; + for (i = 0; i < length; i++) + { + int x = offset+i; + if (i != 0 && i % 16 == 0) + { + sb1.Append(" ") + .Append(sb2) + .Append("\n") + .Append(String.Format("{0:X4} ", i)); + sb2.Remove(0,sb2.Length); + } + sb1.Append(System.String.Format("{0:X2} ", b[x])); + if (b[x] >=32 && b[x] <= 126) + sb2.Append((char)b[x]); + else + sb2.Append("."); + } + if (sb2.Length > 0) + { + sb1.Append(new String(' ', ((16 - i%16) * 3) + 4)) + .Append(sb2); + } + } + + + + internal static string FormatByteArray(byte[] b, int limit) + { + System.Text.StringBuilder sb1 = new System.Text.StringBuilder(); + + if ((limit * 2 > b.Length) || limit == 0) + { + _Format(sb1, b, 0, b.Length); + } + else + { + // first N bytes of the buffer + _Format(sb1, b, 0, limit); + + if (b.Length > limit * 2) + sb1.Append(String.Format("\n ...({0} other bytes here)....\n", b.Length - limit * 2)); + + // last N bytes of the buffer + _Format(sb1, b, b.Length - limit, limit); + } + + return sb1.ToString(); + } + + + internal static string FormatByteArray(byte[] b) + { + return FormatByteArray(b, 0); + } + } + +#endif + #endregion + + + + + /// + /// A stream that encrypts as it writes, or decrypts as it reads. The + /// Crypto is AES in CTR (counter) mode, which is compatible with the AES + /// encryption employed by WinZip 12.0. + /// + /// + /// + /// The AES/CTR encryption protocol used by WinZip works like this: + /// + /// - start with a counter, initialized to zero. + /// + /// - to encrypt, take the data by 16-byte blocks. For each block: + /// - apply the transform to the counter + /// - increement the counter + /// - XOR the result of the transform with the plaintext to + /// get the ciphertext. + /// - compute the mac on the encrypted bytes + /// - when finished with all blocks, store the computed MAC. + /// + /// - to decrypt, take the data by 16-byte blocks. For each block: + /// - compute the mac on the encrypted bytes, + /// - apply the transform to the counter + /// - increement the counter + /// - XOR the result of the transform with the ciphertext to + /// get the plaintext. + /// - when finished with all blocks, compare the computed MAC against + /// the stored MAC + /// + /// + /// + // + internal class WinZipAesCipherStream : Stream + { + private WinZipAesCrypto _params; + private System.IO.Stream _s; + private CryptoMode _mode; + private int _nonce; + private bool _finalBlock; + + internal HMACSHA1 _mac; + + // Use RijndaelManaged from .NET 2.0. + // AesManaged came in .NET 3.5, but we want to limit + // dependency to .NET 2.0. AES is just a restricted form + // of Rijndael (fixed block size of 128, some crypto modes not supported). + + internal RijndaelManaged _aesCipher; + internal ICryptoTransform _xform; + + private const int BLOCK_SIZE_IN_BYTES = 16; + + private byte[] counter = new byte[BLOCK_SIZE_IN_BYTES]; + private byte[] counterOut = new byte[BLOCK_SIZE_IN_BYTES]; + + // I've had a problem when wrapping a WinZipAesCipherStream inside + // a DeflateStream. Calling Read() on the DeflateStream results in + // a Read() on the WinZipAesCipherStream, but the buffer is larger + // than the total size of the encrypted data, and larger than the + // initial Read() on the DeflateStream! When the encrypted + // bytestream is embedded within a larger stream (As in a zip + // archive), the Read() doesn't fail with EOF. This causes bad + // data to be returned, and it messes up the MAC. + + // This field is used to provide a hard-stop to the size of + // data that can be read from the stream. In Read(), if the buffer or + // read request goes beyond the stop, we truncate it. + + private long _length; + private long _totalBytesXferred; + private byte[] _PendingWriteBlock; + private int _pendingCount; + private byte[] _iobuf; + + /// + /// The constructor. + /// + /// The underlying stream + /// To either encrypt or decrypt. + /// The pre-initialized WinZipAesCrypto object. + /// The maximum number of bytes to read from the stream. + internal WinZipAesCipherStream(System.IO.Stream s, WinZipAesCrypto cryptoParams, long length, CryptoMode mode) + : this(s, cryptoParams, mode) + { + // don't read beyond this limit! + _length = length; + //Console.WriteLine("max length of AES stream: {0}", _length); + } + + +#if WANT_TRACE + Stream untransformed; + String traceFileUntransformed; + Stream transformed; + String traceFileTransformed; +#endif + + + internal WinZipAesCipherStream(System.IO.Stream s, WinZipAesCrypto cryptoParams, CryptoMode mode) + : base() + { + TraceOutput("-------------------------------------------------------"); + TraceOutput("Create {0:X8}", this.GetHashCode()); + + _params = cryptoParams; + _s = s; + _mode = mode; + _nonce = 1; + + if (_params == null) + throw new BadPasswordException("Supply a password to use AES encryption."); + + int keySizeInBits = _params.KeyBytes.Length * 8; + if (keySizeInBits != 256 && keySizeInBits != 128 && keySizeInBits != 192) + throw new ArgumentOutOfRangeException("keysize", + "size of key must be 128, 192, or 256"); + + _mac = new HMACSHA1(_params.MacIv); + + _aesCipher = new System.Security.Cryptography.RijndaelManaged(); + _aesCipher.BlockSize = 128; + _aesCipher.KeySize = keySizeInBits; // 128, 192, 256 + _aesCipher.Mode = CipherMode.ECB; + _aesCipher.Padding = PaddingMode.None; + + byte[] iv = new byte[BLOCK_SIZE_IN_BYTES]; // all zeroes + + // Create an ENCRYPTOR, regardless whether doing decryption or encryption. + // It is reflexive. + _xform = _aesCipher.CreateEncryptor(_params.KeyBytes, iv); + + if (_mode == CryptoMode.Encrypt) + { + _iobuf = new byte[2048]; + _PendingWriteBlock = new byte[BLOCK_SIZE_IN_BYTES]; + } + + +#if WANT_TRACE + traceFileUntransformed = "unpack\\WinZipAesCipherStream.trace.untransformed.out"; + traceFileTransformed = "unpack\\WinZipAesCipherStream.trace.transformed.out"; + + untransformed = System.IO.File.Create(traceFileUntransformed); + transformed = System.IO.File.Create(traceFileTransformed); +#endif + } + + private void XorInPlace(byte[] buffer, int offset, int count) + { + for (int i = 0; i < count; i++) + { + buffer[offset + i] = (byte)(counterOut[i] ^ buffer[offset + i]); + } + } + + private void WriteTransformOneBlock(byte[] buffer, int offset) + { + System.Array.Copy(BitConverter.GetBytes(_nonce++), 0, counter, 0, 4); + _xform.TransformBlock(counter, + 0, + BLOCK_SIZE_IN_BYTES, + counterOut, + 0); + XorInPlace(buffer, offset, BLOCK_SIZE_IN_BYTES); + _mac.TransformBlock(buffer, offset, BLOCK_SIZE_IN_BYTES, null, 0); + } + + + private void WriteTransformBlocks(byte[] buffer, int offset, int count) + { + int posn = offset; + int last = count + offset; + + while (posn < buffer.Length && posn < last) + { + WriteTransformOneBlock (buffer, posn); + posn += BLOCK_SIZE_IN_BYTES; + } + } + + + private void WriteTransformFinalBlock() + { + if (_pendingCount == 0) + throw new InvalidOperationException("No bytes available."); + + if (_finalBlock) + throw new InvalidOperationException("The final block has already been transformed."); + + System.Array.Copy(BitConverter.GetBytes(_nonce++), 0, counter, 0, 4); + counterOut = _xform.TransformFinalBlock(counter, + 0, + BLOCK_SIZE_IN_BYTES); + XorInPlace(_PendingWriteBlock, 0, _pendingCount); + _mac.TransformFinalBlock(_PendingWriteBlock, 0, _pendingCount); + _finalBlock = true; + } + + + + + + private int ReadTransformOneBlock(byte[] buffer, int offset, int last) + { + if (_finalBlock) + throw new NotSupportedException(); + + int bytesRemaining = last - offset; + int bytesToRead = (bytesRemaining > BLOCK_SIZE_IN_BYTES) + ? BLOCK_SIZE_IN_BYTES + : bytesRemaining; + + // update the counter + System.Array.Copy(BitConverter.GetBytes(_nonce++), 0, counter, 0, 4); + + // Determine if this is the final block + if ((bytesToRead == bytesRemaining) && + (_length > 0) && + (_totalBytesXferred + last == _length)) + { + _mac.TransformFinalBlock(buffer, offset, bytesToRead); + counterOut = _xform.TransformFinalBlock(counter, + 0, + BLOCK_SIZE_IN_BYTES); + _finalBlock = true; + } + else + { + _mac.TransformBlock(buffer, offset, bytesToRead, null, 0); + _xform.TransformBlock(counter, + 0, // offset + BLOCK_SIZE_IN_BYTES, + counterOut, + 0); // offset + } + + XorInPlace(buffer, offset, bytesToRead); + return bytesToRead; + } + + + + private void ReadTransformBlocks(byte[] buffer, int offset, int count) + { + int posn = offset; + int last = count + offset; + + while (posn < buffer.Length && posn < last ) + { + int n = ReadTransformOneBlock (buffer, posn, last); + posn += n; + } + } + + + + public override int Read(byte[] buffer, int offset, int count) + { + if (_mode == CryptoMode.Encrypt) + throw new NotSupportedException(); + + if (buffer == null) + throw new ArgumentNullException("buffer"); + + if (offset < 0) + throw new ArgumentOutOfRangeException("offset", + "Must not be less than zero."); + if (count < 0) + throw new ArgumentOutOfRangeException("count", + "Must not be less than zero."); + + if (buffer.Length < offset + count) + throw new ArgumentException("The buffer is too small"); + + // When I wrap a WinZipAesStream in a DeflateStream, the + // DeflateStream asks its captive to read 4k blocks, even if the + // encrypted bytestream is smaller than that. This is a way to + // limit the number of bytes read. + + int bytesToRead = count; + + if (_totalBytesXferred >= _length) + { + return 0; // EOF + } + + long bytesRemaining = _length - _totalBytesXferred; + if (bytesRemaining < count) bytesToRead = (int)bytesRemaining; + + int n = _s.Read(buffer, offset, bytesToRead); + + +#if WANT_TRACE + untransformed.Write(buffer, offset, bytesToRead); +#endif + + ReadTransformBlocks(buffer, offset, bytesToRead); + +#if WANT_TRACE + transformed.Write(buffer, offset, bytesToRead); +#endif + _totalBytesXferred += n; + return n; + } + + + + /// + /// Returns the final HMAC-SHA1-80 for the data that was encrypted. + /// + public byte[] FinalAuthentication + { + get + { + if (!_finalBlock) + { + // special-case zero-byte files + if ( _totalBytesXferred != 0) + throw new BadStateException("The final hash has not been computed."); + + // Must call ComputeHash on an empty byte array when no data + // has run through the MAC. + + byte[] b = { }; + _mac.ComputeHash(b); + // fall through + } + byte[] macBytes10 = new byte[10]; + System.Array.Copy(_mac.Hash, 0, macBytes10, 0, 10); + return macBytes10; + } + } + + + public override void Write(byte[] buffer, int offset, int count) + { + if (_finalBlock) + throw new InvalidOperationException("The final block has already been transformed."); + + if (_mode == CryptoMode.Decrypt) + throw new NotSupportedException(); + + if (buffer == null) + throw new ArgumentNullException("buffer"); + + if (offset < 0) + throw new ArgumentOutOfRangeException("offset", + "Must not be less than zero."); + if (count < 0) + throw new ArgumentOutOfRangeException("count", + "Must not be less than zero."); + if (buffer.Length < offset + count) + throw new ArgumentException("The offset and count are too large"); + + if (count == 0) + return; + + TraceOutput("Write off({0}) count({1})", offset, count); + +#if WANT_TRACE + untransformed.Write(buffer, offset, count); +#endif + + // For proper AES encryption, an AES encryptor application calls + // TransformBlock repeatedly for all 16-byte blocks except the + // last. For the last block, it then calls TransformFinalBlock(). + // + // This class is a stream that encrypts via Write(). But, it's not + // possible to recognize which are the "last" bytes from within the call + // to Write(). The caller can call Write() several times in succession, + // with varying buffers. This class only "knows" that the last bytes + // have been written when the app calls Close(). + // + // Therefore, this class buffers writes: After completion every Write(), + // a 16-byte "pending" block (_PendingWriteBlock) must hold between 1 + // and 16 bytes, which will be used in TransformFinalBlock if the app + // calls Close() immediately thereafter. Also, every write must + // transform any pending bytes, before transforming the data passed in + // to the current call. + // + // In operation, after the first call to Write() and before the call to + // Close(), one full or partial block of bytes is always available, + // pending. At time of Close(), this class calls + // WriteTransformFinalBlock() to flush the pending bytes. + // + // This approach works whether the caller writes in odd-sized batches, + // for example 5000 bytes, or in batches that are neat multiples of the + // blocksize (16). + // + // Logicaly, what we do is this: + // + // 1. if there are fewer than 16 bytes (pending + current), then + // just copy them into th pending buffer and return. + // + // 2. there are more than 16 bytes to write. So, take the leading slice + // of bytes from the current buffer, enough to fill the pending + // buffer. Transform the pending block, and write it out. + // + // 3. Take the trailing slice of bytes (a full block or a partial block), + // and copy it to the pending block for next time. + // + // 4. transform and write all the other blocks, the middle slice. + // + + // There are 16 or fewer bytes, so just buffer the bytes. + if (count + _pendingCount <= BLOCK_SIZE_IN_BYTES) + { + Buffer.BlockCopy(buffer, + offset, + _PendingWriteBlock, + _pendingCount, + count); + _pendingCount += count; + + // At this point, _PendingWriteBlock contains up to + // BLOCK_SIZE_IN_BYTES bytes, and _pendingCount ranges from 0 to + // BLOCK_SIZE_IN_BYTES. We don't want to xform+write them yet, + // because this may have been the last block. The last block gets + // written at Close(). + return; + } + + // We know there are at least 17 bytes, counting those in the current + // buffer, along with the (possibly empty) pending block. + + int bytesRemaining = count; + int curOffset = offset; + + // workitem 12815 + // + // xform chunkwise ... Cannot transform in place using the original + // buffer because that is user-maintained. + + if (_pendingCount != 0) + { + // We have more than one block of data to write, therefore it is safe + // to xform+write. + int fillCount = BLOCK_SIZE_IN_BYTES - _pendingCount; + + // fillCount is possibly zero here. That happens when the pending + // buffer held 16 bytes (one complete block) before this call to + // Write. + if (fillCount > 0) + { + Buffer.BlockCopy(buffer, + offset, + _PendingWriteBlock, + _pendingCount, + fillCount); + + // adjust counts: + bytesRemaining -= fillCount; + curOffset += fillCount; + } + + // xform and write: + WriteTransformOneBlock(_PendingWriteBlock, 0); + _s.Write(_PendingWriteBlock, 0, BLOCK_SIZE_IN_BYTES); + _totalBytesXferred += BLOCK_SIZE_IN_BYTES; + _pendingCount = 0; + } + + // At this point _PendingWriteBlock is empty, and bytesRemaining is + // always greater than 0. + + // Now, xform N blocks, where N = floor((bytesRemaining-1)/16). If + // writing 32 bytes, then xform 1 block, and stage the remaining 16. If + // writing 10037 bytes, xform 627 blocks of 16 bytes, then stage the + // remaining 5 bytes. + + int blocksToXform = (bytesRemaining-1)/BLOCK_SIZE_IN_BYTES; + _pendingCount = bytesRemaining - (blocksToXform * BLOCK_SIZE_IN_BYTES); + + // _pendingCount is ALWAYS between 1 and 16. + // Put the last _pendingCount bytes into the pending block. + Buffer.BlockCopy(buffer, + curOffset + bytesRemaining - _pendingCount, + _PendingWriteBlock, + 0, + _pendingCount); + bytesRemaining -= _pendingCount; + _totalBytesXferred += bytesRemaining; // will be true after the loop + + // now, transform all the full blocks preceding that. + // bytesRemaining is always a multiple of 16 . + if (blocksToXform > 0) + { + do + { + int c = _iobuf.Length; + if (c > bytesRemaining) c = bytesRemaining; + Buffer.BlockCopy(buffer, + curOffset, + _iobuf, + 0, + c); + + WriteTransformBlocks(_iobuf, 0, c); + _s.Write(_iobuf, 0, c); + bytesRemaining -= c; + curOffset += c; + } while(bytesRemaining > 0); + } + } + + + + /// + /// Close the stream. + /// + public override void Close() + { + TraceOutput("Close {0:X8}", this.GetHashCode()); + + // In the degenerate case, no bytes have been written to the + // stream at all. Need to check here, and NOT emit the + // final block if Write has not been called. + if (_pendingCount > 0) + { + WriteTransformFinalBlock(); + _s.Write(_PendingWriteBlock, 0, _pendingCount); + _totalBytesXferred += _pendingCount; + _pendingCount = 0; + } + _s.Close(); + +#if WANT_TRACE + untransformed.Close(); + transformed.Close(); + Console.WriteLine("\nuntransformed bytestream is in {0}", traceFileUntransformed); + Console.WriteLine("\ntransformed bytestream is in {0}", traceFileTransformed); +#endif + TraceOutput("-------------------------------------------------------"); + } + + + /// + /// Returns true if the stream can be read. + /// + public override bool CanRead + { + get + { + if (_mode != CryptoMode.Decrypt) return false; + return true; + } + } + + + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + /// + /// Returns true if the CryptoMode is Encrypt. + /// + public override bool CanWrite + { + get { return (_mode == CryptoMode.Encrypt); } + } + + /// + /// Flush the content in the stream. + /// + public override void Flush() + { + _s.Flush(); + } + + /// + /// Getting this property throws a NotImplementedException. + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// Getting or Setting this property throws a NotImplementedException. + /// + public override long Position + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + /// + /// This method throws a NotImplementedException. + /// + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// This method throws a NotImplementedException. + /// + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + + + [System.Diagnostics.ConditionalAttribute("Trace")] + private void TraceOutput(string format, params object[] varParams) + { + lock(_outputLock) + { + int tid = System.Threading.Thread.CurrentThread.GetHashCode(); + Console.ForegroundColor = (ConsoleColor) (tid % 8 + 8); + Console.Write("{0:000} WZACS ", tid); + Console.WriteLine(format, varParams); + Console.ResetColor(); + } + } + + private object _outputLock = new Object(); + } +} +#endif diff --git a/dotNetZip/Zip/Zip DLL.csproj b/dotNetZip/Zip/Zip DLL.csproj new file mode 100644 index 0000000..bb47406 --- /dev/null +++ b/dotNetZip/Zip/Zip DLL.csproj @@ -0,0 +1,193 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D3B0AD67-44D8-4B3D-BED9-CE1FD6DE2C5A} + Library + Properties + Ionic.Zip + Ionic.Zip + true + ..\Ionic.snk + + + + + 3.5 + false + SAK + SAK + SAK + SAK + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;AESCRYPTO;BZIP + prompt + 4 + bin\Debug\Ionic.Zip.xml + false + + + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE;AESCRYPTO;BZIP + prompt + 4 + bin\Release\Ionic.Zip.xml + AllRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BZip2\%(FileName) + + + Zlib\%(FileName) + + + CRC32.cs + + + Properties\SolutionInfo.cs + + + + + + + + PasswordDialog.cs + + + + WinFormsSelfExtractorStub.cs + + + + ZipContentsDialog.cs + + + + + + + + Ionic.snk + + + + + PasswordDialog.cs + + + WinFormsSelfExtractorStub.cs + + + ZipContentsDialog.cs + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + ..\..\PackResources.vbs + + + + \ No newline at end of file diff --git a/dotNetZip/Zip/ZipConstants.cs b/dotNetZip/Zip/ZipConstants.cs new file mode 100644 index 0000000..cc5eec1 --- /dev/null +++ b/dotNetZip/Zip/ZipConstants.cs @@ -0,0 +1,51 @@ +// ZipConstants.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2006, 2007, 2008, 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-August-27 23:22:32> +// +// ------------------------------------------------------------------ +// +// This module defines a few constants that are used in the project. +// +// ------------------------------------------------------------------ + +using System; + +namespace Ionic.Zip +{ + static class ZipConstants + { + public const UInt32 PackedToRemovableMedia = 0x30304b50; + public const UInt32 Zip64EndOfCentralDirectoryRecordSignature = 0x06064b50; + public const UInt32 Zip64EndOfCentralDirectoryLocatorSignature = 0x07064b50; + public const UInt32 EndOfCentralDirectorySignature = 0x06054b50; + public const int ZipEntrySignature = 0x04034b50; + public const int ZipEntryDataDescriptorSignature = 0x08074b50; + public const int SplitArchiveSignature = 0x08074b50; + public const int ZipDirEntrySignature = 0x02014b50; + + + // These are dictated by the Zip Spec.See APPNOTE.txt + public const int AesKeySize = 192; // 128, 192, 256 + public const int AesBlockSize = 128; // ??? + + public const UInt16 AesAlgId128 = 0x660E; + public const UInt16 AesAlgId192 = 0x660F; + public const UInt16 AesAlgId256 = 0x6610; + + } +} diff --git a/dotNetZip/Zip/ZipCrypto.cs b/dotNetZip/Zip/ZipCrypto.cs new file mode 100644 index 0000000..a8c0b5f --- /dev/null +++ b/dotNetZip/Zip/ZipCrypto.cs @@ -0,0 +1,455 @@ +// ZipCrypto.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008, 2009, 2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-28 06:30:59> +// +// ------------------------------------------------------------------ +// +// This module provides the implementation for "traditional" Zip encryption. +// +// Created Tue Apr 15 17:39:56 2008 +// +// ------------------------------------------------------------------ + +using System; + +namespace Ionic.Zip +{ + /// + /// This class implements the "traditional" or "classic" PKZip encryption, + /// which today is considered to be weak. On the other hand it is + /// ubiquitous. This class is intended for use only by the DotNetZip + /// library. + /// + /// + /// + /// Most uses of the DotNetZip library will not involve direct calls into + /// the ZipCrypto class. Instead, the ZipCrypto class is instantiated and + /// used by the ZipEntry() class when encryption or decryption on an entry + /// is employed. If for some reason you really wanted to use a weak + /// encryption algorithm in some other application, you might use this + /// library. But you would be much better off using one of the built-in + /// strong encryption libraries in the .NET Framework, like the AES + /// algorithm or SHA. + /// + internal class ZipCrypto + { + /// + /// The default constructor for ZipCrypto. + /// + /// + /// + /// This class is intended for internal use by the library only. It's + /// probably not useful to you. Seriously. Stop reading this + /// documentation. It's a waste of your time. Go do something else. + /// Check the football scores. Go get an ice cream with a friend. + /// Seriously. + /// + /// + private ZipCrypto() { } + + public static ZipCrypto ForWrite(string password) + { + ZipCrypto z = new ZipCrypto(); + if (password == null) + throw new BadPasswordException("This entry requires a password."); + z.InitCipher(password); + return z; + } + + + public static ZipCrypto ForRead(string password, ZipEntry e) + { + System.IO.Stream s = e._archiveStream; + e._WeakEncryptionHeader = new byte[12]; + byte[] eh = e._WeakEncryptionHeader; + ZipCrypto z = new ZipCrypto(); + + if (password == null) + throw new BadPasswordException("This entry requires a password."); + + z.InitCipher(password); + + ZipEntry.ReadWeakEncryptionHeader(s, eh); + + // Decrypt the header. This has a side effect of "further initializing the + // encryption keys" in the traditional zip encryption. + byte[] DecryptedHeader = z.DecryptMessage(eh, eh.Length); + + // CRC check + // According to the pkzip spec, the final byte in the decrypted header + // is the highest-order byte in the CRC. We check it here. + if (DecryptedHeader[11] != (byte)((e._Crc32 >> 24) & 0xff)) + { + // In the case that bit 3 of the general purpose bit flag is set to + // indicate the presence of an 'Extended File Header' or a 'data + // descriptor' (signature 0x08074b50), the last byte of the decrypted + // header is sometimes compared with the high-order byte of the + // lastmodified time, rather than the high-order byte of the CRC, to + // verify the password. + // + // This is not documented in the PKWare Appnote.txt. It was + // discovered this by analysis of the Crypt.c source file in the + // InfoZip library http://www.info-zip.org/pub/infozip/ + // + // The reason for this is that the CRC for a file cannot be known + // until the entire contents of the file have been streamed. This + // means a tool would have to read the file content TWICE in its + // entirety in order to perform PKZIP encryption - once to compute + // the CRC, and again to actually encrypt. + // + // This is so important for performance that using the timeblob as + // the verification should be the standard practice for DotNetZip + // when using PKZIP encryption. This implies that bit 3 must be + // set. The downside is that some tools still cannot cope with ZIP + // files that use bit 3. Therefore, DotNetZip DOES NOT force bit 3 + // when PKZIP encryption is in use, and instead, reads the stream + // twice. + // + + if ((e._BitField & 0x0008) != 0x0008) + { + throw new BadPasswordException("The password did not match."); + } + else if (DecryptedHeader[11] != (byte)((e._TimeBlob >> 8) & 0xff)) + { + throw new BadPasswordException("The password did not match."); + } + + // We have a good password. + } + else + { + // A-OK + } + return z; + } + + + + + /// + /// From AppNote.txt: + /// unsigned char decrypt_byte() + /// local unsigned short temp + /// temp :=- Key(2) | 2 + /// decrypt_byte := (temp * (temp ^ 1)) bitshift-right 8 + /// end decrypt_byte + /// + private byte MagicByte + { + get + { + UInt16 t = (UInt16)((UInt16)(_Keys[2] & 0xFFFF) | 2); + return (byte)((t * (t ^ 1)) >> 8); + } + } + + // Decrypting: + // From AppNote.txt: + // loop for i from 0 to 11 + // C := buffer(i) ^ decrypt_byte() + // update_keys(C) + // buffer(i) := C + // end loop + + + /// + /// Call this method on a cipher text to render the plaintext. You must + /// first initialize the cipher with a call to InitCipher. + /// + /// + /// + /// + /// var cipher = new ZipCrypto(); + /// cipher.InitCipher(Password); + /// // Decrypt the header. This has a side effect of "further initializing the + /// // encryption keys" in the traditional zip encryption. + /// byte[] DecryptedMessage = cipher.DecryptMessage(EncryptedMessage); + /// + /// + /// + /// The encrypted buffer. + /// + /// The number of bytes to encrypt. + /// Should be less than or equal to CipherText.Length. + /// + /// + /// The plaintext. + public byte[] DecryptMessage(byte[] cipherText, int length) + { + if (cipherText == null) + throw new ArgumentNullException("cipherText"); + + if (length > cipherText.Length) + throw new ArgumentOutOfRangeException("length", + "Bad length during Decryption: the length parameter must be smaller than or equal to the size of the destination array."); + + byte[] plainText = new byte[length]; + for (int i = 0; i < length; i++) + { + byte C = (byte)(cipherText[i] ^ MagicByte); + UpdateKeys(C); + plainText[i] = C; + } + return plainText; + } + + /// + /// This is the converse of DecryptMessage. It encrypts the plaintext + /// and produces a ciphertext. + /// + /// + /// The plain text buffer. + /// + /// + /// The number of bytes to encrypt. + /// Should be less than or equal to plainText.Length. + /// + /// + /// The ciphertext. + public byte[] EncryptMessage(byte[] plainText, int length) + { + if (plainText == null) + throw new ArgumentNullException("plaintext"); + + if (length > plainText.Length) + throw new ArgumentOutOfRangeException("length", + "Bad length during Encryption: The length parameter must be smaller than or equal to the size of the destination array."); + + byte[] cipherText = new byte[length]; + for (int i = 0; i < length; i++) + { + byte C = plainText[i]; + cipherText[i] = (byte)(plainText[i] ^ MagicByte); + UpdateKeys(C); + } + return cipherText; + } + + + /// + /// This initializes the cipher with the given password. + /// See AppNote.txt for details. + /// + /// + /// + /// The passphrase for encrypting or decrypting with this cipher. + /// + /// + /// + /// + /// Step 1 - Initializing the encryption keys + /// ----------------------------------------- + /// Start with these keys: + /// Key(0) := 305419896 (0x12345678) + /// Key(1) := 591751049 (0x23456789) + /// Key(2) := 878082192 (0x34567890) + /// + /// Then, initialize the keys with a password: + /// + /// loop for i from 0 to length(password)-1 + /// update_keys(password(i)) + /// end loop + /// + /// Where update_keys() is defined as: + /// + /// update_keys(char): + /// Key(0) := crc32(key(0),char) + /// Key(1) := Key(1) + (Key(0) bitwiseAND 000000ffH) + /// Key(1) := Key(1) * 134775813 + 1 + /// Key(2) := crc32(key(2),key(1) rightshift 24) + /// end update_keys + /// + /// Where crc32(old_crc,char) is a routine that given a CRC value and a + /// character, returns an updated CRC value after applying the CRC-32 + /// algorithm described elsewhere in this document. + /// + /// + /// + /// + /// After the keys are initialized, then you can use the cipher to + /// encrypt the plaintext. + /// + /// + /// + /// Essentially we encrypt the password with the keys, then discard the + /// ciphertext for the password. This initializes the keys for later use. + /// + /// + /// + public void InitCipher(string passphrase) + { + byte[] p = SharedUtilities.StringToByteArray(passphrase); + for (int i = 0; i < passphrase.Length; i++) + UpdateKeys(p[i]); + } + + + private void UpdateKeys(byte byteValue) + { + _Keys[0] = (UInt32)crc32.ComputeCrc32((int)_Keys[0], byteValue); + _Keys[1] = _Keys[1] + (byte)_Keys[0]; + _Keys[1] = _Keys[1] * 0x08088405 + 1; + _Keys[2] = (UInt32)crc32.ComputeCrc32((int)_Keys[2], (byte)(_Keys[1] >> 24)); + } + + ///// + ///// The byte array representing the seed keys used. + ///// Get this after calling InitCipher. The 12 bytes represents + ///// what the zip spec calls the "EncryptionHeader". + ///// + //public byte[] KeyHeader + //{ + // get + // { + // byte[] result = new byte[12]; + // result[0] = (byte)(_Keys[0] & 0xff); + // result[1] = (byte)((_Keys[0] >> 8) & 0xff); + // result[2] = (byte)((_Keys[0] >> 16) & 0xff); + // result[3] = (byte)((_Keys[0] >> 24) & 0xff); + // result[4] = (byte)(_Keys[1] & 0xff); + // result[5] = (byte)((_Keys[1] >> 8) & 0xff); + // result[6] = (byte)((_Keys[1] >> 16) & 0xff); + // result[7] = (byte)((_Keys[1] >> 24) & 0xff); + // result[8] = (byte)(_Keys[2] & 0xff); + // result[9] = (byte)((_Keys[2] >> 8) & 0xff); + // result[10] = (byte)((_Keys[2] >> 16) & 0xff); + // result[11] = (byte)((_Keys[2] >> 24) & 0xff); + // return result; + // } + //} + + // private fields for the crypto stuff: + private UInt32[] _Keys = { 0x12345678, 0x23456789, 0x34567890 }; + private Ionic.Crc.CRC32 crc32 = new Ionic.Crc.CRC32(); + + } + + internal enum CryptoMode + { + Encrypt, + Decrypt + } + + /// + /// A Stream for reading and concurrently decrypting data from a zip file, + /// or for writing and concurrently encrypting data to a zip file. + /// + internal class ZipCipherStream : System.IO.Stream + { + private ZipCrypto _cipher; + private System.IO.Stream _s; + private CryptoMode _mode; + + /// The constructor. + /// The underlying stream + /// To either encrypt or decrypt. + /// The pre-initialized ZipCrypto object. + public ZipCipherStream(System.IO.Stream s, ZipCrypto cipher, CryptoMode mode) + : base() + { + _cipher = cipher; + _s = s; + _mode = mode; + } + + public override int Read(byte[] buffer, int offset, int count) + { + if (_mode == CryptoMode.Encrypt) + throw new NotSupportedException("This stream does not encrypt via Read()"); + + if (buffer == null) + throw new ArgumentNullException("buffer"); + + byte[] db = new byte[count]; + int n = _s.Read(db, 0, count); + byte[] decrypted = _cipher.DecryptMessage(db, n); + for (int i = 0; i < n; i++) + { + buffer[offset + i] = decrypted[i]; + } + return n; + } + + public override void Write(byte[] buffer, int offset, int count) + { + if (_mode == CryptoMode.Decrypt) + throw new NotSupportedException("This stream does not Decrypt via Write()"); + + if (buffer == null) + throw new ArgumentNullException("buffer"); + + // workitem 7696 + if (count == 0) return; + + byte[] plaintext = null; + if (offset != 0) + { + plaintext = new byte[count]; + for (int i = 0; i < count; i++) + { + plaintext[i] = buffer[offset + i]; + } + } + else plaintext = buffer; + + byte[] encrypted = _cipher.EncryptMessage(plaintext, count); + _s.Write(encrypted, 0, encrypted.Length); + } + + + public override bool CanRead + { + get { return (_mode == CryptoMode.Decrypt); } + } + public override bool CanSeek + { + get { return false; } + } + + public override bool CanWrite + { + get { return (_mode == CryptoMode.Encrypt); } + } + + public override void Flush() + { + //throw new NotSupportedException(); + } + + public override long Length + { + get { throw new NotSupportedException(); } + } + + public override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + } +} diff --git a/dotNetZip/Zip/ZipDirEntry.cs b/dotNetZip/Zip/ZipDirEntry.cs new file mode 100644 index 0000000..882c694 --- /dev/null +++ b/dotNetZip/Zip/ZipDirEntry.cs @@ -0,0 +1,381 @@ +// ZipDirEntry.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2006-2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-11 12:03:03> +// +// ------------------------------------------------------------------ +// +// This module defines members of the ZipEntry class for reading the +// Zip file central directory. +// +// Created: Tue, 27 Mar 2007 15:30 +// +// ------------------------------------------------------------------ + + +using System; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + + partial class ZipEntry + { + /// + /// True if the referenced entry is a directory. + /// + internal bool AttributesIndicateDirectory + { + get { return ((_InternalFileAttrs == 0) && ((_ExternalFileAttrs & 0x0010) == 0x0010)); } + } + + + internal void ResetDirEntry() + { + // __FileDataPosition is the position of the file data for an entry. + // It is _RelativeOffsetOfLocalHeader + size of local header. + + // We cannot know the __FileDataPosition until we read the local + // header. + + // The local header is not necessarily the same length as the record + // in the central directory. + + // Set to -1, to indicate we need to read this later. + this.__FileDataPosition = -1; + + // set _LengthOfHeader to 0, to indicate we need to read later. + this._LengthOfHeader = 0; + } + + /// + /// Provides a human-readable string with information about the ZipEntry. + /// + public string Info + { + get + { + var builder = new System.Text.StringBuilder(); + builder + .Append(string.Format(" ZipEntry: {0}\n", this.FileName)) + .Append(string.Format(" Version Made By: {0}\n", this._VersionMadeBy)) + .Append(string.Format(" Needed to extract: {0}\n", this.VersionNeeded)); + + if (this._IsDirectory) + builder.Append(" Entry type: directory\n"); + else + { + builder.Append(string.Format(" File type: {0}\n", this._IsText? "text":"binary")) + .Append(string.Format(" Compression: {0}\n", this.CompressionMethod)) + .Append(string.Format(" Compressed: 0x{0:X}\n", this.CompressedSize)) + .Append(string.Format(" Uncompressed: 0x{0:X}\n", this.UncompressedSize)) + .Append(string.Format(" CRC32: 0x{0:X8}\n", this._Crc32)); + } + builder.Append(string.Format(" Disk Number: {0}\n", this._diskNumber)); + if (this._RelativeOffsetOfLocalHeader > 0xFFFFFFFF) + builder + .Append(string.Format(" Relative Offset: 0x{0:X16}\n", this._RelativeOffsetOfLocalHeader)); + else + builder + .Append(string.Format(" Relative Offset: 0x{0:X8}\n", this._RelativeOffsetOfLocalHeader)); + + builder + .Append(string.Format(" Bit Field: 0x{0:X4}\n", this._BitField)) + .Append(string.Format(" Encrypted?: {0}\n", this._sourceIsEncrypted)) + .Append(string.Format(" Timeblob: 0x{0:X8}\n", this._TimeBlob)) + .Append(string.Format(" Time: {0}\n", Ionic.Zip.SharedUtilities.PackedToDateTime(this._TimeBlob))); + + builder.Append(string.Format(" Is Zip64?: {0}\n", this._InputUsesZip64)); + if (!string.IsNullOrEmpty(this._Comment)) + { + builder.Append(string.Format(" Comment: {0}\n", this._Comment)); + } + builder.Append("\n"); + return builder.ToString(); + } + } + + + // workitem 10330 + private class CopyHelper + { + private static System.Text.RegularExpressions.Regex re = + new System.Text.RegularExpressions.Regex(" \\(copy (\\d+)\\)$"); + + private static int callCount = 0; + + internal static string AppendCopyToFileName(string f) + { + callCount++; + if (callCount > 25) + throw new OverflowException("overflow while creating filename"); + + int n = 1; + int r = f.LastIndexOf("."); + + if (r == -1) + { + // there is no extension + System.Text.RegularExpressions.Match m = re.Match(f); + if (m.Success) + { + n = Int32.Parse(m.Groups[1].Value) + 1; + string copy = String.Format(" (copy {0})", n); + f = f.Substring(0, m.Index) + copy; + } + else + { + string copy = String.Format(" (copy {0})", n); + f = f + copy; + } + } + else + { + //System.Console.WriteLine("HasExtension"); + System.Text.RegularExpressions.Match m = re.Match(f.Substring(0, r)); + if (m.Success) + { + n = Int32.Parse(m.Groups[1].Value) + 1; + string copy = String.Format(" (copy {0})", n); + f = f.Substring(0, m.Index) + copy + f.Substring(r); + } + else + { + string copy = String.Format(" (copy {0})", n); + f = f.Substring(0, r) + copy + f.Substring(r); + } + + //System.Console.WriteLine("returning f({0})", f); + } + return f; + } + } + + + + /// + /// Reads one entry from the zip directory structure in the zip file. + /// + /// + /// + /// The zipfile for which a directory entry will be read. From this param, the + /// method gets the ReadStream and the expected text encoding + /// (ProvisionalAlternateEncoding) which is used if the entry is not marked + /// UTF-8. + /// + /// + /// + /// a list of previously seen entry names; used to prevent duplicates. + /// + /// + /// the entry read from the archive. + internal static ZipEntry ReadDirEntry(ZipFile zf, + Dictionary previouslySeen) + { + System.IO.Stream s = zf.ReadStream; + System.Text.Encoding expectedEncoding = (zf.AlternateEncodingUsage == ZipOption.Always) + ? zf.AlternateEncoding + : ZipFile.DefaultEncoding; + + int signature = Ionic.Zip.SharedUtilities.ReadSignature(s); + // return null if this is not a local file header signature + if (IsNotValidZipDirEntrySig(signature)) + { + s.Seek(-4, System.IO.SeekOrigin.Current); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + + // Getting "not a ZipDirEntry signature" here is not always wrong or an + // error. This can happen when walking through a zipfile. After the + // last ZipDirEntry, we expect to read an + // EndOfCentralDirectorySignature. When we get this is how we know + // we've reached the end of the central directory. + if (signature != ZipConstants.EndOfCentralDirectorySignature && + signature != ZipConstants.Zip64EndOfCentralDirectoryRecordSignature && + signature != ZipConstants.ZipEntrySignature // workitem 8299 + ) + { + throw new BadReadException(String.Format(" Bad signature (0x{0:X8}) at position 0x{1:X8}", signature, s.Position)); + } + return null; + } + + int bytesRead = 42 + 4; + byte[] block = new byte[42]; + int n = s.Read(block, 0, block.Length); + if (n != block.Length) return null; + + int i = 0; + ZipEntry zde = new ZipEntry(); + zde.AlternateEncoding = expectedEncoding; + zde._Source = ZipEntrySource.ZipFile; + zde._container = new ZipContainer(zf); + + unchecked + { + zde._VersionMadeBy = (short)(block[i++] + block[i++] * 256); + zde._VersionNeeded = (short)(block[i++] + block[i++] * 256); + zde._BitField = (short)(block[i++] + block[i++] * 256); + zde._CompressionMethod = (Int16)(block[i++] + block[i++] * 256); + zde._TimeBlob = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + zde._LastModified = Ionic.Zip.SharedUtilities.PackedToDateTime(zde._TimeBlob); + zde._timestamp |= ZipEntryTimestamp.DOS; + + zde._Crc32 = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + zde._CompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + zde._UncompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + } + + // preserve + zde._CompressionMethod_FromZipFile = zde._CompressionMethod; + + zde._filenameLength = (short)(block[i++] + block[i++] * 256); + zde._extraFieldLength = (short)(block[i++] + block[i++] * 256); + zde._commentLength = (short)(block[i++] + block[i++] * 256); + zde._diskNumber = (UInt32)(block[i++] + block[i++] * 256); + + zde._InternalFileAttrs = (short)(block[i++] + block[i++] * 256); + zde._ExternalFileAttrs = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + + zde._RelativeOffsetOfLocalHeader = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + + // workitem 7801 + zde.IsText = ((zde._InternalFileAttrs & 0x01) == 0x01); + + block = new byte[zde._filenameLength]; + n = s.Read(block, 0, block.Length); + bytesRead += n; + if ((zde._BitField & 0x0800) == 0x0800) + { + // UTF-8 is in use + zde._FileNameInArchive = Ionic.Zip.SharedUtilities.Utf8StringFromBuffer(block); + } + else + { + zde._FileNameInArchive = Ionic.Zip.SharedUtilities.StringFromBuffer(block, expectedEncoding); + } + + // workitem 10330 + // insure unique entry names + while (previouslySeen.ContainsKey(zde._FileNameInArchive)) + { + zde._FileNameInArchive = CopyHelper.AppendCopyToFileName(zde._FileNameInArchive); + zde._metadataChanged = true; + } + + if (zde.AttributesIndicateDirectory) + zde.MarkAsDirectory(); // may append a slash to filename if nec. + // workitem 6898 + else if (zde._FileNameInArchive.EndsWith("/")) zde.MarkAsDirectory(); + + zde._CompressedFileDataSize = zde._CompressedSize; + if ((zde._BitField & 0x01) == 0x01) + { + // this may change after processing the Extra field + zde._Encryption_FromZipFile = zde._Encryption = + EncryptionAlgorithm.PkzipWeak; + zde._sourceIsEncrypted = true; + } + + if (zde._extraFieldLength > 0) + { + zde._InputUsesZip64 = (zde._CompressedSize == 0xFFFFFFFF || + zde._UncompressedSize == 0xFFFFFFFF || + zde._RelativeOffsetOfLocalHeader == 0xFFFFFFFF); + + // Console.WriteLine(" Input uses Z64?: {0}", zde._InputUsesZip64); + + bytesRead += zde.ProcessExtraField(s, zde._extraFieldLength); + zde._CompressedFileDataSize = zde._CompressedSize; + } + + // we've processed the extra field, so we know the encryption method is set now. + if (zde._Encryption == EncryptionAlgorithm.PkzipWeak) + { + // the "encryption header" of 12 bytes precedes the file data + zde._CompressedFileDataSize -= 12; + } +#if AESCRYPTO + else if (zde.Encryption == EncryptionAlgorithm.WinZipAes128 || + zde.Encryption == EncryptionAlgorithm.WinZipAes256) + { + zde._CompressedFileDataSize = zde.CompressedSize - + (ZipEntry.GetLengthOfCryptoHeaderBytes(zde.Encryption) + 10); + zde._LengthOfTrailer = 10; + } +#endif + + // tally the trailing descriptor + if ((zde._BitField & 0x0008) == 0x0008) + { + // sig, CRC, Comp and Uncomp sizes + if (zde._InputUsesZip64) + zde._LengthOfTrailer += 24; + else + zde._LengthOfTrailer += 16; + } + + // workitem 12744 + zde.AlternateEncoding = ((zde._BitField & 0x0800) == 0x0800) + ? System.Text.Encoding.UTF8 + :expectedEncoding; + + zde.AlternateEncodingUsage = ZipOption.Always; + + if (zde._commentLength > 0) + { + block = new byte[zde._commentLength]; + n = s.Read(block, 0, block.Length); + bytesRead += n; + if ((zde._BitField & 0x0800) == 0x0800) + { + // UTF-8 is in use + zde._Comment = Ionic.Zip.SharedUtilities.Utf8StringFromBuffer(block); + } + else + { + zde._Comment = Ionic.Zip.SharedUtilities.StringFromBuffer(block, expectedEncoding); + } + } + //zde._LengthOfDirEntry = bytesRead; + return zde; + } + + + /// + /// Returns true if the passed-in value is a valid signature for a ZipDirEntry. + /// + /// the candidate 4-byte signature value. + /// true, if the signature is valid according to the PKWare spec. + internal static bool IsNotValidZipDirEntrySig(int signature) + { + return (signature != ZipConstants.ZipDirEntrySignature); + } + + + private Int16 _VersionMadeBy; + private Int16 _InternalFileAttrs; + private Int32 _ExternalFileAttrs; + + //private Int32 _LengthOfDirEntry; + private Int16 _filenameLength; + private Int16 _extraFieldLength; + private Int16 _commentLength; + } + + +} diff --git a/dotNetZip/Zip/ZipEntry.Extract.cs b/dotNetZip/Zip/ZipEntry.Extract.cs new file mode 100644 index 0000000..17117db --- /dev/null +++ b/dotNetZip/Zip/ZipEntry.Extract.cs @@ -0,0 +1,1456 @@ +// ZipEntry.Extract.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 18:08:21> +// +// ------------------------------------------------------------------ +// +// This module defines logic for Extract methods on the ZipEntry class. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; + +namespace Ionic.Zip +{ + + public partial class ZipEntry + { + /// + /// Extract the entry to the filesystem, starting at the current + /// working directory. + /// + /// + /// + /// This method has a bunch of overloads! One of them is sure to + /// be the right one for you... If you don't like these, check + /// out the ExtractWithPassword() methods. + /// + /// + /// + /// + /// + /// + /// + /// + /// This method extracts an entry from a zip file into the current + /// working directory. The path of the entry as extracted is the full + /// path as specified in the zip archive, relative to the current + /// working directory. After the file is extracted successfully, the + /// file attributes and timestamps are set. + /// + /// + /// + /// The action taken when extraction an entry would overwrite an + /// existing file is determined by the property. + /// + /// + /// + /// Within the call to Extract(), the content for the entry is + /// written into a filesystem file, and then the last modified time of the + /// file is set according to the property on + /// the entry. See the remarks the property for + /// some details about the last modified time. + /// + /// + /// + public void Extract() + { + InternalExtract(".", null, null); + } + + + /// + /// Extract the entry to a file in the filesystem, using the specified + /// behavior when extraction would overwrite an existing file. + /// + /// + /// + /// + /// See the remarks on the property, for some + /// details about how the last modified time of the file is set after + /// extraction. + /// + /// + /// + /// + /// The action to take if extraction would overwrite an existing file. + /// + public void Extract(ExtractExistingFileAction extractExistingFile) + { + ExtractExistingFile = extractExistingFile; + InternalExtract(".", null, null); + } + + /// + /// Extracts the entry to the specified stream. + /// + /// + /// + /// + /// The caller can specify any write-able stream, for example a , a , or ASP.NET's + /// Response.OutputStream. The content will be decrypted and + /// decompressed as necessary. If the entry is encrypted and no password + /// is provided, this method will throw. + /// + /// + /// The position on the stream is not reset by this method before it extracts. + /// You may want to call stream.Seek() before calling ZipEntry.Extract(). + /// + /// + /// + /// + /// the stream to which the entry should be extracted. + /// + /// + public void Extract(Stream stream) + { + InternalExtract(null, stream, null); + } + + /// + /// Extract the entry to the filesystem, starting at the specified base + /// directory. + /// + /// + /// the pathname of the base directory + /// + /// + /// + /// + /// + /// This example extracts only the entries in a zip file that are .txt files, + /// into a directory called "textfiles". + /// + /// using (ZipFile zip = ZipFile.Read("PackedDocuments.zip")) + /// { + /// foreach (string s1 in zip.EntryFilenames) + /// { + /// if (s1.EndsWith(".txt")) + /// { + /// zip[s1].Extract("textfiles"); + /// } + /// } + /// } + /// + /// + /// Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip") + /// Dim s1 As String + /// For Each s1 In zip.EntryFilenames + /// If s1.EndsWith(".txt") Then + /// zip(s1).Extract("textfiles") + /// End If + /// Next + /// End Using + /// + /// + /// + /// + /// + /// + /// Using this method, existing entries in the filesystem will not be + /// overwritten. If you would like to force the overwrite of existing + /// files, see the property, or call + /// . + /// + /// + /// + /// See the remarks on the property, for some + /// details about how the last modified time of the created file is set. + /// + /// + public void Extract(string baseDirectory) + { + InternalExtract(baseDirectory, null, null); + } + + + + + + /// + /// Extract the entry to the filesystem, starting at the specified base + /// directory, and using the specified behavior when extraction would + /// overwrite an existing file. + /// + /// + /// + /// + /// See the remarks on the property, for some + /// details about how the last modified time of the created file is set. + /// + /// + /// + /// + /// + /// String sZipPath = "Airborne.zip"; + /// String sFilePath = "Readme.txt"; + /// String sRootFolder = "Digado"; + /// using (ZipFile zip = ZipFile.Read(sZipPath)) + /// { + /// if (zip.EntryFileNames.Contains(sFilePath)) + /// { + /// // use the string indexer on the zip file + /// zip[sFileName].Extract(sRootFolder, + /// ExtractExistingFileAction.OverwriteSilently); + /// } + /// } + /// + /// + /// + /// Dim sZipPath as String = "Airborne.zip" + /// Dim sFilePath As String = "Readme.txt" + /// Dim sRootFolder As String = "Digado" + /// Using zip As ZipFile = ZipFile.Read(sZipPath) + /// If zip.EntryFileNames.Contains(sFilePath) + /// ' use the string indexer on the zip file + /// zip(sFilePath).Extract(sRootFolder, _ + /// ExtractExistingFileAction.OverwriteSilently) + /// End If + /// End Using + /// + /// + /// + /// the pathname of the base directory + /// + /// The action to take if extraction would overwrite an existing file. + /// + public void Extract(string baseDirectory, ExtractExistingFileAction extractExistingFile) + { + ExtractExistingFile = extractExistingFile; + InternalExtract(baseDirectory, null, null); + } + + + /// + /// Extract the entry to the filesystem, using the current working directory + /// and the specified password. + /// + /// + /// + /// This method has a bunch of overloads! One of them is sure to be + /// the right one for you... + /// + /// + /// + /// + /// + /// + /// + /// + /// Existing entries in the filesystem will not be overwritten. If you + /// would like to force the overwrite of existing files, see the property, or call + /// . + /// + /// + /// + /// See the remarks on the property for some + /// details about how the "last modified" time of the created file is + /// set. + /// + /// + /// + /// + /// In this example, entries that use encryption are extracted using a + /// particular password. + /// + /// using (var zip = ZipFile.Read(FilePath)) + /// { + /// foreach (ZipEntry e in zip) + /// { + /// if (e.UsesEncryption) + /// e.ExtractWithPassword("Secret!"); + /// else + /// e.Extract(); + /// } + /// } + /// + /// + /// Using zip As ZipFile = ZipFile.Read(FilePath) + /// Dim e As ZipEntry + /// For Each e In zip + /// If (e.UsesEncryption) + /// e.ExtractWithPassword("Secret!") + /// Else + /// e.Extract + /// End If + /// Next + /// End Using + /// + /// + /// The Password to use for decrypting the entry. + public void ExtractWithPassword(string password) + { + InternalExtract(".", null, password); + } + + /// + /// Extract the entry to the filesystem, starting at the specified base + /// directory, and using the specified password. + /// + /// + /// + /// + /// + /// + /// + /// Existing entries in the filesystem will not be overwritten. If you + /// would like to force the overwrite of existing files, see the property, or call + /// . + /// + /// + /// + /// See the remarks on the property, for some + /// details about how the last modified time of the created file is set. + /// + /// + /// + /// The pathname of the base directory. + /// The Password to use for decrypting the entry. + public void ExtractWithPassword(string baseDirectory, string password) + { + InternalExtract(baseDirectory, null, password); + } + + + + + /// + /// Extract the entry to a file in the filesystem, relative to the + /// current directory, using the specified behavior when extraction + /// would overwrite an existing file. + /// + /// + /// + /// + /// See the remarks on the property, for some + /// details about how the last modified time of the created file is set. + /// + /// + /// + /// The Password to use for decrypting the entry. + /// + /// + /// The action to take if extraction would overwrite an existing file. + /// + public void ExtractWithPassword(ExtractExistingFileAction extractExistingFile, string password) + { + ExtractExistingFile = extractExistingFile; + InternalExtract(".", null, password); + } + + + + /// + /// Extract the entry to the filesystem, starting at the specified base + /// directory, and using the specified behavior when extraction would + /// overwrite an existing file. + /// + /// + /// + /// See the remarks on the property, for some + /// details about how the last modified time of the created file is set. + /// + /// + /// the pathname of the base directory + /// + /// The action to take if extraction would + /// overwrite an existing file. + /// + /// The Password to use for decrypting the entry. + public void ExtractWithPassword(string baseDirectory, ExtractExistingFileAction extractExistingFile, string password) + { + ExtractExistingFile = extractExistingFile; + InternalExtract(baseDirectory, null, password); + } + + /// + /// Extracts the entry to the specified stream, using the specified + /// Password. For example, the caller could extract to Console.Out, or + /// to a MemoryStream. + /// + /// + /// + /// + /// The caller can specify any write-able stream, for example a , a , or ASP.NET's + /// Response.OutputStream. The content will be decrypted and + /// decompressed as necessary. If the entry is encrypted and no password + /// is provided, this method will throw. + /// + /// + /// The position on the stream is not reset by this method before it extracts. + /// You may want to call stream.Seek() before calling ZipEntry.Extract(). + /// + /// + /// + /// + /// + /// the stream to which the entry should be extracted. + /// + /// + /// The password to use for decrypting the entry. + /// + public void ExtractWithPassword(Stream stream, string password) + { + InternalExtract(null, stream, password); + } + + + /// + /// Opens a readable stream corresponding to the zip entry in the + /// archive. The stream decompresses and decrypts as necessary, as it + /// is read. + /// + /// + /// + /// + /// + /// DotNetZip offers a variety of ways to extract entries from a zip + /// file. This method allows an application to extract an entry by + /// reading a . + /// + /// + /// + /// The return value is of type . Use it as you would any + /// stream for reading. When an application calls on that stream, it will + /// receive data from the zip entry that is decrypted and decompressed + /// as necessary. + /// + /// + /// + /// CrcCalculatorStream adds one additional feature: it keeps a + /// CRC32 checksum on the bytes of the stream as it is read. The CRC + /// value is available in the property on the + /// CrcCalculatorStream. When the read is complete, your + /// application + /// should check this CRC against the + /// property on the ZipEntry to validate the content of the + /// ZipEntry. You don't have to validate the entry using the CRC, but + /// you should, to verify integrity. Check the example for how to do + /// this. + /// + /// + /// + /// If the entry is protected with a password, then you need to provide + /// a password prior to calling , either by + /// setting the property on the entry, or the + /// property on the ZipFile + /// itself. Or, you can use , the + /// overload of OpenReader that accepts a password parameter. + /// + /// + /// + /// If you want to extract entry data into a write-able stream that is + /// already opened, like a , do not + /// use this method. Instead, use . + /// + /// + /// + /// Your application may use only one stream created by OpenReader() at + /// a time, and you should not call other Extract methods before + /// completing your reads on a stream obtained from OpenReader(). This + /// is because there is really only one source stream for the compressed + /// content. A call to OpenReader() seeks in the source stream, to the + /// beginning of the compressed content. A subsequent call to + /// OpenReader() on a different entry will seek to a different position + /// in the source stream, as will a call to Extract() or one of its + /// overloads. This will corrupt the state for the decompressing stream + /// from the original call to OpenReader(). + /// + /// + /// + /// The OpenReader() method works only when the ZipEntry is + /// obtained from an instance of ZipFile. This method will throw + /// an exception if the ZipEntry is obtained from a . + /// + /// + /// + /// + /// This example shows how to open a zip archive, then read in a named + /// entry via a stream. After the read loop is complete, the code + /// compares the calculated during the read loop with the expected CRC + /// on the ZipEntry, to verify the extraction. + /// + /// using (ZipFile zip = new ZipFile(ZipFileToRead)) + /// { + /// ZipEntry e1= zip["Elevation.mp3"]; + /// using (Ionic.Zlib.CrcCalculatorStream s = e1.OpenReader()) + /// { + /// byte[] buffer = new byte[4096]; + /// int n, totalBytesRead= 0; + /// do { + /// n = s.Read(buffer,0, buffer.Length); + /// totalBytesRead+=n; + /// } while (n>0); + /// if (s.Crc32 != e1.Crc32) + /// throw new Exception(string.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32)); + /// if (totalBytesRead != e1.UncompressedSize) + /// throw new Exception(string.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize)); + /// } + /// } + /// + /// + /// Using zip As New ZipFile(ZipFileToRead) + /// Dim e1 As ZipEntry = zip.Item("Elevation.mp3") + /// Using s As Ionic.Zlib.CrcCalculatorStream = e1.OpenReader + /// Dim n As Integer + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim totalBytesRead As Integer = 0 + /// Do + /// n = s.Read(buffer, 0, buffer.Length) + /// totalBytesRead = (totalBytesRead + n) + /// Loop While (n > 0) + /// If (s.Crc32 <> e1.Crc32) Then + /// Throw New Exception(String.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32)) + /// End If + /// If (totalBytesRead <> e1.UncompressedSize) Then + /// Throw New Exception(String.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize)) + /// End If + /// End Using + /// End Using + /// + /// + /// + /// The Stream for reading. + public Ionic.Crc.CrcCalculatorStream OpenReader() + { + // workitem 10923 + if (_container.ZipFile == null) + throw new InvalidOperationException("Use OpenReader() only with ZipFile."); + + // use the entry password if it is non-null, + // else use the zipfile password, which is possibly null + return InternalOpenReader(this._Password ?? this._container.Password); + } + + /// + /// Opens a readable stream for an encrypted zip entry in the archive. + /// The stream decompresses and decrypts as necessary, as it is read. + /// + /// + /// + /// + /// See the documentation on the method for + /// full details. This overload allows the application to specify a + /// password for the ZipEntry to be read. + /// + /// + /// + /// The password to use for decrypting the entry. + /// The Stream for reading. + public Ionic.Crc.CrcCalculatorStream OpenReader(string password) + { + // workitem 10923 + if (_container.ZipFile == null) + throw new InvalidOperationException("Use OpenReader() only with ZipFile."); + + return InternalOpenReader(password); + } + + + + internal Ionic.Crc.CrcCalculatorStream InternalOpenReader(string password) + { + ValidateCompression(); + ValidateEncryption(); + SetupCryptoForExtract(password); + + // workitem 7958 + if (this._Source != ZipEntrySource.ZipFile) + throw new BadStateException("You must call ZipFile.Save before calling OpenReader"); + + // LeftToRead is a count of bytes remaining to be read (out) + // from the stream AFTER decompression and decryption. + // It is the uncompressed size, unless ... there is no compression in which + // case ...? :< I'm not sure why it's not always UncompressedSize + Int64 LeftToRead = (_CompressionMethod_FromZipFile == (short)CompressionMethod.None) + ? this._CompressedFileDataSize + : this.UncompressedSize; + + Stream input = this.ArchiveStream; + + this.ArchiveStream.Seek(this.FileDataPosition, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + + _inputDecryptorStream = GetExtractDecryptor(input); + Stream input3 = GetExtractDecompressor(_inputDecryptorStream); + + return new Ionic.Crc.CrcCalculatorStream(input3, LeftToRead); + } + + + + private void OnExtractProgress(Int64 bytesWritten, Int64 totalBytesToWrite) + { + if (_container.ZipFile != null) + _ioOperationCanceled = _container.ZipFile.OnExtractBlock(this, bytesWritten, totalBytesToWrite); + } + + + private void OnBeforeExtract(string path) + { + // When in the context of a ZipFile.ExtractAll, the events are generated from + // the ZipFile method, not from within the ZipEntry instance. (why?) + // Therefore we suppress the events originating from the ZipEntry method. + if (_container.ZipFile != null) + { + if (!_container.ZipFile._inExtractAll) + { + _ioOperationCanceled = _container.ZipFile.OnSingleEntryExtract(this, path, true); + } + } + } + + private void OnAfterExtract(string path) + { + // When in the context of a ZipFile.ExtractAll, the events are generated from + // the ZipFile method, not from within the ZipEntry instance. (why?) + // Therefore we suppress the events originating from the ZipEntry method. + if (_container.ZipFile != null) + { + if (!_container.ZipFile._inExtractAll) + { + _container.ZipFile.OnSingleEntryExtract(this, path, false); + } + } + } + + private void OnExtractExisting(string path) + { + if (_container.ZipFile != null) + _ioOperationCanceled = _container.ZipFile.OnExtractExisting(this, path); + } + + private static void ReallyDelete(string fileName) + { + // workitem 7881 + // reset ReadOnly bit if necessary +#if NETCF + if ( (NetCfFile.GetAttributes(fileName) & (uint)FileAttributes.ReadOnly) == (uint)FileAttributes.ReadOnly) + NetCfFile.SetAttributes(fileName, (uint)FileAttributes.Normal); +#elif SILVERLIGHT +#else + if ((File.GetAttributes(fileName) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) + File.SetAttributes(fileName, FileAttributes.Normal); +#endif + File.Delete(fileName); + } + + + private void WriteStatus(string format, params Object[] args) + { + if (_container.ZipFile != null && _container.ZipFile.Verbose) _container.ZipFile.StatusMessageTextWriter.WriteLine(format, args); + } + + + // Pass in either basedir or s, but not both. + // In other words, you can extract to a stream or to a directory (filesystem), but not both! + // The Password param is required for encrypted entries. + private void InternalExtract(string baseDir, Stream outstream, string password) + { + // workitem 7958 + if (_container == null) + throw new BadStateException("This entry is an orphan"); + + // workitem 10355 + if (_container.ZipFile == null) + throw new InvalidOperationException("Use Extract() only with ZipFile."); + + _container.ZipFile.Reset(false); + + if (this._Source != ZipEntrySource.ZipFile) + throw new BadStateException("You must call ZipFile.Save before calling any Extract method"); + + OnBeforeExtract(baseDir); + _ioOperationCanceled = false; + string targetFileName = null; + Stream output = null; + bool fileExistsBeforeExtraction = false; + bool checkLaterForResetDirTimes = false; + try + { + ValidateCompression(); + ValidateEncryption(); + + if (ValidateOutput(baseDir, outstream, out targetFileName)) + { + WriteStatus("extract dir {0}...", targetFileName); + // if true, then the entry was a directory and has been created. + // We need to fire the Extract Event. + OnAfterExtract(baseDir); + return; + } + + // workitem 10639 + // do we want to extract to a regular filesystem file? + if (targetFileName != null) + { + // Check for extracting to a previously extant file. The user + // can specify bejavior for that case: overwrite, don't + // overwrite, and throw. Also, if the file exists prior to + // extraction, it affects exception handling: whether to delete + // the target of extraction or not. This check needs to be done + // before the password check is done, because password check may + // throw a BadPasswordException, which triggers the catch, + // wherein the extant file may be deleted if not flagged as + // pre-existing. + if (File.Exists(targetFileName)) + { + fileExistsBeforeExtraction = true; + int rc = CheckExtractExistingFile(baseDir, targetFileName); + if (rc == 2) goto ExitTry; // cancel + if (rc == 1) return; // do not overwrite + } + } + + // If no password explicitly specified, use the password on the entry itself, + // or on the zipfile itself. + string p = password ?? this._Password ?? this._container.Password; + if (_Encryption_FromZipFile != EncryptionAlgorithm.None) + { + if (p == null) + throw new BadPasswordException(); + SetupCryptoForExtract(p); + } + + + // set up the output stream + if (targetFileName != null) + { + WriteStatus("extract file {0}...", targetFileName); + targetFileName += ".tmp"; + var dirName = Path.GetDirectoryName(targetFileName); + // ensure the target path exists + if (!Directory.Exists(dirName)) + { + // we create the directory here, but we do not set the + // create/modified/accessed times on it because it is being + // created implicitly, not explcitly. There's no entry in the + // zip archive for the directory. + Directory.CreateDirectory(dirName); + } + else + { + // workitem 8264 + if (_container.ZipFile != null) + checkLaterForResetDirTimes = _container.ZipFile._inExtractAll; + } + + // File.Create(CreateNew) will overwrite any existing file. + output = new FileStream(targetFileName, FileMode.CreateNew); + } + else + { + WriteStatus("extract entry {0} to stream...", FileName); + output = outstream; + } + + + if (_ioOperationCanceled) + goto ExitTry; + + Int32 ActualCrc32 = ExtractOne(output); + + if (_ioOperationCanceled) + goto ExitTry; + + VerifyCrcAfterExtract(ActualCrc32); + + if (targetFileName != null) + { + output.Close(); + output = null; + + // workitem 10639 + // move file to permanent home + string tmpName = targetFileName; + string zombie = null; + targetFileName = tmpName.Substring(0,tmpName.Length-4); + + if (fileExistsBeforeExtraction) + { + // An AV program may hold the target file open, which means + // File.Delete() will succeed, though the actual deletion + // remains pending. This will prevent a subsequent + // File.Move() from succeeding. To avoid this, when the file + // already exists, we need to replace it in 3 steps: + // + // 1. rename the existing file to a zombie name; + // 2. rename the extracted file from the temp name to + // the target file name; + // 3. delete the zombie. + // + zombie = targetFileName + ".PendingOverwrite"; + File.Move(targetFileName, zombie); + } + + File.Move(tmpName, targetFileName); + _SetTimes(targetFileName, true); + + if (zombie != null && File.Exists(zombie)) + ReallyDelete(zombie); + + // workitem 8264 + if (checkLaterForResetDirTimes) + { + // This is sort of a hack. What I do here is set the time on + // the parent directory, every time a file is extracted into + // it. If there is a directory with 1000 files, then I set + // the time on the dir, 1000 times. This allows the directory + // to have times that reflect the actual time on the entry in + // the zip archive. + + // String.Contains is not available on .NET CF 2.0 + if (this.FileName.IndexOf('/') != -1) + { + string dirname = Path.GetDirectoryName(this.FileName); + if (this._container.ZipFile[dirname] == null) + { + _SetTimes(Path.GetDirectoryName(targetFileName), false); + } + } + } + +#if NETCF + // workitem 7926 - version made by OS can be zero or 10 + if ((_VersionMadeBy & 0xFF00) == 0x0a00 || (_VersionMadeBy & 0xFF00) == 0x0000) + NetCfFile.SetAttributes(targetFileName, (uint)_ExternalFileAttrs); + +#else + // workitem 7071 + // + // We can only apply attributes if they are relevant to the NTFS + // OS. Must do this LAST because it may involve a ReadOnly bit, + // which would prevent us from setting the time, etc. + // + // workitem 7926 - version made by OS can be zero (FAT) or 10 + // (NTFS) + if ((_VersionMadeBy & 0xFF00) == 0x0a00 || (_VersionMadeBy & 0xFF00) == 0x0000) + File.SetAttributes(targetFileName, (FileAttributes)_ExternalFileAttrs); +#endif + } + + OnAfterExtract(baseDir); + + ExitTry: ; + } + catch (Exception) + { + _ioOperationCanceled = true; + throw; + } + finally + { + if (_ioOperationCanceled) + { + if (targetFileName != null) + { + try + { + if (output != null) output.Close(); + // An exception has occurred. If the file exists, check + // to see if it existed before we tried extracting. If + // it did not, attempt to remove the target file. There + // is a small possibility that the existing file has + // been extracted successfully, overwriting a previously + // existing file, and an exception was thrown after that + // but before final completion (setting times, etc). In + // that case the file will remain, even though some + // error occurred. Nothing to be done about it. + if (File.Exists(targetFileName) && !fileExistsBeforeExtraction) + File.Delete(targetFileName); + + } + finally { } + } + } + } + } + + +#if NOT + internal void CalcWinZipAesMac(Stream input) + { + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + if (input is WinZipAesCipherStream) + wzs = input as WinZipAesCipherStream; + + else if (input is Ionic.Zlib.CrcCalculatorStream) + { + xxx; + } + + } + } +#endif + + + internal void VerifyCrcAfterExtract(Int32 actualCrc32) + { + +#if AESCRYPTO + // After extracting, Validate the CRC32 + if (actualCrc32 != _Crc32) + { + // CRC is not meaningful with WinZipAES and AES method 2 (AE-2) + if ((Encryption != EncryptionAlgorithm.WinZipAes128 && + Encryption != EncryptionAlgorithm.WinZipAes256) + || _WinZipAesMethod != 0x02) + throw new BadCrcException("CRC error: the file being extracted appears to be corrupted. " + + String.Format("Expected 0x{0:X8}, Actual 0x{1:X8}", _Crc32, actualCrc32)); + } + + // ignore MAC if the size of the file is zero + if (this.UncompressedSize == 0) + return; + + // calculate the MAC + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + WinZipAesCipherStream wzs = _inputDecryptorStream as WinZipAesCipherStream; + _aesCrypto_forExtract.CalculatedMac = wzs.FinalAuthentication; + + _aesCrypto_forExtract.ReadAndVerifyMac(this.ArchiveStream); // throws if MAC is bad + // side effect: advances file position. + } + + + + +#else + if (actualCrc32 != _Crc32) + throw new BadCrcException("CRC error: the file being extracted appears to be corrupted. " + + String.Format("Expected 0x{0:X8}, Actual 0x{1:X8}", _Crc32, actualCrc32)); +#endif + } + + + + + private int CheckExtractExistingFile(string baseDir, string targetFileName) + { + int loop = 0; + // returns: 0 == extract, 1 = don't, 2 = cancel + do + { + switch (ExtractExistingFile) + { + case ExtractExistingFileAction.OverwriteSilently: + WriteStatus("the file {0} exists; will overwrite it...", targetFileName); + return 0; + + case ExtractExistingFileAction.DoNotOverwrite: + WriteStatus("the file {0} exists; not extracting entry...", FileName); + OnAfterExtract(baseDir); + return 1; + + case ExtractExistingFileAction.InvokeExtractProgressEvent: + if (loop>0) + throw new ZipException(String.Format("The file {0} already exists.", targetFileName)); + OnExtractExisting(baseDir); + if (_ioOperationCanceled) + return 2; + + // loop around + break; + + case ExtractExistingFileAction.Throw: + default: + throw new ZipException(String.Format("The file {0} already exists.", targetFileName)); + } + loop++; + } + while (true); + } + + + + + private void _CheckRead(int nbytes) + { + if (nbytes == 0) + throw new BadReadException(String.Format("bad read of entry {0} from compressed archive.", + this.FileName)); + } + + + private Stream _inputDecryptorStream; + + private Int32 ExtractOne(Stream output) + { + Int32 CrcResult = 0; + Stream input = this.ArchiveStream; + + try + { + // change for workitem 8098 + input.Seek(this.FileDataPosition, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(input); + + byte[] bytes = new byte[BufferSize]; + + // The extraction process varies depending on how the entry was + // stored. It could have been encrypted, and it coould have + // been compressed, or both, or neither. So we need to check + // both the encryption flag and the compression flag, and take + // the proper action in all cases. + + Int64 LeftToRead = (_CompressionMethod_FromZipFile != (short)CompressionMethod.None) + ? this.UncompressedSize + : this._CompressedFileDataSize; + + // Get a stream that either decrypts or not. + _inputDecryptorStream = GetExtractDecryptor(input); + + Stream input3 = GetExtractDecompressor( _inputDecryptorStream ); + + Int64 bytesWritten = 0; + // As we read, we maybe decrypt, and then we maybe decompress. Then we write. + using (var s1 = new Ionic.Crc.CrcCalculatorStream(input3)) + { + while (LeftToRead > 0) + { + //Console.WriteLine("ExtractOne: LeftToRead {0}", LeftToRead); + + // Casting LeftToRead down to an int is ok here in the else clause, + // because that only happens when it is less than bytes.Length, + // which is much less than MAX_INT. + int len = (LeftToRead > bytes.Length) ? bytes.Length : (int)LeftToRead; + int n = s1.Read(bytes, 0, len); + + // must check data read - essential for detecting corrupt zip files + _CheckRead(n); + + output.Write(bytes, 0, n); + LeftToRead -= n; + bytesWritten += n; + + // fire the progress event, check for cancels + OnExtractProgress(bytesWritten, UncompressedSize); + if (_ioOperationCanceled) + { + break; + } + } + + CrcResult = s1.Crc; + } + } + finally + { + var zss = input as ZipSegmentedStream; + if (zss != null) + { +#if NETCF + zss.Close(); +#else + // need to dispose it + zss.Dispose(); +#endif + _archiveStream = null; + } + } + + return CrcResult; + } + + + + internal Stream GetExtractDecompressor(Stream input2) + { + // get a stream that either decompresses or not. + switch (_CompressionMethod_FromZipFile) + { + case (short)CompressionMethod.None: + return input2; + case (short)CompressionMethod.Deflate: + return new Ionic.Zlib.DeflateStream(input2, Ionic.Zlib.CompressionMode.Decompress, true); +#if BZIP + case (short)CompressionMethod.BZip2: + return new Ionic.BZip2.BZip2InputStream(input2, true); +#endif + } + + return null; + } + + + + internal Stream GetExtractDecryptor(Stream input) + { + Stream input2 = null; + if (_Encryption_FromZipFile == EncryptionAlgorithm.PkzipWeak) + input2 = new ZipCipherStream(input, _zipCrypto_forExtract, CryptoMode.Decrypt); + +#if AESCRYPTO + else if (_Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes128 || + _Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes256) + input2 = new WinZipAesCipherStream(input, _aesCrypto_forExtract, _CompressedFileDataSize, CryptoMode.Decrypt); +#endif + + else + input2 = input; + + return input2; + } + + + + + internal void _SetTimes(string fileOrDirectory, bool isFile) + { +#if SILVERLIGHT + // punt on setting file times +#else + // workitem 8807: + // Because setting the time is not considered to be a fatal error, + // and because other applications can interfere with the setting + // of a time on a directory, we're going to swallow IO exceptions + // in this method. + + try + { + if (_ntfsTimesAreSet) + { +#if NETCF + // workitem 7944: set time should not be a fatal error on CF + int rc = NetCfFile.SetTimes(fileOrDirectory, _Ctime, _Atime, _Mtime); + if ( rc != 0) + { + WriteStatus("Warning: SetTimes failed. entry({0}) file({1}) rc({2})", + FileName, fileOrDirectory, rc); + } +#else + if (isFile) + { + // It's possible that the extract was cancelled, in which case, + // the file does not exist. + if (File.Exists(fileOrDirectory)) + { + File.SetCreationTimeUtc(fileOrDirectory, _Ctime); + File.SetLastAccessTimeUtc(fileOrDirectory, _Atime); + File.SetLastWriteTimeUtc(fileOrDirectory, _Mtime); + } + } + else + { + // It's possible that the extract was cancelled, in which case, + // the directory does not exist. + if (Directory.Exists(fileOrDirectory)) + { + Directory.SetCreationTimeUtc(fileOrDirectory, _Ctime); + Directory.SetLastAccessTimeUtc(fileOrDirectory, _Atime); + Directory.SetLastWriteTimeUtc(fileOrDirectory, _Mtime); + } + } +#endif + } + else + { + // workitem 6191 + DateTime AdjustedLastModified = Ionic.Zip.SharedUtilities.AdjustTime_Reverse(LastModified); + +#if NETCF + int rc = NetCfFile.SetLastWriteTime(fileOrDirectory, AdjustedLastModified); + + if ( rc != 0) + { + WriteStatus("Warning: SetLastWriteTime failed. entry({0}) file({1}) rc({2})", + FileName, fileOrDirectory, rc); + } +#else + if (isFile) + File.SetLastWriteTime(fileOrDirectory, AdjustedLastModified); + else + Directory.SetLastWriteTime(fileOrDirectory, AdjustedLastModified); +#endif + } + } + catch (System.IO.IOException ioexc1) + { + WriteStatus("failed to set time on {0}: {1}", fileOrDirectory, ioexc1.Message); + } +#endif + } + + + #region Support methods + + + // workitem 7968 + private string UnsupportedAlgorithm + { + get + { + string alg = String.Empty; + switch (_UnsupportedAlgorithmId) + { + case 0: + alg = "--"; + break; + case 0x6601: + alg = "DES"; + break; + case 0x6602: // - RC2 (version needed to extract < 5.2) + alg = "RC2"; + break; + case 0x6603: // - 3DES 168 + alg = "3DES-168"; + break; + case 0x6609: // - 3DES 112 + alg = "3DES-112"; + break; + case 0x660E: // - AES 128 + alg = "PKWare AES128"; + break; + case 0x660F: // - AES 192 + alg = "PKWare AES192"; + break; + case 0x6610: // - AES 256 + alg = "PKWare AES256"; + break; + case 0x6702: // - RC2 (version needed to extract >= 5.2) + alg = "RC2"; + break; + case 0x6720: // - Blowfish + alg = "Blowfish"; + break; + case 0x6721: // - Twofish + alg = "Twofish"; + break; + case 0x6801: // - RC4 + alg = "RC4"; + break; + case 0xFFFF: // - Unknown algorithm + default: + alg = String.Format("Unknown (0x{0:X4})", _UnsupportedAlgorithmId); + break; + } + return alg; + } + } + + // workitem 7968 + private string UnsupportedCompressionMethod + { + get + { + string meth = String.Empty; + switch ((int)_CompressionMethod) + { + case 0: + meth = "Store"; + break; + case 1: + meth = "Shrink"; + break; + case 8: + meth = "DEFLATE"; + break; + case 9: + meth = "Deflate64"; + break; + case 12: + meth = "BZIP2"; // only if BZIP not compiled in + break; + case 14: + meth = "LZMA"; + break; + case 19: + meth = "LZ77"; + break; + case 98: + meth = "PPMd"; + break; + default: + meth = String.Format("Unknown (0x{0:X4})", _CompressionMethod); + break; + } + return meth; + } + } + + + internal void ValidateEncryption() + { + if (Encryption != EncryptionAlgorithm.PkzipWeak && +#if AESCRYPTO + Encryption != EncryptionAlgorithm.WinZipAes128 && + Encryption != EncryptionAlgorithm.WinZipAes256 && +#endif + Encryption != EncryptionAlgorithm.None) + { + // workitem 7968 + if (_UnsupportedAlgorithmId != 0) + throw new ZipException(String.Format("Cannot extract: Entry {0} is encrypted with an algorithm not supported by DotNetZip: {1}", + FileName, UnsupportedAlgorithm)); + else + throw new ZipException(String.Format("Cannot extract: Entry {0} uses an unsupported encryption algorithm ({1:X2})", + FileName, (int)Encryption)); + } + } + + + private void ValidateCompression() + { + if ((_CompressionMethod_FromZipFile != (short)CompressionMethod.None) && + (_CompressionMethod_FromZipFile != (short)CompressionMethod.Deflate) +#if BZIP + && (_CompressionMethod_FromZipFile != (short)CompressionMethod.BZip2) +#endif + ) + throw new ZipException(String.Format("Entry {0} uses an unsupported compression method (0x{1:X2}, {2})", + FileName, _CompressionMethod_FromZipFile, UnsupportedCompressionMethod)); + } + + + private void SetupCryptoForExtract(string password) + { + //if (password == null) return; + if (_Encryption_FromZipFile == EncryptionAlgorithm.None) return; + + if (_Encryption_FromZipFile == EncryptionAlgorithm.PkzipWeak) + { + if (password == null) + throw new ZipException("Missing password."); + + this.ArchiveStream.Seek(this.FileDataPosition - 12, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + _zipCrypto_forExtract = ZipCrypto.ForRead(password, this); + } + +#if AESCRYPTO + else if (_Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes128 || + _Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes256) + { + if (password == null) + throw new ZipException("Missing password."); + + // If we already have a WinZipAesCrypto object in place, use it. + // It can be set up in the ReadDirEntry(), or during a previous Extract. + if (_aesCrypto_forExtract != null) + { + _aesCrypto_forExtract.Password = password; + } + else + { + int sizeOfSaltAndPv = GetLengthOfCryptoHeaderBytes(_Encryption_FromZipFile); + this.ArchiveStream.Seek(this.FileDataPosition - sizeOfSaltAndPv, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + int keystrength = GetKeyStrengthInBits(_Encryption_FromZipFile); + _aesCrypto_forExtract = WinZipAesCrypto.ReadFromStream(password, keystrength, this.ArchiveStream); + } + } +#endif + } + + + + /// + /// Validates that the args are consistent. + /// + /// + /// Only one of {baseDir, outStream} can be non-null. + /// If baseDir is non-null, then the outputFile is created. + /// + private bool ValidateOutput(string basedir, Stream outstream, out string outFileName) + { + if (basedir != null) + { + // Sometimes the name on the entry starts with a slash. + // Rather than unpack to the root of the volume, we're going to + // drop the slash and unpack to the specified base directory. + string f = this.FileName.Replace("\\","/"); + + // workitem 11772: remove drive letter with separator + if (f.IndexOf(':') == 1) + f= f.Substring(2); + + if (f.StartsWith("/")) + f= f.Substring(1); + + // String.Contains is not available on .NET CF 2.0 + + if (_container.ZipFile.FlattenFoldersOnExtract) + outFileName = Path.Combine(basedir, + (f.IndexOf('/') != -1) ? Path.GetFileName(f) : f); + else + outFileName = Path.Combine(basedir, f); + + // workitem 10639 + outFileName = outFileName.Replace("/","\\"); + + // check if it is a directory + if ((IsDirectory) || (FileName.EndsWith("/"))) + { + if (!Directory.Exists(outFileName)) + { + Directory.CreateDirectory(outFileName); + _SetTimes(outFileName, false); + } + else + { + // the dir exists, maybe we want to overwrite times. + if (ExtractExistingFile == ExtractExistingFileAction.OverwriteSilently) + _SetTimes(outFileName, false); + } + return true; // true == all done, caller will return + } + return false; // false == work to do by caller. + } + + if (outstream != null) + { + outFileName = null; + if ((IsDirectory) || (FileName.EndsWith("/"))) + { + // extract a directory to streamwriter? nothing to do! + return true; // true == all done! caller can return + } + return false; + } + + throw new ArgumentNullException("outstream"); + } + + + #endregion + + } +} diff --git a/dotNetZip/Zip/ZipEntry.Read.cs b/dotNetZip/Zip/ZipEntry.Read.cs new file mode 100644 index 0000000..7a53356 --- /dev/null +++ b/dotNetZip/Zip/ZipEntry.Read.cs @@ -0,0 +1,798 @@ +// ZipEntry.Read.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-09 21:31:28> +// +// ------------------------------------------------------------------ +// +// This module defines logic for Reading the ZipEntry from a +// zip file. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; + +namespace Ionic.Zip +{ + public partial class ZipEntry + { + private int _readExtraDepth; + private void ReadExtraField() + { + _readExtraDepth++; + // workitem 8098: ok (restore) + long posn = this.ArchiveStream.Position; + this.ArchiveStream.Seek(this._RelativeOffsetOfLocalHeader, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + + byte[] block = new byte[30]; + this.ArchiveStream.Read(block, 0, block.Length); + int i = 26; + Int16 filenameLength = (short)(block[i++] + block[i++] * 256); + Int16 extraFieldLength = (short)(block[i++] + block[i++] * 256); + + // workitem 8098: ok (relative) + this.ArchiveStream.Seek(filenameLength, SeekOrigin.Current); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + + ProcessExtraField(this.ArchiveStream, extraFieldLength); + + // workitem 8098: ok (restore) + this.ArchiveStream.Seek(posn, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + _readExtraDepth--; + } + + + private static bool ReadHeader(ZipEntry ze, System.Text.Encoding defaultEncoding) + { + int bytesRead = 0; + + // change for workitem 8098 + ze._RelativeOffsetOfLocalHeader = ze.ArchiveStream.Position; + + int signature = Ionic.Zip.SharedUtilities.ReadEntrySignature(ze.ArchiveStream); + bytesRead += 4; + + // Return false if this is not a local file header signature. + if (ZipEntry.IsNotValidSig(signature)) + { + // Getting "not a ZipEntry signature" is not always wrong or an error. + // This will happen after the last entry in a zipfile. In that case, we + // expect to read : + // a ZipDirEntry signature (if a non-empty zip file) or + // a ZipConstants.EndOfCentralDirectorySignature. + // + // Anything else is a surprise. + + ze.ArchiveStream.Seek(-4, SeekOrigin.Current); // unread the signature + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(ze.ArchiveStream); + if (ZipEntry.IsNotValidZipDirEntrySig(signature) && (signature != ZipConstants.EndOfCentralDirectorySignature)) + { + throw new BadReadException(String.Format(" Bad signature (0x{0:X8}) at position 0x{1:X8}", signature, ze.ArchiveStream.Position)); + } + return false; + } + + byte[] block = new byte[26]; + int n = ze.ArchiveStream.Read(block, 0, block.Length); + if (n != block.Length) return false; + bytesRead += n; + + int i = 0; + ze._VersionNeeded = (Int16)(block[i++] + block[i++] * 256); + ze._BitField = (Int16)(block[i++] + block[i++] * 256); + ze._CompressionMethod_FromZipFile = ze._CompressionMethod = (Int16)(block[i++] + block[i++] * 256); + ze._TimeBlob = block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256; + // transform the time data into something usable (a DateTime) + ze._LastModified = Ionic.Zip.SharedUtilities.PackedToDateTime(ze._TimeBlob); + ze._timestamp |= ZipEntryTimestamp.DOS; + + if ((ze._BitField & 0x01) == 0x01) + { + ze._Encryption_FromZipFile = ze._Encryption = EncryptionAlgorithm.PkzipWeak; // this *may* change after processing the Extra field + ze._sourceIsEncrypted = true; + } + + // NB: if ((ze._BitField & 0x0008) != 0x0008), then the Compressed, uncompressed and + // CRC values are not true values; the true values will follow the entry data. + // But, regardless of the status of bit 3 in the bitfield, the slots for + // the three amigos may contain marker values for ZIP64. So we must read them. + { + ze._Crc32 = (Int32)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + ze._CompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + ze._UncompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + + if ((uint)ze._CompressedSize == 0xFFFFFFFF || + (uint)ze._UncompressedSize == 0xFFFFFFFF) + + ze._InputUsesZip64 = true; + } + + Int16 filenameLength = (short)(block[i++] + block[i++] * 256); + Int16 extraFieldLength = (short)(block[i++] + block[i++] * 256); + + block = new byte[filenameLength]; + n = ze.ArchiveStream.Read(block, 0, block.Length); + bytesRead += n; + + // if the UTF8 bit is set for this entry, override the + // encoding the application requested. + + if ((ze._BitField & 0x0800) == 0x0800) + { + // workitem 12744 + ze.AlternateEncoding = System.Text.Encoding.UTF8; + ze.AlternateEncodingUsage = ZipOption.Always; + } + + // need to use this form of GetString() for .NET CF + ze._FileNameInArchive = ze.AlternateEncoding.GetString(block, 0, block.Length); + + // workitem 6898 + if (ze._FileNameInArchive.EndsWith("/")) ze.MarkAsDirectory(); + + bytesRead += ze.ProcessExtraField(ze.ArchiveStream, extraFieldLength); + + ze._LengthOfTrailer = 0; + + // workitem 6607 - don't read for directories + // actually get the compressed size and CRC if necessary + if (!ze._FileNameInArchive.EndsWith("/") && (ze._BitField & 0x0008) == 0x0008) + { + // This descriptor exists only if bit 3 of the general + // purpose bit flag is set (see below). It is byte aligned + // and immediately follows the last byte of compressed data, + // as well as any encryption trailer, as with AES. + // This descriptor is used only when it was not possible to + // seek in the output .ZIP file, e.g., when the output .ZIP file + // was standard output or a non-seekable device. For ZIP64(tm) format + // archives, the compressed and uncompressed sizes are 8 bytes each. + + // workitem 8098: ok (restore) + long posn = ze.ArchiveStream.Position; + + // Here, we're going to loop until we find a ZipEntryDataDescriptorSignature and + // a consistent data record after that. To be consistent, the data record must + // indicate the length of the entry data. + bool wantMore = true; + long SizeOfDataRead = 0; + int tries = 0; + while (wantMore) + { + tries++; + // We call the FindSignature shared routine to find the specified signature + // in the already-opened zip archive, starting from the current cursor + // position in that filestream. If we cannot find the signature, then the + // routine returns -1, and the ReadHeader() method returns false, + // indicating we cannot read a legal entry header. If we have found it, + // then the FindSignature() method returns the number of bytes in the + // stream we had to seek forward, to find the sig. We need this to + // determine if the zip entry is valid, later. + + if (ze._container.ZipFile != null) + ze._container.ZipFile.OnReadBytes(ze); + + long d = Ionic.Zip.SharedUtilities.FindSignature(ze.ArchiveStream, ZipConstants.ZipEntryDataDescriptorSignature); + if (d == -1) return false; + + // total size of data read (through all loops of this). + SizeOfDataRead += d; + + if (ze._InputUsesZip64) + { + // read 1x 4-byte (CRC) and 2x 8-bytes (Compressed Size, Uncompressed Size) + block = new byte[20]; + n = ze.ArchiveStream.Read(block, 0, block.Length); + if (n != 20) return false; + + // do not increment bytesRead - it is for entry header only. + // the data we have just read is a footer (falls after the file data) + //bytesRead += n; + + i = 0; + ze._Crc32 = (Int32)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + ze._CompressedSize = BitConverter.ToInt64(block, i); + i += 8; + ze._UncompressedSize = BitConverter.ToInt64(block, i); + i += 8; + + ze._LengthOfTrailer += 24; // bytes including sig, CRC, Comp and Uncomp sizes + } + else + { + // read 3x 4-byte fields (CRC, Compressed Size, Uncompressed Size) + block = new byte[12]; + n = ze.ArchiveStream.Read(block, 0, block.Length); + if (n != 12) return false; + + // do not increment bytesRead - it is for entry header only. + // the data we have just read is a footer (falls after the file data) + //bytesRead += n; + + i = 0; + ze._Crc32 = (Int32)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + ze._CompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + ze._UncompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); + + ze._LengthOfTrailer += 16; // bytes including sig, CRC, Comp and Uncomp sizes + + } + + wantMore = (SizeOfDataRead != ze._CompressedSize); + + if (wantMore) + { + // Seek back to un-read the last 12 bytes - maybe THEY contain + // the ZipEntryDataDescriptorSignature. + // (12 bytes for the CRC, Comp and Uncomp size.) + ze.ArchiveStream.Seek(-12, SeekOrigin.Current); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(ze.ArchiveStream); + + // Adjust the size to account for the false signature read in + // FindSignature(). + SizeOfDataRead += 4; + } + } + + // seek back to previous position, to prepare to read file data + // workitem 8098: ok (restore) + ze.ArchiveStream.Seek(posn, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(ze.ArchiveStream); + } + + ze._CompressedFileDataSize = ze._CompressedSize; + + + // bit 0 set indicates that some kind of encryption is in use + if ((ze._BitField & 0x01) == 0x01) + { +#if AESCRYPTO + if (ze.Encryption == EncryptionAlgorithm.WinZipAes128 || + ze.Encryption == EncryptionAlgorithm.WinZipAes256) + { + int bits = ZipEntry.GetKeyStrengthInBits(ze._Encryption_FromZipFile); + // read in the WinZip AES metadata: salt + PV. 18 bytes for AES256. 10 bytes for AES128. + ze._aesCrypto_forExtract = WinZipAesCrypto.ReadFromStream(null, bits, ze.ArchiveStream); + bytesRead += ze._aesCrypto_forExtract.SizeOfEncryptionMetadata - 10; // MAC (follows crypto bytes) + // according to WinZip, the CompressedSize includes the AES Crypto framing data. + ze._CompressedFileDataSize -= ze._aesCrypto_forExtract.SizeOfEncryptionMetadata; + ze._LengthOfTrailer += 10; // MAC + } + else +#endif + { + // read in the header data for "weak" encryption + ze._WeakEncryptionHeader = new byte[12]; + bytesRead += ZipEntry.ReadWeakEncryptionHeader(ze._archiveStream, ze._WeakEncryptionHeader); + // decrease the filedata size by 12 bytes + ze._CompressedFileDataSize -= 12; + } + } + + // Remember the size of the blob for this entry. + // We also have the starting position in the stream for this entry. + ze._LengthOfHeader = bytesRead; + ze._TotalEntrySize = ze._LengthOfHeader + ze._CompressedFileDataSize + ze._LengthOfTrailer; + + + // We've read in the regular entry header, the extra field, and any + // encryption header. The pointer in the file is now at the start of the + // filedata, which is potentially compressed and encrypted. Just ahead in + // the file, there are _CompressedFileDataSize bytes of data, followed by + // potentially a non-zero length trailer, consisting of optionally, some + // encryption stuff (10 byte MAC for AES), and the bit-3 trailer (16 or 24 + // bytes). + + return true; + } + + + + internal static int ReadWeakEncryptionHeader(Stream s, byte[] buffer) + { + // PKZIP encrypts the compressed data stream. Encrypted files must + // be decrypted before they can be extracted. + + // Each PKZIP-encrypted file has an extra 12 bytes stored at the start of the data + // area defining the encryption header for that file. The encryption header is + // originally set to random values, and then itself encrypted, using three, 32-bit + // keys. The key values are initialized using the supplied encryption password. + // After each byte is encrypted, the keys are then updated using pseudo-random + // number generation techniques in combination with the same CRC-32 algorithm used + // in PKZIP and implemented in the CRC32.cs module in this project. + + // read the 12-byte encryption header + int additionalBytesRead = s.Read(buffer, 0, 12); + if (additionalBytesRead != 12) + throw new ZipException(String.Format("Unexpected end of data at position 0x{0:X8}", s.Position)); + + return additionalBytesRead; + } + + + + private static bool IsNotValidSig(int signature) + { + return (signature != ZipConstants.ZipEntrySignature); + } + + + /// + /// Reads one ZipEntry from the given stream. The content for + /// the entry does not get decompressed or decrypted. This method + /// basically reads metadata, and seeks. + /// + /// the ZipContainer this entry belongs to. + /// + /// true of this is the first entry being read from the stream. + /// + /// the ZipEntry read from the stream. + internal static ZipEntry ReadEntry(ZipContainer zc, bool first) + { + ZipFile zf = zc.ZipFile; + Stream s = zc.ReadStream; + System.Text.Encoding defaultEncoding = zc.AlternateEncoding; + ZipEntry entry = new ZipEntry(); + entry._Source = ZipEntrySource.ZipFile; + entry._container = zc; + entry._archiveStream = s; + if (zf != null) + zf.OnReadEntry(true, null); + + if (first) HandlePK00Prefix(s); + + // Read entry header, including any encryption header + if (!ReadHeader(entry, defaultEncoding)) return null; + + // Store the position in the stream for this entry + // change for workitem 8098 + entry.__FileDataPosition = entry.ArchiveStream.Position; + + // seek past the data without reading it. We will read on Extract() + s.Seek(entry._CompressedFileDataSize + entry._LengthOfTrailer, SeekOrigin.Current); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + + // ReadHeader moves the file pointer to the end of the entry header, + // as well as any encryption header. + + // CompressedFileDataSize includes: + // the maybe compressed, maybe encrypted file data + // the encryption trailer, if any + // the bit 3 descriptor, if any + + // workitem 5306 + // http://www.codeplex.com/DotNetZip/WorkItem/View.aspx?WorkItemId=5306 + HandleUnexpectedDataDescriptor(entry); + + if (zf != null) + { + zf.OnReadBytes(entry); + zf.OnReadEntry(false, entry); + } + + return entry; + } + + + internal static void HandlePK00Prefix(Stream s) + { + // in some cases, the zip file begins with "PK00". This is a throwback and is rare, + // but we handle it anyway. We do not change behavior based on it. + uint datum = (uint)Ionic.Zip.SharedUtilities.ReadInt(s); + if (datum != ZipConstants.PackedToRemovableMedia) + { + s.Seek(-4, SeekOrigin.Current); // unread the block + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + } + } + + + + private static void HandleUnexpectedDataDescriptor(ZipEntry entry) + { + Stream s = entry.ArchiveStream; + + // In some cases, the "data descriptor" is present, without a signature, even when + // bit 3 of the BitField is NOT SET. This is the CRC, followed + // by the compressed length and the uncompressed length (4 bytes for each + // of those three elements). Need to check that here. + // + uint datum = (uint)Ionic.Zip.SharedUtilities.ReadInt(s); + if (datum == entry._Crc32) + { + int sz = Ionic.Zip.SharedUtilities.ReadInt(s); + if (sz == entry._CompressedSize) + { + sz = Ionic.Zip.SharedUtilities.ReadInt(s); + if (sz == entry._UncompressedSize) + { + // ignore everything and discard it. + } + else + { + s.Seek(-12, SeekOrigin.Current); // unread the three blocks + + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + } + } + else + { + s.Seek(-8, SeekOrigin.Current); // unread the two blocks + + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + } + } + else + { + s.Seek(-4, SeekOrigin.Current); // unread the block + + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + } + } + + + /// + /// Finds a particular segment in the given extra field. + /// This is used when modifying a previously-generated + /// extra field, in particular when removing the AES crypto + /// segment in the extra field. + /// + static internal int FindExtraFieldSegment(byte[] extra, int offx, UInt16 targetHeaderId) + { + int j = offx; + while (j + 3 < extra.Length) + { + UInt16 headerId = (UInt16)(extra[j++] + extra[j++] * 256); + if (headerId == targetHeaderId) return j-2; + + // else advance to next segment + Int16 dataSize = (short)(extra[j++] + extra[j++] * 256); + j+= dataSize; + } + + return -1; + } + + + /// + /// At current cursor position in the stream, read the extra + /// field, and set the properties on the ZipEntry instance + /// appropriately. This can be called when processing the + /// Extra field in the Central Directory, or in the local + /// header. + /// + internal int ProcessExtraField(Stream s, Int16 extraFieldLength) + { + int additionalBytesRead = 0; + if (extraFieldLength > 0) + { + byte[] buffer = this._Extra = new byte[extraFieldLength]; + additionalBytesRead = s.Read(buffer, 0, buffer.Length); + long posn = s.Position - additionalBytesRead; + int j = 0; + while (j + 3 < buffer.Length) + { + int start = j; + UInt16 headerId = (UInt16)(buffer[j++] + buffer[j++] * 256); + Int16 dataSize = (short)(buffer[j++] + buffer[j++] * 256); + + switch (headerId) + { + case 0x000a: // NTFS ctime, atime, mtime + j = ProcessExtraFieldWindowsTimes(buffer, j, dataSize, posn); + break; + + case 0x5455: // Unix ctime, atime, mtime + j = ProcessExtraFieldUnixTimes(buffer, j, dataSize, posn); + break; + + case 0x5855: // Info-zip Extra field (outdated) + // This is outdated, so the field is supported on + // read only. + j = ProcessExtraFieldInfoZipTimes(buffer, j, dataSize, posn); + break; + + case 0x7855: // Unix uid/gid + // ignored. DotNetZip does not handle this field. + break; + + case 0x7875: // ?? + // ignored. I could not find documentation on this field, + // though it appears in some zip files. + break; + + case 0x0001: // ZIP64 + j = ProcessExtraFieldZip64(buffer, j, dataSize, posn); + break; + +#if AESCRYPTO + case 0x9901: // WinZip AES encryption is in use. (workitem 6834) + // we will handle this extra field only if compressionmethod is 0x63 + j = ProcessExtraFieldWinZipAes(buffer, j, dataSize, posn); + break; +#endif + case 0x0017: // workitem 7968: handle PKWare Strong encryption header + j = ProcessExtraFieldPkwareStrongEncryption(buffer, j); + break; + } + + // move to the next Header in the extra field + j = start + dataSize + 4; + } + } + return additionalBytesRead; + } + + private int ProcessExtraFieldPkwareStrongEncryption(byte[] Buffer, int j) + { + // Value Size Description + // ----- ---- ----------- + // 0x0017 2 bytes Tag for this "extra" block type + // TSize 2 bytes Size of data that follows + // Format 2 bytes Format definition for this record + // AlgID 2 bytes Encryption algorithm identifier + // Bitlen 2 bytes Bit length of encryption key + // Flags 2 bytes Processing flags + // CertData TSize-8 Certificate decryption extra field data + // (refer to the explanation for CertData + // in the section describing the + // Certificate Processing Method under + // the Strong Encryption Specification) + + j += 2; + _UnsupportedAlgorithmId = (UInt16)(Buffer[j++] + Buffer[j++] * 256); + _Encryption_FromZipFile = _Encryption = EncryptionAlgorithm.Unsupported; + + // DotNetZip doesn't support this algorithm, but we don't need to throw + // here. we might just be reading the archive, which is fine. We'll + // need to throw if Extract() is called. + + return j; + } + + +#if AESCRYPTO + private int ProcessExtraFieldWinZipAes(byte[] buffer, int j, Int16 dataSize, long posn) + { + if (this._CompressionMethod == 0x0063) + { + if ((this._BitField & 0x01) != 0x01) + throw new BadReadException(String.Format(" Inconsistent metadata at position 0x{0:X16}", posn)); + + this._sourceIsEncrypted = true; + + //this._aesCrypto = new WinZipAesCrypto(this); + // see spec at http://www.winzip.com/aes_info.htm + if (dataSize != 7) + throw new BadReadException(String.Format(" Inconsistent size (0x{0:X4}) in WinZip AES field at position 0x{1:X16}", dataSize, posn)); + + this._WinZipAesMethod = BitConverter.ToInt16(buffer, j); + j += 2; + if (this._WinZipAesMethod != 0x01 && this._WinZipAesMethod != 0x02) + throw new BadReadException(String.Format(" Unexpected vendor version number (0x{0:X4}) for WinZip AES metadata at position 0x{1:X16}", + this._WinZipAesMethod, posn)); + + Int16 vendorId = BitConverter.ToInt16(buffer, j); + j += 2; + if (vendorId != 0x4541) + throw new BadReadException(String.Format(" Unexpected vendor ID (0x{0:X4}) for WinZip AES metadata at position 0x{1:X16}", vendorId, posn)); + + int keystrength = (buffer[j] == 1) ? 128 : (buffer[j] == 3) ? 256 : -1; + if (keystrength < 0) + throw new BadReadException(String.Format("Invalid key strength ({0})", keystrength)); + + _Encryption_FromZipFile = this._Encryption = (keystrength == 128) + ? EncryptionAlgorithm.WinZipAes128 + : EncryptionAlgorithm.WinZipAes256; + + j++; + + // set the actual compression method + this._CompressionMethod_FromZipFile = + this._CompressionMethod = BitConverter.ToInt16(buffer, j); + j += 2; // for the next segment of the extra field + } + return j; + } + +#endif + + private delegate T Func(); + + private int ProcessExtraFieldZip64(byte[] buffer, int j, Int16 dataSize, long posn) + { + // The PKWare spec says that any of {UncompressedSize, CompressedSize, + // RelativeOffset} exceeding 0xFFFFFFFF can lead to the ZIP64 header, + // and the ZIP64 header may contain one or more of those. If the + // values are present, they will be found in the prescribed order. + // There may also be a 4-byte "disk start number." + // This means that the DataSize must be 28 bytes or less. + + this._InputUsesZip64 = true; + + // workitem 7941: check datasize before reading. + if (dataSize > 28) + throw new BadReadException(String.Format(" Inconsistent size (0x{0:X4}) for ZIP64 extra field at position 0x{1:X16}", + dataSize, posn)); + int remainingData = dataSize; + + var slurp = new Func( () => { + if (remainingData < 8) + throw new BadReadException(String.Format(" Missing data for ZIP64 extra field, position 0x{0:X16}", posn)); + var x = BitConverter.ToInt64(buffer, j); + j+= 8; + remainingData -= 8; + return x; + }); + + if (this._UncompressedSize == 0xFFFFFFFF) + this._UncompressedSize = slurp(); + + if (this._CompressedSize == 0xFFFFFFFF) + this._CompressedSize = slurp(); + + if (this._RelativeOffsetOfLocalHeader == 0xFFFFFFFF) + this._RelativeOffsetOfLocalHeader = slurp(); + + // Ignore anything else. Potentially there are 4 more bytes for the + // disk start number. DotNetZip currently doesn't handle multi-disk + // archives. + return j; + } + + + private int ProcessExtraFieldInfoZipTimes(byte[] buffer, int j, Int16 dataSize, long posn) + { + if (dataSize != 12 && dataSize != 8) + throw new BadReadException(String.Format(" Unexpected size (0x{0:X4}) for InfoZip v1 extra field at position 0x{1:X16}", dataSize, posn)); + + Int32 timet = BitConverter.ToInt32(buffer, j); + this._Mtime = _unixEpoch.AddSeconds(timet); + j += 4; + + timet = BitConverter.ToInt32(buffer, j); + this._Atime = _unixEpoch.AddSeconds(timet); + j += 4; + + this._Ctime = DateTime.UtcNow; + + _ntfsTimesAreSet = true; + _timestamp |= ZipEntryTimestamp.InfoZip1; return j; + } + + + + private int ProcessExtraFieldUnixTimes(byte[] buffer, int j, Int16 dataSize, long posn) + { + // The Unix filetimes are 32-bit unsigned integers, + // storing seconds since Unix epoch. + + if (dataSize != 13 && dataSize != 9 && dataSize != 5) + throw new BadReadException(String.Format(" Unexpected size (0x{0:X4}) for Extended Timestamp extra field at position 0x{1:X16}", dataSize, posn)); + + int remainingData = dataSize; + + var slurp = new Func( () => { + Int32 timet = BitConverter.ToInt32(buffer, j); + j += 4; + remainingData -= 4; + return _unixEpoch.AddSeconds(timet); + }); + + if (dataSize == 13 || _readExtraDepth > 0) + { + byte flag = buffer[j++]; + remainingData--; + + if ((flag & 0x0001) != 0 && remainingData >= 4) + this._Mtime = slurp(); + + this._Atime = ((flag & 0x0002) != 0 && remainingData >= 4) + ? slurp() + : DateTime.UtcNow; + + this._Ctime = ((flag & 0x0004) != 0 && remainingData >= 4) + ? slurp() + :DateTime.UtcNow; + + _timestamp |= ZipEntryTimestamp.Unix; + _ntfsTimesAreSet = true; + _emitUnixTimes = true; + } + else + ReadExtraField(); // will recurse + + return j; + } + + + private int ProcessExtraFieldWindowsTimes(byte[] buffer, int j, Int16 dataSize, long posn) + { + // The NTFS filetimes are 64-bit unsigned integers, stored in Intel + // (least significant byte first) byte order. They are expressed as the + // number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", + // which is "01-Jan-1601 00:00:00 UTC". + // + // HeaderId 2 bytes 0x000a == NTFS stuff + // Datasize 2 bytes ?? (usually 32) + // reserved 4 bytes ?? + // timetag 2 bytes 0x0001 == time + // size 2 bytes 24 == 8 bytes each for ctime, mtime, atime + // mtime 8 bytes win32 ticks since win32epoch + // atime 8 bytes win32 ticks since win32epoch + // ctime 8 bytes win32 ticks since win32epoch + + if (dataSize != 32) + throw new BadReadException(String.Format(" Unexpected size (0x{0:X4}) for NTFS times extra field at position 0x{1:X16}", dataSize, posn)); + + j += 4; // reserved + Int16 timetag = (Int16)(buffer[j] + buffer[j + 1] * 256); + Int16 addlsize = (Int16)(buffer[j + 2] + buffer[j + 3] * 256); + j += 4; // tag and size + + if (timetag == 0x0001 && addlsize == 24) + { + Int64 z = BitConverter.ToInt64(buffer, j); + this._Mtime = DateTime.FromFileTimeUtc(z); + j += 8; + + // At this point the library *could* set the LastModified value + // to coincide with the Mtime value. In theory, they refer to + // the same property of the file, and should be the same anyway, + // allowing for differences in precision. But they are + // independent quantities in the zip archive, and this library + // will keep them separate in the object model. There is no ill + // effect from this, because as files are extracted, the + // higher-precision value (Mtime) is used if it is present. + // Apps may wish to compare the Mtime versus LastModified + // values, but any difference when both are present is not + // germaine to the correctness of the library. but note: when + // explicitly setting either value, both are set. See the setter + // for LastModified or the SetNtfsTimes() method. + + z = BitConverter.ToInt64(buffer, j); + this._Atime = DateTime.FromFileTimeUtc(z); + j += 8; + + z = BitConverter.ToInt64(buffer, j); + this._Ctime = DateTime.FromFileTimeUtc(z); + j += 8; + + _ntfsTimesAreSet = true; + _timestamp |= ZipEntryTimestamp.Windows; + _emitNtfsTimes = true; + } + return j; + } + + + } +} diff --git a/dotNetZip/Zip/ZipEntry.Write.cs b/dotNetZip/Zip/ZipEntry.Write.cs new file mode 100644 index 0000000..b4e87f6 --- /dev/null +++ b/dotNetZip/Zip/ZipEntry.Write.cs @@ -0,0 +1,2582 @@ +//#define Trace + +// ZipEntry.Write.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-July-30 14:55:47> +// +// ------------------------------------------------------------------ +// +// This module defines logic for writing (saving) the ZipEntry into a +// zip file. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; +using RE = System.Text.RegularExpressions; + +namespace Ionic.Zip +{ + public partial class ZipEntry + { + internal void WriteCentralDirectoryEntry(Stream s) + { + byte[] bytes = new byte[4096]; + int i = 0; + // signature + bytes[i++] = (byte)(ZipConstants.ZipDirEntrySignature & 0x000000FF); + bytes[i++] = (byte)((ZipConstants.ZipDirEntrySignature & 0x0000FF00) >> 8); + bytes[i++] = (byte)((ZipConstants.ZipDirEntrySignature & 0x00FF0000) >> 16); + bytes[i++] = (byte)((ZipConstants.ZipDirEntrySignature & 0xFF000000) >> 24); + + // Version Made By + // workitem 7071 + // We must not overwrite the VersionMadeBy field when writing out a zip + // archive. The VersionMadeBy tells the zip reader the meaning of the + // File attributes. Overwriting the VersionMadeBy will result in + // inconsistent metadata. Consider the scenario where the application + // opens and reads a zip file that had been created on Linux. Then the + // app adds one file to the Zip archive, and saves it. The file + // attributes for all the entries added on Linux will be significant for + // Linux. Therefore the VersionMadeBy for those entries must not be + // changed. Only the entries that are actually created on Windows NTFS + // should get the VersionMadeBy indicating Windows/NTFS. + bytes[i++] = (byte)(_VersionMadeBy & 0x00FF); + bytes[i++] = (byte)((_VersionMadeBy & 0xFF00) >> 8); + + // Apparently we want to duplicate the extra field here; we cannot + // simply zero it out and assume tools and apps will use the right one. + + ////Int16 extraFieldLengthSave = (short)(_EntryHeader[28] + _EntryHeader[29] * 256); + ////_EntryHeader[28] = 0; + ////_EntryHeader[29] = 0; + + // Version Needed, Bitfield, compression method, lastmod, + // crc, compressed and uncompressed sizes, filename length and extra field length. + // These are all present in the local file header, but they may be zero values there. + // So we cannot just copy them. + + // workitem 11969: Version Needed To Extract in central directory must be + // the same as the local entry or MS .NET System.IO.Zip fails read. + Int16 vNeeded = (Int16)(VersionNeeded != 0 ? VersionNeeded : 20); + // workitem 12964 + if (_OutputUsesZip64==null) + { + // a zipentry in a zipoutputstream, with zero bytes written + _OutputUsesZip64 = new Nullable(_container.Zip64 == Zip64Option.Always); + } + + Int16 versionNeededToExtract = (Int16)(_OutputUsesZip64.Value ? 45 : vNeeded); +#if BZIP + if (this.CompressionMethod == Ionic.Zip.CompressionMethod.BZip2) + versionNeededToExtract = 46; +#endif + + bytes[i++] = (byte)(versionNeededToExtract & 0x00FF); + bytes[i++] = (byte)((versionNeededToExtract & 0xFF00) >> 8); + + bytes[i++] = (byte)(_BitField & 0x00FF); + bytes[i++] = (byte)((_BitField & 0xFF00) >> 8); + + bytes[i++] = (byte)(_CompressionMethod & 0x00FF); + bytes[i++] = (byte)((_CompressionMethod & 0xFF00) >> 8); + +#if AESCRYPTO + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + i -= 2; + bytes[i++] = 0x63; + bytes[i++] = 0; + } +#endif + + bytes[i++] = (byte)(_TimeBlob & 0x000000FF); + bytes[i++] = (byte)((_TimeBlob & 0x0000FF00) >> 8); + bytes[i++] = (byte)((_TimeBlob & 0x00FF0000) >> 16); + bytes[i++] = (byte)((_TimeBlob & 0xFF000000) >> 24); + bytes[i++] = (byte)(_Crc32 & 0x000000FF); + bytes[i++] = (byte)((_Crc32 & 0x0000FF00) >> 8); + bytes[i++] = (byte)((_Crc32 & 0x00FF0000) >> 16); + bytes[i++] = (byte)((_Crc32 & 0xFF000000) >> 24); + + int j = 0; + if (_OutputUsesZip64.Value) + { + // CompressedSize (Int32) and UncompressedSize - all 0xFF + for (j = 0; j < 8; j++) + bytes[i++] = 0xFF; + } + else + { + bytes[i++] = (byte)(_CompressedSize & 0x000000FF); + bytes[i++] = (byte)((_CompressedSize & 0x0000FF00) >> 8); + bytes[i++] = (byte)((_CompressedSize & 0x00FF0000) >> 16); + bytes[i++] = (byte)((_CompressedSize & 0xFF000000) >> 24); + + bytes[i++] = (byte)(_UncompressedSize & 0x000000FF); + bytes[i++] = (byte)((_UncompressedSize & 0x0000FF00) >> 8); + bytes[i++] = (byte)((_UncompressedSize & 0x00FF0000) >> 16); + bytes[i++] = (byte)((_UncompressedSize & 0xFF000000) >> 24); + } + + byte[] fileNameBytes = GetEncodedFileNameBytes(); + Int16 filenameLength = (Int16)fileNameBytes.Length; + bytes[i++] = (byte)(filenameLength & 0x00FF); + bytes[i++] = (byte)((filenameLength & 0xFF00) >> 8); + + // do this again because now we have real data + _presumeZip64 = _OutputUsesZip64.Value; + + // workitem 11131 + // + // cannot generate the extra field again, here's why: In the case of a + // zero-byte entry, which uses encryption, DotNetZip will "remove" the + // encryption from the entry. It does this in PostProcessOutput; it + // modifies the entry header, and rewrites it, resetting the Bitfield + // (one bit indicates encryption), and potentially resetting the + // compression method - for AES the Compression method is 0x63, and it + // would get reset to zero (no compression). It then calls SetLength() + // to truncate the stream to remove the encryption header (12 bytes for + // AES256). But, it leaves the previously-generated "Extra Field" + // metadata (11 bytes) for AES in the entry header. This extra field + // data is now "orphaned" - it refers to AES encryption when in fact no + // AES encryption is used. But no problem, the PKWARE spec says that + // unrecognized extra fields can just be ignored. ok. After "removal" + // of AES encryption, the length of the Extra Field can remains the + // same; it's just that there will be 11 bytes in there that previously + // pertained to AES which are now unused. Even the field code is still + // there, but it will be unused by readers, as the encryption bit is not + // set. + // + // Re-calculating the Extra field now would produce a block that is 11 + // bytes shorter, and that mismatch - between the extra field in the + // local header and the extra field in the Central Directory - would + // cause problems. (where? why? what problems?) So we can't do + // that. It's all good though, because though the content may have + // changed, the length definitely has not. Also, the _EntryHeader + // contains the "updated" extra field (after PostProcessOutput) at + // offset (30 + filenameLength). + + _Extra = ConstructExtraField(true); + + Int16 extraFieldLength = (Int16)((_Extra == null) ? 0 : _Extra.Length); + bytes[i++] = (byte)(extraFieldLength & 0x00FF); + bytes[i++] = (byte)((extraFieldLength & 0xFF00) >> 8); + + // File (entry) Comment Length + // the _CommentBytes private field was set during WriteHeader() + int commentLength = (_CommentBytes == null) ? 0 : _CommentBytes.Length; + + // the size of our buffer defines the max length of the comment we can write + if (commentLength + i > bytes.Length) commentLength = bytes.Length - i; + bytes[i++] = (byte)(commentLength & 0x00FF); + bytes[i++] = (byte)((commentLength & 0xFF00) >> 8); + + // Disk number start + bool segmented = (this._container.ZipFile != null) && + (this._container.ZipFile.MaxOutputSegmentSize != 0); + if (segmented) // workitem 13915 + { + // Emit nonzero disknumber only if saving segmented archive. + bytes[i++] = (byte)(_diskNumber & 0x00FF); + bytes[i++] = (byte)((_diskNumber & 0xFF00) >> 8); + } + else + { + // If reading a segmneted archive and saving to a regular archive, + // ZipEntry._diskNumber will be non-zero but it should be saved as + // zero. + bytes[i++] = 0; + bytes[i++] = 0; + } + + // internal file attrs + // workitem 7801 + bytes[i++] = (byte)((_IsText) ? 1 : 0); // lo bit: filetype hint. 0=bin, 1=txt. + bytes[i++] = 0; + + // external file attrs + // workitem 7071 + bytes[i++] = (byte)(_ExternalFileAttrs & 0x000000FF); + bytes[i++] = (byte)((_ExternalFileAttrs & 0x0000FF00) >> 8); + bytes[i++] = (byte)((_ExternalFileAttrs & 0x00FF0000) >> 16); + bytes[i++] = (byte)((_ExternalFileAttrs & 0xFF000000) >> 24); + + // workitem 11131 + // relative offset of local header. + // + // If necessary to go to 64-bit value, then emit 0xFFFFFFFF, + // else write out the value. + // + // Even if zip64 is required for other reasons - number of the entry + // > 65534, or uncompressed size of the entry > MAX_INT32, the ROLH + // need not be stored in a 64-bit field . + if (_RelativeOffsetOfLocalHeader > 0xFFFFFFFFL) // _OutputUsesZip64.Value + { + bytes[i++] = 0xFF; + bytes[i++] = 0xFF; + bytes[i++] = 0xFF; + bytes[i++] = 0xFF; + } + else + { + bytes[i++] = (byte)(_RelativeOffsetOfLocalHeader & 0x000000FF); + bytes[i++] = (byte)((_RelativeOffsetOfLocalHeader & 0x0000FF00) >> 8); + bytes[i++] = (byte)((_RelativeOffsetOfLocalHeader & 0x00FF0000) >> 16); + bytes[i++] = (byte)((_RelativeOffsetOfLocalHeader & 0xFF000000) >> 24); + } + + // actual filename + Buffer.BlockCopy(fileNameBytes, 0, bytes, i, filenameLength); + i += filenameLength; + + // "Extra field" + if (_Extra != null) + { + // workitem 11131 + // + // copy from EntryHeader if available - it may have been updated. + // if not, copy from Extra. This would be unnecessary if I just + // updated the Extra field when updating EntryHeader, in + // PostProcessOutput. + + //?? I don't understand why I wouldn't want to just use + // the recalculated Extra field. ?? + + // byte[] h = _EntryHeader ?? _Extra; + // int offx = (h == _EntryHeader) ? 30 + filenameLength : 0; + // Buffer.BlockCopy(h, offx, bytes, i, extraFieldLength); + // i += extraFieldLength; + + byte[] h = _Extra; + int offx = 0; + Buffer.BlockCopy(h, offx, bytes, i, extraFieldLength); + i += extraFieldLength; + } + + // file (entry) comment + if (commentLength != 0) + { + // now actually write the comment itself into the byte buffer + Buffer.BlockCopy(_CommentBytes, 0, bytes, i, commentLength); + // for (j = 0; (j < commentLength) && (i + j < bytes.Length); j++) + // bytes[i + j] = _CommentBytes[j]; + i += commentLength; + } + + s.Write(bytes, 0, i); + } + + +#if INFOZIP_UTF8 + static private bool FileNameIsUtf8(char[] FileNameChars) + { + bool isUTF8 = false; + bool isUnicode = false; + for (int j = 0; j < FileNameChars.Length; j++) + { + byte[] b = System.BitConverter.GetBytes(FileNameChars[j]); + isUnicode |= (b.Length != 2); + isUnicode |= (b[1] != 0); + isUTF8 |= ((b[0] & 0x80) != 0); + } + + return isUTF8; + } +#endif + + + private byte[] ConstructExtraField(bool forCentralDirectory) + { + var listOfBlocks = new System.Collections.Generic.List(); + byte[] block; + + // Conditionally emit an extra field with Zip64 information. If the + // Zip64 option is Always, we emit the field, before knowing that it's + // necessary. Later, if it turns out this entry does not need zip64, + // we'll set the header ID to rubbish and the data will be ignored. + // This results in additional overhead metadata in the zip file, but + // it will be small in comparison to the entry data. + // + // On the other hand if the Zip64 option is AsNecessary and it's NOT + // for the central directory, then we do the same thing. Or, if the + // Zip64 option is AsNecessary and it IS for the central directory, + // and the entry requires zip64, then emit the header. + if (_container.Zip64 == Zip64Option.Always || + (_container.Zip64 == Zip64Option.AsNecessary && + (!forCentralDirectory || _entryRequiresZip64.Value))) + { + // add extra field for zip64 here + // workitem 7924 + int sz = 4 + (forCentralDirectory ? 28 : 16); + block = new byte[sz]; + int i = 0; + + if (_presumeZip64 || forCentralDirectory) + { + // HeaderId = always use zip64 extensions. + block[i++] = 0x01; + block[i++] = 0x00; + } + else + { + // HeaderId = dummy data now, maybe set to 0x0001 (ZIP64) later. + block[i++] = 0x99; + block[i++] = 0x99; + } + + // DataSize + block[i++] = (byte)(sz - 4); // decimal 28 or 16 (workitem 7924) + block[i++] = 0x00; + + // The actual metadata - we may or may not have real values yet... + + // uncompressed size + Array.Copy(BitConverter.GetBytes(_UncompressedSize), 0, block, i, 8); + i += 8; + // compressed size + Array.Copy(BitConverter.GetBytes(_CompressedSize), 0, block, i, 8); + i += 8; + + // workitem 7924 - only include this if the "extra" field is for + // use in the central directory. It is unnecessary and not useful + // for local header; makes WinZip choke. + if (forCentralDirectory) + { + // relative offset + Array.Copy(BitConverter.GetBytes(_RelativeOffsetOfLocalHeader), 0, block, i, 8); + i += 8; + + // starting disk number + Array.Copy(BitConverter.GetBytes(0), 0, block, i, 4); + } + listOfBlocks.Add(block); + } + + +#if AESCRYPTO + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + block = new byte[4 + 7]; + int i = 0; + // extra field for WinZip AES + // header id + block[i++] = 0x01; + block[i++] = 0x99; + + // data size + block[i++] = 0x07; + block[i++] = 0x00; + + // vendor number + block[i++] = 0x01; // AE-1 - means "Verify CRC" + block[i++] = 0x00; + + // vendor id "AE" + block[i++] = 0x41; + block[i++] = 0x45; + + // key strength + int keystrength = GetKeyStrengthInBits(Encryption); + if (keystrength == 128) + block[i] = 1; + else if (keystrength == 256) + block[i] = 3; + else + block[i] = 0xFF; + i++; + + // actual compression method + block[i++] = (byte)(_CompressionMethod & 0x00FF); + block[i++] = (byte)(_CompressionMethod & 0xFF00); + + listOfBlocks.Add(block); + } +#endif + + if (_ntfsTimesAreSet && _emitNtfsTimes) + { + block = new byte[32 + 4]; + // HeaderId 2 bytes 0x000a == NTFS times + // Datasize 2 bytes 32 + // reserved 4 bytes ?? don't care + // timetag 2 bytes 0x0001 == NTFS time + // size 2 bytes 24 == 8 bytes each for ctime, mtime, atime + // mtime 8 bytes win32 ticks since win32epoch + // atime 8 bytes win32 ticks since win32epoch + // ctime 8 bytes win32 ticks since win32epoch + int i = 0; + // extra field for NTFS times + // header id + block[i++] = 0x0a; + block[i++] = 0x00; + + // data size + block[i++] = 32; + block[i++] = 0; + + i += 4; // reserved + + // time tag + block[i++] = 0x01; + block[i++] = 0x00; + + // data size (again) + block[i++] = 24; + block[i++] = 0; + + Int64 z = _Mtime.ToFileTime(); + Array.Copy(BitConverter.GetBytes(z), 0, block, i, 8); + i += 8; + z = _Atime.ToFileTime(); + Array.Copy(BitConverter.GetBytes(z), 0, block, i, 8); + i += 8; + z = _Ctime.ToFileTime(); + Array.Copy(BitConverter.GetBytes(z), 0, block, i, 8); + i += 8; + + listOfBlocks.Add(block); + } + + if (_ntfsTimesAreSet && _emitUnixTimes) + { + int len = 5 + 4; + if (!forCentralDirectory) len += 8; + + block = new byte[len]; + // local form: + // -------------- + // HeaderId 2 bytes 0x5455 == unix timestamp + // Datasize 2 bytes 13 + // flags 1 byte 7 (low three bits all set) + // mtime 4 bytes seconds since unix epoch + // atime 4 bytes seconds since unix epoch + // ctime 4 bytes seconds since unix epoch + // + // central directory form: + //--------------------------------- + // HeaderId 2 bytes 0x5455 == unix timestamp + // Datasize 2 bytes 5 + // flags 1 byte 7 (low three bits all set) + // mtime 4 bytes seconds since unix epoch + // + int i = 0; + // extra field for "unix" times + // header id + block[i++] = 0x55; + block[i++] = 0x54; + + // data size + block[i++] = unchecked((byte)(len - 4)); + block[i++] = 0; + + // flags + block[i++] = 0x07; + + Int32 z = unchecked((int)((_Mtime - _unixEpoch).TotalSeconds)); + Array.Copy(BitConverter.GetBytes(z), 0, block, i, 4); + i += 4; + if (!forCentralDirectory) + { + z = unchecked((int)((_Atime - _unixEpoch).TotalSeconds)); + Array.Copy(BitConverter.GetBytes(z), 0, block, i, 4); + i += 4; + z = unchecked((int)((_Ctime - _unixEpoch).TotalSeconds)); + Array.Copy(BitConverter.GetBytes(z), 0, block, i, 4); + i += 4; + } + listOfBlocks.Add(block); + } + + + // inject other blocks here... + + + // concatenate any blocks we've got: + byte[] aggregateBlock = null; + if (listOfBlocks.Count > 0) + { + int totalLength = 0; + int i, current = 0; + for (i = 0; i < listOfBlocks.Count; i++) + totalLength += listOfBlocks[i].Length; + aggregateBlock = new byte[totalLength]; + for (i = 0; i < listOfBlocks.Count; i++) + { + System.Array.Copy(listOfBlocks[i], 0, aggregateBlock, current, listOfBlocks[i].Length); + current += listOfBlocks[i].Length; + } + } + + return aggregateBlock; + } + + + + // private System.Text.Encoding GenerateCommentBytes() + // { + // var getEncoding = new Func({ + // switch (AlternateEncodingUsage) + // { + // case ZipOption.Always: + // return AlternateEncoding; + // case ZipOption.Never: + // return ibm437; + // } + // var cb = ibm437.GetBytes(_Comment); + // // need to use this form of GetString() for .NET CF + // string s1 = ibm437.GetString(cb, 0, cb.Length); + // if (s1 == _Comment) + // return ibm437; + // return AlternateEncoding; + // }); + // + // var encoding = getEncoding(); + // _CommentBytes = encoding.GetBytes(_Comment); + // return encoding; + // } + + + private string NormalizeFileName() + { + // here, we need to flip the backslashes to forward-slashes, + // also, we need to trim the \\server\share syntax from any UNC path. + // and finally, we need to remove any leading .\ + + string SlashFixed = FileName.Replace("\\", "/"); + string s1 = null; + if ((_TrimVolumeFromFullyQualifiedPaths) && (FileName.Length >= 3) + && (FileName[1] == ':') && (SlashFixed[2] == '/')) + { + // trim off volume letter, colon, and slash + s1 = SlashFixed.Substring(3); + } + else if ((FileName.Length >= 4) + && ((SlashFixed[0] == '/') && (SlashFixed[1] == '/'))) + { + int n = SlashFixed.IndexOf('/', 2); + if (n == -1) + throw new ArgumentException("The path for that entry appears to be badly formatted"); + s1 = SlashFixed.Substring(n + 1); + } + else if ((FileName.Length >= 3) + && ((SlashFixed[0] == '.') && (SlashFixed[1] == '/'))) + { + // trim off dot and slash + s1 = SlashFixed.Substring(2); + } + else + { + s1 = SlashFixed; + } + return s1; + } + + + /// + /// generate and return a byte array that encodes the filename + /// for the entry. + /// + /// + /// + /// side effects: generate and store into _CommentBytes the + /// byte array for any comment attached to the entry. Also + /// sets _actualEncoding to indicate the actual encoding + /// used. The same encoding is used for both filename and + /// comment. + /// + /// + private byte[] GetEncodedFileNameBytes() + { + // workitem 6513 + var s1 = NormalizeFileName(); + + switch(AlternateEncodingUsage) + { + case ZipOption.Always: + if (!(_Comment == null || _Comment.Length == 0)) + _CommentBytes = AlternateEncoding.GetBytes(_Comment); + _actualEncoding = AlternateEncoding; + return AlternateEncoding.GetBytes(s1); + + case ZipOption.Never: + if (!(_Comment == null || _Comment.Length == 0)) + _CommentBytes = ibm437.GetBytes(_Comment); + _actualEncoding = ibm437; + return ibm437.GetBytes(s1); + } + + // arriving here means AlternateEncodingUsage is "AsNecessary" + + // case ZipOption.AsNecessary: + // workitem 6513: when writing, use the alternative encoding + // only when _actualEncoding is not yet set (it can be set + // during Read), and when ibm437 will not do. + + byte[] result = ibm437.GetBytes(s1); + // need to use this form of GetString() for .NET CF + string s2 = ibm437.GetString(result, 0, result.Length); + _CommentBytes = null; + if (s2 != s1) + { + // Encoding the filename with ibm437 does not allow round-trips. + // Therefore, use the alternate encoding. Assume it will work, + // no checking of round trips here. + result = AlternateEncoding.GetBytes(s1); + if (_Comment != null && _Comment.Length != 0) + _CommentBytes = AlternateEncoding.GetBytes(_Comment); + _actualEncoding = AlternateEncoding; + return result; + } + + _actualEncoding = ibm437; + + // Using ibm437, FileName can be encoded without information + // loss; now try the Comment. + + // if there is no comment, use ibm437. + if (_Comment == null || _Comment.Length == 0) + return result; + + // there is a comment. Get the encoded form. + byte[] cbytes = ibm437.GetBytes(_Comment); + string c2 = ibm437.GetString(cbytes,0,cbytes.Length); + + // Check for round-trip. + if (c2 != Comment) + { + // Comment cannot correctly be encoded with ibm437. Use + // the alternate encoding. + + result = AlternateEncoding.GetBytes(s1); + _CommentBytes = AlternateEncoding.GetBytes(_Comment); + _actualEncoding = AlternateEncoding; + return result; + } + + // use IBM437 + _CommentBytes = cbytes; + return result; + } + + + + private bool WantReadAgain() + { + if (_UncompressedSize < 0x10) return false; + if (_CompressionMethod == 0x00) return false; + if (CompressionLevel == Ionic.Zlib.CompressionLevel.None) return false; + if (_CompressedSize < _UncompressedSize) return false; + + if (this._Source == ZipEntrySource.Stream && !this._sourceStream.CanSeek) return false; + +#if AESCRYPTO + if (_aesCrypto_forWrite != null && (CompressedSize - _aesCrypto_forWrite.SizeOfEncryptionMetadata) <= UncompressedSize + 0x10) return false; +#endif + + if (_zipCrypto_forWrite != null && (CompressedSize - 12) <= UncompressedSize) return false; + + return true; + } + + + + private void MaybeUnsetCompressionMethodForWriting(int cycle) + { + // if we've already tried with compression... turn it off this time + if (cycle > 1) + { + _CompressionMethod = 0x0; + return; + } + // compression for directories = 0x00 (No Compression) + if (IsDirectory) + { + _CompressionMethod = 0x0; + return; + } + + if (this._Source == ZipEntrySource.ZipFile) + { + return; // do nothing + } + + // If __FileDataPosition is zero, then that means we will get the data + // from a file or stream. + + // It is never possible to compress a zero-length file, so we check for + // this condition. + + if (this._Source == ZipEntrySource.Stream) + { + // workitem 7742 + if (_sourceStream != null && _sourceStream.CanSeek) + { + // Length prop will throw if CanSeek is false + long fileLength = _sourceStream.Length; + if (fileLength == 0) + { + _CompressionMethod = 0x00; + return; + } + } + } + else if ((this._Source == ZipEntrySource.FileSystem) && (SharedUtilities.GetFileLength(LocalFileName) == 0L)) + { + _CompressionMethod = 0x00; + return; + } + + // Ok, we're getting the data to be compressed from a + // non-zero-length file or stream, or a file or stream of + // unknown length, and we presume that it is non-zero. In + // that case we check the callback to see if the app wants + // to tell us whether to compress or not. + if (SetCompression != null) + CompressionLevel = SetCompression(LocalFileName, _FileNameInArchive); + + // finally, set CompressionMethod to None if CompressionLevel is None + if (CompressionLevel == (short)Ionic.Zlib.CompressionLevel.None && + CompressionMethod == Ionic.Zip.CompressionMethod.Deflate) + _CompressionMethod = 0x00; + + return; + } + + + + // write the header info for an entry + internal void WriteHeader(Stream s, int cycle) + { + // Must remember the offset, within the output stream, of this particular + // entry header. + // + // This is for 2 reasons: + // + // 1. so we can determine the RelativeOffsetOfLocalHeader (ROLH) for + // use in the central directory. + // 2. so we can seek backward in case there is an error opening or reading + // the file, and the application decides to skip the file. In this case, + // we need to seek backward in the output stream to allow the next entry + // to be added to the zipfile output stream. + // + // Normally you would just store the offset before writing to the output + // stream and be done with it. But the possibility to use split archives + // makes this approach ineffective. In split archives, each file or segment + // is bound to a max size limit, and each local file header must not span a + // segment boundary; it must be written contiguously. If it will fit in the + // current segment, then the ROLH is just the current Position in the output + // stream. If it won't fit, then we need a new file (segment) and the ROLH + // is zero. + // + // But we only can know if it is possible to write a header contiguously + // after we know the size of the local header, a size that varies with + // things like filename length, comments, and extra fields. We have to + // compute the header fully before knowing whether it will fit. + // + // That takes care of item #1 above. Now, regarding #2. If an error occurs + // while computing the local header, we want to just seek backward. The + // exception handling logic (in the caller of WriteHeader) uses ROLH to + // scroll back. + // + // All this means we have to preserve the starting offset before computing + // the header, and also we have to compute the offset later, to handle the + // case of split archives. + + var counter = s as CountingStream; + + // workitem 8098: ok (output) + // This may change later, for split archives + + // Don't set _RelativeOffsetOfLocalHeader. Instead, set a temp variable. + // This allows for re-streaming, where a zip entry might be read from a + // zip archive (and maybe decrypted, and maybe decompressed) and then + // written to another zip archive, with different settings for + // compression method, compression level, or encryption algorithm. + _future_ROLH = (counter != null) + ? counter.ComputedPosition + : s.Position; + + int j = 0, i = 0; + + byte[] block = new byte[30]; + + // signature + block[i++] = (byte)(ZipConstants.ZipEntrySignature & 0x000000FF); + block[i++] = (byte)((ZipConstants.ZipEntrySignature & 0x0000FF00) >> 8); + block[i++] = (byte)((ZipConstants.ZipEntrySignature & 0x00FF0000) >> 16); + block[i++] = (byte)((ZipConstants.ZipEntrySignature & 0xFF000000) >> 24); + + // Design notes for ZIP64: + // + // The specification says that the header must include the Compressed + // and Uncompressed sizes, as well as the CRC32 value. When creating + // a zip via streamed processing, these quantities are not known until + // after the compression is done. Thus, a typical way to do it is to + // insert zeroes for these quantities, then do the compression, then + // seek back to insert the appropriate values, then seek forward to + // the end of the file data. + // + // There is also the option of using bit 3 in the GP bitfield - to + // specify that there is a data descriptor after the file data + // containing these three quantities. + // + // This works when the size of the quantities is known, either 32-bits + // or 64 bits as with the ZIP64 extensions. + // + // With Zip64, the 4-byte fields are set to 0xffffffff, and there is a + // corresponding data block in the "extra field" that contains the + // actual Compressed, uncompressed sizes. (As well as an additional + // field, the "Relative Offset of Local Header") + // + // The problem is when the app desires to use ZIP64 extensions + // optionally, only when necessary. Suppose the library assumes no + // zip64 extensions when writing the header, then after compression + // finds that the size of the data requires zip64. At this point, the + // header, already written to the file, won't have the necessary data + // block in the "extra field". The size of the entry header is fixed, + // so it is not possible to just "add on" the zip64 data block after + // compressing the file. On the other hand, always using zip64 will + // break interoperability with many other systems and apps. + // + // The approach we take is to insert a 32-byte dummy data block in the + // extra field, whenever zip64 is to be used "as necessary". This data + // block will get the actual zip64 HeaderId and zip64 metadata if + // necessary. If not necessary, the data block will get a meaningless + // HeaderId (0x1111), and will be filled with zeroes. + // + // When zip64 is actually in use, we also need to set the + // VersionNeededToExtract field to 45. + // + // There is one additional wrinkle: using zip64 as necessary conflicts + // with output to non-seekable devices. The header is emitted and + // must indicate whether zip64 is in use, before we know if zip64 is + // necessary. Because there is no seeking, the header can never be + // changed. Therefore, on non-seekable devices, + // Zip64Option.AsNecessary is the same as Zip64Option.Always. + // + + + // version needed- see AppNote.txt. + // + // need v5.1 for PKZIP strong encryption, or v2.0 for no encryption or + // for PK encryption, 4.5 for zip64. We may reset this later, as + // necessary or zip64. + + _presumeZip64 = (_container.Zip64 == Zip64Option.Always || + (_container.Zip64 == Zip64Option.AsNecessary && !s.CanSeek)); + Int16 VersionNeededToExtract = (Int16)(_presumeZip64 ? 45 : 20); +#if BZIP + if (this.CompressionMethod == Ionic.Zip.CompressionMethod.BZip2) + VersionNeededToExtract = 46; +#endif + + // (i==4) + block[i++] = (byte)(VersionNeededToExtract & 0x00FF); + block[i++] = (byte)((VersionNeededToExtract & 0xFF00) >> 8); + + // Get byte array. Side effect: sets ActualEncoding. + // Must determine encoding before setting the bitfield. + // workitem 6513 + byte[] fileNameBytes = GetEncodedFileNameBytes(); + Int16 filenameLength = (Int16)fileNameBytes.Length; + + // general purpose bitfield + // In the current implementation, this library uses only these bits + // in the GP bitfield: + // bit 0 = if set, indicates the entry is encrypted + // bit 3 = if set, indicates the CRC, C and UC sizes follow the file data. + // bit 6 = strong encryption - for pkware's meaning of strong encryption + // bit 11 = UTF-8 encoding is used in the comment and filename + + + // Here we set or unset the encryption bit. + // _BitField may already be set, as with a ZipEntry added into ZipOutputStream, which + // has bit 3 always set. We only want to set one bit + if (_Encryption == EncryptionAlgorithm.None) + _BitField &= ~1; // encryption bit OFF + else + _BitField |= 1; // encryption bit ON + + + // workitem 7941: WinZip does not the "strong encryption" bit when using AES. + // This "Strong Encryption" is a PKWare Strong encryption thing. + // _BitField |= 0x0020; + + // set the UTF8 bit if necessary +#if SILVERLIGHT + if (_actualEncoding.WebName == "utf-8") +#else + if (_actualEncoding.CodePage == System.Text.Encoding.UTF8.CodePage) +#endif + _BitField |= 0x0800; + + // The PKZIP spec says that if bit 3 is set (0x0008) in the General + // Purpose BitField, then the CRC, Compressed size, and uncompressed + // size are written directly after the file data. + // + // These 3 quantities are normally present in the regular zip entry + // header. But, they are not knowable until after the compression is + // done. So, in the normal case, we + // + // - write the header, using zeros for these quantities + // - compress the data, and incidentally compute these quantities. + // - seek back and write the correct values them into the header. + // + // This is nice because, while it is more complicated to write the zip + // file, it is simpler and less error prone to read the zip file, and + // as a result more applications can read zip files produced this way, + // with those 3 quantities in the header. + // + // But if seeking in the output stream is not possible, then we need + // to set the appropriate bitfield and emit these quantities after the + // compressed file data in the output. + // + // workitem 7216 - having trouble formatting a zip64 file that is + // readable by WinZip. not sure why! What I found is that setting + // bit 3 and following all the implications, the zip64 file is + // readable by WinZip 12. and Perl's IO::Compress::Zip . Perl takes + // an interesting approach - it always sets bit 3 if ZIP64 in use. + // DotNetZip now does the same; this gives better compatibility with + // WinZip 12. + + if (IsDirectory || cycle == 99) + { + // (cycle == 99) indicates a zero-length entry written by ZipOutputStream + + _BitField &= ~0x0008; // unset bit 3 - no "data descriptor" - ever + _BitField &= ~0x0001; // unset bit 1 - no encryption - ever + Encryption = EncryptionAlgorithm.None; + Password = null; + } + else if (!s.CanSeek) + _BitField |= 0x0008; + +#if DONT_GO_THERE + else if (this.Encryption == EncryptionAlgorithm.PkzipWeak && + this._Source != ZipEntrySource.ZipFile) + { + // Set bit 3 to avoid the double-read perf issue. + // + // When PKZIP encryption is used, byte 11 of the encryption header is + // used as a consistency check. It is normally set to the MSByte of the + // CRC. But this means the cRC must be known ebfore compression and + // encryption, which means the entire stream has to be read twice. To + // avoid that, the high-byte of the time blob (when in DOS format) can + // be used for the consistency check (byte 11 in the encryption header). + // But this means the entry must have bit 3 set. + // + // Previously I used a more complex arrangement - using the methods like + // FigureCrc32(), PrepOutputStream() and others, in order to manage the + // seek-back in the source stream. Why? Because bit 3 is not always + // friendly with third-party zip tools, like those on the Mac. + // + // This is why this code is still ifdef'd out. + // + // Might consider making this yet another programmable option - + // AlwaysUseBit3ForPkzip. But that's for another day. + // + _BitField |= 0x0008; + } +#endif + + // (i==6) + block[i++] = (byte)(_BitField & 0x00FF); + block[i++] = (byte)((_BitField & 0xFF00) >> 8); + + // Here, we want to set values for Compressed Size, Uncompressed Size, + // and CRC. If we have __FileDataPosition as not -1 (zero is a valid + // FDP), then that means we are reading this zip entry from a zip + // file, and we have good values for those quantities. + // + // If _FileDataPosition is -1, then we are constructing this Entry + // from nothing. We zero those quantities now, and we will compute + // actual values for the three quantities later, when we do the + // compression, and then seek back to write them into the appropriate + // place in the header. + if (this.__FileDataPosition == -1) + { + //_UncompressedSize = 0; // do not unset - may need this value for restream + // _Crc32 = 0; // ditto + _CompressedSize = 0; + _crcCalculated = false; + } + + // set compression method here + MaybeUnsetCompressionMethodForWriting(cycle); + + // (i==8) compression method + block[i++] = (byte)(_CompressionMethod & 0x00FF); + block[i++] = (byte)((_CompressionMethod & 0xFF00) >> 8); + + if (cycle == 99) + { + // (cycle == 99) indicates a zero-length entry written by ZipOutputStream + SetZip64Flags(); + } + +#if AESCRYPTO + else if (Encryption == EncryptionAlgorithm.WinZipAes128 || Encryption == EncryptionAlgorithm.WinZipAes256) + { + i -= 2; + block[i++] = 0x63; + block[i++] = 0; + } +#endif + + // LastMod + _TimeBlob = Ionic.Zip.SharedUtilities.DateTimeToPacked(LastModified); + + // (i==10) time blob + block[i++] = (byte)(_TimeBlob & 0x000000FF); + block[i++] = (byte)((_TimeBlob & 0x0000FF00) >> 8); + block[i++] = (byte)((_TimeBlob & 0x00FF0000) >> 16); + block[i++] = (byte)((_TimeBlob & 0xFF000000) >> 24); + + // (i==14) CRC - if source==filesystem, this is zero now, actual value + // will be calculated later. if source==archive, this is a bonafide + // value. + block[i++] = (byte)(_Crc32 & 0x000000FF); + block[i++] = (byte)((_Crc32 & 0x0000FF00) >> 8); + block[i++] = (byte)((_Crc32 & 0x00FF0000) >> 16); + block[i++] = (byte)((_Crc32 & 0xFF000000) >> 24); + + if (_presumeZip64) + { + // (i==18) CompressedSize (Int32) and UncompressedSize - all 0xFF for now + for (j = 0; j < 8; j++) + block[i++] = 0xFF; + } + else + { + // (i==18) CompressedSize (Int32) - this value may or may not be + // bonafide. if source == filesystem, then it is zero, and we'll + // learn it after we compress. if source == archive, then it is + // bonafide data. + block[i++] = (byte)(_CompressedSize & 0x000000FF); + block[i++] = (byte)((_CompressedSize & 0x0000FF00) >> 8); + block[i++] = (byte)((_CompressedSize & 0x00FF0000) >> 16); + block[i++] = (byte)((_CompressedSize & 0xFF000000) >> 24); + + // (i==22) UncompressedSize (Int32) - this value may or may not be + // bonafide. + block[i++] = (byte)(_UncompressedSize & 0x000000FF); + block[i++] = (byte)((_UncompressedSize & 0x0000FF00) >> 8); + block[i++] = (byte)((_UncompressedSize & 0x00FF0000) >> 16); + block[i++] = (byte)((_UncompressedSize & 0xFF000000) >> 24); + } + + // (i==26) filename length (Int16) + block[i++] = (byte)(filenameLength & 0x00FF); + block[i++] = (byte)((filenameLength & 0xFF00) >> 8); + + _Extra = ConstructExtraField(false); + + // (i==28) extra field length (short) + Int16 extraFieldLength = (Int16)((_Extra == null) ? 0 : _Extra.Length); + block[i++] = (byte)(extraFieldLength & 0x00FF); + block[i++] = (byte)((extraFieldLength & 0xFF00) >> 8); + + // workitem 13542 + byte[] bytes = new byte[i + filenameLength + extraFieldLength]; + + // get the fixed portion + Buffer.BlockCopy(block, 0, bytes, 0, i); + //for (j = 0; j < i; j++) bytes[j] = block[j]; + + // The filename written to the archive. + Buffer.BlockCopy(fileNameBytes, 0, bytes, i, fileNameBytes.Length); + // for (j = 0; j < fileNameBytes.Length; j++) + // bytes[i + j] = fileNameBytes[j]; + + i += fileNameBytes.Length; + + // "Extra field" + if (_Extra != null) + { + Buffer.BlockCopy(_Extra, 0, bytes, i, _Extra.Length); + // for (j = 0; j < _Extra.Length; j++) + // bytes[i + j] = _Extra[j]; + i += _Extra.Length; + } + + _LengthOfHeader = i; + + // handle split archives + var zss = s as ZipSegmentedStream; + if (zss != null) + { + zss.ContiguousWrite = true; + UInt32 requiredSegment = zss.ComputeSegment(i); + if (requiredSegment != zss.CurrentSegment) + _future_ROLH = 0; // rollover! + else + _future_ROLH = zss.Position; + + _diskNumber = requiredSegment; + } + + // validate the ZIP64 usage + if (_container.Zip64 == Zip64Option.Never && (uint)_RelativeOffsetOfLocalHeader >= 0xFFFFFFFF) + throw new ZipException("Offset within the zip archive exceeds 0xFFFFFFFF. Consider setting the UseZip64WhenSaving property on the ZipFile instance."); + + + // finally, write the header to the stream + s.Write(bytes, 0, i); + + // now that the header is written, we can turn off the contiguous write restriction. + if (zss != null) + zss.ContiguousWrite = false; + + // Preserve this header data, we'll use it again later. + // ..when seeking backward, to write again, after we have the Crc, compressed + // and uncompressed sizes. + // ..and when writing the central directory structure. + _EntryHeader = bytes; + } + + + + + private Int32 FigureCrc32() + { + if (_crcCalculated == false) + { + Stream input = null; + // get the original stream: + if (this._Source == ZipEntrySource.WriteDelegate) + { + var output = new Ionic.Crc.CrcCalculatorStream(Stream.Null); + // allow the application to write the data + this._WriteDelegate(this.FileName, output); + _Crc32 = output.Crc; + } + else if (this._Source == ZipEntrySource.ZipFile) + { + // nothing to do - the CRC is already set + } + else + { + if (this._Source == ZipEntrySource.Stream) + { + PrepSourceStream(); + input = this._sourceStream; + } + else if (this._Source == ZipEntrySource.JitStream) + { + // allow the application to open the stream + if (this._sourceStream == null) + _sourceStream = this._OpenDelegate(this.FileName); + PrepSourceStream(); + input = this._sourceStream; + } + else if (this._Source == ZipEntrySource.ZipOutputStream) + { + } + else + { + //input = File.OpenRead(LocalFileName); + input = File.Open(LocalFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + } + + var crc32 = new Ionic.Crc.CRC32(); + _Crc32 = crc32.GetCrc32(input); + + if (_sourceStream == null) + { +#if NETCF + input.Close(); +#else + input.Dispose(); +#endif + } + } + _crcCalculated = true; + } + return _Crc32; + } + + + /// + /// Stores the position of the entry source stream, or, if the position is + /// already stored, seeks to that position. + /// + /// + /// + /// + /// This method is called in prep for reading the source stream. If PKZIP + /// encryption is used, then we need to calc the CRC32 before doing the + /// encryption, because the CRC is used in the 12th byte of the PKZIP + /// encryption header. So, we need to be able to seek backward in the source + /// when saving the ZipEntry. This method is called from the place that + /// calculates the CRC, and also from the method that does the encryption of + /// the file data. + /// + /// + /// + /// The first time through, this method sets the _sourceStreamOriginalPosition + /// field. Subsequent calls to this method seek to that position. + /// + /// + private void PrepSourceStream() + { + if (_sourceStream == null) + throw new ZipException(String.Format("The input stream is null for entry '{0}'.", FileName)); + + if (this._sourceStreamOriginalPosition != null) + { + // this will happen the 2nd cycle through, if the stream is seekable + this._sourceStream.Position = this._sourceStreamOriginalPosition.Value; + } + else if (this._sourceStream.CanSeek) + { + // this will happen the first cycle through, if seekable + this._sourceStreamOriginalPosition = new Nullable(this._sourceStream.Position); + } + else if (this.Encryption == EncryptionAlgorithm.PkzipWeak) + { + // In general, using PKZIP encryption on a a zip entry whose input + // comes from a non-seekable stream, is tricky. Here's why: + // + // Byte 11 of the PKZIP encryption header is used for password + // validation and consistency checknig. + // + // Normally, the highest byte of the CRC is used as the 11th (last) byte + // in the PKZIP encryption header. This means the CRC must be known + // before encryption is performed. Normally that means we read the full + // data stream, compute the CRC, then seek back and read it again for + // the compression+encryption phase. Obviously this is bad for + // performance with a large input file. + // + // There's a twist in the ZIP spec (actually documented only in infozip + // code, not in the spec itself) that allows the high-order byte of the + // last modified time for the entry, when the lastmod time is in packed + // (DOS) format, to be used for Byte 11 in the encryption header. In + // this case, the bit 3 "data descriptor" must be used. + // + // An intelligent implementation would therefore force the use of the + // bit 3 data descriptor when PKZIP encryption is in use, regardless. + // This avoids the double-read of the stream to be encrypted. So far, + // DotNetZip doesn't do that; it just punts when the input stream is + // non-seekable, and the output does not use Bit 3. + // + // The other option is to use the CRC when it is already available, eg, + // when the source for the data is a ZipEntry (when the zip file is + // being updated). In this case we already know the CRC and can just use + // what we know. + + if (this._Source != ZipEntrySource.ZipFile && ((this._BitField & 0x0008) != 0x0008)) + throw new ZipException("It is not possible to use PKZIP encryption on a non-seekable input stream"); + } + } + + + /// + /// Copy metadata that may have been changed by the app. We do this when + /// resetting the zipFile instance. If the app calls Save() on a ZipFile, then + /// tries to party on that file some more, we may need to Reset() it , which + /// means re-reading the entries and then copying the metadata. I think. + /// + internal void CopyMetaData(ZipEntry source) + { + this.__FileDataPosition = source.__FileDataPosition; + this.CompressionMethod = source.CompressionMethod; + this._CompressionMethod_FromZipFile = source._CompressionMethod_FromZipFile; + this._CompressedFileDataSize = source._CompressedFileDataSize; + this._UncompressedSize = source._UncompressedSize; + this._BitField = source._BitField; + this._Source = source._Source; + this._LastModified = source._LastModified; + this._Mtime = source._Mtime; + this._Atime = source._Atime; + this._Ctime = source._Ctime; + this._ntfsTimesAreSet = source._ntfsTimesAreSet; + this._emitUnixTimes = source._emitUnixTimes; + this._emitNtfsTimes = source._emitNtfsTimes; + } + + + private void OnWriteBlock(Int64 bytesXferred, Int64 totalBytesToXfer) + { + if (_container.ZipFile != null) + _ioOperationCanceled = _container.ZipFile.OnSaveBlock(this, bytesXferred, totalBytesToXfer); + } + + + + private void _WriteEntryData(Stream s) + { + // Read in the data from the input stream (often a file in the filesystem), + // and write it to the output stream, calculating a CRC on it as we go. + // We will also compress and encrypt as necessary. + + Stream input = null; + long fdp = -1L; + try + { + // Want to record the position in the zip file of the zip entry + // data (as opposed to the metadata). s.Position may fail on some + // write-only streams, eg stdout or System.Web.HttpResponseStream. + // We swallow that exception, because we don't care, in that case. + // But, don't set __FileDataPosition directly. It may be needed + // to READ the zip entry from the zip file, if this is a + // "re-stream" situation. In other words if the zip entry has + // changed compression level, or compression method, or (maybe?) + // encryption algorithm. In that case if the original entry is + // encrypted, we need __FileDataPosition to be the value for the + // input zip file. This s.Position is for the output zipfile. So + // we copy fdp to __FileDataPosition after this entry has been + // (maybe) restreamed. + fdp = s.Position; + } + catch (Exception) { } + + try + { + // Use fileLength for progress updates, and to decide whether we can + // skip encryption and compression altogether (in case of length==zero) + long fileLength = SetInputAndFigureFileLength(ref input); + + // Wrap a counting stream around the raw output stream: + // This is the last thing that happens before the bits go to the + // application-provided stream. + // + // Sometimes s is a CountingStream. Doesn't matter. Wrap it with a + // counter anyway. We need to count at both levels. + + CountingStream entryCounter = new CountingStream(s); + + Stream encryptor; + Stream compressor; + + if (fileLength != 0L) + { + // Maybe wrap an encrypting stream around the counter: This will + // happen BEFORE output counting, and AFTER compression, if encryption + // is used. + encryptor = MaybeApplyEncryption(entryCounter); + + // Maybe wrap a compressing Stream around that. + // This will happen BEFORE encryption (if any) as we write data out. + compressor = MaybeApplyCompression(encryptor, fileLength); + } + else + { + encryptor = compressor = entryCounter; + } + + // Wrap a CrcCalculatorStream around that. + // This will happen BEFORE compression (if any) as we write data out. + var output = new Ionic.Crc.CrcCalculatorStream(compressor, true); + + // output.Write() causes this flow: + // calc-crc -> compress -> encrypt -> count -> actually write + + if (this._Source == ZipEntrySource.WriteDelegate) + { + // allow the application to write the data + this._WriteDelegate(this.FileName, output); + } + else + { + // synchronously copy the input stream to the output stream-chain + byte[] buffer = new byte[BufferSize]; + int n; + while ((n = SharedUtilities.ReadWithRetry(input, buffer, 0, buffer.Length, FileName)) != 0) + { + output.Write(buffer, 0, n); + OnWriteBlock(output.TotalBytesSlurped, fileLength); + if (_ioOperationCanceled) + break; + } + } + + FinishOutputStream(s, entryCounter, encryptor, compressor, output); + } + finally + { + if (this._Source == ZipEntrySource.JitStream) + { + // allow the application to close the stream + if (this._CloseDelegate != null) + this._CloseDelegate(this.FileName, input); + } + else if ((input as FileStream) != null) + { +#if NETCF + input.Close(); +#else + input.Dispose(); +#endif + } + } + + if (_ioOperationCanceled) + return; + + // set FDP now, to allow for re-streaming + this.__FileDataPosition = fdp; + PostProcessOutput(s); + } + + + /// + /// Set the input stream and get its length, if possible. The length is + /// used for progress updates, AND, to allow an optimization in case of + /// a stream/file of zero length. In that case we skip the Encrypt and + /// compression Stream. (like DeflateStream or BZip2OutputStream) + /// + private long SetInputAndFigureFileLength(ref Stream input) + { + long fileLength = -1L; + // get the original stream: + if (this._Source == ZipEntrySource.Stream) + { + PrepSourceStream(); + input = this._sourceStream; + + // Try to get the length, no big deal if not available. + try { fileLength = this._sourceStream.Length; } + catch (NotSupportedException) { } + } + else if (this._Source == ZipEntrySource.ZipFile) + { + // we are "re-streaming" the zip entry. + string pwd = (_Encryption_FromZipFile == EncryptionAlgorithm.None) ? null : (this._Password ?? this._container.Password); + this._sourceStream = InternalOpenReader(pwd); + PrepSourceStream(); + input = this._sourceStream; + fileLength = this._sourceStream.Length; + } + else if (this._Source == ZipEntrySource.JitStream) + { + // allow the application to open the stream + if (this._sourceStream == null) _sourceStream = this._OpenDelegate(this.FileName); + PrepSourceStream(); + input = this._sourceStream; + try { fileLength = this._sourceStream.Length; } + catch (NotSupportedException) { } + } + else if (this._Source == ZipEntrySource.FileSystem) + { + // workitem 7145 + FileShare fs = FileShare.ReadWrite; +#if !NETCF + // FileShare.Delete is not defined for the Compact Framework + fs |= FileShare.Delete; +#endif + // workitem 8423 + input = File.Open(LocalFileName, FileMode.Open, FileAccess.Read, fs); + fileLength = input.Length; + } + + return fileLength; + } + + + + internal void FinishOutputStream(Stream s, + CountingStream entryCounter, + Stream encryptor, + Stream compressor, + Ionic.Crc.CrcCalculatorStream output) + { + if (output == null) return; + + output.Close(); + + // by calling Close() on the deflate stream, we write the footer bytes, as necessary. + if ((compressor as Ionic.Zlib.DeflateStream) != null) + compressor.Close(); +#if BZIP + else if ((compressor as Ionic.BZip2.BZip2OutputStream) != null) + compressor.Close(); +#if !NETCF + else if ((compressor as Ionic.BZip2.ParallelBZip2OutputStream) != null) + compressor.Close(); +#endif +#endif + +#if !NETCF + else if ((compressor as Ionic.Zlib.ParallelDeflateOutputStream) != null) + compressor.Close(); +#endif + + encryptor.Flush(); + encryptor.Close(); + + _LengthOfTrailer = 0; + + _UncompressedSize = output.TotalBytesSlurped; + +#if AESCRYPTO + WinZipAesCipherStream wzacs = encryptor as WinZipAesCipherStream; + if (wzacs != null && _UncompressedSize > 0) + { + s.Write(wzacs.FinalAuthentication, 0, 10); + _LengthOfTrailer += 10; + } +#endif + _CompressedFileDataSize = entryCounter.BytesWritten; + _CompressedSize = _CompressedFileDataSize; // may be adjusted + _Crc32 = output.Crc; + + // Set _RelativeOffsetOfLocalHeader now, to allow for re-streaming + StoreRelativeOffset(); + } + + + + + internal void PostProcessOutput(Stream s) + { + var s1 = s as CountingStream; + + // workitem 8931 - for WriteDelegate. + // The WriteDelegate changes things because there can be a zero-byte stream + // written. In all other cases DotNetZip knows the length of the stream + // before compressing and encrypting. In this case we have to circle back, + // and omit all the crypto stuff - the GP bitfield, and the crypto header. + if (_UncompressedSize == 0 && _CompressedSize == 0) + { + if (this._Source == ZipEntrySource.ZipOutputStream) return; // nothing to do... + + if (_Password != null) + { + int headerBytesToRetract = 0; + if (Encryption == EncryptionAlgorithm.PkzipWeak) + headerBytesToRetract = 12; +#if AESCRYPTO + else if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + headerBytesToRetract = _aesCrypto_forWrite._Salt.Length + _aesCrypto_forWrite.GeneratedPV.Length; + } +#endif + if (this._Source == ZipEntrySource.ZipOutputStream && !s.CanSeek) + throw new ZipException("Zero bytes written, encryption in use, and non-seekable output."); + + if (Encryption != EncryptionAlgorithm.None) + { + // seek back in the stream to un-output the security metadata + s.Seek(-1 * headerBytesToRetract, SeekOrigin.Current); + s.SetLength(s.Position); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(s); + + // workitem 11131 + // adjust the count on the CountingStream as necessary + if (s1 != null) s1.Adjust(headerBytesToRetract); + + // subtract the size of the security header from the _LengthOfHeader + _LengthOfHeader -= headerBytesToRetract; + __FileDataPosition -= headerBytesToRetract; + } + _Password = null; + + // turn off the encryption bit + _BitField &= ~(0x0001); + + // copy the updated bitfield value into the header + int j = 6; + _EntryHeader[j++] = (byte)(_BitField & 0x00FF); + _EntryHeader[j++] = (byte)((_BitField & 0xFF00) >> 8); + +#if AESCRYPTO + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + // Fix the extra field - overwrite the 0x9901 headerId + // with dummy data. (arbitrarily, 0x9999) + Int16 fnLength = (short)(_EntryHeader[26] + _EntryHeader[27] * 256); + int offx = 30 + fnLength; + int aesIndex = FindExtraFieldSegment(_EntryHeader, offx, 0x9901); + if (aesIndex >= 0) + { + _EntryHeader[aesIndex++] = 0x99; + _EntryHeader[aesIndex++] = 0x99; + } + } +#endif + } + + CompressionMethod = 0; + Encryption = EncryptionAlgorithm.None; + } + else if (_zipCrypto_forWrite != null +#if AESCRYPTO + || _aesCrypto_forWrite != null +#endif + ) + + { + if (Encryption == EncryptionAlgorithm.PkzipWeak) + { + _CompressedSize += 12; // 12 extra bytes for the encryption header + } +#if AESCRYPTO + else if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + // adjust the compressed size to include the variable (salt+pv) + // security header and 10-byte trailer. According to the winzip AES + // spec, that metadata is included in the "Compressed Size" figure + // when encoding the zip archive. + _CompressedSize += _aesCrypto_forWrite.SizeOfEncryptionMetadata; + } +#endif + } + + int i = 8; + _EntryHeader[i++] = (byte)(_CompressionMethod & 0x00FF); + _EntryHeader[i++] = (byte)((_CompressionMethod & 0xFF00) >> 8); + + i = 14; + // CRC - the correct value now + _EntryHeader[i++] = (byte)(_Crc32 & 0x000000FF); + _EntryHeader[i++] = (byte)((_Crc32 & 0x0000FF00) >> 8); + _EntryHeader[i++] = (byte)((_Crc32 & 0x00FF0000) >> 16); + _EntryHeader[i++] = (byte)((_Crc32 & 0xFF000000) >> 24); + + SetZip64Flags(); + + // (i==26) filename length (Int16) + Int16 filenameLength = (short)(_EntryHeader[26] + _EntryHeader[27] * 256); + Int16 extraFieldLength = (short)(_EntryHeader[28] + _EntryHeader[29] * 256); + + if (_OutputUsesZip64.Value) + { + // VersionNeededToExtract - set to 45 to indicate zip64 + _EntryHeader[4] = (byte)(45 & 0x00FF); + _EntryHeader[5] = 0x00; + + // workitem 7924 - don't need bit 3 + // // workitem 7917 + // // set bit 3 for ZIP64 compatibility with WinZip12 + // _BitField |= 0x0008; + // _EntryHeader[6] = (byte)(_BitField & 0x00FF); + + // CompressedSize and UncompressedSize - 0xFF + for (int j = 0; j < 8; j++) + _EntryHeader[i++] = 0xff; + + // At this point we need to find the "Extra field" that follows the + // filename. We had already emitted it, but the data (uncomp, comp, + // ROLH) was not available at the time we did so. Here, we emit it + // again, with final values. + + i = 30 + filenameLength; + _EntryHeader[i++] = 0x01; // zip64 + _EntryHeader[i++] = 0x00; + + i += 2; // skip over data size, which is 16+4 + + Array.Copy(BitConverter.GetBytes(_UncompressedSize), 0, _EntryHeader, i, 8); + i += 8; + Array.Copy(BitConverter.GetBytes(_CompressedSize), 0, _EntryHeader, i, 8); + } + else + { + // VersionNeededToExtract - reset to 20 since no zip64 + _EntryHeader[4] = (byte)(20 & 0x00FF); + _EntryHeader[5] = 0x00; + + // CompressedSize - the correct value now + i = 18; + _EntryHeader[i++] = (byte)(_CompressedSize & 0x000000FF); + _EntryHeader[i++] = (byte)((_CompressedSize & 0x0000FF00) >> 8); + _EntryHeader[i++] = (byte)((_CompressedSize & 0x00FF0000) >> 16); + _EntryHeader[i++] = (byte)((_CompressedSize & 0xFF000000) >> 24); + + // UncompressedSize - the correct value now + _EntryHeader[i++] = (byte)(_UncompressedSize & 0x000000FF); + _EntryHeader[i++] = (byte)((_UncompressedSize & 0x0000FF00) >> 8); + _EntryHeader[i++] = (byte)((_UncompressedSize & 0x00FF0000) >> 16); + _EntryHeader[i++] = (byte)((_UncompressedSize & 0xFF000000) >> 24); + + // The HeaderId in the extra field header, is already dummied out. + if (extraFieldLength != 0) + { + i = 30 + filenameLength; + // For zip archives written by this library, if the zip64 + // header exists, it is the first header. Because of the logic + // used when first writing the _EntryHeader bytes, the + // HeaderId is not guaranteed to be any particular value. So + // we determine if the first header is a putative zip64 header + // by examining the datasize. UInt16 HeaderId = + // (UInt16)(_EntryHeader[i] + _EntryHeader[i + 1] * 256); + Int16 DataSize = (short)(_EntryHeader[i + 2] + _EntryHeader[i + 3] * 256); + if (DataSize == 16) + { + // reset to Header Id to dummy value, effectively dummy-ing out the zip64 metadata + _EntryHeader[i++] = 0x99; + _EntryHeader[i++] = 0x99; + } + } + } + + +#if AESCRYPTO + + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + // Must set compressionmethod to 0x0063 (decimal 99) + // + // and then set the compression method bytes inside the extra + // field to the actual compression method value. + + i = 8; + _EntryHeader[i++] = 0x63; + _EntryHeader[i++] = 0; + + i = 30 + filenameLength; + do + { + UInt16 HeaderId = (UInt16)(_EntryHeader[i] + _EntryHeader[i + 1] * 256); + Int16 DataSize = (short)(_EntryHeader[i + 2] + _EntryHeader[i + 3] * 256); + if (HeaderId != 0x9901) + { + // skip this header + i += DataSize + 4; + } + else + { + i += 9; + // actual compression method + _EntryHeader[i++] = (byte)(_CompressionMethod & 0x00FF); + _EntryHeader[i++] = (byte)(_CompressionMethod & 0xFF00); + } + } while (i < (extraFieldLength - 30 - filenameLength)); + } +#endif + + // finally, write the data. + + // workitem 7216 - sometimes we don't seek even if we CAN. ASP.NET + // Response.OutputStream, or stdout are non-seekable. But we may also want + // to NOT seek in other cases, eg zip64. For all cases, we just check bit 3 + // to see if we want to seek. There's one exception - if using a + // ZipOutputStream, and PKZip encryption is in use, then we set bit 3 even + // if the out is seekable. This is so the check on the last byte of the + // PKZip Encryption Header can be done on the current time, as opposed to + // the CRC, to prevent streaming the file twice. So, test for + // ZipOutputStream and seekable, and if so, seek back, even if bit 3 is set. + + if ((_BitField & 0x0008) != 0x0008 || + (this._Source == ZipEntrySource.ZipOutputStream && s.CanSeek)) + { + // seek back and rewrite the entry header + var zss = s as ZipSegmentedStream; + if (zss != null && _diskNumber != zss.CurrentSegment) + { + // In this case the entry header is in a different file, + // which has already been closed. Need to re-open it. + using (Stream hseg = ZipSegmentedStream.ForUpdate(this._container.ZipFile.Name, _diskNumber)) + { + hseg.Seek(this._RelativeOffsetOfLocalHeader, SeekOrigin.Begin); + hseg.Write(_EntryHeader, 0, _EntryHeader.Length); + } + } + else + { + // seek in the raw output stream, to the beginning of the header for + // this entry. + // workitem 8098: ok (output) + s.Seek(this._RelativeOffsetOfLocalHeader, SeekOrigin.Begin); + + // write the updated header to the output stream + s.Write(_EntryHeader, 0, _EntryHeader.Length); + + // adjust the count on the CountingStream as necessary + if (s1 != null) s1.Adjust(_EntryHeader.Length); + + // seek in the raw output stream, to the end of the file data + // for this entry + s.Seek(_CompressedSize, SeekOrigin.Current); + } + } + + // emit the descriptor - only if not a directory. + if (((_BitField & 0x0008) == 0x0008) && !IsDirectory) + { + byte[] Descriptor = new byte[16 + (_OutputUsesZip64.Value ? 8 : 0)]; + i = 0; + + // signature + Array.Copy(BitConverter.GetBytes(ZipConstants.ZipEntryDataDescriptorSignature), 0, Descriptor, i, 4); + i += 4; + + // CRC - the correct value now + Array.Copy(BitConverter.GetBytes(_Crc32), 0, Descriptor, i, 4); + i += 4; + + // workitem 7917 + if (_OutputUsesZip64.Value) + { + // CompressedSize - the correct value now + Array.Copy(BitConverter.GetBytes(_CompressedSize), 0, Descriptor, i, 8); + i += 8; + + // UncompressedSize - the correct value now + Array.Copy(BitConverter.GetBytes(_UncompressedSize), 0, Descriptor, i, 8); + i += 8; + } + else + { + // CompressedSize - (lower 32 bits) the correct value now + Descriptor[i++] = (byte)(_CompressedSize & 0x000000FF); + Descriptor[i++] = (byte)((_CompressedSize & 0x0000FF00) >> 8); + Descriptor[i++] = (byte)((_CompressedSize & 0x00FF0000) >> 16); + Descriptor[i++] = (byte)((_CompressedSize & 0xFF000000) >> 24); + + // UncompressedSize - (lower 32 bits) the correct value now + Descriptor[i++] = (byte)(_UncompressedSize & 0x000000FF); + Descriptor[i++] = (byte)((_UncompressedSize & 0x0000FF00) >> 8); + Descriptor[i++] = (byte)((_UncompressedSize & 0x00FF0000) >> 16); + Descriptor[i++] = (byte)((_UncompressedSize & 0xFF000000) >> 24); + } + + // finally, write the trailing descriptor to the output stream + s.Write(Descriptor, 0, Descriptor.Length); + + _LengthOfTrailer += Descriptor.Length; + } + } + + + + private void SetZip64Flags() + { + // zip64 housekeeping + _entryRequiresZip64 = new Nullable + (_CompressedSize >= 0xFFFFFFFF || _UncompressedSize >= 0xFFFFFFFF || _RelativeOffsetOfLocalHeader >= 0xFFFFFFFF); + + // validate the ZIP64 usage + if (_container.Zip64 == Zip64Option.Never && _entryRequiresZip64.Value) + throw new ZipException("Compressed or Uncompressed size, or offset exceeds the maximum value. Consider setting the UseZip64WhenSaving property on the ZipFile instance."); + + _OutputUsesZip64 = new Nullable(_container.Zip64 == Zip64Option.Always || _entryRequiresZip64.Value); + } + + + + /// + /// Prepare the given stream for output - wrap it in a CountingStream, and + /// then in a CRC stream, and an encryptor and deflator as appropriate. + /// + /// + /// + /// Previously this was used in ZipEntry.Write(), but in an effort to + /// introduce some efficiencies in that method I've refactored to put the + /// code inline. This method still gets called by ZipOutputStream. + /// + /// + internal void PrepOutputStream(Stream s, + long streamLength, + out CountingStream outputCounter, + out Stream encryptor, + out Stream compressor, + out Ionic.Crc.CrcCalculatorStream output) + { + TraceWriteLine("PrepOutputStream: e({0}) comp({1}) crypto({2}) zf({3})", + FileName, + CompressionLevel, + Encryption, + _container.Name); + + // Wrap a counting stream around the raw output stream: + // This is the last thing that happens before the bits go to the + // application-provided stream. + outputCounter = new CountingStream(s); + + // Sometimes the incoming "raw" output stream is already a CountingStream. + // Doesn't matter. Wrap it with a counter anyway. We need to count at both + // levels. + + if (streamLength != 0L) + { + // Maybe wrap an encrypting stream around that: + // This will happen BEFORE output counting, and AFTER deflation, if encryption + // is used. + encryptor = MaybeApplyEncryption(outputCounter); + + // Maybe wrap a compressing Stream around that. + // This will happen BEFORE encryption (if any) as we write data out. + compressor = MaybeApplyCompression(encryptor, streamLength); + } + else + { + encryptor = compressor = outputCounter; + } + // Wrap a CrcCalculatorStream around that. + // This will happen BEFORE compression (if any) as we write data out. + output = new Ionic.Crc.CrcCalculatorStream(compressor, true); + } + + + + private Stream MaybeApplyCompression(Stream s, long streamLength) + { + if (_CompressionMethod == 0x08 && CompressionLevel != Ionic.Zlib.CompressionLevel.None) + { +#if !NETCF + // ParallelDeflateThreshold == 0 means ALWAYS use parallel deflate + // ParallelDeflateThreshold == -1L means NEVER use parallel deflate + // Other values specify the actual threshold. + if (_container.ParallelDeflateThreshold == 0L || + (streamLength > _container.ParallelDeflateThreshold && + _container.ParallelDeflateThreshold > 0L)) + { + // This is sort of hacky. + // + // It's expensive to create a ParallelDeflateOutputStream, because + // of the large memory buffers. But the class is unlike most Stream + // classes in that it can be re-used, so the caller can compress + // multiple files with it, one file at a time. The key is to call + // Reset() on it, in between uses. + // + // The ParallelDeflateOutputStream is attached to the container + // itself - there is just one for the entire ZipFile or + // ZipOutputStream. So it gets created once, per save, and then + // re-used many times. + // + // This approach will break when we go to a "parallel save" + // approach, where multiple entries within the zip file are being + // compressed and saved at the same time. But for now it's ok. + // + + // instantiate the ParallelDeflateOutputStream + if (_container.ParallelDeflater == null) + { + _container.ParallelDeflater = + new Ionic.Zlib.ParallelDeflateOutputStream(s, + CompressionLevel, + _container.Strategy, + true); + // can set the codec buffer size only before the first call to Write(). + if (_container.CodecBufferSize > 0) + _container.ParallelDeflater.BufferSize = _container.CodecBufferSize; + if (_container.ParallelDeflateMaxBufferPairs > 0) + _container.ParallelDeflater.MaxBufferPairs = + _container.ParallelDeflateMaxBufferPairs; + } + // reset it with the new stream + Ionic.Zlib.ParallelDeflateOutputStream o1 = _container.ParallelDeflater; + o1.Reset(s); + return o1; + } +#endif + var o = new Ionic.Zlib.DeflateStream(s, Ionic.Zlib.CompressionMode.Compress, + CompressionLevel, + true); + if (_container.CodecBufferSize > 0) + o.BufferSize = _container.CodecBufferSize; + o.Strategy = _container.Strategy; + return o; + } + + +#if BZIP + if (_CompressionMethod == 0x0c) + { +#if !NETCF + if (_container.ParallelDeflateThreshold == 0L || + (streamLength > _container.ParallelDeflateThreshold && + _container.ParallelDeflateThreshold > 0L)) + { + + var o1 = new Ionic.BZip2.ParallelBZip2OutputStream(s, true); + return o1; + } +#endif + var o = new Ionic.BZip2.BZip2OutputStream(s, true); + return o; + } +#endif + + return s; + } + + + + private Stream MaybeApplyEncryption(Stream s) + { + if (Encryption == EncryptionAlgorithm.PkzipWeak) + { + TraceWriteLine("MaybeApplyEncryption: e({0}) PKZIP", FileName); + + return new ZipCipherStream(s, _zipCrypto_forWrite, CryptoMode.Encrypt); + } +#if AESCRYPTO + if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + TraceWriteLine("MaybeApplyEncryption: e({0}) AES", FileName); + + return new WinZipAesCipherStream(s, _aesCrypto_forWrite, CryptoMode.Encrypt); + } +#endif + TraceWriteLine("MaybeApplyEncryption: e({0}) None", FileName); + + return s; + } + + + + private void OnZipErrorWhileSaving(Exception e) + { + if (_container.ZipFile != null) + _ioOperationCanceled = _container.ZipFile.OnZipErrorSaving(this, e); + } + + + + internal void Write(Stream s) + { + var cs1 = s as CountingStream; + var zss1 = s as ZipSegmentedStream; + + bool done = false; + do + { + try + { + // When the app is updating a zip file, it may be possible to + // just copy data for a ZipEntry from the source zipfile to the + // destination, as a block, without decompressing and + // recompressing, etc. But, in some cases the app modifies the + // properties on a ZipEntry prior to calling Save(). A change to + // any of the metadata - the FileName, CompressioLeve and so on, + // means DotNetZip cannot simply copy through the existing + // ZipEntry data unchanged. + // + // There are two cases: + // + // 1. Changes to only metadata, which means the header and + // central directory must be changed. + // + // 2. Changes to the properties that affect the compressed + // stream, such as CompressionMethod, CompressionLevel, or + // EncryptionAlgorithm. In this case, DotNetZip must + // "re-stream" the data: the old entry data must be maybe + // decrypted, maybe decompressed, then maybe re-compressed + // and maybe re-encrypted. + // + // This test checks if the source for the entry data is a zip file, and + // if a restream is necessary. If NOT, then it just copies through + // one entry, potentially changing the metadata. + + if (_Source == ZipEntrySource.ZipFile && !_restreamRequiredOnSave) + { + CopyThroughOneEntry(s); + return; + } + + // Is the entry a directory? If so, the write is relatively simple. + if (IsDirectory) + { + WriteHeader(s, 1); + StoreRelativeOffset(); + _entryRequiresZip64 = new Nullable(_RelativeOffsetOfLocalHeader >= 0xFFFFFFFF); + _OutputUsesZip64 = new Nullable(_container.Zip64 == Zip64Option.Always || _entryRequiresZip64.Value); + // handle case for split archives + if (zss1 != null) + _diskNumber = zss1.CurrentSegment; + + return; + } + + // At this point, the source for this entry is not a directory, and + // not a previously created zip file, or the source for the entry IS + // a previously created zip but the settings whave changed in + // important ways and therefore we will need to process the + // bytestream (compute crc, maybe compress, maybe encrypt) in order + // to write the content into the new zip. + // + // We do this in potentially 2 passes: The first time we do it as + // requested, maybe with compression and maybe encryption. If that + // causes the bytestream to inflate in size, and if compression was + // on, then we turn off compression and do it again. + + + bool readAgain = true; + int nCycles = 0; + do + { + nCycles++; + + WriteHeader(s, nCycles); + + // write the encrypted header + WriteSecurityMetadata(s); + + // write the (potentially compressed, potentially encrypted) file data + _WriteEntryData(s); + + // track total entry size (including the trailing descriptor and MAC) + _TotalEntrySize = _LengthOfHeader + _CompressedFileDataSize + _LengthOfTrailer; + + // The file data has now been written to the stream, and + // the file pointer is positioned directly after file data. + + if (nCycles > 1) readAgain = false; + else if (!s.CanSeek) readAgain = false; + else readAgain = WantReadAgain(); + + if (readAgain) + { + // Seek back in the raw output stream, to the beginning of the file + // data for this entry. + + // handle case for split archives + if (zss1 != null) + { + // Console.WriteLine("***_diskNumber/first: {0}", _diskNumber); + // Console.WriteLine("***_diskNumber/current: {0}", zss.CurrentSegment); + zss1.TruncateBackward(_diskNumber, _RelativeOffsetOfLocalHeader); + } + else + // workitem 8098: ok (output). + s.Seek(_RelativeOffsetOfLocalHeader, SeekOrigin.Begin); + + // If the last entry expands, we read again; but here, we must + // truncate the stream to prevent garbage data after the + // end-of-central-directory. + + // workitem 8098: ok (output). + s.SetLength(s.Position); + + // Adjust the count on the CountingStream as necessary. + if (cs1 != null) cs1.Adjust(_TotalEntrySize); + } + } + while (readAgain); + _skippedDuringSave = false; + done = true; + } + catch (System.Exception exc1) + { + ZipErrorAction orig = this.ZipErrorAction; + int loop = 0; + do + { + if (ZipErrorAction == ZipErrorAction.Throw) + throw; + + if (ZipErrorAction == ZipErrorAction.Skip || + ZipErrorAction == ZipErrorAction.Retry) + { + // must reset file pointer here. + // workitem 13903 - seek back only when necessary + long p1 = (cs1 != null) + ? cs1.ComputedPosition + : s.Position; + long delta = p1 - _future_ROLH; + if (delta > 0) + { + s.Seek(delta, SeekOrigin.Current); // may throw + long p2 = s.Position; + s.SetLength(s.Position); // to prevent garbage if this is the last entry + if (cs1 != null) cs1.Adjust(p1 - p2); + } + if (ZipErrorAction == ZipErrorAction.Skip) + { + WriteStatus("Skipping file {0} (exception: {1})", LocalFileName, exc1.ToString()); + + _skippedDuringSave = true; + done = true; + } + else + this.ZipErrorAction = orig; + break; + } + + if (loop > 0) throw; + + if (ZipErrorAction == ZipErrorAction.InvokeErrorEvent) + { + OnZipErrorWhileSaving(exc1); + if (_ioOperationCanceled) + { + done = true; + break; + } + } + loop++; + } + while (true); + } + } + while (!done); + } + + + internal void StoreRelativeOffset() + { + _RelativeOffsetOfLocalHeader = _future_ROLH; + } + + + + internal void NotifySaveComplete() + { + // When updating a zip file, there are two contexts for properties + // like Encryption or CompressionMethod - the values read from the + // original zip file, and the values used in the updated zip file. + // The _FromZipFile versions are the originals. At the end of a save, + // these values are the same. So we need to update them. This takes + // care of the boundary case where a single zipfile instance can be + // saved multiple times, with distinct changes to the properties on + // the entries, in between each Save(). + _Encryption_FromZipFile = _Encryption; + _CompressionMethod_FromZipFile = _CompressionMethod; + _restreamRequiredOnSave = false; + _metadataChanged = false; + //_Source = ZipEntrySource.None; + _Source = ZipEntrySource.ZipFile; // workitem 10694 + } + + + internal void WriteSecurityMetadata(Stream outstream) + { + if (Encryption == EncryptionAlgorithm.None) + return; + + string pwd = this._Password; + + // special handling for source == ZipFile. + // Want to support the case where we re-stream an encrypted entry. This will involve, + // at runtime, reading, decrypting, and decompressing from the original zip file, then + // compressing, encrypting, and writing to the output zip file. + + // If that's what we're doing, and the password hasn't been set on the entry, + // we use the container (ZipFile/ZipOutputStream) password to decrypt. + // This test here says to use the container password to re-encrypt, as well, + // with that password, if the entry password is null. + + if (this._Source == ZipEntrySource.ZipFile && pwd == null) + pwd = this._container.Password; + + if (pwd == null) + { + _zipCrypto_forWrite = null; +#if AESCRYPTO + _aesCrypto_forWrite = null; +#endif + return; + } + + TraceWriteLine("WriteSecurityMetadata: e({0}) crypto({1}) pw({2})", + FileName, Encryption.ToString(), pwd); + + if (Encryption == EncryptionAlgorithm.PkzipWeak) + { + // If PKZip (weak) encryption is in use, then the encrypted entry data + // is preceded by 12-byte "encryption header" for the entry. + + _zipCrypto_forWrite = ZipCrypto.ForWrite(pwd); + + // generate the random 12-byte header: + var rnd = new System.Random(); + byte[] encryptionHeader = new byte[12]; + rnd.NextBytes(encryptionHeader); + + // workitem 8271 + if ((this._BitField & 0x0008) == 0x0008) + { + // In the case that bit 3 of the general purpose bit flag is set to + // indicate the presence of a 'data descriptor' (signature + // 0x08074b50), the last byte of the decrypted header is sometimes + // compared with the high-order byte of the lastmodified time, + // rather than the high-order byte of the CRC, to verify the + // password. + // + // This is not documented in the PKWare Appnote.txt. + // This was discovered this by analysis of the Crypt.c source file in the + // InfoZip library + // http://www.info-zip.org/pub/infozip/ + + // Also, winzip insists on this! + _TimeBlob = Ionic.Zip.SharedUtilities.DateTimeToPacked(LastModified); + encryptionHeader[11] = (byte)((this._TimeBlob >> 8) & 0xff); + } + else + { + // When bit 3 is not set, the CRC value is required before + // encryption of the file data begins. In this case there is no way + // around it: must read the stream in its entirety to compute the + // actual CRC before proceeding. + FigureCrc32(); + encryptionHeader[11] = (byte)((this._Crc32 >> 24) & 0xff); + } + + // Encrypt the random header, INCLUDING the final byte which is either + // the high-order byte of the CRC32, or the high-order byte of the + // _TimeBlob. Must do this BEFORE encrypting the file data. This + // step changes the state of the cipher, or in the words of the PKZIP + // spec, it "further initializes" the cipher keys. + + byte[] cipherText = _zipCrypto_forWrite.EncryptMessage(encryptionHeader, encryptionHeader.Length); + + // Write the ciphered bonafide encryption header. + outstream.Write(cipherText, 0, cipherText.Length); + _LengthOfHeader += cipherText.Length; // 12 bytes + } + +#if AESCRYPTO + else if (Encryption == EncryptionAlgorithm.WinZipAes128 || + Encryption == EncryptionAlgorithm.WinZipAes256) + { + // If WinZip AES encryption is in use, then the encrypted entry data is + // preceded by a variable-sized Salt and a 2-byte "password + // verification" value for the entry. + + int keystrength = GetKeyStrengthInBits(Encryption); + _aesCrypto_forWrite = WinZipAesCrypto.Generate(pwd, keystrength); + outstream.Write(_aesCrypto_forWrite.Salt, 0, _aesCrypto_forWrite._Salt.Length); + outstream.Write(_aesCrypto_forWrite.GeneratedPV, 0, _aesCrypto_forWrite.GeneratedPV.Length); + _LengthOfHeader += _aesCrypto_forWrite._Salt.Length + _aesCrypto_forWrite.GeneratedPV.Length; + + TraceWriteLine("WriteSecurityMetadata: AES e({0}) keybits({1}) _LOH({2})", + FileName, keystrength, _LengthOfHeader); + + } +#endif + + } + + + + private void CopyThroughOneEntry(Stream outStream) + { + // Just read the entry from the existing input zipfile and write to the output. + // But, if metadata has changed (like file times or attributes), or if the ZIP64 + // option has changed, we can re-stream the entry data but must recompute the + // metadata. + if (this.LengthOfHeader == 0) + throw new BadStateException("Bad header length."); + + // is it necessary to re-constitute new metadata for this entry? + bool needRecompute = _metadataChanged || + (this.ArchiveStream is ZipSegmentedStream) || + (outStream is ZipSegmentedStream) || + (_InputUsesZip64 && _container.UseZip64WhenSaving == Zip64Option.Never) || + (!_InputUsesZip64 && _container.UseZip64WhenSaving == Zip64Option.Always); + + if (needRecompute) + CopyThroughWithRecompute(outStream); + else + CopyThroughWithNoChange(outStream); + + // zip64 housekeeping + _entryRequiresZip64 = new Nullable + (_CompressedSize >= 0xFFFFFFFF || _UncompressedSize >= 0xFFFFFFFF || + _RelativeOffsetOfLocalHeader >= 0xFFFFFFFF + ); + + _OutputUsesZip64 = new Nullable(_container.Zip64 == Zip64Option.Always || _entryRequiresZip64.Value); + } + + + + private void CopyThroughWithRecompute(Stream outstream) + { + int n; + byte[] bytes = new byte[BufferSize]; + var input = new CountingStream(this.ArchiveStream); + + long origRelativeOffsetOfHeader = _RelativeOffsetOfLocalHeader; + + // The header length may change due to rename of file, add a comment, etc. + // We need to retain the original. + int origLengthOfHeader = LengthOfHeader; // including crypto bytes! + + // WriteHeader() has the side effect of changing _RelativeOffsetOfLocalHeader + // and setting _LengthOfHeader. While ReadHeader() reads the crypto header if + // present, WriteHeader() does not write the crypto header. + WriteHeader(outstream, 0); + StoreRelativeOffset(); + + if (!this.FileName.EndsWith("/")) + { + // Not a directory; there is file data. + // Seek to the beginning of the entry data in the input stream. + + long pos = origRelativeOffsetOfHeader + origLengthOfHeader; + int len = GetLengthOfCryptoHeaderBytes(_Encryption_FromZipFile); + pos -= len; // want to keep the crypto header + _LengthOfHeader += len; + + input.Seek(pos, SeekOrigin.Begin); + + // copy through everything after the header to the output stream + long remaining = this._CompressedSize; + + while (remaining > 0) + { + len = (remaining > bytes.Length) ? bytes.Length : (int)remaining; + + // read + n = input.Read(bytes, 0, len); + //_CheckRead(n); + + // write + outstream.Write(bytes, 0, n); + remaining -= n; + OnWriteBlock(input.BytesRead, this._CompressedSize); + if (_ioOperationCanceled) + break; + } + + // bit 3 descriptor + if ((this._BitField & 0x0008) == 0x0008) + { + int size = 16; + if (_InputUsesZip64) size += 8; + byte[] Descriptor = new byte[size]; + input.Read(Descriptor, 0, size); + + if (_InputUsesZip64 && _container.UseZip64WhenSaving == Zip64Option.Never) + { + // original descriptor was 24 bytes, now we need 16. + // Must check for underflow here. + // signature + CRC. + outstream.Write(Descriptor, 0, 8); + + // Compressed + if (_CompressedSize > 0xFFFFFFFF) + throw new InvalidOperationException("ZIP64 is required"); + outstream.Write(Descriptor, 8, 4); + + // UnCompressed + if (_UncompressedSize > 0xFFFFFFFF) + throw new InvalidOperationException("ZIP64 is required"); + outstream.Write(Descriptor, 16, 4); + _LengthOfTrailer -= 8; + } + else if (!_InputUsesZip64 && _container.UseZip64WhenSaving == Zip64Option.Always) + { + // original descriptor was 16 bytes, now we need 24 + // signature + CRC + byte[] pad = new byte[4]; + outstream.Write(Descriptor, 0, 8); + // Compressed + outstream.Write(Descriptor, 8, 4); + outstream.Write(pad, 0, 4); + // UnCompressed + outstream.Write(Descriptor, 12, 4); + outstream.Write(pad, 0, 4); + _LengthOfTrailer += 8; + } + else + { + // same descriptor on input and output. Copy it through. + outstream.Write(Descriptor, 0, size); + //_LengthOfTrailer += size; + } + } + } + + _TotalEntrySize = _LengthOfHeader + _CompressedFileDataSize + _LengthOfTrailer; + } + + + private void CopyThroughWithNoChange(Stream outstream) + { + int n; + byte[] bytes = new byte[BufferSize]; + var input = new CountingStream(this.ArchiveStream); + + // seek to the beginning of the entry data in the input stream + input.Seek(this._RelativeOffsetOfLocalHeader, SeekOrigin.Begin); + + if (this._TotalEntrySize == 0) + { + // We've never set the length of the entry. + // Set it here. + this._TotalEntrySize = this._LengthOfHeader + this._CompressedFileDataSize + _LengthOfTrailer; + + // The CompressedSize includes all the leading metadata associated + // to encryption, if any, as well as the compressed data, or + // compressed-then-encrypted data, and the trailer in case of AES. + + // The CompressedFileData size is the same, less the encryption + // framing data (12 bytes header for PKZip; 10/18 bytes header and + // 10 byte trailer for AES). + + // The _LengthOfHeader includes all the zip entry header plus the + // crypto header, if any. The _LengthOfTrailer includes the + // 10-byte MAC for AES, where appropriate, and the bit-3 + // Descriptor, where applicable. + } + + + // workitem 5616 + // remember the offset, within the output stream, of this particular entry header. + // This may have changed if any of the other entries changed (eg, if a different + // entry was removed or added.) + var counter = outstream as CountingStream; + _RelativeOffsetOfLocalHeader = (counter != null) + ? counter.ComputedPosition + : outstream.Position; // BytesWritten + + // copy through the header, filedata, trailer, everything... + long remaining = this._TotalEntrySize; + while (remaining > 0) + { + int len = (remaining > bytes.Length) ? bytes.Length : (int)remaining; + + // read + n = input.Read(bytes, 0, len); + //_CheckRead(n); + + // write + outstream.Write(bytes, 0, n); + remaining -= n; + OnWriteBlock(input.BytesRead, this._TotalEntrySize); + if (_ioOperationCanceled) + break; + } + } + + + + + [System.Diagnostics.ConditionalAttribute("Trace")] + private void TraceWriteLine(string format, params object[] varParams) + { + lock (_outputLock) + { + int tid = System.Threading.Thread.CurrentThread.GetHashCode(); +#if ! (NETCF || SILVERLIGHT) + Console.ForegroundColor = (ConsoleColor)(tid % 8 + 8); +#endif + Console.Write("{0:000} ZipEntry.Write ", tid); + Console.WriteLine(format, varParams); +#if ! (NETCF || SILVERLIGHT) + Console.ResetColor(); +#endif + } + } + + private object _outputLock = new Object(); + } +} diff --git a/dotNetZip/Zip/ZipEntry.cs b/dotNetZip/Zip/ZipEntry.cs new file mode 100644 index 0000000..02d3f5b --- /dev/null +++ b/dotNetZip/Zip/ZipEntry.cs @@ -0,0 +1,2968 @@ +// ZipEntry.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2006-2010 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 17:25:53> +// +// ------------------------------------------------------------------ +// +// This module defines the ZipEntry class, which models the entries within a zip file. +// +// Created: Tue, 27 Mar 2007 15:30 +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; +using Interop = System.Runtime.InteropServices; + +namespace Ionic.Zip +{ + /// + /// Represents a single entry in a ZipFile. Typically, applications get a ZipEntry + /// by enumerating the entries within a ZipFile, or by adding an entry to a ZipFile. + /// + + [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d00004")] + [Interop.ComVisible(true)] +#if !NETCF + [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)] // AutoDual +#endif + public partial class ZipEntry + { + /// + /// Default constructor. + /// + /// + /// Applications should never need to call this directly. It is exposed to + /// support COM Automation environments. + /// + public ZipEntry() + { + _CompressionMethod = (Int16)CompressionMethod.Deflate; + _CompressionLevel = Ionic.Zlib.CompressionLevel.Default; + _Encryption = EncryptionAlgorithm.None; + _Source = ZipEntrySource.None; + AlternateEncoding = System.Text.Encoding.GetEncoding("IBM437"); + AlternateEncodingUsage = ZipOption.Never; + } + + /// + /// The time and date at which the file indicated by the ZipEntry was + /// last modified. + /// + /// + /// + /// + /// The DotNetZip library sets the LastModified value for an entry, equal to + /// the Last Modified time of the file in the filesystem. If an entry is + /// added from a stream, the library uses System.DateTime.Now for this + /// value, for the given entry. + /// + /// + /// + /// This property allows the application to retrieve and possibly set the + /// LastModified value on an entry, to an arbitrary value. values with a + /// setting of DateTimeKind.Unspecified are taken to be expressed as + /// DateTimeKind.Local. + /// + /// + /// + /// Be aware that because of the way PKWare's + /// Zip specification describes how times are stored in the zip file, + /// the full precision of the System.DateTime datatype is not stored + /// for the last modified time when saving zip files. For more information on + /// how times are formatted, see the PKZip specification. + /// + /// + /// + /// The actual last modified time of a file can be stored in multiple ways in + /// the zip file, and they are not mutually exclusive: + /// + /// + /// + /// + /// In the so-called "DOS" format, which has a 2-second precision. Values + /// are rounded to the nearest even second. For example, if the time on the + /// file is 12:34:43, then it will be stored as 12:34:44. This first value + /// is accessible via the LastModified property. This value is always + /// present in the metadata for each zip entry. In some cases the value is + /// invalid, or zero. + /// + /// + /// + /// In the so-called "Windows" or "NTFS" format, as an 8-byte integer + /// quantity expressed as the number of 1/10 milliseconds (in other words + /// the number of 100 nanosecond units) since January 1, 1601 (UTC). This + /// format is how Windows represents file times. This time is accessible + /// via the ModifiedTime property. + /// + /// + /// + /// In the "Unix" format, a 4-byte quantity specifying the number of seconds since + /// January 1, 1970 UTC. + /// + /// + /// + /// In an older format, now deprecated but still used by some current + /// tools. This format is also a 4-byte quantity specifying the number of + /// seconds since January 1, 1970 UTC. + /// + /// + /// + /// + /// + /// Zip tools and libraries will always at least handle (read or write) the + /// DOS time, and may also handle the other time formats. Keep in mind that + /// while the names refer to particular operating systems, there is nothing in + /// the time formats themselves that prevents their use on other operating + /// systems. + /// + /// + /// + /// When reading ZIP files, the DotNetZip library reads the Windows-formatted + /// time, if it is stored in the entry, and sets both LastModified and + /// ModifiedTime to that value. When writing ZIP files, the DotNetZip + /// library by default will write both time quantities. It can also emit the + /// Unix-formatted time if desired (See .) + /// + /// + /// + /// The last modified time of the file created upon a call to + /// ZipEntry.Extract() may be adjusted during extraction to compensate + /// for differences in how the .NET Base Class Library deals with daylight + /// saving time (DST) versus how the Windows filesystem deals with daylight + /// saving time. Raymond Chen provides + /// some good context. + /// + /// + /// + /// In a nutshell: Daylight savings time rules change regularly. In 2007, for + /// example, the inception week of DST changed. In 1977, DST was in place all + /// year round. In 1945, likewise. And so on. Win32 does not attempt to + /// guess which time zone rules were in effect at the time in question. It + /// will render a time as "standard time" and allow the app to change to DST + /// as necessary. .NET makes a different choice. + /// + /// + /// + /// Compare the output of FileInfo.LastWriteTime.ToString("f") with what you + /// see in the Windows Explorer property sheet for a file that was last + /// written to on the other side of the DST transition. For example, suppose + /// the file was last modified on October 17, 2003, during DST but DST is not + /// currently in effect. Explorer's file properties reports Thursday, October + /// 17, 2003, 8:45:38 AM, but .NETs FileInfo reports Thursday, October 17, + /// 2003, 9:45 AM. + /// + /// + /// + /// Win32 says, "Thursday, October 17, 2002 8:45:38 AM PST". Note: Pacific + /// STANDARD Time. Even though October 17 of that year occurred during Pacific + /// Daylight Time, Win32 displays the time as standard time because that's + /// what time it is NOW. + /// + /// + /// + /// .NET BCL assumes that the current DST rules were in place at the time in + /// question. So, .NET says, "Well, if the rules in effect now were also in + /// effect on October 17, 2003, then that would be daylight time" so it + /// displays "Thursday, October 17, 2003, 9:45 AM PDT" - daylight time. + /// + /// + /// + /// So .NET gives a value which is more intuitively correct, but is also + /// potentially incorrect, and which is not invertible. Win32 gives a value + /// which is intuitively incorrect, but is strictly correct. + /// + /// + /// + /// Because of this funkiness, this library adds one hour to the LastModified + /// time on the extracted file, if necessary. That is to say, if the time in + /// question had occurred in what the .NET Base Class Library assumed to be + /// DST. This assumption may be wrong given the constantly changing DST rules, + /// but it is the best we can do. + /// + /// + /// + /// + public DateTime LastModified + { + get { return _LastModified.ToLocalTime(); } + set + { + _LastModified = (value.Kind == DateTimeKind.Unspecified) + ? DateTime.SpecifyKind(value, DateTimeKind.Local) + : value.ToLocalTime(); + _Mtime = Ionic.Zip.SharedUtilities.AdjustTime_Reverse(_LastModified).ToUniversalTime(); + _metadataChanged = true; + } + } + + + private int BufferSize + { + get + { + return this._container.BufferSize; + } + } + + /// + /// Last Modified time for the file represented by the entry. + /// + /// + /// + /// + /// + /// This value corresponds to the "last modified" time in the NTFS file times + /// as described in the Zip + /// specification. When getting this property, the value may be + /// different from . When setting the property, + /// the property also gets set, but with a lower + /// precision. + /// + /// + /// + /// Let me explain. It's going to take a while, so get + /// comfortable. Originally, waaaaay back in 1989 when the ZIP specification + /// was originally described by the esteemed Mr. Phil Katz, the dominant + /// operating system of the time was MS-DOS. MSDOS stored file times with a + /// 2-second precision, because, c'mon, who is ever going to need better + /// resolution than THAT? And so ZIP files, regardless of the platform on + /// which the zip file was created, store file times in exactly the same format that DOS used + /// in 1989. + /// + /// + /// + /// Since then, the ZIP spec has evolved, but the internal format for file + /// timestamps remains the same. Despite the fact that the way times are + /// stored in a zip file is rooted in DOS heritage, any program on any + /// operating system can format a time in this way, and most zip tools and + /// libraries DO - they round file times to the nearest even second and store + /// it just like DOS did 25+ years ago. + /// + /// + /// + /// PKWare extended the ZIP specification to allow a zip file to store what + /// are called "NTFS Times" and "Unix(tm) times" for a file. These are the + /// last write, last access, and file creation + /// times of a particular file. These metadata are not actually specific + /// to NTFS or Unix. They are tracked for each file by NTFS and by various + /// Unix filesystems, but they are also tracked by other filesystems, too. + /// The key point is that the times are formatted in the zip file + /// in the same way that NTFS formats the time (ticks since win32 epoch), + /// or in the same way that Unix formats the time (seconds since Unix + /// epoch). As with the DOS time, any tool or library running on any + /// operating system is capable of formatting a time in one of these ways + /// and embedding it into the zip file. + /// + /// + /// + /// These extended times are higher precision quantities than the DOS time. + /// As described above, the (DOS) LastModified has a precision of 2 seconds. + /// The Unix time is stored with a precision of 1 second. The NTFS time is + /// stored with a precision of 0.0000001 seconds. The quantities are easily + /// convertible, except for the loss of precision you may incur. + /// + /// + /// + /// A zip archive can store the {C,A,M} times in NTFS format, in Unix format, + /// or not at all. Often a tool running on Unix or Mac will embed the times + /// in Unix format (1 second precision), while WinZip running on Windows might + /// embed the times in NTFS format (precision of of 0.0000001 seconds). When + /// reading a zip file with these "extended" times, in either format, + /// DotNetZip represents the values with the + /// ModifiedTime, AccessedTime and CreationTime + /// properties on the ZipEntry. + /// + /// + /// + /// While any zip application or library, regardless of the platform it + /// runs on, could use any of the time formats allowed by the ZIP + /// specification, not all zip tools or libraries do support all these + /// formats. Storing the higher-precision times for each entry is + /// optional for zip files, and many tools and libraries don't use the + /// higher precision quantities at all. The old DOS time, represented by + /// , is guaranteed to be present, though it + /// sometimes unset. + /// + /// + /// + /// Ok, getting back to the question about how the LastModified + /// property relates to this ModifiedTime + /// property... LastModified is always set, while + /// ModifiedTime is not. (The other times stored in the NTFS + /// times extension, CreationTime and AccessedTime also + /// may not be set on an entry that is read from an existing zip file.) + /// When reading a zip file, then LastModified takes the DOS time + /// that is stored with the file. If the DOS time has been stored as zero + /// in the zipfile, then this library will use DateTime.Now for the + /// LastModified value. If the ZIP file was created by an evolved + /// tool, then there will also be higher precision NTFS or Unix times in + /// the zip file. In that case, this library will read those times, and + /// set LastModified and ModifiedTime to the same value, the + /// one corresponding to the last write time of the file. If there are no + /// higher precision times stored for the entry, then ModifiedTime + /// remains unset (likewise AccessedTime and CreationTime), + /// and LastModified keeps its DOS time. + /// + /// + /// + /// When creating zip files with this library, by default the extended time + /// properties (ModifiedTime, AccessedTime, and + /// CreationTime) are set on the ZipEntry instance, and these data are + /// stored in the zip archive for each entry, in NTFS format. If you add an + /// entry from an actual filesystem file, then the entry gets the actual file + /// times for that file, to NTFS-level precision. If you add an entry from a + /// stream, or a string, then the times get the value DateTime.Now. In + /// this case LastModified and ModifiedTime will be identical, + /// to 2 seconds of precision. You can explicitly set the + /// CreationTime, AccessedTime, and ModifiedTime of an + /// entry using the property setters. If you want to set all of those + /// quantities, it's more efficient to use the method. Those + /// changes are not made permanent in the zip file until you call or one of its cousins. + /// + /// + /// + /// When creating a zip file, you can override the default behavior of + /// this library for formatting times in the zip file, disabling the + /// embedding of file times in NTFS format or enabling the storage of file + /// times in Unix format, or both. You may want to do this, for example, + /// when creating a zip file on Windows, that will be consumed on a Mac, + /// by an application that is not hip to the "NTFS times" format. To do + /// this, use the and + /// properties. A valid zip + /// file may store the file times in both formats. But, there are no + /// guarantees that a program running on Mac or Linux will gracefully + /// handle the NTFS-formatted times when Unix times are present, or that a + /// non-DotNetZip-powered application running on Windows will be able to + /// handle file times in Unix format. DotNetZip will always do something + /// reasonable; other libraries or tools may not. When in doubt, test. + /// + /// + /// + /// I'll bet you didn't think one person could type so much about time, eh? + /// And reading it was so enjoyable, too! Well, in appreciation, maybe you + /// should donate? + /// + /// + /// + /// + /// + /// + /// + public DateTime ModifiedTime + { + get { return _Mtime; } + set + { + SetEntryTimes(_Ctime, _Atime, value); + } + } + + /// + /// Last Access time for the file represented by the entry. + /// + /// + /// This value may or may not be meaningful. If the ZipEntry was read from an existing + /// Zip archive, this information may not be available. For an explanation of why, see + /// . + /// + /// + /// + /// + public DateTime AccessedTime + { + get { return _Atime; } + set + { + SetEntryTimes(_Ctime, value, _Mtime); + } + } + + /// + /// The file creation time for the file represented by the entry. + /// + /// + /// + /// This value may or may not be meaningful. If the ZipEntry was read + /// from an existing zip archive, and the creation time was not set on the entry + /// when the zip file was created, then this property may be meaningless. For an + /// explanation of why, see . + /// + /// + /// + /// + public DateTime CreationTime + { + get { return _Ctime; } + set + { + SetEntryTimes(value, _Atime, _Mtime); + } + } + + /// + /// Sets the NTFS Creation, Access, and Modified times for the given entry. + /// + /// + /// + /// + /// When adding an entry from a file or directory, the Creation, Access, and + /// Modified times for the given entry are automatically set from the + /// filesystem values. When adding an entry from a stream or string, the + /// values are implicitly set to DateTime.Now. The application may wish to + /// set these values to some arbitrary value, before saving the archive, and + /// can do so using the various setters. If you want to set all of the times, + /// this method is more efficient. + /// + /// + /// + /// The values you set here will be retrievable with the , and properties. + /// + /// + /// + /// When this method is called, if both and are false, then the + /// EmitTimesInWindowsFormatWhenSaving flag is automatically set. + /// + /// + /// + /// DateTime values provided here without a DateTimeKind are assumed to be Local Time. + /// + /// + /// + /// the creation time of the entry. + /// the last access time of the entry. + /// the last modified time of the entry. + /// + /// + /// + /// + /// + /// + public void SetEntryTimes(DateTime created, DateTime accessed, DateTime modified) + { + _ntfsTimesAreSet = true; + if (created == _zeroHour && created.Kind == _zeroHour.Kind) created = _win32Epoch; + if (accessed == _zeroHour && accessed.Kind == _zeroHour.Kind) accessed = _win32Epoch; + if (modified == _zeroHour && modified.Kind == _zeroHour.Kind) modified = _win32Epoch; + _Ctime = created.ToUniversalTime(); + _Atime = accessed.ToUniversalTime(); + _Mtime = modified.ToUniversalTime(); + _LastModified = _Mtime; + if (!_emitUnixTimes && !_emitNtfsTimes) + _emitNtfsTimes = true; + _metadataChanged = true; + } + + + + /// + /// Specifies whether the Creation, Access, and Modified times for the given + /// entry will be emitted in "Windows format" when the zip archive is saved. + /// + /// + /// + /// + /// An application creating a zip archive can use this flag to explicitly + /// specify that the file times for the entry should or should not be stored + /// in the zip archive in the format used by Windows. The default value of + /// this property is true. + /// + /// + /// + /// When adding an entry from a file or directory, the Creation (), Access (), and Modified + /// () times for the given entry are automatically + /// set from the filesystem values. When adding an entry from a stream or + /// string, all three values are implicitly set to DateTime.Now. Applications + /// can also explicitly set those times by calling . + /// + /// + /// + /// PKWARE's + /// zip specification describes multiple ways to format these times in a + /// zip file. One is the format Windows applications normally use: 100ns ticks + /// since Jan 1, 1601 UTC. The other is a format Unix applications typically + /// use: seconds since January 1, 1970 UTC. Each format can be stored in an + /// "extra field" in the zip entry when saving the zip archive. The former + /// uses an extra field with a Header Id of 0x000A, while the latter uses a + /// header ID of 0x5455. + /// + /// + /// + /// Not all zip tools and libraries can interpret these fields. Windows + /// compressed folders is one that can read the Windows Format timestamps, + /// while I believe the Infozip + /// tools can read the Unix format timestamps. Although the time values are + /// easily convertible, subject to a loss of precision, some tools and + /// libraries may be able to read only one or the other. DotNetZip can read or + /// write times in either or both formats. + /// + /// + /// + /// The times stored are taken from , , and . + /// + /// + /// + /// This property is not mutually exclusive from the property. It is + /// possible that a zip entry can embed the timestamps in both forms, one + /// form, or neither. But, there are no guarantees that a program running on + /// Mac or Linux will gracefully handle NTFS Formatted times, or that a + /// non-DotNetZip-powered application running on Windows will be able to + /// handle file times in Unix format. When in doubt, test. + /// + /// + /// + /// Normally you will use the ZipFile.EmitTimesInWindowsFormatWhenSaving + /// property, to specify the behavior for all entries in a zip, rather than + /// the property on each individual entry. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public bool EmitTimesInWindowsFormatWhenSaving + { + get + { + return _emitNtfsTimes; + } + set + { + _emitNtfsTimes = value; + _metadataChanged = true; + } + } + + /// + /// Specifies whether the Creation, Access, and Modified times for the given + /// entry will be emitted in "Unix(tm) format" when the zip archive is saved. + /// + /// + /// + /// + /// An application creating a zip archive can use this flag to explicitly + /// specify that the file times for the entry should or should not be stored + /// in the zip archive in the format used by Unix. By default this flag is + /// false, meaning the Unix-format times are not stored in the zip + /// archive. + /// + /// + /// + /// When adding an entry from a file or directory, the Creation (), Access (), and Modified + /// () times for the given entry are automatically + /// set from the filesystem values. When adding an entry from a stream or + /// string, all three values are implicitly set to DateTime.Now. Applications + /// can also explicitly set those times by calling . + /// + /// + /// + /// PKWARE's + /// zip specification describes multiple ways to format these times in a + /// zip file. One is the format Windows applications normally use: 100ns ticks + /// since Jan 1, 1601 UTC. The other is a format Unix applications typically + /// use: seconds since Jan 1, 1970 UTC. Each format can be stored in an + /// "extra field" in the zip entry when saving the zip archive. The former + /// uses an extra field with a Header Id of 0x000A, while the latter uses a + /// header ID of 0x5455. + /// + /// + /// + /// Not all tools and libraries can interpret these fields. Windows + /// compressed folders is one that can read the Windows Format timestamps, + /// while I believe the Infozip + /// tools can read the Unix format timestamps. Although the time values are + /// easily convertible, subject to a loss of precision, some tools and + /// libraries may be able to read only one or the other. DotNetZip can read or + /// write times in either or both formats. + /// + /// + /// + /// The times stored are taken from , , and . + /// + /// + /// + /// This property is not mutually exclusive from the property. It is + /// possible that a zip entry can embed the timestamps in both forms, one + /// form, or neither. But, there are no guarantees that a program running on + /// Mac or Linux will gracefully handle NTFS Formatted times, or that a + /// non-DotNetZip-powered application running on Windows will be able to + /// handle file times in Unix format. When in doubt, test. + /// + /// + /// + /// Normally you will use the ZipFile.EmitTimesInUnixFormatWhenSaving + /// property, to specify the behavior for all entries, rather than the + /// property on each individual entry. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public bool EmitTimesInUnixFormatWhenSaving + { + get + { + return _emitUnixTimes; + } + set + { + _emitUnixTimes = value; + _metadataChanged = true; + } + } + + + /// + /// The type of timestamp attached to the ZipEntry. + /// + /// + /// + /// This property is valid only for a ZipEntry that was read from a zip archive. + /// It indicates the type of timestamp attached to the entry. + /// + /// + /// + /// + public ZipEntryTimestamp Timestamp + { + get + { + return _timestamp; + } + } + + /// + /// The file attributes for the entry. + /// + /// + /// + /// + /// + /// The attributes in NTFS include + /// ReadOnly, Archive, Hidden, System, and Indexed. When adding a + /// ZipEntry to a ZipFile, these attributes are set implicitly when + /// adding an entry from the filesystem. When adding an entry from a stream + /// or string, the Attributes are not set implicitly. Regardless of the way + /// an entry was added to a ZipFile, you can set the attributes + /// explicitly if you like. + /// + /// + /// + /// When reading a ZipEntry from a ZipFile, the attributes are + /// set according to the data stored in the ZipFile. If you extract the + /// entry from the archive to a filesystem file, DotNetZip will set the + /// attributes on the resulting file accordingly. + /// + /// + /// + /// The attributes can be set explicitly by the application. For example the + /// application may wish to set the FileAttributes.ReadOnly bit for all + /// entries added to an archive, so that on unpack, this attribute will be set + /// on the extracted file. Any changes you make to this property are made + /// permanent only when you call a Save() method on the ZipFile + /// instance that contains the ZipEntry. + /// + /// + /// + /// For example, an application may wish to zip up a directory and set the + /// ReadOnly bit on every file in the archive, so that upon later extraction, + /// the resulting files will be marked as ReadOnly. Not every extraction tool + /// respects these attributes, but if you unpack with DotNetZip, as for + /// example in a self-extracting archive, then the attributes will be set as + /// they are stored in the ZipFile. + /// + /// + /// + /// These attributes may not be interesting or useful if the resulting archive + /// is extracted on a non-Windows platform. How these attributes get used + /// upon extraction depends on the platform and tool used. + /// + /// + /// + /// This property is only partially supported in the Silverlight version + /// of the library: applications can read attributes on entries within + /// ZipFiles. But extracting entries within Silverlight will not set the + /// attributes on the extracted files. + /// + /// + /// + public System.IO.FileAttributes Attributes + { + // workitem 7071 + get { return (System.IO.FileAttributes)_ExternalFileAttrs; } + set + { + _ExternalFileAttrs = (int)value; + // Since the application is explicitly setting the attributes, overwriting + // whatever was there, we will explicitly set the Version made by field. + // workitem 7926 - "version made by" OS should be zero for compat with WinZip + _VersionMadeBy = (0 << 8) + 45; // v4.5 of the spec + _metadataChanged = true; + } + } + + + /// + /// The name of the filesystem file, referred to by the ZipEntry. + /// + /// + /// + /// + /// This property specifies the thing-to-be-zipped on disk, and is set only + /// when the ZipEntry is being created from a filesystem file. If the + /// ZipFile is instantiated by reading an existing .zip archive, then + /// the LocalFileName will be null (Nothing in VB). + /// + /// + /// + /// When it is set, the value of this property may be different than , which is the path used in the archive itself. If you + /// call Zip.AddFile("foop.txt", AlternativeDirectory), then the path + /// used for the ZipEntry within the zip archive will be different + /// than this path. + /// + /// + /// + /// If the entry is being added from a stream, then this is null (Nothing in VB). + /// + /// + /// + /// + internal string LocalFileName + { + get { return _LocalFileName; } + } + + /// + /// The name of the file contained in the ZipEntry. + /// + /// + /// + /// + /// + /// This is the name of the entry in the ZipFile itself. When creating + /// a zip archive, if the ZipEntry has been created from a filesystem + /// file, via a call to or , or a related overload, the value + /// of this property is derived from the name of that file. The + /// FileName property does not include drive letters, and may include a + /// different directory path, depending on the value of the + /// directoryPathInArchive parameter used when adding the entry into + /// the ZipFile. + /// + /// + /// + /// In some cases there is no related filesystem file - for example when a + /// ZipEntry is created using or one of the similar overloads. In this case, the value of + /// this property is derived from the fileName and the directory path passed + /// to that method. + /// + /// + /// + /// When reading a zip file, this property takes the value of the entry name + /// as stored in the zip file. If you extract such an entry, the extracted + /// file will take the name given by this property. + /// + /// + /// + /// Applications can set this property when creating new zip archives or when + /// reading existing archives. When setting this property, the actual value + /// that is set will replace backslashes with forward slashes, in accordance + /// with the Zip + /// specification, for compatibility with Unix(tm) and ... get + /// this.... Amiga! + /// + /// + /// + /// If an application reads a ZipFile via or a related overload, and then explicitly + /// sets the FileName on an entry contained within the ZipFile, and + /// then calls , the application will effectively + /// rename the entry within the zip archive. + /// + /// + /// + /// If an application sets the value of FileName, then calls + /// Extract() on the entry, the entry is extracted to a file using the + /// newly set value as the filename. The FileName value is made + /// permanent in the zip archive only after a call to one of the + /// ZipFile.Save() methods on the ZipFile that contains the + /// ZipEntry. + /// + /// + /// + /// If an application attempts to set the FileName to a value that + /// would result in a duplicate entry in the ZipFile, an exception is + /// thrown. + /// + /// + /// + /// When a ZipEntry is contained within a ZipFile, applications + /// cannot rename the entry within the context of a foreach (For + /// Each in VB) loop, because of the way the ZipFile stores + /// entries. If you need to enumerate through all the entries and rename one + /// or more of them, use ZipFile.EntriesSorted as the + /// collection. See also, ZipFile.GetEnumerator(). + /// + /// + /// + public string FileName + { + get { return _FileNameInArchive; } + set + { + if (_container.ZipFile == null) + throw new ZipException("Cannot rename; this is not supported in ZipOutputStream/ZipInputStream."); + + // rename the entry! + if (String.IsNullOrEmpty(value)) throw new ZipException("The FileName must be non empty and non-null."); + + var filename = ZipEntry.NameInArchive(value, null); + // workitem 8180 + if (_FileNameInArchive == filename) return; // nothing to do + + // workitem 8047 - when renaming, must remove old and then add a new entry + this._container.ZipFile.RemoveEntry(this); + this._container.ZipFile.InternalAddEntry(filename, this); + + _FileNameInArchive = filename; + _container.ZipFile.NotifyEntryChanged(); + _metadataChanged = true; + } + } + + + /// + /// The stream that provides content for the ZipEntry. + /// + /// + /// + /// + /// + /// The application can use this property to set the input stream for an + /// entry on a just-in-time basis. Imagine a scenario where the application + /// creates a ZipFile comprised of content obtained from hundreds of + /// files, via calls to AddFile(). The DotNetZip library opens streams + /// on these files on a just-in-time basis, only when writing the entry out to + /// an external store within the scope of a ZipFile.Save() call. Only + /// one input stream is opened at a time, as each entry is being written out. + /// + /// + /// + /// Now imagine a different application that creates a ZipFile + /// with content obtained from hundreds of streams, added through . Normally the + /// application would supply an open stream to that call. But when large + /// numbers of streams are being added, this can mean many open streams at one + /// time, unnecessarily. + /// + /// + /// + /// To avoid this, call and specify delegates that open and close the stream at + /// the time of Save. + /// + /// + /// + /// + /// Setting the value of this property when the entry was not added from a + /// stream (for example, when the ZipEntry was added with or , or when the entry was added by + /// reading an existing zip archive) will throw an exception. + /// + /// + /// + /// + public Stream InputStream + { + get { return _sourceStream; } + + set + { + if (this._Source != ZipEntrySource.Stream) + throw new ZipException("You must not set the input stream for this entry."); + + _sourceWasJitProvided = true; + _sourceStream = value; + } + } + + + /// + /// A flag indicating whether the InputStream was provided Just-in-time. + /// + /// + /// + /// + /// + /// When creating a zip archive, an application can obtain content for one or + /// more of the ZipEntry instances from streams, using the method. At the time + /// of calling that method, the application can supply null as the value of + /// the stream parameter. By doing so, the application indicates to the + /// library that it will provide a stream for the entry on a just-in-time + /// basis, at the time one of the ZipFile.Save() methods is called and + /// the data for the various entries are being compressed and written out. + /// + /// + /// + /// In this case, the application can set the + /// property, typically within the SaveProgress event (event type: ) for that entry. + /// + /// + /// + /// The application will later want to call Close() and Dispose() on that + /// stream. In the SaveProgress event, when the event type is , the application can + /// do so. This flag indicates that the stream has been provided by the + /// application on a just-in-time basis and that it is the application's + /// responsibility to call Close/Dispose on that stream. + /// + /// + /// + /// + public bool InputStreamWasJitProvided + { + get { return _sourceWasJitProvided; } + } + + + + /// + /// An enum indicating the source of the ZipEntry. + /// + public ZipEntrySource Source + { + get { return _Source; } + } + + + /// + /// The version of the zip engine needed to read the ZipEntry. + /// + /// + /// + /// + /// This is a readonly property, indicating the version of the Zip + /// specification that the extracting tool or library must support to + /// extract the given entry. Generally higher versions indicate newer + /// features. Older zip engines obviously won't know about new features, and + /// won't be able to extract entries that depend on those newer features. + /// + /// + /// + /// + /// value + /// Features + /// + /// + /// + /// 20 + /// a basic Zip Entry, potentially using PKZIP encryption. + /// + /// + /// + /// + /// 45 + /// The ZIP64 extension is used on the entry. + /// + /// + /// + /// + /// 46 + /// File is compressed using BZIP2 compression* + /// + /// + /// + /// 50 + /// File is encrypted using PkWare's DES, 3DES, (broken) RC2 or RC4 + /// + /// + /// + /// 51 + /// File is encrypted using PKWare's AES encryption or corrected RC2 encryption. + /// + /// + /// + /// 52 + /// File is encrypted using corrected RC2-64 encryption** + /// + /// + /// + /// 61 + /// File is encrypted using non-OAEP key wrapping*** + /// + /// + /// + /// 63 + /// File is compressed using LZMA, PPMd+, Blowfish, or Twofish + /// + /// + /// + /// + /// + /// There are other values possible, not listed here. DotNetZip supports + /// regular PKZip encryption, and ZIP64 extensions. DotNetZip cannot extract + /// entries that require a zip engine higher than 45. + /// + /// + /// + /// This value is set upon reading an existing zip file, or after saving a zip + /// archive. + /// + /// + public Int16 VersionNeeded + { + get { return _VersionNeeded; } + } + + /// + /// The comment attached to the ZipEntry. + /// + /// + /// + /// + /// Each entry in a zip file can optionally have a comment associated to + /// it. The comment might be displayed by a zip tool during extraction, for + /// example. + /// + /// + /// + /// By default, the Comment is encoded in IBM437 code page. You can + /// specify an alternative with and + /// . + /// + /// + /// + /// + public string Comment + { + get { return _Comment; } + set + { + _Comment = value; + _metadataChanged = true; + } + } + + + /// + /// Indicates whether the entry requires ZIP64 extensions. + /// + /// + /// + /// + /// + /// This property is null (Nothing in VB) until a Save() method on the + /// containing instance has been called. The property is + /// non-null (HasValue is true) only after a Save() method has + /// been called. + /// + /// + /// + /// After the containing ZipFile has been saved, the Value of this + /// property is true if any of the following three conditions holds: the + /// uncompressed size of the entry is larger than 0xFFFFFFFF; the compressed + /// size of the entry is larger than 0xFFFFFFFF; the relative offset of the + /// entry within the zip archive is larger than 0xFFFFFFFF. These quantities + /// are not known until a Save() is attempted on the zip archive and + /// the compression is applied. + /// + /// + /// + /// If none of the three conditions holds, then the Value is false. + /// + /// + /// + /// A Value of false does not indicate that the entry, as saved in the + /// zip archive, does not use ZIP64. It merely indicates that ZIP64 is + /// not required. An entry may use ZIP64 even when not required if + /// the property on the containing + /// ZipFile instance is set to , or if + /// the property on the containing + /// ZipFile instance is set to + /// and the output stream was not seekable. + /// + /// + /// + /// + public Nullable RequiresZip64 + { + get + { + return _entryRequiresZip64; + } + } + + /// + /// Indicates whether the entry actually used ZIP64 extensions, as it was most + /// recently written to the output file or stream. + /// + /// + /// + /// + /// + /// This Nullable property is null (Nothing in VB) until a Save() + /// method on the containing instance has been + /// called. HasValue is true only after a Save() method has been + /// called. + /// + /// + /// + /// The value of this property for a particular ZipEntry may change + /// over successive calls to Save() methods on the containing ZipFile, + /// even if the file that corresponds to the ZipEntry does not. This + /// may happen if other entries contained in the ZipFile expand, + /// causing the offset for this particular entry to exceed 0xFFFFFFFF. + /// + /// + /// + public Nullable OutputUsedZip64 + { + get { return _OutputUsesZip64; } + } + + + /// + /// The bitfield for the entry as defined in the zip spec. You probably + /// never need to look at this. + /// + /// + /// + /// + /// You probably do not need to concern yourself with the contents of this + /// property, but in case you do: + /// + /// + /// + /// + /// bit + /// meaning + /// + /// + /// + /// 0 + /// set if encryption is used. + /// + /// + /// + /// 1-2 + /// + /// set to determine whether normal, max, fast deflation. DotNetZip library + /// always leaves these bits unset when writing (indicating "normal" + /// deflation"), but can read an entry with any value here. + /// + /// + /// + /// + /// 3 + /// + /// Indicates that the Crc32, Compressed and Uncompressed sizes are zero in the + /// local header. This bit gets set on an entry during writing a zip file, when + /// it is saved to a non-seekable output stream. + /// + /// + /// + /// + /// + /// 4 + /// reserved for "enhanced deflating". This library doesn't do enhanced deflating. + /// + /// + /// + /// 5 + /// set to indicate the zip is compressed patched data. This library doesn't do that. + /// + /// + /// + /// 6 + /// + /// set if PKWare's strong encryption is used (must also set bit 1 if bit 6 is + /// set). This bit is not set if WinZip's AES encryption is set. + /// + /// + /// + /// 7 + /// not used + /// + /// + /// + /// 8 + /// not used + /// + /// + /// + /// 9 + /// not used + /// + /// + /// + /// 10 + /// not used + /// + /// + /// + /// 11 + /// + /// Language encoding flag (EFS). If this bit is set, the filename and comment + /// fields for this file must be encoded using UTF-8. This library currently + /// does not support UTF-8. + /// + /// + /// + /// + /// 12 + /// Reserved by PKWARE for enhanced compression. + /// + /// + /// + /// 13 + /// + /// Used when encrypting the Central Directory to indicate selected data + /// values in the Local Header are masked to hide their actual values. See + /// the section in the Zip + /// specification describing the Strong Encryption Specification for + /// details. + /// + /// + /// + /// + /// 14 + /// Reserved by PKWARE. + /// + /// + /// + /// 15 + /// Reserved by PKWARE. + /// + /// + /// + /// + /// + public Int16 BitField + { + get { return _BitField; } + } + + /// + /// The compression method employed for this ZipEntry. + /// + /// + /// + /// + /// + /// The + /// Zip specification allows a variety of compression methods. This + /// library supports just two: 0x08 = Deflate. 0x00 = Store (no compression), + /// for reading or writing. + /// + /// + /// + /// When reading an entry from an existing zipfile, the value you retrieve + /// here indicates the compression method used on the entry by the original + /// creator of the zip. When writing a zipfile, you can specify either 0x08 + /// (Deflate) or 0x00 (None). If you try setting something else, you will get + /// an exception. + /// + /// + /// + /// You may wish to set CompressionMethod to CompressionMethod.None (0) + /// when zipping already-compressed data like a jpg, png, or mp3 file. + /// This can save time and cpu cycles. + /// + /// + /// + /// When setting this property on a ZipEntry that is read from an + /// existing zip file, calling ZipFile.Save() will cause the new + /// CompressionMethod to be used on the entry in the newly saved zip file. + /// + /// + /// + /// Setting this property may have the side effect of modifying the + /// CompressionLevel property. If you set the CompressionMethod to a + /// value other than None, and CompressionLevel is previously + /// set to None, then CompressionLevel will be set to + /// Default. + /// + /// + /// + /// + /// + /// + /// In this example, the first entry added to the zip archive uses the default + /// behavior - compression is used where it makes sense. The second entry, + /// the MP3 file, is added to the archive without being compressed. + /// + /// using (ZipFile zip = new ZipFile(ZipFileToCreate)) + /// { + /// ZipEntry e1= zip.AddFile(@"notes\Readme.txt"); + /// ZipEntry e2= zip.AddFile(@"music\StopThisTrain.mp3"); + /// e2.CompressionMethod = CompressionMethod.None; + /// zip.Save(); + /// } + /// + /// + /// + /// Using zip As New ZipFile(ZipFileToCreate) + /// zip.AddFile("notes\Readme.txt") + /// Dim e2 as ZipEntry = zip.AddFile("music\StopThisTrain.mp3") + /// e2.CompressionMethod = CompressionMethod.None + /// zip.Save + /// End Using + /// + /// + public CompressionMethod CompressionMethod + { + get { return (CompressionMethod)_CompressionMethod; } + set + { + if (value == (CompressionMethod)_CompressionMethod) return; // nothing to do. + + if (value != CompressionMethod.None && value != CompressionMethod.Deflate +#if BZIP + && value != CompressionMethod.BZip2 +#endif + ) + throw new InvalidOperationException("Unsupported compression method."); + + // If the source is a zip archive and there was encryption on the + // entry, changing the compression method is not supported. + // if (this._Source == ZipEntrySource.ZipFile && _sourceIsEncrypted) + // throw new InvalidOperationException("Cannot change compression method on encrypted entries read from archives."); + + _CompressionMethod = (Int16)value; + + if (_CompressionMethod == (Int16)Ionic.Zip.CompressionMethod.None) + _CompressionLevel = Ionic.Zlib.CompressionLevel.None; + else if (CompressionLevel == Ionic.Zlib.CompressionLevel.None) + _CompressionLevel = Ionic.Zlib.CompressionLevel.Default; + + if (_container.ZipFile != null) _container.ZipFile.NotifyEntryChanged(); + _restreamRequiredOnSave = true; + } + } + + + /// + /// Sets the compression level to be used for the entry when saving the zip + /// archive. This applies only for CompressionMethod = DEFLATE. + /// + /// + /// + /// + /// When using the DEFLATE compression method, Varying the compression + /// level used on entries can affect the size-vs-speed tradeoff when + /// compression and decompressing data streams or files. + /// + /// + /// + /// If you do not set this property, the default compression level is used, + /// which normally gives a good balance of compression efficiency and + /// compression speed. In some tests, using BestCompression can + /// double the time it takes to compress, while delivering just a small + /// increase in compression efficiency. This behavior will vary with the + /// type of data you compress. If you are in doubt, just leave this setting + /// alone, and accept the default. + /// + /// + /// + /// When setting this property on a ZipEntry that is read from an + /// existing zip file, calling ZipFile.Save() will cause the new + /// CompressionLevel to be used on the entry in the newly saved zip file. + /// + /// + /// + /// Setting this property may have the side effect of modifying the + /// CompressionMethod property. If you set the CompressionLevel + /// to a value other than None, CompressionMethod will be set + /// to Deflate, if it was previously None. + /// + /// + /// + /// Setting this property has no effect if the CompressionMethod is something + /// other than Deflate or None. + /// + /// + /// + /// + public Ionic.Zlib.CompressionLevel CompressionLevel + { + get + { + return _CompressionLevel; + } + set + { + if (_CompressionMethod != (short)CompressionMethod.Deflate && + _CompressionMethod != (short)CompressionMethod.None) + return ; // no effect + + if (value == Ionic.Zlib.CompressionLevel.Default && + _CompressionMethod == (short)CompressionMethod.Deflate) return; // nothing to do + _CompressionLevel = value; + + if (value == Ionic.Zlib.CompressionLevel.None && + _CompressionMethod == (short)CompressionMethod.None) + return; // nothing more to do + + if (_CompressionLevel == Ionic.Zlib.CompressionLevel.None) + _CompressionMethod = (short) Ionic.Zip.CompressionMethod.None; + else + _CompressionMethod = (short) Ionic.Zip.CompressionMethod.Deflate; + + if (_container.ZipFile != null) _container.ZipFile.NotifyEntryChanged(); + _restreamRequiredOnSave = true; + } + } + + + + /// + /// The compressed size of the file, in bytes, within the zip archive. + /// + /// + /// + /// When reading a ZipFile, this value is read in from the existing + /// zip file. When creating or updating a ZipFile, the compressed + /// size is computed during compression. Therefore the value on a + /// ZipEntry is valid after a call to Save() (or one of its + /// overloads) in that case. + /// + /// + /// + public Int64 CompressedSize + { + get { return _CompressedSize; } + } + + /// + /// The size of the file, in bytes, before compression, or after extraction. + /// + /// + /// + /// When reading a ZipFile, this value is read in from the existing + /// zip file. When creating or updating a ZipFile, the uncompressed + /// size is computed during compression. Therefore the value on a + /// ZipEntry is valid after a call to Save() (or one of its + /// overloads) in that case. + /// + /// + /// + public Int64 UncompressedSize + { + get { return _UncompressedSize; } + } + + /// + /// The ratio of compressed size to uncompressed size of the ZipEntry. + /// + /// + /// + /// + /// This is a ratio of the compressed size to the uncompressed size of the + /// entry, expressed as a double in the range of 0 to 100+. A value of 100 + /// indicates no compression at all. It could be higher than 100 when the + /// compression algorithm actually inflates the data, as may occur for small + /// files, or uncompressible data that is encrypted. + /// + /// + /// + /// You could format it for presentation to a user via a format string of + /// "{3,5:F0}%" to see it as a percentage. + /// + /// + /// + /// If the size of the original uncompressed file is 0, implying a + /// denominator of 0, the return value will be zero. + /// + /// + /// + /// This property is valid after reading in an existing zip file, or after + /// saving the ZipFile that contains the ZipEntry. You cannot know the + /// effect of a compression transform until you try it. + /// + /// + /// + public Double CompressionRatio + { + get + { + if (UncompressedSize == 0) return 0; + return 100 * (1.0 - (1.0 * CompressedSize) / (1.0 * UncompressedSize)); + } + } + + /// + /// The 32-bit CRC (Cyclic Redundancy Check) on the contents of the ZipEntry. + /// + /// + /// + /// + /// You probably don't need to concern yourself with this. It is used + /// internally by DotNetZip to verify files or streams upon extraction. + /// + /// The value is a 32-bit + /// CRC using 0xEDB88320 for the polynomial. This is the same CRC-32 used in + /// PNG, MPEG-2, and other protocols and formats. It is a read-only property; when + /// creating a Zip archive, the CRC for each entry is set only after a call to + /// Save() on the containing ZipFile. When reading an existing zip file, the value + /// of this property reflects the stored CRC for the entry. + /// + /// + public Int32 Crc + { + get { return _Crc32; } + } + + /// + /// True if the entry is a directory (not a file). + /// This is a readonly property on the entry. + /// + public bool IsDirectory + { + get { return _IsDirectory; } + } + + /// + /// A derived property that is true if the entry uses encryption. + /// + /// + /// + /// + /// This is a readonly property on the entry. When reading a zip file, + /// the value for the ZipEntry is determined by the data read + /// from the zip file. After saving a ZipFile, the value of this + /// property for each ZipEntry indicates whether encryption was + /// actually used (which will have been true if the was set and the property + /// was something other than . + /// + /// + public bool UsesEncryption + { + get { return (_Encryption_FromZipFile != EncryptionAlgorithm.None); } + } + + + /// + /// Set this to specify which encryption algorithm to use for the entry when + /// saving it to a zip archive. + /// + /// + /// + /// + /// + /// Set this property in order to encrypt the entry when the ZipFile is + /// saved. When setting this property, you must also set a on the entry. If you set a value other than on this property and do not set a + /// Password then the entry will not be encrypted. The ZipEntry + /// data is encrypted as the ZipFile is saved, when you call or one of its cousins on the containing + /// ZipFile instance. You do not need to specify the Encryption + /// when extracting entries from an archive. + /// + /// + /// + /// The Zip specification from PKWare defines a set of encryption algorithms, + /// and the data formats for the zip archive that support them, and PKWare + /// supports those algorithms in the tools it produces. Other vendors of tools + /// and libraries, such as WinZip or Xceed, typically support a + /// subset of the algorithms specified by PKWare. These tools can + /// sometimes support additional different encryption algorithms and data + /// formats, not specified by PKWare. The AES Encryption specified and + /// supported by WinZip is the most popular example. This library supports a + /// subset of the complete set of algorithms specified by PKWare and other + /// vendors. + /// + /// + /// + /// There is no common, ubiquitous multi-vendor standard for strong encryption + /// within zip files. There is broad support for so-called "traditional" Zip + /// encryption, sometimes called Zip 2.0 encryption, as specified + /// by PKWare, but this encryption is considered weak and + /// breakable. This library currently supports the Zip 2.0 "weak" encryption, + /// and also a stronger WinZip-compatible AES encryption, using either 128-bit + /// or 256-bit key strength. If you want DotNetZip to support an algorithm + /// that is not currently supported, call the author of this library and maybe + /// we can talk business. + /// + /// + /// + /// The class also has a property. In most cases you will use + /// that property when setting encryption. This property takes + /// precedence over any Encryption set on the ZipFile itself. + /// Typically, you would use the per-entry Encryption when most entries in the + /// zip archive use one encryption algorithm, and a few entries use a + /// different one. If all entries in the zip file use the same Encryption, + /// then it is simpler to just set this property on the ZipFile itself, when + /// creating a zip archive. + /// + /// + /// + /// Some comments on updating archives: If you read a ZipFile, you can + /// modify the Encryption on an encrypted entry: you can remove encryption + /// from an entry that was encrypted; you can encrypt an entry that was not + /// encrypted previously; or, you can change the encryption algorithm. The + /// changes in encryption are not made permanent until you call Save() on the + /// ZipFile. To effect changes in encryption, the entry content is + /// streamed through several transformations, depending on the modification + /// the application has requested. For example if the entry is not encrypted + /// and the application sets Encryption to PkzipWeak, then at + /// the time of Save(), the original entry is read and decompressed, + /// then re-compressed and encrypted. Conversely, if the original entry is + /// encrypted with PkzipWeak encryption, and the application sets the + /// Encryption property to WinZipAes128, then at the time of + /// Save(), the original entry is decrypted via PKZIP encryption and + /// decompressed, then re-compressed and re-encrypted with AES. This all + /// happens automatically within the library, but it can be time-consuming for + /// large entries. + /// + /// + /// + /// Additionally, when updating archives, it is not possible to change the + /// password when changing the encryption algorithm. To change both the + /// algorithm and the password, you need to Save() the zipfile twice. First + /// set the Encryption to None, then call Save(). Then set the + /// Encryption to the new value (not "None"), then call Save() + /// once again. + /// + /// + /// + /// The WinZip AES encryption algorithms are not supported on the .NET Compact + /// Framework. + /// + /// + /// + /// + /// + /// This example creates a zip archive that uses encryption, and then extracts + /// entries from the archive. When creating the zip archive, the ReadMe.txt + /// file is zipped without using a password or encryption. The other file + /// uses encryption. + /// + /// + /// // Create a zip archive with AES Encryption. + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddFile("ReadMe.txt") + /// ZipEntry e1= zip.AddFile("2008-Regional-Sales-Report.pdf"); + /// e1.Encryption= EncryptionAlgorithm.WinZipAes256; + /// e1.Password= "Top.Secret.No.Peeking!"; + /// zip.Save("EncryptedArchive.zip"); + /// } + /// + /// // Extract a zip archive that uses AES Encryption. + /// // You do not need to specify the algorithm during extraction. + /// using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + /// { + /// // Specify the password that is used during extraction, for + /// // all entries that require a password: + /// zip.Password= "Top.Secret.No.Peeking!"; + /// zip.ExtractAll("extractDirectory"); + /// } + /// + /// + /// + /// ' Create a zip that uses Encryption. + /// Using zip As New ZipFile() + /// zip.AddFile("ReadMe.txt") + /// Dim e1 as ZipEntry + /// e1= zip.AddFile("2008-Regional-Sales-Report.pdf") + /// e1.Encryption= EncryptionAlgorithm.WinZipAes256 + /// e1.Password= "Top.Secret.No.Peeking!" + /// zip.Save("EncryptedArchive.zip") + /// End Using + /// + /// ' Extract a zip archive that uses AES Encryption. + /// ' You do not need to specify the algorithm during extraction. + /// Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + /// ' Specify the password that is used during extraction, for + /// ' all entries that require a password: + /// zip.Password= "Top.Secret.No.Peeking!" + /// zip.ExtractAll("extractDirectory") + /// End Using + /// + /// + /// + /// + /// + /// Thrown in the setter if EncryptionAlgorithm.Unsupported is specified. + /// + /// + /// ZipEntry.Password + /// ZipFile.Encryption + public EncryptionAlgorithm Encryption + { + get + { + return _Encryption; + } + set + { + if (value == _Encryption) return; // no change + + if (value == EncryptionAlgorithm.Unsupported) + throw new InvalidOperationException("You may not set Encryption to that value."); + + // If the source is a zip archive and there was encryption + // on the entry, this will not work. + //if (this._Source == ZipEntrySource.ZipFile && _sourceIsEncrypted) + // throw new InvalidOperationException("You cannot change the encryption method on encrypted entries read from archives."); + + _Encryption = value; + _restreamRequiredOnSave = true; + if (_container.ZipFile!=null) + _container.ZipFile.NotifyEntryChanged(); + } + } + + + /// + /// The Password to be used when encrypting a ZipEntry upon + /// ZipFile.Save(), or when decrypting an entry upon Extract(). + /// + /// + /// + /// + /// This is a write-only property on the entry. Set this to request that the + /// entry be encrypted when writing the zip archive, or set it to specify the + /// password to be used when extracting an existing entry that is encrypted. + /// + /// + /// + /// The password set here is implicitly used to encrypt the entry during the + /// operation, or to decrypt during the or operation. If you set + /// the Password on a ZipEntry after calling Save(), there is no + /// effect. + /// + /// + /// + /// Consider setting the property when using a + /// password. Answering concerns that the standard password protection + /// supported by all zip tools is weak, WinZip has extended the ZIP + /// specification with a way to use AES Encryption to protect entries in the + /// Zip file. Unlike the "PKZIP 2.0" encryption specified in the PKZIP + /// specification, AES + /// Encryption uses a standard, strong, tested, encryption + /// algorithm. DotNetZip can create zip archives that use WinZip-compatible + /// AES encryption, if you set the property. But, + /// archives created that use AES encryption may not be readable by all other + /// tools and libraries. For example, Windows Explorer cannot read a + /// "compressed folder" (a zip file) that uses AES encryption, though it can + /// read a zip file that uses "PKZIP encryption." + /// + /// + /// + /// The class also has a + /// property. This property takes precedence over any password set on the + /// ZipFile itself. Typically, you would use the per-entry Password when most + /// entries in the zip archive use one password, and a few entries use a + /// different password. If all entries in the zip file use the same password, + /// then it is simpler to just set this property on the ZipFile itself, + /// whether creating a zip archive or extracting a zip archive. + /// + /// + /// + /// Some comments on updating archives: If you read a ZipFile, you + /// cannot modify the password on any encrypted entry, except by extracting + /// the entry with the original password (if any), removing the original entry + /// via , and then adding a new + /// entry with a new Password. + /// + /// + /// + /// For example, suppose you read a ZipFile, and there is an encrypted + /// entry. Setting the Password property on that ZipEntry and then + /// calling Save() on the ZipFile does not update the password + /// on that entry in the archive. Neither is an exception thrown. Instead, + /// what happens during the Save() is the existing entry is copied + /// through to the new zip archive, in its original encrypted form. Upon + /// re-reading that archive, the entry can be decrypted with its original + /// password. + /// + /// + /// + /// If you read a ZipFile, and there is an un-encrypted entry, you can set the + /// Password on the entry and then call Save() on the ZipFile, and get + /// encryption on that entry. + /// + /// + /// + /// + /// + /// + /// This example creates a zip file with two entries, and then extracts the + /// entries from the zip file. When creating the zip file, the two files are + /// added to the zip file using password protection. Each entry uses a + /// different password. During extraction, each file is extracted with the + /// appropriate password. + /// + /// + /// // create a file with encryption + /// using (ZipFile zip = new ZipFile()) + /// { + /// ZipEntry entry; + /// entry= zip.AddFile("Declaration.txt"); + /// entry.Password= "123456!"; + /// entry = zip.AddFile("Report.xls"); + /// entry.Password= "1Secret!"; + /// zip.Save("EncryptedArchive.zip"); + /// } + /// + /// // extract entries that use encryption + /// using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + /// { + /// ZipEntry entry; + /// entry = zip["Declaration.txt"]; + /// entry.Password = "123456!"; + /// entry.Extract("extractDir"); + /// entry = zip["Report.xls"]; + /// entry.Password = "1Secret!"; + /// entry.Extract("extractDir"); + /// } + /// + /// + /// + /// + /// Using zip As New ZipFile + /// Dim entry as ZipEntry + /// entry= zip.AddFile("Declaration.txt") + /// entry.Password= "123456!" + /// entry = zip.AddFile("Report.xls") + /// entry.Password= "1Secret!" + /// zip.Save("EncryptedArchive.zip") + /// End Using + /// + /// + /// ' extract entries that use encryption + /// Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + /// Dim entry as ZipEntry + /// entry = zip("Declaration.txt") + /// entry.Password = "123456!" + /// entry.Extract("extractDir") + /// entry = zip("Report.xls") + /// entry.Password = "1Secret!" + /// entry.Extract("extractDir") + /// End Using + /// + /// + /// + /// + /// + /// + /// ZipFile.Password + public string Password + { + set + { + _Password = value; + if (_Password == null) + { + _Encryption = EncryptionAlgorithm.None; + } + else + { + // We're setting a non-null password. + + // For entries obtained from a zip file that are encrypted, we cannot + // simply restream (recompress, re-encrypt) the file data, because we + // need the old password in order to decrypt the data, and then we + // need the new password to encrypt. So, setting the password is + // never going to work on an entry that is stored encrypted in a zipfile. + + // But it is not en error to set the password, obviously: callers will + // set the password in order to Extract encrypted archives. + + // If the source is a zip archive and there was previously no encryption + // on the entry, then we must re-stream the entry in order to encrypt it. + if (this._Source == ZipEntrySource.ZipFile && !_sourceIsEncrypted) + _restreamRequiredOnSave = true; + + if (Encryption == EncryptionAlgorithm.None) + { + _Encryption = EncryptionAlgorithm.PkzipWeak; + } + } + } + private get { return _Password; } + } + + + + internal bool IsChanged + { + get + { + return _restreamRequiredOnSave | _metadataChanged; + } + } + + + /// + /// The action the library should take when extracting a file that already exists. + /// + /// + /// + /// + /// This property affects the behavior of the Extract methods (one of the + /// Extract() or ExtractWithPassword() overloads), when + /// extraction would would overwrite an existing filesystem file. If you do + /// not set this property, the library throws an exception when extracting + /// an entry would overwrite an existing file. + /// + /// + /// + /// This property has no effect when extracting to a stream, or when the file to be + /// extracted does not already exist. + /// + /// + /// + /// + /// + /// + /// This example shows how to set the ExtractExistingFile property in + /// an ExtractProgress event, in response to user input. The + /// ExtractProgress event is invoked if and only if the + /// ExtractExistingFile property was previously set to + /// ExtractExistingFileAction.InvokeExtractProgressEvent. + /// + /// public static void ExtractProgress(object sender, ExtractProgressEventArgs e) + /// { + /// if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) + /// Console.WriteLine("extract {0} ", e.CurrentEntry.FileName); + /// + /// else if (e.EventType == ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite) + /// { + /// ZipEntry entry = e.CurrentEntry; + /// string response = null; + /// // Ask the user if he wants overwrite the file + /// do + /// { + /// Console.Write("Overwrite {0} in {1} ? (y/n/C) ", entry.FileName, e.ExtractLocation); + /// response = Console.ReadLine(); + /// Console.WriteLine(); + /// + /// } while (response != null && response[0]!='Y' && + /// response[0]!='N' && response[0]!='C'); + /// + /// if (response[0]=='C') + /// e.Cancel = true; + /// else if (response[0]=='Y') + /// entry.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently; + /// else + /// entry.ExtractExistingFile= ExtractExistingFileAction.DoNotOverwrite; + /// } + /// } + /// + /// + public ExtractExistingFileAction ExtractExistingFile + { + get; + set; + } + + + /// + /// The action to take when an error is encountered while + /// opening or reading files as they are saved into a zip archive. + /// + /// + /// + /// + /// Errors can occur within a call to ZipFile.Save, as the various files contained + /// in a ZipFile are being saved into the zip archive. During the + /// Save, DotNetZip will perform a File.Open on the file + /// associated to the ZipEntry, and then will read the entire contents of + /// the file as it is zipped. Either the open or the Read may fail, because + /// of lock conflicts or other reasons. Using this property, you can + /// specify the action to take when such errors occur. + /// + /// + /// + /// Typically you will NOT set this property on individual ZipEntry + /// instances. Instead, you will set the ZipFile.ZipErrorAction property on + /// the ZipFile instance, before adding any entries to the + /// ZipFile. If you do this, errors encountered on behalf of any of + /// the entries in the ZipFile will be handled the same way. + /// + /// + /// + /// But, if you use a handler, you will want + /// to set this property on the ZipEntry within the handler, to + /// communicate back to DotNetZip what you would like to do with the + /// particular error. + /// + /// + /// + /// + /// + public ZipErrorAction ZipErrorAction + { + get; + set; + } + + + /// + /// Indicates whether the entry was included in the most recent save. + /// + /// + /// An entry can be excluded or skipped from a save if there is an error + /// opening or reading the entry. + /// + /// + public bool IncludedInMostRecentSave + { + get + { + return !_skippedDuringSave; + } + } + + + /// + /// A callback that allows the application to specify the compression to use + /// for a given entry that is about to be added to the zip archive. + /// + /// + /// + /// + /// See + /// + /// + public SetCompressionCallback SetCompression + { + get; + set; + } + + + + /// + /// Set to indicate whether to use UTF-8 encoding for filenames and comments. + /// + /// + /// + /// + /// + /// If this flag is set, the comment and filename for the entry will be + /// encoded with UTF-8, as described in the Zip + /// specification, if necessary. "Necessary" means, the filename or + /// entry comment (if any) cannot be reflexively encoded and decoded using the + /// default code page, IBM437. + /// + /// + /// + /// Setting this flag to true is equivalent to setting to System.Text.Encoding.UTF8. + /// + /// + /// + /// This flag has no effect or relation to the text encoding used within the + /// file itself. + /// + /// + /// + [Obsolete("Beginning with v1.9.1.6 of DotNetZip, this property is obsolete. It will be removed in a future version of the library. Your applications should use AlternateEncoding and AlternateEncodingUsage instead.")] + public bool UseUnicodeAsNecessary + { + get + { + return (AlternateEncoding == System.Text.Encoding.GetEncoding("UTF-8")) && + (AlternateEncodingUsage == ZipOption.AsNecessary); + } + set + { + if (value) + { + AlternateEncoding = System.Text.Encoding.GetEncoding("UTF-8"); + AlternateEncodingUsage = ZipOption.AsNecessary; + + } + else + { + AlternateEncoding = Ionic.Zip.ZipFile.DefaultEncoding; + AlternateEncodingUsage = ZipOption.Never; + } + } + } + + /// + /// The text encoding to use for the FileName and Comment on this ZipEntry, + /// when the default encoding is insufficient. + /// + /// + /// + /// + /// + /// Don't use this property. See . + /// + /// + /// + [Obsolete("This property is obsolete since v1.9.1.6. Use AlternateEncoding and AlternateEncodingUsage instead.", true)] + public System.Text.Encoding ProvisionalAlternateEncoding + { + get; set; + } + + /// + /// Specifies the alternate text encoding used by this ZipEntry + /// + /// + /// + /// The default text encoding used in Zip files for encoding filenames and + /// comments is IBM437, which is something like a superset of ASCII. In + /// cases where this is insufficient, applications can specify an + /// alternate encoding. + /// + /// + /// When creating a zip file, the usage of the alternate encoding is + /// governed by the property. + /// Typically you would set both properties to tell DotNetZip to employ an + /// encoding that is not IBM437 in the zipfile you are creating. + /// + /// + /// Keep in mind that because the ZIP specification states that the only + /// valid encodings to use are IBM437 and UTF-8, if you use something + /// other than that, then zip tools and libraries may not be able to + /// successfully read the zip archive you generate. + /// + /// + /// The zip specification states that applications should presume that + /// IBM437 is in use, except when a special bit is set, which indicates + /// UTF-8. There is no way to specify an arbitrary code page, within the + /// zip file itself. When you create a zip file encoded with gb2312 or + /// ibm861 or anything other than IBM437 or UTF-8, then the application + /// that reads the zip file needs to "know" which code page to use. In + /// some cases, the code page used when reading is chosen implicitly. For + /// example, WinRar uses the ambient code page for the host desktop + /// operating system. The pitfall here is that if you create a zip in + /// Copenhagen and send it to Tokyo, the reader of the zipfile may not be + /// able to decode successfully. + /// + /// + /// + /// This example shows how to create a zipfile encoded with a + /// language-specific encoding: + /// + /// using (var zip = new ZipFile()) + /// { + /// zip.AlternateEnoding = System.Text.Encoding.GetEncoding("ibm861"); + /// zip.AlternateEnodingUsage = ZipOption.Always; + /// zip.AddFileS(arrayOfFiles); + /// zip.Save("Myarchive-Encoded-in-IBM861.zip"); + /// } + /// + /// + /// + public System.Text.Encoding AlternateEncoding + { + get; set; + } + + + /// + /// Describes if and when this instance should apply + /// AlternateEncoding to encode the FileName and Comment, when + /// saving. + /// + /// + public ZipOption AlternateEncodingUsage + { + get; set; + } + + + // /// + // /// The text encoding actually used for this ZipEntry. + // /// + // /// + // /// + // /// + // /// + // /// This read-only property describes the encoding used by the + // /// ZipEntry. If the entry has been read in from an existing ZipFile, + // /// then it may take the value UTF-8, if the entry is coded to specify UTF-8. + // /// If the entry does not specify UTF-8, the typical case, then the encoding + // /// used is whatever the application specified in the call to + // /// ZipFile.Read(). If the application has used one of the overloads of + // /// ZipFile.Read() that does not accept an encoding parameter, then the + // /// encoding used is IBM437, which is the default encoding described in the + // /// ZIP specification. + // /// + // /// + // /// If the entry is being created, then the value of ActualEncoding is taken + // /// according to the logic described in the documentation for . + // /// + // /// + // /// An application might be interested in retrieving this property to see if + // /// an entry read in from a file has used Unicode (UTF-8). + // /// + // /// + // /// + // /// + // public System.Text.Encoding ActualEncoding + // { + // get + // { + // return _actualEncoding; + // } + // } + + + + + internal static string NameInArchive(String filename, string directoryPathInArchive) + { + string result = null; + if (directoryPathInArchive == null) + result = filename; + + else + { + if (String.IsNullOrEmpty(directoryPathInArchive)) + { + result = Path.GetFileName(filename); + } + else + { + // explicitly specify a pathname for this file + result = Path.Combine(directoryPathInArchive, Path.GetFileName(filename)); + } + } + + //result = Path.GetFullPath(result); + result = SharedUtilities.NormalizePathForUseInZipFile(result); + + return result; + } + + // workitem 9073 + internal static ZipEntry CreateFromNothing(String nameInArchive) + { + return Create(nameInArchive, ZipEntrySource.None, null, null); + } + + internal static ZipEntry CreateFromFile(String filename, string nameInArchive) + { + return Create(nameInArchive, ZipEntrySource.FileSystem, filename, null); + } + + internal static ZipEntry CreateForStream(String entryName, Stream s) + { + return Create(entryName, ZipEntrySource.Stream, s, null); + } + + internal static ZipEntry CreateForWriter(String entryName, WriteDelegate d) + { + return Create(entryName, ZipEntrySource.WriteDelegate, d, null); + } + + internal static ZipEntry CreateForJitStreamProvider(string nameInArchive, OpenDelegate opener, CloseDelegate closer) + { + return Create(nameInArchive, ZipEntrySource.JitStream, opener, closer); + } + + internal static ZipEntry CreateForZipOutputStream(string nameInArchive) + { + return Create(nameInArchive, ZipEntrySource.ZipOutputStream, null, null); + } + + + private static ZipEntry Create(string nameInArchive, ZipEntrySource source, Object arg1, Object arg2) + { + if (String.IsNullOrEmpty(nameInArchive)) + throw new Ionic.Zip.ZipException("The entry name must be non-null and non-empty."); + + ZipEntry entry = new ZipEntry(); + + // workitem 7071 + // workitem 7926 - "version made by" OS should be zero for compat with WinZip + entry._VersionMadeBy = (0 << 8) + 45; // indicates the attributes are FAT Attributes, and v4.5 of the spec + entry._Source = source; + entry._Mtime = entry._Atime = entry._Ctime = DateTime.UtcNow; + + if (source == ZipEntrySource.Stream) + { + entry._sourceStream = (arg1 as Stream); // may or may not be null + } + else if (source == ZipEntrySource.WriteDelegate) + { + entry._WriteDelegate = (arg1 as WriteDelegate); // may or may not be null + } + else if (source == ZipEntrySource.JitStream) + { + entry._OpenDelegate = (arg1 as OpenDelegate); // may or may not be null + entry._CloseDelegate = (arg2 as CloseDelegate); // may or may not be null + } + else if (source == ZipEntrySource.ZipOutputStream) + { + } + // workitem 9073 + else if (source == ZipEntrySource.None) + { + // make this a valid value, for later. + entry._Source = ZipEntrySource.FileSystem; + } + else + { + String filename = (arg1 as String); // must not be null + + if (String.IsNullOrEmpty(filename)) + throw new Ionic.Zip.ZipException("The filename must be non-null and non-empty."); + + try + { + // The named file may or may not exist at this time. For + // example, when adding a directory by name. We test existence + // when necessary: when saving the ZipFile, or when getting the + // attributes, and so on. + +#if NETCF + // workitem 6878 + // Ionic.Zip.SharedUtilities.AdjustTime_Win32ToDotNet + entry._Mtime = File.GetLastWriteTime(filename).ToUniversalTime(); + entry._Ctime = File.GetCreationTime(filename).ToUniversalTime(); + entry._Atime = File.GetLastAccessTime(filename).ToUniversalTime(); + + // workitem 7071 + // can only get attributes of files that exist. + if (File.Exists(filename) || Directory.Exists(filename)) + entry._ExternalFileAttrs = (int)NetCfFile.GetAttributes(filename); + +#elif SILVERLIGHT + entry._Mtime = + entry._Ctime = + entry._Atime = System.DateTime.UtcNow; + entry._ExternalFileAttrs = (int)0; +#else + // workitem 6878?? + entry._Mtime = File.GetLastWriteTime(filename).ToUniversalTime(); + entry._Ctime = File.GetCreationTime(filename).ToUniversalTime(); + entry._Atime = File.GetLastAccessTime(filename).ToUniversalTime(); + + // workitem 7071 + // can only get attributes on files that exist. + if (File.Exists(filename) || Directory.Exists(filename)) + entry._ExternalFileAttrs = (int)File.GetAttributes(filename); + +#endif + entry._ntfsTimesAreSet = true; + + entry._LocalFileName = Path.GetFullPath(filename); // workitem 8813 + + } + catch (System.IO.PathTooLongException ptle) + { + // workitem 14035 + var msg = String.Format("The path is too long, filename={0}", + filename); + throw new ZipException(msg, ptle); + } + + } + + entry._LastModified = entry._Mtime; + entry._FileNameInArchive = SharedUtilities.NormalizePathForUseInZipFile(nameInArchive); + // We don't actually slurp in the file data until the caller invokes Write on this entry. + + return entry; + } + + + + + internal void MarkAsDirectory() + { + _IsDirectory = true; + // workitem 6279 + if (!_FileNameInArchive.EndsWith("/")) + _FileNameInArchive += "/"; + } + + + + /// + /// Indicates whether an entry is marked as a text file. Be careful when + /// using on this property. Unless you have a good reason, you should + /// probably ignore this property. + /// + /// + /// + /// + /// The ZIP format includes a provision for specifying whether an entry in + /// the zip archive is a text or binary file. This property exposes that + /// metadata item. Be careful when using this property: It's not clear + /// that this property as a firm meaning, across tools and libraries. + /// + /// + /// + /// To be clear, when reading a zip file, the property value may or may + /// not be set, and its value may or may not be valid. Not all entries + /// that you may think of as "text" entries will be so marked, and entries + /// marked as "text" are not guaranteed in any way to be text entries. + /// Whether the value is set and set correctly depends entirely on the + /// application that produced the zip file. + /// + /// + /// + /// There are many zip tools available, and when creating zip files, some + /// of them "respect" the IsText metadata field, and some of them do not. + /// Unfortunately, even when an application tries to do "the right thing", + /// it's not always clear what "the right thing" is. + /// + /// + /// + /// There's no firm definition of just what it means to be "a text file", + /// and the zip specification does not help in this regard. Twenty years + /// ago, text was ASCII, each byte was less than 127. IsText meant, all + /// bytes in the file were less than 127. These days, it is not the case + /// that all text files have all bytes less than 127. Any unicode file + /// may have bytes that are above 0x7f. The zip specification has nothing + /// to say on this topic. Therefore, it's not clear what IsText really + /// means. + /// + /// + /// + /// This property merely tells a reading application what is stored in the + /// metadata for an entry, without guaranteeing its validity or its + /// meaning. + /// + /// + /// + /// When DotNetZip is used to create a zipfile, it attempts to set this + /// field "correctly." For example, if a file ends in ".txt", this field + /// will be set. Your application may override that default setting. When + /// writing a zip file, you must set the property before calling + /// Save() on the ZipFile. + /// + /// + /// + /// When reading a zip file, a more general way to decide just what kind + /// of file is contained in a particular entry is to use the file type + /// database stored in the operating system. The operating system stores + /// a table that says, a file with .jpg extension is a JPG image file, a + /// file with a .xml extension is an XML document, a file with a .txt is a + /// pure ASCII text document, and so on. To get this information on + /// Windows, you + /// need to read and parse the registry. + /// + /// + /// + /// + /// using (var zip = new ZipFile()) + /// { + /// var e = zip.UpdateFile("Descriptions.mme", ""); + /// e.IsText = true; + /// zip.Save(zipPath); + /// } + /// + /// + /// + /// Using zip As New ZipFile + /// Dim e2 as ZipEntry = zip.AddFile("Descriptions.mme", "") + /// e.IsText= True + /// zip.Save(zipPath) + /// End Using + /// + /// + public bool IsText + { + // workitem 7801 + get { return _IsText; } + set { _IsText = value; } + } + + + + /// Provides a string representation of the instance. + /// a string representation of the instance. + public override String ToString() + { + return String.Format("ZipEntry::{0}", FileName); + } + + + internal Stream ArchiveStream + { + get + { + if (_archiveStream == null) + { + if (_container.ZipFile != null) + { + var zf = _container.ZipFile; + zf.Reset(false); + _archiveStream = zf.StreamForDiskNumber(_diskNumber); + } + else + { + _archiveStream = _container.ZipOutputStream.OutputStream; + } + } + return _archiveStream; + } + } + + + private void SetFdpLoh() + { + // The value for FileDataPosition has not yet been set. + // Therefore, seek to the local header, and figure the start of file data. + // workitem 8098: ok (restore) + long origPosition = this.ArchiveStream.Position; + try + { + this.ArchiveStream.Seek(this._RelativeOffsetOfLocalHeader, SeekOrigin.Begin); + + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + } + catch (System.IO.IOException exc1) + { + string description = String.Format("Exception seeking entry({0}) offset(0x{1:X8}) len(0x{2:X8})", + this.FileName, this._RelativeOffsetOfLocalHeader, + this.ArchiveStream.Length); + throw new BadStateException(description, exc1); + } + + byte[] block = new byte[30]; + this.ArchiveStream.Read(block, 0, block.Length); + + // At this point we could verify the contents read from the local header + // with the contents read from the central header. We could, but don't need to. + // So we won't. + + Int16 filenameLength = (short)(block[26] + block[27] * 256); + Int16 extraFieldLength = (short)(block[28] + block[29] * 256); + + // Console.WriteLine(" pos 0x{0:X8} ({0})", this.ArchiveStream.Position); + // Console.WriteLine(" seek 0x{0:X8} ({0})", filenameLength + extraFieldLength); + + this.ArchiveStream.Seek(filenameLength + extraFieldLength, SeekOrigin.Current); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + + this._LengthOfHeader = 30 + extraFieldLength + filenameLength + + GetLengthOfCryptoHeaderBytes(_Encryption_FromZipFile); + + // Console.WriteLine(" ROLH 0x{0:X8} ({0})", _RelativeOffsetOfLocalHeader); + // Console.WriteLine(" LOH 0x{0:X8} ({0})", _LengthOfHeader); + // workitem 8098: ok (arithmetic) + this.__FileDataPosition = _RelativeOffsetOfLocalHeader + _LengthOfHeader; + // Console.WriteLine(" FDP 0x{0:X8} ({0})", __FileDataPosition); + + // restore file position: + // workitem 8098: ok (restore) + this.ArchiveStream.Seek(origPosition, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(this.ArchiveStream); + } + + + +#if AESCRYPTO + private static int GetKeyStrengthInBits(EncryptionAlgorithm a) + { + if (a == EncryptionAlgorithm.WinZipAes256) return 256; + else if (a == EncryptionAlgorithm.WinZipAes128) return 128; + return -1; + } +#endif + + internal static int GetLengthOfCryptoHeaderBytes(EncryptionAlgorithm a) + { + //if ((_BitField & 0x01) != 0x01) return 0; + if (a == EncryptionAlgorithm.None) return 0; + +#if AESCRYPTO + if (a == EncryptionAlgorithm.WinZipAes128 || + a == EncryptionAlgorithm.WinZipAes256) + { + int KeyStrengthInBits = GetKeyStrengthInBits(a); + int sizeOfSaltAndPv = ((KeyStrengthInBits / 8 / 2) + 2); + return sizeOfSaltAndPv; + } +#endif + if (a == EncryptionAlgorithm.PkzipWeak) + return 12; + throw new ZipException("internal error"); + } + + + internal long FileDataPosition + { + get + { + if (__FileDataPosition == -1) + SetFdpLoh(); + + return __FileDataPosition; + } + } + + private int LengthOfHeader + { + get + { + if (_LengthOfHeader == 0) + SetFdpLoh(); + + return _LengthOfHeader; + } + } + + + + private ZipCrypto _zipCrypto_forExtract; + private ZipCrypto _zipCrypto_forWrite; +#if AESCRYPTO + private WinZipAesCrypto _aesCrypto_forExtract; + private WinZipAesCrypto _aesCrypto_forWrite; + private Int16 _WinZipAesMethod; +#endif + + internal DateTime _LastModified; + private DateTime _Mtime, _Atime, _Ctime; // workitem 6878: NTFS quantities + private bool _ntfsTimesAreSet; + private bool _emitNtfsTimes = true; + private bool _emitUnixTimes; // by default, false + private bool _TrimVolumeFromFullyQualifiedPaths = true; // by default, trim them. + internal string _LocalFileName; + private string _FileNameInArchive; + internal Int16 _VersionNeeded; + internal Int16 _BitField; + internal Int16 _CompressionMethod; + private Int16 _CompressionMethod_FromZipFile; + private Ionic.Zlib.CompressionLevel _CompressionLevel; + internal string _Comment; + private bool _IsDirectory; + private byte[] _CommentBytes; + internal Int64 _CompressedSize; + internal Int64 _CompressedFileDataSize; // CompressedSize less 12 bytes for the encryption header, if any + internal Int64 _UncompressedSize; + internal Int32 _TimeBlob; + private bool _crcCalculated; + internal Int32 _Crc32; + internal byte[] _Extra; + private bool _metadataChanged; + private bool _restreamRequiredOnSave; + private bool _sourceIsEncrypted; + private bool _skippedDuringSave; + private UInt32 _diskNumber; + + private static System.Text.Encoding ibm437 = System.Text.Encoding.GetEncoding("IBM437"); + //private System.Text.Encoding _provisionalAlternateEncoding = System.Text.Encoding.GetEncoding("IBM437"); + private System.Text.Encoding _actualEncoding; + + internal ZipContainer _container; + + private long __FileDataPosition = -1; + private byte[] _EntryHeader; + internal Int64 _RelativeOffsetOfLocalHeader; + private Int64 _future_ROLH; + private Int64 _TotalEntrySize; + private int _LengthOfHeader; + private int _LengthOfTrailer; + internal bool _InputUsesZip64; + private UInt32 _UnsupportedAlgorithmId; + + internal string _Password; + internal ZipEntrySource _Source; + internal EncryptionAlgorithm _Encryption; + internal EncryptionAlgorithm _Encryption_FromZipFile; + internal byte[] _WeakEncryptionHeader; + internal Stream _archiveStream; + private Stream _sourceStream; + private Nullable _sourceStreamOriginalPosition; + private bool _sourceWasJitProvided; + private bool _ioOperationCanceled; + private bool _presumeZip64; + private Nullable _entryRequiresZip64; + private Nullable _OutputUsesZip64; + private bool _IsText; // workitem 7801 + private ZipEntryTimestamp _timestamp; + + private static System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static System.DateTime _win32Epoch = System.DateTime.FromFileTimeUtc(0L); + private static System.DateTime _zeroHour = new System.DateTime(1, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + private WriteDelegate _WriteDelegate; + private OpenDelegate _OpenDelegate; + private CloseDelegate _CloseDelegate; + + + // summary + // The default size of the IO buffer for ZipEntry instances. Currently it is 8192 bytes. + // summary + //public const int IO_BUFFER_SIZE_DEFAULT = 8192; // 0x8000; // 0x4400 + + } + + + + /// + /// An enum that specifies the type of timestamp available on the ZipEntry. + /// + /// + /// + /// + /// + /// The last modified time of a file can be stored in multiple ways in + /// a zip file, and they are not mutually exclusive: + /// + /// + /// + /// + /// In the so-called "DOS" format, which has a 2-second precision. Values + /// are rounded to the nearest even second. For example, if the time on the + /// file is 12:34:43, then it will be stored as 12:34:44. This first value + /// is accessible via the LastModified property. This value is always + /// present in the metadata for each zip entry. In some cases the value is + /// invalid, or zero. + /// + /// + /// + /// In the so-called "Windows" or "NTFS" format, as an 8-byte integer + /// quantity expressed as the number of 1/10 milliseconds (in other words + /// the number of 100 nanosecond units) since January 1, 1601 (UTC). This + /// format is how Windows represents file times. This time is accessible + /// via the ModifiedTime property. + /// + /// + /// + /// In the "Unix" format, a 4-byte quantity specifying the number of seconds since + /// January 1, 1970 UTC. + /// + /// + /// + /// In an older format, now deprecated but still used by some current + /// tools. This format is also a 4-byte quantity specifying the number of + /// seconds since January 1, 1970 UTC. + /// + /// + /// + /// + /// + /// This bit field describes which of the formats were found in a ZipEntry that was read. + /// + /// + /// + [Flags] + public enum ZipEntryTimestamp + { + /// + /// Default value. + /// + None = 0, + + /// + /// A DOS timestamp with 2-second precision. + /// + DOS = 1, + + /// + /// A Windows timestamp with 100-ns precision. + /// + Windows = 2, + + /// + /// A Unix timestamp with 1-second precision. + /// + Unix = 4, + + /// + /// A Unix timestamp with 1-second precision, stored in InfoZip v1 format. This + /// format is outdated and is supported for reading archives only. + /// + InfoZip1 = 8, + } + + + + /// + /// The method of compression to use for a particular ZipEntry. + /// + /// + /// + /// PKWare's + /// ZIP Specification describes a number of distinct + /// cmopression methods that can be used within a zip + /// file. DotNetZip supports a subset of them. + /// + public enum CompressionMethod + { + /// + /// No compression at all. For COM environments, the value is 0 (zero). + /// + None = 0, + + /// + /// DEFLATE compression, as described in IETF RFC + /// 1951. This is the "normal" compression used in zip + /// files. For COM environments, the value is 8. + /// + Deflate = 8, + +#if BZIP + /// + /// BZip2 compression, a compression algorithm developed by Julian Seward. + /// For COM environments, the value is 12. + /// + BZip2 = 12, +#endif + } + + +#if NETCF + internal class NetCfFile + { + public static int SetTimes(string filename, DateTime ctime, DateTime atime, DateTime mtime) + { + IntPtr hFile = (IntPtr) CreateFileCE(filename, + (uint)0x40000000L, // (uint)FileAccess.Write, + (uint)0x00000002L, // (uint)FileShare.Write, + 0, + (uint) 3, // == open existing + (uint)0, // flagsAndAttributes + 0); + + if((int)hFile == -1) + { + // workitem 7944: don't throw on failure to set file times + // throw new ZipException("CreateFileCE Failed"); + return Interop.Marshal.GetLastWin32Error(); + } + + SetFileTime(hFile, + BitConverter.GetBytes(ctime.ToFileTime()), + BitConverter.GetBytes(atime.ToFileTime()), + BitConverter.GetBytes(mtime.ToFileTime())); + + CloseHandle(hFile); + return 0; + } + + + public static int SetLastWriteTime(string filename, DateTime mtime) + { + IntPtr hFile = (IntPtr) CreateFileCE(filename, + (uint)0x40000000L, // (uint)FileAccess.Write, + (uint)0x00000002L, // (uint)FileShare.Write, + 0, + (uint) 3, // == open existing + (uint)0, // flagsAndAttributes + 0); + + if((int)hFile == -1) + { + // workitem 7944: don't throw on failure to set file time + // throw new ZipException(String.Format("CreateFileCE Failed ({0})", + // Interop.Marshal.GetLastWin32Error())); + return Interop.Marshal.GetLastWin32Error(); + } + + SetFileTime(hFile, null, null, + BitConverter.GetBytes(mtime.ToFileTime())); + + CloseHandle(hFile); + return 0; + } + + + [Interop.DllImport("coredll.dll", EntryPoint="CreateFile", SetLastError=true)] + internal static extern int CreateFileCE(string lpFileName, + uint dwDesiredAccess, + uint dwShareMode, + int lpSecurityAttributes, + uint dwCreationDisposition, + uint dwFlagsAndAttributes, + int hTemplateFile); + + + [Interop.DllImport("coredll", EntryPoint="GetFileAttributes", SetLastError=true)] + internal static extern uint GetAttributes(string lpFileName); + + [Interop.DllImport("coredll", EntryPoint="SetFileAttributes", SetLastError=true)] + internal static extern bool SetAttributes(string lpFileName, uint dwFileAttributes); + + [Interop.DllImport("coredll", EntryPoint="SetFileTime", SetLastError=true)] + internal static extern bool SetFileTime(IntPtr hFile, byte[] lpCreationTime, byte[] lpLastAccessTime, byte[] lpLastWriteTime); + + [Interop.DllImport("coredll.dll", SetLastError=true)] + internal static extern bool CloseHandle(IntPtr hObject); + + } +#endif + + + +} diff --git a/dotNetZip/Zip/ZipEntrySource.cs b/dotNetZip/Zip/ZipEntrySource.cs new file mode 100644 index 0000000..b64380d --- /dev/null +++ b/dotNetZip/Zip/ZipEntrySource.cs @@ -0,0 +1,69 @@ +// ZipEntrySource.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-November-19 11:18:42> +// +// ------------------------------------------------------------------ +// + +namespace Ionic.Zip +{ + /// + /// An enum that specifies the source of the ZipEntry. + /// + public enum ZipEntrySource + { + /// + /// Default value. Invalid on a bonafide ZipEntry. + /// + None = 0, + + /// + /// The entry was instantiated by calling AddFile() or another method that + /// added an entry from the filesystem. + /// + FileSystem, + + /// + /// The entry was instantiated via or + /// . + /// + Stream, + + /// + /// The ZipEntry was instantiated by reading a zipfile. + /// + ZipFile, + + /// + /// The content for the ZipEntry will be or was provided by the WriteDelegate. + /// + WriteDelegate, + + /// + /// The content for the ZipEntry will be obtained from the stream dispensed by the OpenDelegate. + /// The entry was instantiated via . + /// + JitStream, + + /// + /// The content for the ZipEntry will be or was obtained from a ZipOutputStream. + /// + ZipOutputStream, + } + +} \ No newline at end of file diff --git a/dotNetZip/Zip/ZipErrorAction.cs b/dotNetZip/Zip/ZipErrorAction.cs new file mode 100644 index 0000000..3a394cd --- /dev/null +++ b/dotNetZip/Zip/ZipErrorAction.cs @@ -0,0 +1,97 @@ +// ZipErrorAction.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-September-01 18:43:20> +// +// ------------------------------------------------------------------ +// +// This module defines the ZipErrorAction enum, which provides +// an action to take when errors occur when opening or reading +// files to be added to a zip file. +// +// ------------------------------------------------------------------ + + +namespace Ionic.Zip +{ + /// + /// An enum providing the options when an error occurs during opening or reading + /// of a file or directory that is being saved to a zip file. + /// + /// + /// + /// + /// This enum describes the actions that the library can take when an error occurs + /// opening or reading a file, as it is being saved into a Zip archive. + /// + /// + /// + /// In some cases an error will occur when DotNetZip tries to open a file to be + /// added to the zip archive. In other cases, an error might occur after the + /// file has been successfully opened, while DotNetZip is reading the file. + /// + /// + /// + /// The first problem might occur when calling AddDirectory() on a directory + /// that contains a Clipper .dbf file; the file is locked by Clipper and + /// cannot be opened by another process. An example of the second problem is + /// the ERROR_LOCK_VIOLATION that results when a file is opened by another + /// process, but not locked, and a range lock has been taken on the file. + /// Microsoft Outlook takes range locks on .PST files. + /// + /// + public enum ZipErrorAction + { + /// + /// Throw an exception when an error occurs while zipping. This is the default + /// behavior. (For COM clients, this is a 0 (zero).) + /// + Throw, + + /// + /// When an error occurs during zipping, for example a file cannot be opened, + /// skip the file causing the error, and continue zipping. (For COM clients, + /// this is a 1.) + /// + Skip, + + /// + /// When an error occurs during zipping, for example a file cannot be opened, + /// retry the operation that caused the error. Be careful with this option. If + /// the error is not temporary, the library will retry forever. (For COM + /// clients, this is a 2.) + /// + Retry, + + /// + /// When an error occurs, invoke the zipError event. The event type used is + /// . A typical use of this option: + /// a GUI application may wish to pop up a dialog to allow the user to view the + /// error that occurred, and choose an appropriate action. After your + /// processing in the error event, if you want to skip the file, set on the + /// ZipProgressEventArgs.CurrentEntry to Skip. If you want the + /// exception to be thrown, set ZipErrorAction on the CurrentEntry + /// to Throw. If you want to cancel the zip, set + /// ZipProgressEventArgs.Cancel to true. Cancelling differs from using + /// Skip in that a cancel will not save any further entries, if there are any. + /// (For COM clients, the value of this enum is a 3.) + /// + InvokeErrorEvent, + } + +} diff --git a/dotNetZip/Zip/ZipFile.AddUpdate.cs b/dotNetZip/Zip/ZipFile.AddUpdate.cs new file mode 100644 index 0000000..d5da4fc --- /dev/null +++ b/dotNetZip/Zip/ZipFile.AddUpdate.cs @@ -0,0 +1,2182 @@ +// ZipFile.AddUpdate.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-November-01 13:56:58> +// +// ------------------------------------------------------------------ +// +// This module defines the methods for Adding and Updating entries in +// the ZipFile. +// +// ------------------------------------------------------------------ +// + + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + public partial class ZipFile + { + /// + /// Adds an item, either a file or a directory, to a zip file archive. + /// + /// + /// + /// + /// This method is handy if you are adding things to zip archive and don't + /// want to bother distinguishing between directories or files. Any files are + /// added as single entries. A directory added through this method is added + /// recursively: all files and subdirectories contained within the directory + /// are added to the ZipFile. + /// + /// + /// + /// The name of the item may be a relative path or a fully-qualified + /// path. Remember, the items contained in ZipFile instance get written + /// to the disk only when you call or a similar + /// save method. + /// + /// + /// + /// The directory name used for the file within the archive is the same + /// as the directory name (potentially a relative path) specified in the + /// . + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// + /// + /// This method has two overloads. + /// + /// the name of the file or directory to add. + /// + /// The ZipEntry added. + public ZipEntry AddItem(string fileOrDirectoryName) + { + return AddItem(fileOrDirectoryName, null); + } + + + /// + /// Adds an item, either a file or a directory, to a zip file archive, + /// explicitly specifying the directory path to be used in the archive. + /// + /// + /// + /// + /// If adding a directory, the add is recursive on all files and + /// subdirectories contained within it. + /// + /// + /// The name of the item may be a relative path or a fully-qualified path. + /// The item added by this call to the ZipFile is not read from the + /// disk nor written to the zip file archive until the application calls + /// Save() on the ZipFile. + /// + /// + /// + /// This version of the method allows the caller to explicitly specify the + /// directory path to be used in the archive, which would override the + /// "natural" path of the filesystem file. + /// + /// + /// + /// Encryption will be used on the file data if the Password has + /// been set on the ZipFile object, prior to calling this method. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// Thrown if the file or directory passed in does not exist. + /// + /// + /// the name of the file or directory to add. + /// + /// + /// + /// The name of the directory path to use within the zip archive. This path + /// need not refer to an extant directory in the current filesystem. If the + /// files within the zip are later extracted, this is the path used for the + /// extracted file. Passing null (Nothing in VB) will use the + /// path on the fileOrDirectoryName. Passing the empty string ("") will + /// insert the item at the root path within the archive. + /// + /// + /// + /// + /// + /// + /// + /// This example shows how to zip up a set of files into a flat hierarchy, + /// regardless of where in the filesystem the files originated. The resulting + /// zip archive will contain a toplevel directory named "flat", which itself + /// will contain files Readme.txt, MyProposal.docx, and Image1.jpg. A + /// subdirectory under "flat" called SupportFiles will contain all the files + /// in the "c:\SupportFiles" directory on disk. + /// + /// + /// String[] itemnames= { + /// "c:\\fixedContent\\Readme.txt", + /// "MyProposal.docx", + /// "c:\\SupportFiles", // a directory + /// "images\\Image1.jpg" + /// }; + /// + /// try + /// { + /// using (ZipFile zip = new ZipFile()) + /// { + /// for (int i = 1; i < itemnames.Length; i++) + /// { + /// // will add Files or Dirs, recurses and flattens subdirectories + /// zip.AddItem(itemnames[i],"flat"); + /// } + /// zip.Save(ZipToCreate); + /// } + /// } + /// catch (System.Exception ex1) + /// { + /// System.Console.Error.WriteLine("exception: {0}", ex1); + /// } + /// + /// + /// + /// Dim itemnames As String() = _ + /// New String() { "c:\fixedContent\Readme.txt", _ + /// "MyProposal.docx", _ + /// "SupportFiles", _ + /// "images\Image1.jpg" } + /// Try + /// Using zip As New ZipFile + /// Dim i As Integer + /// For i = 1 To itemnames.Length - 1 + /// ' will add Files or Dirs, recursing and flattening subdirectories. + /// zip.AddItem(itemnames(i), "flat") + /// Next i + /// zip.Save(ZipToCreate) + /// End Using + /// Catch ex1 As Exception + /// Console.Error.WriteLine("exception: {0}", ex1.ToString()) + /// End Try + /// + /// + /// The ZipEntry added. + public ZipEntry AddItem(String fileOrDirectoryName, String directoryPathInArchive) + { + if (File.Exists(fileOrDirectoryName)) + return AddFile(fileOrDirectoryName, directoryPathInArchive); + + if (Directory.Exists(fileOrDirectoryName)) + return AddDirectory(fileOrDirectoryName, directoryPathInArchive); + + throw new FileNotFoundException(String.Format("That file or directory ({0}) does not exist!", + fileOrDirectoryName)); + } + + /// + /// Adds a File to a Zip file archive. + /// + /// + /// + /// + /// This call collects metadata for the named file in the filesystem, + /// including the file attributes and the timestamp, and inserts that metadata + /// into the resulting ZipEntry. Only when the application calls Save() on + /// the ZipFile, does DotNetZip read the file from the filesystem and + /// then write the content to the zip file archive. + /// + /// + /// + /// This method will throw an exception if an entry with the same name already + /// exists in the ZipFile. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// In this example, three files are added to a Zip archive. The ReadMe.txt + /// file will be placed in the root of the archive. The .png file will be + /// placed in a folder within the zip called photos\personal. The pdf file + /// will be included into a folder within the zip called Desktop. + /// + /// + /// try + /// { + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddFile("c:\\photos\\personal\\7440-N49th.png"); + /// zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf"); + /// zip.AddFile("ReadMe.txt"); + /// + /// zip.Save("Package.zip"); + /// } + /// } + /// catch (System.Exception ex1) + /// { + /// System.Console.Error.WriteLine("exception: " + ex1); + /// } + /// + /// + /// + /// Try + /// Using zip As ZipFile = New ZipFile + /// zip.AddFile("c:\photos\personal\7440-N49th.png") + /// zip.AddFile("c:\Desktop\2008-Regional-Sales-Report.pdf") + /// zip.AddFile("ReadMe.txt") + /// zip.Save("Package.zip") + /// End Using + /// Catch ex1 As Exception + /// Console.Error.WriteLine("exception: {0}", ex1.ToString) + /// End Try + /// + /// + /// + /// This method has two overloads. + /// + /// + /// + /// + /// + /// + /// The name of the file to add. It should refer to a file in the filesystem. + /// The name of the file may be a relative path or a fully-qualified path. + /// + /// The ZipEntry corresponding to the File added. + public ZipEntry AddFile(string fileName) + { + return AddFile(fileName, null); + } + + + + + + /// + /// Adds a File to a Zip file archive, potentially overriding the path to be + /// used within the zip archive. + /// + /// + /// + /// + /// The file added by this call to the ZipFile is not written to the + /// zip file archive until the application calls Save() on the ZipFile. + /// + /// + /// + /// This method will throw an exception if an entry with the same name already + /// exists in the ZipFile. + /// + /// + /// + /// This version of the method allows the caller to explicitly specify the + /// directory path to be used in the archive. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// In this example, three files are added to a Zip archive. The ReadMe.txt + /// file will be placed in the root of the archive. The .png file will be + /// placed in a folder within the zip called images. The pdf file will be + /// included into a folder within the zip called files\docs, and will be + /// encrypted with the given password. + /// + /// + /// try + /// { + /// using (ZipFile zip = new ZipFile()) + /// { + /// // the following entry will be inserted at the root in the archive. + /// zip.AddFile("c:\\datafiles\\ReadMe.txt", ""); + /// // this image file will be inserted into the "images" directory in the archive. + /// zip.AddFile("c:\\photos\\personal\\7440-N49th.png", "images"); + /// // the following will result in a password-protected file called + /// // files\\docs\\2008-Regional-Sales-Report.pdf in the archive. + /// zip.Password = "EncryptMe!"; + /// zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf", "files\\docs"); + /// zip.Save("Archive.zip"); + /// } + /// } + /// catch (System.Exception ex1) + /// { + /// System.Console.Error.WriteLine("exception: {0}", ex1); + /// } + /// + /// + /// + /// Try + /// Using zip As ZipFile = New ZipFile + /// ' the following entry will be inserted at the root in the archive. + /// zip.AddFile("c:\datafiles\ReadMe.txt", "") + /// ' this image file will be inserted into the "images" directory in the archive. + /// zip.AddFile("c:\photos\personal\7440-N49th.png", "images") + /// ' the following will result in a password-protected file called + /// ' files\\docs\\2008-Regional-Sales-Report.pdf in the archive. + /// zip.Password = "EncryptMe!" + /// zip.AddFile("c:\Desktop\2008-Regional-Sales-Report.pdf", "files\documents") + /// zip.Save("Archive.zip") + /// End Using + /// Catch ex1 As Exception + /// Console.Error.WriteLine("exception: {0}", ex1) + /// End Try + /// + /// + /// + /// + /// + /// + /// + /// + /// The name of the file to add. The name of the file may be a relative path + /// or a fully-qualified path. + /// + /// + /// + /// Specifies a directory path to use to override any path in the fileName. + /// This path may, or may not, correspond to a real directory in the current + /// filesystem. If the files within the zip are later extracted, this is the + /// path used for the extracted file. Passing null (Nothing in + /// VB) will use the path on the fileName, if any. Passing the empty string + /// ("") will insert the item at the root path within the archive. + /// + /// + /// The ZipEntry corresponding to the file added. + public ZipEntry AddFile(string fileName, String directoryPathInArchive) + { + string nameInArchive = ZipEntry.NameInArchive(fileName, directoryPathInArchive); + ZipEntry ze = ZipEntry.CreateFromFile(fileName, nameInArchive); + if (Verbose) StatusMessageTextWriter.WriteLine("adding {0}...", fileName); + return _InternalAddEntry(ze); + } + + + /// + /// This method removes a collection of entries from the ZipFile. + /// + /// + /// + /// A collection of ZipEntry instances from this zip file to be removed. For + /// example, you can pass in an array of ZipEntry instances; or you can call + /// SelectEntries(), and then add or remove entries from that + /// ICollection<ZipEntry> (ICollection(Of ZipEntry) in VB), and pass + /// that ICollection to this method. + /// + /// + /// + /// + public void RemoveEntries(System.Collections.Generic.ICollection entriesToRemove) + { + if (entriesToRemove == null) + throw new ArgumentNullException("entriesToRemove"); + + foreach (ZipEntry e in entriesToRemove) + { + this.RemoveEntry(e); + } + } + + + /// + /// This method removes a collection of entries from the ZipFile, by name. + /// + /// + /// + /// A collection of strings that refer to names of entries to be removed + /// from the ZipFile. For example, you can pass in an array or a + /// List of Strings that provide the names of entries to be removed. + /// + /// + /// + /// + public void RemoveEntries(System.Collections.Generic.ICollection entriesToRemove) + { + if (entriesToRemove == null) + throw new ArgumentNullException("entriesToRemove"); + + foreach (String e in entriesToRemove) + { + this.RemoveEntry(e); + } + } + + + /// + /// This method adds a set of files to the ZipFile. + /// + /// + /// + /// + /// Use this method to add a set of files to the zip archive, in one call. + /// For example, a list of files received from + /// System.IO.Directory.GetFiles() can be added to a zip archive in one + /// call. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to each + /// ZipEntry added. + /// + /// + /// + /// + /// The collection of names of the files to add. Each string should refer to a + /// file in the filesystem. The name of the file may be a relative path or a + /// fully-qualified path. + /// + /// + /// + /// This example shows how to create a zip file, and add a few files into it. + /// + /// String ZipFileToCreate = "archive1.zip"; + /// String DirectoryToZip = "c:\\reports"; + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Store all files found in the top level directory, into the zip archive. + /// String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + /// zip.AddFiles(filenames); + /// zip.Save(ZipFileToCreate); + /// } + /// + /// + /// + /// Dim ZipFileToCreate As String = "archive1.zip" + /// Dim DirectoryToZip As String = "c:\reports" + /// Using zip As ZipFile = New ZipFile + /// ' Store all files found in the top level directory, into the zip archive. + /// Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + /// zip.AddFiles(filenames) + /// zip.Save(ZipFileToCreate) + /// End Using + /// + /// + /// + /// + public void AddFiles(System.Collections.Generic.IEnumerable fileNames) + { + this.AddFiles(fileNames, null); + } + + + /// + /// Adds or updates a set of files in the ZipFile. + /// + /// + /// + /// + /// Any files that already exist in the archive are updated. Any files that + /// don't yet exist in the archive are added. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to each + /// ZipEntry added. + /// + /// + /// + /// + /// The collection of names of the files to update. Each string should refer to a file in + /// the filesystem. The name of the file may be a relative path or a fully-qualified path. + /// + /// + public void UpdateFiles(System.Collections.Generic.IEnumerable fileNames) + { + this.UpdateFiles(fileNames, null); + } + + + /// + /// Adds a set of files to the ZipFile, using the + /// specified directory path in the archive. + /// + /// + /// + /// + /// Any directory structure that may be present in the + /// filenames contained in the list is "flattened" in the + /// archive. Each file in the list is added to the archive in + /// the specified top-level directory. + /// + /// + /// + /// For ZipFile properties including , , , , , , and , their respective values at the + /// time of this call will be applied to each ZipEntry added. + /// + /// + /// + /// + /// The names of the files to add. Each string should refer to + /// a file in the filesystem. The name of the file may be a + /// relative path or a fully-qualified path. + /// + /// + /// + /// Specifies a directory path to use to override any path in the file name. + /// Th is path may, or may not, correspond to a real directory in the current + /// filesystem. If the files within the zip are later extracted, this is the + /// path used for the extracted file. Passing null (Nothing in + /// VB) will use the path on each of the fileNames, if any. Passing + /// the empty string ("") will insert the item at the root path within the + /// archive. + /// + /// + /// + public void AddFiles(System.Collections.Generic.IEnumerable fileNames, String directoryPathInArchive) + { + AddFiles(fileNames, false, directoryPathInArchive); + } + + + + /// + /// Adds a set of files to the ZipFile, using the specified directory + /// path in the archive, and preserving the full directory structure in the + /// filenames. + /// + /// + /// + /// + /// + /// Think of the as a "root" or + /// base directory used in the archive for the files that get added. when + /// is true, the hierarchy of files + /// found in the filesystem will be placed, with the hierarchy intact, + /// starting at that root in the archive. When preserveDirHierarchy + /// is false, the path hierarchy of files is flattned, and the flattened + /// set of files gets placed in the root within the archive as specified in + /// directoryPathInArchive. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to each + /// ZipEntry added. + /// + /// + /// + /// + /// + /// The names of the files to add. Each string should refer to a file in the + /// filesystem. The name of the file may be a relative path or a + /// fully-qualified path. + /// + /// + /// + /// Specifies a directory path to use as a prefix for each entry name. + /// This path may, or may not, correspond to a real directory in the current + /// filesystem. If the files within the zip are later extracted, this is the + /// path used for the extracted file. Passing null (Nothing in + /// VB) will use the path on each of the fileNames, if any. Passing + /// the empty string ("") will insert the item at the root path within the + /// archive. + /// + /// + /// + /// whether the entries in the zip archive will reflect the directory + /// hierarchy that is present in the various filenames. For example, if + /// includes two paths, + /// \Animalia\Chordata\Mammalia\Info.txt and + /// \Plantae\Magnoliophyta\Dicotyledon\Info.txt, then calling this method + /// with = false will + /// result in an exception because of a duplicate entry name, while + /// calling this method with = + /// true will result in the full direcory paths being included in + /// the entries added to the ZipFile. + /// + /// + public void AddFiles(System.Collections.Generic.IEnumerable fileNames, + bool preserveDirHierarchy, + String directoryPathInArchive) + { + if (fileNames == null) + throw new ArgumentNullException("fileNames"); + + _addOperationCanceled = false; + OnAddStarted(); + if (preserveDirHierarchy) + { + foreach (var f in fileNames) + { + if (_addOperationCanceled) break; + if (directoryPathInArchive != null) + { + //string s = SharedUtilities.NormalizePath(Path.Combine(directoryPathInArchive, Path.GetDirectoryName(f))); + string s = Path.GetFullPath(Path.Combine(directoryPathInArchive, Path.GetDirectoryName(f))); + this.AddFile(f, s); + } + else + this.AddFile(f, null); + } + } + else + { + foreach (var f in fileNames) + { + if (_addOperationCanceled) break; + this.AddFile(f, directoryPathInArchive); + } + } + if (!_addOperationCanceled) + OnAddCompleted(); + } + + + /// + /// Adds or updates a set of files to the ZipFile, using the specified + /// directory path in the archive. + /// + /// + /// + /// + /// + /// Any files that already exist in the archive are updated. Any files that + /// don't yet exist in the archive are added. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to each + /// ZipEntry added. + /// + /// + /// + /// + /// The names of the files to add or update. Each string should refer to a + /// file in the filesystem. The name of the file may be a relative path or a + /// fully-qualified path. + /// + /// + /// + /// Specifies a directory path to use to override any path in the file name. + /// This path may, or may not, correspond to a real directory in the current + /// filesystem. If the files within the zip are later extracted, this is the + /// path used for the extracted file. Passing null (Nothing in + /// VB) will use the path on each of the fileNames, if any. Passing + /// the empty string ("") will insert the item at the root path within the + /// archive. + /// + /// + /// + public void UpdateFiles(System.Collections.Generic.IEnumerable fileNames, String directoryPathInArchive) + { + if (fileNames == null) + throw new ArgumentNullException("fileNames"); + + OnAddStarted(); + foreach (var f in fileNames) + this.UpdateFile(f, directoryPathInArchive); + OnAddCompleted(); + } + + + + + /// + /// Adds or Updates a File in a Zip file archive. + /// + /// + /// + /// + /// This method adds a file to a zip archive, or, if the file already exists + /// in the zip archive, this method Updates the content of that given filename + /// in the zip archive. The UpdateFile method might more accurately be + /// called "AddOrUpdateFile". + /// + /// + /// + /// Upon success, there is no way for the application to learn whether the file + /// was added versus updated. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// This example shows how to Update an existing entry in a zipfile. The first + /// call to UpdateFile adds the file to the newly-created zip archive. The + /// second call to UpdateFile updates the content for that file in the zip + /// archive. + /// + /// + /// using (ZipFile zip1 = new ZipFile()) + /// { + /// // UpdateFile might more accurately be called "AddOrUpdateFile" + /// zip1.UpdateFile("MyDocuments\\Readme.txt"); + /// zip1.UpdateFile("CustomerList.csv"); + /// zip1.Comment = "This zip archive has been created."; + /// zip1.Save("Content.zip"); + /// } + /// + /// using (ZipFile zip2 = ZipFile.Read("Content.zip")) + /// { + /// zip2.UpdateFile("Updates\\Readme.txt"); + /// zip2.Comment = "This zip archive has been updated: The Readme.txt file has been changed."; + /// zip2.Save(); + /// } + /// + /// + /// + /// Using zip1 As New ZipFile + /// ' UpdateFile might more accurately be called "AddOrUpdateFile" + /// zip1.UpdateFile("MyDocuments\Readme.txt") + /// zip1.UpdateFile("CustomerList.csv") + /// zip1.Comment = "This zip archive has been created." + /// zip1.Save("Content.zip") + /// End Using + /// + /// Using zip2 As ZipFile = ZipFile.Read("Content.zip") + /// zip2.UpdateFile("Updates\Readme.txt") + /// zip2.Comment = "This zip archive has been updated: The Readme.txt file has been changed." + /// zip2.Save + /// End Using + /// + /// + /// + /// + /// + /// + /// + /// + /// The name of the file to add or update. It should refer to a file in the + /// filesystem. The name of the file may be a relative path or a + /// fully-qualified path. + /// + /// + /// + /// The ZipEntry corresponding to the File that was added or updated. + /// + public ZipEntry UpdateFile(string fileName) + { + return UpdateFile(fileName, null); + } + + + + /// + /// Adds or Updates a File in a Zip file archive. + /// + /// + /// + /// + /// This method adds a file to a zip archive, or, if the file already exists + /// in the zip archive, this method Updates the content of that given filename + /// in the zip archive. + /// + /// + /// + /// This version of the method allows the caller to explicitly specify the + /// directory path to be used in the archive. The entry to be added or + /// updated is found by using the specified directory path, combined with the + /// basename of the specified filename. + /// + /// + /// + /// Upon success, there is no way for the application to learn if the file was + /// added versus updated. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// + /// + /// The name of the file to add or update. It should refer to a file in the + /// filesystem. The name of the file may be a relative path or a + /// fully-qualified path. + /// + /// + /// + /// Specifies a directory path to use to override any path in the + /// fileName. This path may, or may not, correspond to a real + /// directory in the current filesystem. If the files within the zip are + /// later extracted, this is the path used for the extracted file. Passing + /// null (Nothing in VB) will use the path on the + /// fileName, if any. Passing the empty string ("") will insert the + /// item at the root path within the archive. + /// + /// + /// + /// The ZipEntry corresponding to the File that was added or updated. + /// + public ZipEntry UpdateFile(string fileName, String directoryPathInArchive) + { + // ideally this would all be transactional! + var key = ZipEntry.NameInArchive(fileName, directoryPathInArchive); + if (this[key] != null) + this.RemoveEntry(key); + return this.AddFile(fileName, directoryPathInArchive); + } + + + + + + /// + /// Add or update a directory in a zip archive. + /// + /// + /// + /// If the specified directory does not exist in the archive, then this method + /// is equivalent to calling AddDirectory(). If the specified + /// directory already exists in the archive, then this method updates any + /// existing entries, and adds any new entries. Any entries that are in the + /// zip archive but not in the specified directory, are left alone. In other + /// words, the contents of the zip file will be a union of the previous + /// contents and the new files. + /// + /// + /// + /// + /// + /// + /// + /// The path to the directory to be added to the zip archive, or updated in + /// the zip archive. + /// + /// + /// + /// The ZipEntry corresponding to the Directory that was added or updated. + /// + public ZipEntry UpdateDirectory(string directoryName) + { + return UpdateDirectory(directoryName, null); + } + + + /// + /// Add or update a directory in the zip archive at the specified root + /// directory in the archive. + /// + /// + /// + /// If the specified directory does not exist in the archive, then this method + /// is equivalent to calling AddDirectory(). If the specified + /// directory already exists in the archive, then this method updates any + /// existing entries, and adds any new entries. Any entries that are in the + /// zip archive but not in the specified directory, are left alone. In other + /// words, the contents of the zip file will be a union of the previous + /// contents and the new files. + /// + /// + /// + /// + /// + /// + /// + /// The path to the directory to be added to the zip archive, or updated + /// in the zip archive. + /// + /// + /// + /// Specifies a directory path to use to override any path in the + /// directoryName. This path may, or may not, correspond to a real + /// directory in the current filesystem. If the files within the zip are + /// later extracted, this is the path used for the extracted file. Passing + /// null (Nothing in VB) will use the path on the + /// directoryName, if any. Passing the empty string ("") will insert + /// the item at the root path within the archive. + /// + /// + /// + /// The ZipEntry corresponding to the Directory that was added or updated. + /// + public ZipEntry UpdateDirectory(string directoryName, String directoryPathInArchive) + { + return this.AddOrUpdateDirectoryImpl(directoryName, directoryPathInArchive, AddOrUpdateAction.AddOrUpdate); + } + + + + + + /// + /// Add or update a file or directory in the zip archive. + /// + /// + /// + /// + /// This is useful when the application is not sure or does not care if the + /// item to be added is a file or directory, and does not know or does not + /// care if the item already exists in the ZipFile. Calling this method + /// is equivalent to calling RemoveEntry() if an entry by the same name + /// already exists, followed calling by AddItem(). + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// + /// + /// the path to the file or directory to be added or updated. + /// + public void UpdateItem(string itemName) + { + UpdateItem(itemName, null); + } + + + /// + /// Add or update a file or directory. + /// + /// + /// + /// + /// This method is useful when the application is not sure or does not care if + /// the item to be added is a file or directory, and does not know or does not + /// care if the item already exists in the ZipFile. Calling this method + /// is equivalent to calling RemoveEntry(), if an entry by that name + /// exists, and then calling AddItem(). + /// + /// + /// + /// This version of the method allows the caller to explicitly specify the + /// directory path to be used for the item being added to the archive. The + /// entry or entries that are added or updated will use the specified + /// DirectoryPathInArchive. Extracting the entry from the archive will + /// result in a file stored in that directory path. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// + /// + /// The path for the File or Directory to be added or updated. + /// + /// + /// Specifies a directory path to use to override any path in the + /// itemName. This path may, or may not, correspond to a real + /// directory in the current filesystem. If the files within the zip are + /// later extracted, this is the path used for the extracted file. Passing + /// null (Nothing in VB) will use the path on the + /// itemName, if any. Passing the empty string ("") will insert the + /// item at the root path within the archive. + /// + public void UpdateItem(string itemName, string directoryPathInArchive) + { + if (File.Exists(itemName)) + UpdateFile(itemName, directoryPathInArchive); + + else if (Directory.Exists(itemName)) + UpdateDirectory(itemName, directoryPathInArchive); + + else + throw new FileNotFoundException(String.Format("That file or directory ({0}) does not exist!", itemName)); + } + + + + + /// + /// Adds a named entry into the zip archive, taking content for the entry + /// from a string. + /// + /// + /// + /// Calling this method creates an entry using the given fileName and + /// directory path within the archive. There is no need for a file by the + /// given name to exist in the filesystem; the name is used within the zip + /// archive only. The content for the entry is encoded using the default text + /// encoding for the machine, or on Silverlight, using UTF-8. + /// + /// + /// + /// The content of the file, should it be extracted from the zip. + /// + /// + /// + /// The name, including any path, to use for the entry within the archive. + /// + /// + /// The ZipEntry added. + /// + /// + /// + /// This example shows how to add an entry to the zipfile, using a string as + /// content for that entry. + /// + /// + /// string Content = "This string will be the content of the Readme.txt file in the zip archive."; + /// using (ZipFile zip1 = new ZipFile()) + /// { + /// zip1.AddFile("MyDocuments\\Resume.doc", "files"); + /// zip1.AddEntry("Readme.txt", Content); + /// zip1.Comment = "This zip file was created at " + System.DateTime.Now.ToString("G"); + /// zip1.Save("Content.zip"); + /// } + /// + /// + /// + /// Public Sub Run() + /// Dim Content As String = "This string will be the content of the Readme.txt file in the zip archive." + /// Using zip1 As ZipFile = New ZipFile + /// zip1.AddEntry("Readme.txt", Content) + /// zip1.AddFile("MyDocuments\Resume.doc", "files") + /// zip1.Comment = ("This zip file was created at " & DateTime.Now.ToString("G")) + /// zip1.Save("Content.zip") + /// End Using + /// End Sub + /// + /// + public ZipEntry AddEntry(string entryName, string content) + { +#if SILVERLIGHT + return AddEntry(entryName, content, System.Text.Encoding.UTF8); +#else + return AddEntry(entryName, content, System.Text.Encoding.Default); +#endif + } + + + + /// + /// Adds a named entry into the zip archive, taking content for the entry + /// from a string, and using the specified text encoding. + /// + /// + /// + /// + /// + /// Calling this method creates an entry using the given fileName and + /// directory path within the archive. There is no need for a file by the + /// given name to exist in the filesystem; the name is used within the zip + /// archive only. + /// + /// + /// + /// The content for the entry, a string value, is encoded using the given + /// text encoding. A BOM (byte-order-mark) is emitted into the file, if the + /// Encoding parameter is set for that. + /// + /// + /// + /// Most Encoding classes support a constructor that accepts a boolean, + /// indicating whether to emit a BOM or not. For example see . + /// + /// + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// + /// The content of the file, should it be extracted from the zip. + /// + /// + /// + /// The text encoding to use when encoding the string. Be aware: This is + /// distinct from the text encoding used to encode the fileName, as specified + /// in . + /// + /// + /// The ZipEntry added. + /// + public ZipEntry AddEntry(string entryName, string content, System.Text.Encoding encoding) + { + // cannot employ a using clause here. We need the stream to + // persist after exit from this method. + var ms = new MemoryStream(); + + // cannot use a using clause here; StreamWriter takes + // ownership of the stream and Disposes it before we are ready. + var sw = new StreamWriter(ms, encoding); + sw.Write(content); + sw.Flush(); + + // reset to allow reading later + ms.Seek(0, SeekOrigin.Begin); + + return AddEntry(entryName, ms); + + // must not dispose the MemoryStream - it will be used later. + } + + + /// + /// Create an entry in the ZipFile using the given Stream + /// as input. The entry will have the given filename. + /// + /// + /// + /// + /// + /// The application should provide an open, readable stream; in this case it + /// will be read during the call to or one of + /// its overloads. + /// + /// + /// + /// The passed stream will be read from its current position. If + /// necessary, callers should set the position in the stream before + /// calling AddEntry(). This might be appropriate when using this method + /// with a MemoryStream, for example. + /// + /// + /// + /// In cases where a large number of streams will be added to the + /// ZipFile, the application may wish to avoid maintaining all of the + /// streams open simultaneously. To handle this situation, the application + /// should use the + /// overload. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// This example adds a single entry to a ZipFile via a Stream. + /// + /// + /// + /// String zipToCreate = "Content.zip"; + /// String fileNameInArchive = "Content-From-Stream.bin"; + /// using (System.IO.Stream streamToRead = MyStreamOpener()) + /// { + /// using (ZipFile zip = new ZipFile()) + /// { + /// ZipEntry entry= zip.AddEntry(fileNameInArchive, streamToRead); + /// zip.AddFile("Readme.txt"); + /// zip.Save(zipToCreate); // the stream is read implicitly here + /// } + /// } + /// + /// + /// + /// Dim zipToCreate As String = "Content.zip" + /// Dim fileNameInArchive As String = "Content-From-Stream.bin" + /// Using streamToRead as System.IO.Stream = MyStreamOpener() + /// Using zip As ZipFile = New ZipFile() + /// Dim entry as ZipEntry = zip.AddEntry(fileNameInArchive, streamToRead) + /// zip.AddFile("Readme.txt") + /// zip.Save(zipToCreate) '' the stream is read implicitly, here + /// End Using + /// End Using + /// + /// + /// + /// + /// + /// + /// The name, including any path, which is shown in the zip file for the added + /// entry. + /// + /// + /// The input stream from which to grab content for the file + /// + /// The ZipEntry added. + public ZipEntry AddEntry(string entryName, Stream stream) + { + ZipEntry ze = ZipEntry.CreateForStream(entryName, stream); + ze.SetEntryTimes(DateTime.Now,DateTime.Now,DateTime.Now); + if (Verbose) StatusMessageTextWriter.WriteLine("adding {0}...", entryName); + return _InternalAddEntry(ze); + } + + + + /// + /// Add a ZipEntry for which content is written directly by the application. + /// + /// + /// + /// + /// When the application needs to write the zip entry data, use this + /// method to add the ZipEntry. For example, in the case that the + /// application wishes to write the XML representation of a DataSet into + /// a ZipEntry, the application can use this method to do so. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// About progress events: When using the WriteDelegate, DotNetZip does + /// not issue any SaveProgress events with EventType = + /// Saving_EntryBytesRead. (This is because it is the + /// application's code that runs in WriteDelegate - there's no way for + /// DotNetZip to know when to issue a EntryBytesRead event.) + /// Applications that want to update a progress bar or similar status + /// indicator should do so from within the WriteDelegate + /// itself. DotNetZip will issue the other SaveProgress events, + /// including + /// Saving_Started, + /// + /// Saving_BeforeWriteEntry, and + /// Saving_AfterWriteEntry. + /// + /// + /// + /// Note: When you use PKZip encryption, it's normally necessary to + /// compute the CRC of the content to be encrypted, before compressing or + /// encrypting it. Therefore, when using PKZip encryption with a + /// WriteDelegate, the WriteDelegate CAN BE called twice: once to compute + /// the CRC, and the second time to potentially compress and + /// encrypt. Surprising, but true. This is because PKWARE specified that + /// the encryption initialization data depends on the CRC. + /// If this happens, for each call of the delegate, your + /// application must stream the same entry data in its entirety. If your + /// application writes different data during the second call, it will + /// result in a corrupt zip file. + /// + /// + /// + /// The double-read behavior happens with all types of entries, not only + /// those that use WriteDelegate. It happens if you add an entry from a + /// filesystem file, or using a string, or a stream, or an opener/closer + /// pair. But in those cases, DotNetZip takes care of reading twice; in + /// the case of the WriteDelegate, the application code gets invoked + /// twice. Be aware. + /// + /// + /// + /// As you can imagine, this can cause performance problems for large + /// streams, and it can lead to correctness problems when you use a + /// WriteDelegate. This is a pretty big pitfall. There are two + /// ways to avoid it. First, and most preferred: don't use PKZIP + /// encryption. If you use the WinZip AES encryption, this problem + /// doesn't occur, because the encryption protocol doesn't require the CRC + /// up front. Second: if you do choose to use PKZIP encryption, write out + /// to a non-seekable stream (like standard output, or the + /// Response.OutputStream in an ASP.NET application). In this case, + /// DotNetZip will use an alternative encryption protocol that does not + /// rely on the CRC of the content. This also implies setting bit 3 in + /// the zip entry, which still presents problems for some zip tools. + /// + /// + /// + /// In the future I may modify DotNetZip to *always* use bit 3 when PKZIP + /// encryption is in use. This seems like a win overall, but there will + /// be some work involved. If you feel strongly about it, visit the + /// DotNetZip forums and vote up the Workitem + /// tracking this issue. + /// + /// + /// + /// + /// the name of the entry to add + /// the delegate which will write the entry content + /// the ZipEntry added + /// + /// + /// + /// This example shows an application filling a DataSet, then saving the + /// contents of that DataSet as XML, into a ZipEntry in a ZipFile, using an + /// anonymous delegate in C#. The DataSet XML is never saved to a disk file. + /// + /// + /// var c1= new System.Data.SqlClient.SqlConnection(connstring1); + /// var da = new System.Data.SqlClient.SqlDataAdapter() + /// { + /// SelectCommand= new System.Data.SqlClient.SqlCommand(strSelect, c1) + /// }; + /// + /// DataSet ds1 = new DataSet(); + /// da.Fill(ds1, "Invoices"); + /// + /// using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) + /// { + /// zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) ); + /// zip.Save(zipFileName); + /// } + /// + /// + /// + /// + /// + /// This example uses an anonymous method in C# as the WriteDelegate to provide + /// the data for the ZipEntry. The example is a bit contrived - the + /// AddFile() method is a simpler way to insert the contents of a file + /// into an entry in a zip file. On the other hand, if there is some sort of + /// processing or transformation of the file contents required before writing, + /// the application could use the WriteDelegate to do it, in this way. + /// + /// + /// using (var input = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite )) + /// { + /// using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) + /// { + /// zip.AddEntry(zipEntryName, (name,output) => + /// { + /// byte[] buffer = new byte[BufferSize]; + /// int n; + /// while ((n = input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// // could transform the data here... + /// output.Write(buffer, 0, n); + /// // could update a progress bar here + /// } + /// }); + /// + /// zip.Save(zipFileName); + /// } + /// } + /// + /// + /// + /// + /// + /// This example uses a named delegate in VB to write data for the given + /// ZipEntry (VB9 does not have anonymous delegates). The example here is a bit + /// contrived - a simpler way to add the contents of a file to a ZipEntry is to + /// simply use the appropriate AddFile() method. The key scenario for + /// which the WriteDelegate makes sense is saving a DataSet, in XML + /// format, to the zip file. The DataSet can write XML to a stream, and the + /// WriteDelegate is the perfect place to write into the zip file. There may be + /// other data structures that can write to a stream, but cannot be read as a + /// stream. The WriteDelegate would be appropriate for those cases as + /// well. + /// + /// + /// Private Sub WriteEntry (ByVal name As String, ByVal output As Stream) + /// Using input As FileStream = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + /// Dim n As Integer = -1 + /// Dim buffer As Byte() = New Byte(BufferSize){} + /// Do While n <> 0 + /// n = input.Read(buffer, 0, buffer.Length) + /// output.Write(buffer, 0, n) + /// Loop + /// End Using + /// End Sub + /// + /// Public Sub Run() + /// Using zip = New ZipFile + /// zip.AddEntry(zipEntryName, New WriteDelegate(AddressOf WriteEntry)) + /// zip.Save(zipFileName) + /// End Using + /// End Sub + /// + /// + public ZipEntry AddEntry(string entryName, WriteDelegate writer) + { + ZipEntry ze = ZipEntry.CreateForWriter(entryName, writer); + if (Verbose) StatusMessageTextWriter.WriteLine("adding {0}...", entryName); + return _InternalAddEntry(ze); + } + + + /// + /// Add an entry, for which the application will provide a stream + /// containing the entry data, on a just-in-time basis. + /// + /// + /// + /// + /// In cases where the application wishes to open the stream that + /// holds the content for the ZipEntry, on a just-in-time basis, the + /// application can use this method. The application provides an + /// opener delegate that will be called by the DotNetZip library to + /// obtain a readable stream that can be read to get the bytes for + /// the given entry. Typically, this delegate opens a stream. + /// Optionally, the application can provide a closer delegate as + /// well, which will be called by DotNetZip when all bytes have been + /// read from the entry. + /// + /// + /// + /// These delegates are called from within the scope of the call to + /// ZipFile.Save(). + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// This example uses anonymous methods in C# to open and close the + /// source stream for the content for a zip entry. + /// + /// + /// using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) + /// { + /// zip.AddEntry(zipEntryName, + /// (name) => File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ), + /// (name, stream) => stream.Close() + /// ); + /// + /// zip.Save(zipFileName); + /// } + /// + /// + /// + /// + /// + /// + /// This example uses delegates in VB.NET to open and close the + /// the source stream for the content for a zip entry. VB 9.0 lacks + /// support for "Sub" lambda expressions, and so the CloseDelegate must + /// be an actual, named Sub. + /// + /// + /// + /// Function MyStreamOpener(ByVal entryName As String) As Stream + /// '' This simply opens a file. You probably want to do somethinig + /// '' more involved here: open a stream to read from a database, + /// '' open a stream on an HTTP connection, and so on. + /// Return File.OpenRead(entryName) + /// End Function + /// + /// Sub MyStreamCloser(entryName As String, stream As Stream) + /// stream.Close() + /// End Sub + /// + /// Public Sub Run() + /// Dim dirToZip As String = "fodder" + /// Dim zipFileToCreate As String = "Archive.zip" + /// Dim opener As OpenDelegate = AddressOf MyStreamOpener + /// Dim closer As CloseDelegate = AddressOf MyStreamCloser + /// Dim numFilestoAdd As Int32 = 4 + /// Using zip As ZipFile = New ZipFile + /// Dim i As Integer + /// For i = 0 To numFilesToAdd - 1 + /// zip.AddEntry(String.Format("content-{0:000}.txt"), opener, closer) + /// Next i + /// zip.Save(zipFileToCreate) + /// End Using + /// End Sub + /// + /// + /// + /// + /// the name of the entry to add + /// + /// the delegate that will be invoked by ZipFile.Save() to get the + /// readable stream for the given entry. ZipFile.Save() will call + /// read on this stream to obtain the data for the entry. This data + /// will then be compressed and written to the newly created zip + /// file. + /// + /// + /// the delegate that will be invoked to close the stream. This may + /// be null (Nothing in VB), in which case no call is makde to close + /// the stream. + /// + /// the ZipEntry added + /// + public ZipEntry AddEntry(string entryName, OpenDelegate opener, CloseDelegate closer) + { + ZipEntry ze = ZipEntry.CreateForJitStreamProvider(entryName, opener, closer); + ze.SetEntryTimes(DateTime.Now,DateTime.Now,DateTime.Now); + if (Verbose) StatusMessageTextWriter.WriteLine("adding {0}...", entryName); + return _InternalAddEntry(ze); + } + + + + private ZipEntry _InternalAddEntry(ZipEntry ze) + { + // stamp all the props onto the entry + ze._container = new ZipContainer(this); + ze.CompressionMethod = this.CompressionMethod; + ze.CompressionLevel = this.CompressionLevel; + ze.ExtractExistingFile = this.ExtractExistingFile; + ze.ZipErrorAction = this.ZipErrorAction; + ze.SetCompression = this.SetCompression; + ze.AlternateEncoding = this.AlternateEncoding; + ze.AlternateEncodingUsage = this.AlternateEncodingUsage; + ze.Password = this._Password; + ze.Encryption = this.Encryption; + ze.EmitTimesInWindowsFormatWhenSaving = this._emitNtfsTimes; + ze.EmitTimesInUnixFormatWhenSaving = this._emitUnixTimes; + //string key = DictionaryKeyForEntry(ze); + InternalAddEntry(ze.FileName,ze); + AfterAddEntry(ze); + return ze; + } + + + + + /// + /// Updates the given entry in the ZipFile, using the given + /// string as content for the ZipEntry. + /// + /// + /// + /// + /// + /// Calling this method is equivalent to removing the ZipEntry for + /// the given file name and directory path, if it exists, and then calling + /// . See the documentation for + /// that method for further explanation. The string content is encoded + /// using the default encoding for the machine, or on Silverlight, using + /// UTF-8. This encoding is distinct from the encoding used for the + /// filename itself. See . + /// + /// + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// + /// The content of the file, should it be extracted from the zip. + /// + /// + /// The ZipEntry added. + /// + public ZipEntry UpdateEntry(string entryName, string content) + { +#if SILVERLIGHT + return UpdateEntry(entryName, content, System.Text.Encoding.UTF8); +#else + return UpdateEntry(entryName, content, System.Text.Encoding.Default); +#endif + } + + + /// + /// Updates the given entry in the ZipFile, using the given string as + /// content for the ZipEntry. + /// + /// + /// + /// Calling this method is equivalent to removing the ZipEntry for the + /// given file name and directory path, if it exists, and then calling . See the + /// documentation for that method for further explanation. + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// + /// The content of the file, should it be extracted from the zip. + /// + /// + /// + /// The text encoding to use when encoding the string. Be aware: This is + /// distinct from the text encoding used to encode the filename. See . + /// + /// + /// The ZipEntry added. + /// + public ZipEntry UpdateEntry(string entryName, string content, System.Text.Encoding encoding) + { + RemoveEntryForUpdate(entryName); + return AddEntry(entryName, content, encoding); + } + + + + /// + /// Updates the given entry in the ZipFile, using the given delegate + /// as the source for content for the ZipEntry. + /// + /// + /// + /// Calling this method is equivalent to removing the ZipEntry for the + /// given file name and directory path, if it exists, and then calling . See the + /// documentation for that method for further explanation. + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// the delegate which will write the entry content. + /// + /// The ZipEntry added. + /// + public ZipEntry UpdateEntry(string entryName, WriteDelegate writer) + { + RemoveEntryForUpdate(entryName); + return AddEntry(entryName, writer); + } + + + + /// + /// Updates the given entry in the ZipFile, using the given delegates + /// to open and close the stream that provides the content for the ZipEntry. + /// + /// + /// + /// Calling this method is equivalent to removing the ZipEntry for the + /// given file name and directory path, if it exists, and then calling . See the + /// documentation for that method for further explanation. + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// + /// the delegate that will be invoked to open the stream + /// + /// + /// the delegate that will be invoked to close the stream + /// + /// + /// The ZipEntry added or updated. + /// + public ZipEntry UpdateEntry(string entryName, OpenDelegate opener, CloseDelegate closer) + { + RemoveEntryForUpdate(entryName); + return AddEntry(entryName, opener, closer); + } + + + /// + /// Updates the given entry in the ZipFile, using the given stream as + /// input, and the given filename and given directory Path. + /// + /// + /// + /// + /// Calling the method is equivalent to calling RemoveEntry() if an + /// entry by the same name already exists, and then calling AddEntry() + /// with the given fileName and stream. + /// + /// + /// + /// The stream must be open and readable during the call to + /// ZipFile.Save. You can dispense the stream on a just-in-time basis + /// using the property. Check the + /// documentation of that property for more information. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to the + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// The input stream from which to read file data. + /// The ZipEntry added. + public ZipEntry UpdateEntry(string entryName, Stream stream) + { + RemoveEntryForUpdate(entryName); + return AddEntry(entryName, stream); + } + + + private void RemoveEntryForUpdate(string entryName) + { + if (String.IsNullOrEmpty(entryName)) + throw new ArgumentNullException("entryName"); + + string directoryPathInArchive = null; + if (entryName.IndexOf('\\') != -1) + { + directoryPathInArchive = Path.GetDirectoryName(entryName); + entryName = Path.GetFileName(entryName); + } + var key = ZipEntry.NameInArchive(entryName, directoryPathInArchive); + if (this[key] != null) + this.RemoveEntry(key); + } + + + + + /// + /// Add an entry into the zip archive using the given filename and + /// directory path within the archive, and the given content for the + /// file. No file is created in the filesystem. + /// + /// + /// The data to use for the entry. + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// The ZipEntry added. + public ZipEntry AddEntry(string entryName, byte[] byteContent) + { + if (byteContent == null) throw new ArgumentException("bad argument", "byteContent"); + var ms = new MemoryStream(byteContent); + return AddEntry(entryName, ms); + } + + + /// + /// Updates the given entry in the ZipFile, using the given byte + /// array as content for the entry. + /// + /// + /// + /// Calling this method is equivalent to removing the ZipEntry + /// for the given filename and directory path, if it exists, and then + /// calling . See the + /// documentation for that method for further explanation. + /// + /// + /// + /// The name, including any path, to use within the archive for the entry. + /// + /// + /// The content to use for the ZipEntry. + /// + /// The ZipEntry added. + /// + public ZipEntry UpdateEntry(string entryName, byte[] byteContent) + { + RemoveEntryForUpdate(entryName); + return AddEntry(entryName, byteContent); + } + + +// private string DictionaryKeyForEntry(ZipEntry ze1) +// { +// var filename = SharedUtilities.NormalizePathForUseInZipFile(ze1.FileName); +// return filename; +// } + + + /// + /// Adds the contents of a filesystem directory to a Zip file archive. + /// + /// + /// + /// + /// + /// The name of the directory may be a relative path or a fully-qualified + /// path. Any files within the named directory are added to the archive. Any + /// subdirectories within the named directory are also added to the archive, + /// recursively. + /// + /// + /// + /// Top-level entries in the named directory will appear as top-level entries + /// in the zip archive. Entries in subdirectories in the named directory will + /// result in entries in subdirectories in the zip archive. + /// + /// + /// + /// If you want the entries to appear in a containing directory in the zip + /// archive itself, then you should call the AddDirectory() overload that + /// allows you to explicitly specify a directory path for use in the archive. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to each + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// This method has 2 overloads. + /// + /// The name of the directory to add. + /// The ZipEntry added. + public ZipEntry AddDirectory(string directoryName) + { + return AddDirectory(directoryName, null); + } + + + /// + /// Adds the contents of a filesystem directory to a Zip file archive, + /// overriding the path to be used for entries in the archive. + /// + /// + /// + /// + /// The name of the directory may be a relative path or a fully-qualified + /// path. The add operation is recursive, so that any files or subdirectories + /// within the name directory are also added to the archive. + /// + /// + /// + /// Top-level entries in the named directory will appear as top-level entries + /// in the zip archive. Entries in subdirectories in the named directory will + /// result in entries in subdirectories in the zip archive. + /// + /// + /// + /// For ZipFile properties including , , , , , + /// , and , their + /// respective values at the time of this call will be applied to each + /// ZipEntry added. + /// + /// + /// + /// + /// + /// + /// In this code, calling the ZipUp() method with a value of "c:\reports" for + /// the directory parameter will result in a zip file structure in which all + /// entries are contained in a toplevel "reports" directory. + /// + /// + /// + /// public void ZipUp(string targetZip, string directory) + /// { + /// using (var zip = new ZipFile()) + /// { + /// zip.AddDirectory(directory, System.IO.Path.GetFileName(directory)); + /// zip.Save(targetZip); + /// } + /// } + /// + /// + /// + /// + /// + /// + /// + /// The name of the directory to add. + /// + /// + /// Specifies a directory path to use to override any path in the + /// DirectoryName. This path may, or may not, correspond to a real directory + /// in the current filesystem. If the zip is later extracted, this is the + /// path used for the extracted file or directory. Passing null + /// (Nothing in VB) or the empty string ("") will insert the items at + /// the root path within the archive. + /// + /// + /// The ZipEntry added. + public ZipEntry AddDirectory(string directoryName, string directoryPathInArchive) + { + return AddOrUpdateDirectoryImpl(directoryName, directoryPathInArchive, AddOrUpdateAction.AddOnly); + } + + + /// + /// Creates a directory in the zip archive. + /// + /// + /// + /// + /// + /// Use this when you want to create a directory in the archive but there is + /// no corresponding filesystem representation for that directory. + /// + /// + /// + /// You will probably not need to do this in your code. One of the only times + /// you will want to do this is if you want an empty directory in the zip + /// archive. The reason: if you add a file to a zip archive that is stored + /// within a multi-level directory, all of the directory tree is implicitly + /// created in the zip archive. + /// + /// + /// + /// + /// + /// The name of the directory to create in the archive. + /// + /// The ZipEntry added. + public ZipEntry AddDirectoryByName(string directoryNameInArchive) + { + // workitem 9073 + ZipEntry dir = ZipEntry.CreateFromNothing(directoryNameInArchive); + dir._container = new ZipContainer(this); + dir.MarkAsDirectory(); + dir.AlternateEncoding = this.AlternateEncoding; // workitem 8984 + dir.AlternateEncodingUsage = this.AlternateEncodingUsage; + dir.SetEntryTimes(DateTime.Now,DateTime.Now,DateTime.Now); + dir.EmitTimesInWindowsFormatWhenSaving = _emitNtfsTimes; + dir.EmitTimesInUnixFormatWhenSaving = _emitUnixTimes; + dir._Source = ZipEntrySource.Stream; + //string key = DictionaryKeyForEntry(dir); + InternalAddEntry(dir.FileName,dir); + AfterAddEntry(dir); + return dir; + } + + + + private ZipEntry AddOrUpdateDirectoryImpl(string directoryName, + string rootDirectoryPathInArchive, + AddOrUpdateAction action) + { + if (rootDirectoryPathInArchive == null) + { + rootDirectoryPathInArchive = ""; + } + + return AddOrUpdateDirectoryImpl(directoryName, rootDirectoryPathInArchive, action, true, 0); + } + + + internal void InternalAddEntry(String name, ZipEntry entry) + { + _entries.Add(name, entry); + _zipEntriesAsList = null; + _contentsChanged = true; + } + + + + private ZipEntry AddOrUpdateDirectoryImpl(string directoryName, + string rootDirectoryPathInArchive, + AddOrUpdateAction action, + bool recurse, + int level) + { + if (Verbose) + StatusMessageTextWriter.WriteLine("{0} {1}...", + (action == AddOrUpdateAction.AddOnly) ? "adding" : "Adding or updating", + directoryName); + + if (level == 0) + { + _addOperationCanceled = false; + OnAddStarted(); + } + + // workitem 13371 + if (_addOperationCanceled) + return null; + + string dirForEntries = rootDirectoryPathInArchive; + ZipEntry baseDir = null; + + if (level > 0) + { + int f = directoryName.Length; + for (int i = level; i > 0; i--) + f = directoryName.LastIndexOfAny("/\\".ToCharArray(), f - 1, f - 1); + + dirForEntries = directoryName.Substring(f + 1); + dirForEntries = Path.Combine(rootDirectoryPathInArchive, dirForEntries); + } + + // if not top level, or if the root is non-empty, then explicitly add the directory + if (level > 0 || rootDirectoryPathInArchive != "") + { + baseDir = ZipEntry.CreateFromFile(directoryName, dirForEntries); + baseDir._container = new ZipContainer(this); + baseDir.AlternateEncoding = this.AlternateEncoding; // workitem 6410 + baseDir.AlternateEncodingUsage = this.AlternateEncodingUsage; + baseDir.MarkAsDirectory(); + baseDir.EmitTimesInWindowsFormatWhenSaving = _emitNtfsTimes; + baseDir.EmitTimesInUnixFormatWhenSaving = _emitUnixTimes; + + // add the directory only if it does not exist. + // It's not an error if it already exists. + if (!_entries.ContainsKey(baseDir.FileName)) + { + InternalAddEntry(baseDir.FileName,baseDir); + AfterAddEntry(baseDir); + } + dirForEntries = baseDir.FileName; + } + + if (!_addOperationCanceled) + { + + String[] filenames = Directory.GetFiles(directoryName); + + if (recurse) + { + // add the files: + foreach (String filename in filenames) + { + if (_addOperationCanceled) break; + if (action == AddOrUpdateAction.AddOnly) + AddFile(filename, dirForEntries); + else + UpdateFile(filename, dirForEntries); + } + + if (!_addOperationCanceled) + { + // add the subdirectories: + String[] dirnames = Directory.GetDirectories(directoryName); + foreach (String dir in dirnames) + { + // workitem 8617: Optionally traverse reparse points +#if SILVERLIGHT +#elif NETCF + FileAttributes fileAttrs = (FileAttributes) NetCfFile.GetAttributes(dir); +#else + FileAttributes fileAttrs = System.IO.File.GetAttributes(dir); +#endif + if (this.AddDirectoryWillTraverseReparsePoints +#if !SILVERLIGHT + || ((fileAttrs & FileAttributes.ReparsePoint) == 0) +#endif + ) + AddOrUpdateDirectoryImpl(dir, rootDirectoryPathInArchive, action, recurse, level + 1); + + } + + } + } + } + + if (level == 0) + OnAddCompleted(); + + return baseDir; + } + + } + +} diff --git a/dotNetZip/Zip/ZipFile.Check.cs b/dotNetZip/Zip/ZipFile.Check.cs new file mode 100644 index 0000000..b8307d5 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.Check.cs @@ -0,0 +1,352 @@ +// ZipFile.Check.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-31 14:40:50> +// +// ------------------------------------------------------------------ +// +// This module defines the methods for doing Checks on zip files. +// These are not necessary to include in the Reduced or CF +// version of the library. +// +// ------------------------------------------------------------------ +// + + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + public partial class ZipFile + { + /// + /// Checks a zip file to see if its directory is consistent. + /// + /// + /// + /// + /// + /// In cases of data error, the directory within a zip file can get out + /// of synch with the entries in the zip file. This method checks the + /// given zip file and returns true if this has occurred. + /// + /// + /// This method may take a long time to run for large zip files. + /// + /// + /// This method is not supported in the Reduced or Compact Framework + /// versions of DotNetZip. + /// + /// + /// + /// Developers using COM can use the ComHelper.CheckZip(String) + /// method. + /// + /// + /// + /// + /// The filename to of the zip file to check. + /// + /// true if the named zip file checks OK. Otherwise, false. + /// + /// + /// + public static bool CheckZip(string zipFileName) + { + return CheckZip(zipFileName, false, null); + } + + + /// + /// Checks a zip file to see if its directory is consistent, + /// and optionally fixes the directory if necessary. + /// + /// + /// + /// + /// + /// In cases of data error, the directory within a zip file can get out of + /// synch with the entries in the zip file. This method checks the given + /// zip file, and returns true if this has occurred. It also optionally + /// fixes the zipfile, saving the fixed copy in Name_Fixed.zip. + /// + /// + /// + /// This method may take a long time to run for large zip files. It + /// will take even longer if the file actually needs to be fixed, and if + /// fixIfNecessary is true. + /// + /// + /// + /// This method is not supported in the Reduced or Compact + /// Framework versions of DotNetZip. + /// + /// + /// + /// + /// The filename to of the zip file to check. + /// + /// If true, the method will fix the zip file if + /// necessary. + /// + /// + /// a TextWriter in which messages generated while checking will be written. + /// + /// + /// true if the named zip is OK; false if the file needs to be fixed. + /// + /// + /// + public static bool CheckZip(string zipFileName, bool fixIfNecessary, + TextWriter writer) + + { + ZipFile zip1 = null, zip2 = null; + bool isOk = true; + try + { + zip1 = new ZipFile(); + zip1.FullScan = true; + zip1.Initialize(zipFileName); + + zip2 = ZipFile.Read(zipFileName); + + foreach (var e1 in zip1) + { + foreach (var e2 in zip2) + { + if (e1.FileName == e2.FileName) + { + if (e1._RelativeOffsetOfLocalHeader != e2._RelativeOffsetOfLocalHeader) + { + isOk = false; + if (writer != null) + writer.WriteLine("{0}: mismatch in RelativeOffsetOfLocalHeader (0x{1:X16} != 0x{2:X16})", + e1.FileName, e1._RelativeOffsetOfLocalHeader, + e2._RelativeOffsetOfLocalHeader); + } + if (e1._CompressedSize != e2._CompressedSize) + { + isOk = false; + if (writer != null) + writer.WriteLine("{0}: mismatch in CompressedSize (0x{1:X16} != 0x{2:X16})", + e1.FileName, e1._CompressedSize, + e2._CompressedSize); + } + if (e1._UncompressedSize != e2._UncompressedSize) + { + isOk = false; + if (writer != null) + writer.WriteLine("{0}: mismatch in UncompressedSize (0x{1:X16} != 0x{2:X16})", + e1.FileName, e1._UncompressedSize, + e2._UncompressedSize); + } + if (e1.CompressionMethod != e2.CompressionMethod) + { + isOk = false; + if (writer != null) + writer.WriteLine("{0}: mismatch in CompressionMethod (0x{1:X4} != 0x{2:X4})", + e1.FileName, e1.CompressionMethod, + e2.CompressionMethod); + } + if (e1.Crc != e2.Crc) + { + isOk = false; + if (writer != null) + writer.WriteLine("{0}: mismatch in Crc32 (0x{1:X4} != 0x{2:X4})", + e1.FileName, e1.Crc, + e2.Crc); + } + + // found a match, so stop the inside loop + break; + } + } + } + + zip2.Dispose(); + zip2 = null; + + if (!isOk && fixIfNecessary) + { + string newFileName = Path.GetFileNameWithoutExtension(zipFileName); + newFileName = System.String.Format("{0}_fixed.zip", newFileName); + zip1.Save(newFileName); + } + } + finally + { + if (zip1 != null) zip1.Dispose(); + if (zip2 != null) zip2.Dispose(); + } + return isOk; + } + + + + /// + /// Rewrite the directory within a zipfile. + /// + /// + /// + /// + /// + /// In cases of data error, the directory in a zip file can get out of + /// synch with the entries in the zip file. This method attempts to fix + /// the zip file if this has occurred. + /// + /// + /// This can take a long time for large zip files. + /// + /// This won't work if the zip file uses a non-standard + /// code page - neither IBM437 nor UTF-8. + /// + /// + /// This method is not supported in the Reduced or Compact Framework + /// versions of DotNetZip. + /// + /// + /// + /// Developers using COM can use the ComHelper.FixZipDirectory(String) + /// method. + /// + /// + /// + /// + /// The filename to of the zip file to fix. + /// + /// + /// + public static void FixZipDirectory(string zipFileName) + { + using (var zip = new ZipFile()) + { + zip.FullScan = true; + zip.Initialize(zipFileName); + zip.Save(zipFileName); + } + } + + + + /// + /// Verify the password on a zip file. + /// + /// + /// + /// + /// Keep in mind that passwords in zipfiles are applied to + /// zip entries, not to the entire zip file. So testing a + /// zipfile for a particular password doesn't work in the + /// general case. On the other hand, it's often the case + /// that a single password will be used on all entries in a + /// zip file. This method works for that case. + /// + /// + /// There is no way to check a password without doing the + /// decryption. So this code decrypts and extracts the given + /// zipfile into + /// + /// + /// + /// The filename to of the zip file to fix. + /// + /// The password to check. + /// + /// a bool indicating whether the password matches. + public static bool CheckZipPassword(string zipFileName, string password) + { + // workitem 13664 + bool success = false; + try + { + using (ZipFile zip1 = ZipFile.Read(zipFileName)) + { + foreach (var e in zip1) + { + if (!e.IsDirectory && e.UsesEncryption) + { + e.ExtractWithPassword(System.IO.Stream.Null, password); + } + } + } + success = true; + } + catch(Ionic.Zip.BadPasswordException) { } + return success; + } + + + /// + /// Provides a human-readable string with information about the ZipFile. + /// + /// + /// + /// + /// The information string contains 10 lines or so, about each ZipEntry, + /// describing whether encryption is in use, the compressed and uncompressed + /// length of the entry, the offset of the entry, and so on. As a result the + /// information string can be very long for zip files that contain many + /// entries. + /// + /// + /// This information is mostly useful for diagnostic purposes. + /// + /// + public string Info + { + get + { + var builder = new System.Text.StringBuilder(); + builder.Append(string.Format(" ZipFile: {0}\n", this.Name)); + if (!string.IsNullOrEmpty(this._Comment)) + { + builder.Append(string.Format(" Comment: {0}\n", this._Comment)); + } + if (this._versionMadeBy != 0) + { + builder.Append(string.Format(" version made by: 0x{0:X4}\n", this._versionMadeBy)); + } + if (this._versionNeededToExtract != 0) + { + builder.Append(string.Format("needed to extract: 0x{0:X4}\n", this._versionNeededToExtract)); + } + + builder.Append(string.Format(" uses ZIP64: {0}\n", this.InputUsesZip64)); + + builder.Append(string.Format(" disk with CD: {0}\n", this._diskNumberWithCd)); + if (this._OffsetOfCentralDirectory == 0xFFFFFFFF) + builder.Append(string.Format(" CD64 offset: 0x{0:X16}\n", this._OffsetOfCentralDirectory64)); + else + builder.Append(string.Format(" CD offset: 0x{0:X8}\n", this._OffsetOfCentralDirectory)); + builder.Append("\n"); + foreach (ZipEntry entry in this._entries.Values) + { + builder.Append(entry.Info); + } + return builder.ToString(); + } + } + + + } + +} \ No newline at end of file diff --git a/dotNetZip/Zip/ZipFile.Events.cs b/dotNetZip/Zip/ZipFile.Events.cs new file mode 100644 index 0000000..110ee6d --- /dev/null +++ b/dotNetZip/Zip/ZipFile.Events.cs @@ -0,0 +1,1219 @@ +// ZipFile.Events.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008, 2009, 2011 Dino Chiesa . +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-09 08:42:35> +// +// ------------------------------------------------------------------ +// +// This module defines the methods for issuing events from the ZipFile class. +// +// ------------------------------------------------------------------ +// + +using System; +using System.IO; + +namespace Ionic.Zip +{ + public partial class ZipFile + { + private string ArchiveNameForEvent + { + get + { + return (_name != null) ? _name : "(stream)"; + } + } + + #region Save + + /// + /// An event handler invoked when a Save() starts, before and after each + /// entry has been written to the archive, when a Save() completes, and + /// during other Save events. + /// + /// + /// + /// + /// Depending on the particular event, different properties on the parameter are set. The following + /// table summarizes the available EventTypes and the conditions under + /// which this event handler is invoked with a + /// SaveProgressEventArgs with the given EventType. + /// + /// + /// + /// + /// value of EntryType + /// Meaning and conditions + /// + /// + /// + /// ZipProgressEventType.Saving_Started + /// Fired when ZipFile.Save() begins. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_BeforeSaveEntry + /// + /// Fired within ZipFile.Save(), just before writing data for each + /// particular entry. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_AfterSaveEntry + /// + /// Fired within ZipFile.Save(), just after having finished writing data + /// for each particular entry. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_Completed + /// Fired when ZipFile.Save() has completed. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_AfterSaveTempArchive + /// + /// Fired after the temporary file has been created. This happens only + /// when saving to a disk file. This event will not be invoked when + /// saving to a stream. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_BeforeRenameTempArchive + /// + /// Fired just before renaming the temporary file to the permanent + /// location. This happens only when saving to a disk file. This event + /// will not be invoked when saving to a stream. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_AfterRenameTempArchive + /// + /// Fired just after renaming the temporary file to the permanent + /// location. This happens only when saving to a disk file. This event + /// will not be invoked when saving to a stream. + /// + /// + /// + /// + /// ZipProgressEventType.Saving_AfterCompileSelfExtractor + /// + /// Fired after a self-extracting archive has finished compiling. This + /// EventType is used only within SaveSelfExtractor(). + /// + /// + /// + /// + /// ZipProgressEventType.Saving_BytesRead + /// + /// Set during the save of a particular entry, to update progress of the + /// Save(). When this EventType is set, the BytesTransferred is the + /// number of bytes that have been read from the source stream. The + /// TotalBytesToTransfer is the number of bytes in the uncompressed + /// file. + /// + /// + /// + /// + /// + /// + /// + /// + /// This example uses an anonymous method to handle the + /// SaveProgress event, by updating a progress bar. + /// + /// + /// progressBar1.Value = 0; + /// progressBar1.Max = listbox1.Items.Count; + /// using (ZipFile zip = new ZipFile()) + /// { + /// // listbox1 contains a list of filenames + /// zip.AddFiles(listbox1.Items); + /// + /// // do the progress bar: + /// zip.SaveProgress += (sender, e) => { + /// if (e.EventType == ZipProgressEventType.Saving_BeforeWriteEntry) { + /// progressBar1.PerformStep(); + /// } + /// }; + /// + /// zip.Save(fs); + /// } + /// + /// + /// + /// + /// This example uses a named method as the + /// SaveProgress event handler, to update the user, in a + /// console-based application. + /// + /// + /// static bool justHadByteUpdate= false; + /// public static void SaveProgress(object sender, SaveProgressEventArgs e) + /// { + /// if (e.EventType == ZipProgressEventType.Saving_Started) + /// Console.WriteLine("Saving: {0}", e.ArchiveName); + /// + /// else if (e.EventType == ZipProgressEventType.Saving_Completed) + /// { + /// justHadByteUpdate= false; + /// Console.WriteLine(); + /// Console.WriteLine("Done: {0}", e.ArchiveName); + /// } + /// + /// else if (e.EventType == ZipProgressEventType.Saving_BeforeWriteEntry) + /// { + /// if (justHadByteUpdate) + /// Console.WriteLine(); + /// Console.WriteLine(" Writing: {0} ({1}/{2})", + /// e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal); + /// justHadByteUpdate= false; + /// } + /// + /// else if (e.EventType == ZipProgressEventType.Saving_EntryBytesRead) + /// { + /// if (justHadByteUpdate) + /// Console.SetCursorPosition(0, Console.CursorTop); + /// Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, + /// e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); + /// justHadByteUpdate= true; + /// } + /// } + /// + /// public static ZipUp(string targetZip, string directory) + /// { + /// using (var zip = new ZipFile()) { + /// zip.SaveProgress += SaveProgress; + /// zip.AddDirectory(directory); + /// zip.Save(targetZip); + /// } + /// } + /// + /// + /// + /// + /// Public Sub ZipUp(ByVal targetZip As String, ByVal directory As String) + /// Using zip As ZipFile = New ZipFile + /// AddHandler zip.SaveProgress, AddressOf MySaveProgress + /// zip.AddDirectory(directory) + /// zip.Save(targetZip) + /// End Using + /// End Sub + /// + /// Private Shared justHadByteUpdate As Boolean = False + /// + /// Public Shared Sub MySaveProgress(ByVal sender As Object, ByVal e As SaveProgressEventArgs) + /// If (e.EventType Is ZipProgressEventType.Saving_Started) Then + /// Console.WriteLine("Saving: {0}", e.ArchiveName) + /// + /// ElseIf (e.EventType Is ZipProgressEventType.Saving_Completed) Then + /// justHadByteUpdate = False + /// Console.WriteLine + /// Console.WriteLine("Done: {0}", e.ArchiveName) + /// + /// ElseIf (e.EventType Is ZipProgressEventType.Saving_BeforeWriteEntry) Then + /// If justHadByteUpdate Then + /// Console.WriteLine + /// End If + /// Console.WriteLine(" Writing: {0} ({1}/{2})", e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal) + /// justHadByteUpdate = False + /// + /// ElseIf (e.EventType Is ZipProgressEventType.Saving_EntryBytesRead) Then + /// If justHadByteUpdate Then + /// Console.SetCursorPosition(0, Console.CursorTop) + /// End If + /// Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, _ + /// e.TotalBytesToTransfer, _ + /// (CDbl(e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))) + /// justHadByteUpdate = True + /// End If + /// End Sub + /// + /// + /// + /// + /// + /// This is a more complete example of using the SaveProgress + /// events in a Windows Forms application, with a + /// Thread object. + /// + /// + /// delegate void SaveEntryProgress(SaveProgressEventArgs e); + /// delegate void ButtonClick(object sender, EventArgs e); + /// + /// public class WorkerOptions + /// { + /// public string ZipName; + /// public string Folder; + /// public string Encoding; + /// public string Comment; + /// public int ZipFlavor; + /// public Zip64Option Zip64; + /// } + /// + /// private int _progress2MaxFactor; + /// private bool _saveCanceled; + /// private long _totalBytesBeforeCompress; + /// private long _totalBytesAfterCompress; + /// private Thread _workerThread; + /// + /// + /// private void btnZipup_Click(object sender, EventArgs e) + /// { + /// KickoffZipup(); + /// } + /// + /// private void btnCancel_Click(object sender, EventArgs e) + /// { + /// if (this.lblStatus.InvokeRequired) + /// { + /// this.lblStatus.Invoke(new ButtonClick(this.btnCancel_Click), new object[] { sender, e }); + /// } + /// else + /// { + /// _saveCanceled = true; + /// lblStatus.Text = "Canceled..."; + /// ResetState(); + /// } + /// } + /// + /// private void KickoffZipup() + /// { + /// _folderName = tbDirName.Text; + /// + /// if (_folderName == null || _folderName == "") return; + /// if (this.tbZipName.Text == null || this.tbZipName.Text == "") return; + /// + /// // check for existence of the zip file: + /// if (System.IO.File.Exists(this.tbZipName.Text)) + /// { + /// var dlgResult = MessageBox.Show(String.Format("The file you have specified ({0}) already exists." + + /// " Do you want to overwrite this file?", this.tbZipName.Text), + /// "Confirmation is Required", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + /// if (dlgResult != DialogResult.Yes) return; + /// System.IO.File.Delete(this.tbZipName.Text); + /// } + /// + /// _saveCanceled = false; + /// _nFilesCompleted = 0; + /// _totalBytesAfterCompress = 0; + /// _totalBytesBeforeCompress = 0; + /// this.btnOk.Enabled = false; + /// this.btnOk.Text = "Zipping..."; + /// this.btnCancel.Enabled = true; + /// lblStatus.Text = "Zipping..."; + /// + /// var options = new WorkerOptions + /// { + /// ZipName = this.tbZipName.Text, + /// Folder = _folderName, + /// Encoding = "ibm437" + /// }; + /// + /// if (this.comboBox1.SelectedIndex != 0) + /// { + /// options.Encoding = this.comboBox1.SelectedItem.ToString(); + /// } + /// + /// if (this.radioFlavorSfxCmd.Checked) + /// options.ZipFlavor = 2; + /// else if (this.radioFlavorSfxGui.Checked) + /// options.ZipFlavor = 1; + /// else options.ZipFlavor = 0; + /// + /// if (this.radioZip64AsNecessary.Checked) + /// options.Zip64 = Zip64Option.AsNecessary; + /// else if (this.radioZip64Always.Checked) + /// options.Zip64 = Zip64Option.Always; + /// else options.Zip64 = Zip64Option.Never; + /// + /// options.Comment = String.Format("Encoding:{0} || Flavor:{1} || ZIP64:{2}\r\nCreated at {3} || {4}\r\n", + /// options.Encoding, + /// FlavorToString(options.ZipFlavor), + /// options.Zip64.ToString(), + /// System.DateTime.Now.ToString("yyyy-MMM-dd HH:mm:ss"), + /// this.Text); + /// + /// if (this.tbComment.Text != TB_COMMENT_NOTE) + /// options.Comment += this.tbComment.Text; + /// + /// _workerThread = new Thread(this.DoSave); + /// _workerThread.Name = "Zip Saver thread"; + /// _workerThread.Start(options); + /// this.Cursor = Cursors.WaitCursor; + /// } + /// + /// + /// private void DoSave(Object p) + /// { + /// WorkerOptions options = p as WorkerOptions; + /// try + /// { + /// using (var zip1 = new ZipFile()) + /// { + /// zip1.ProvisionalAlternateEncoding = System.Text.Encoding.GetEncoding(options.Encoding); + /// zip1.Comment = options.Comment; + /// zip1.AddDirectory(options.Folder); + /// _entriesToZip = zip1.EntryFileNames.Count; + /// SetProgressBars(); + /// zip1.SaveProgress += this.zip1_SaveProgress; + /// + /// zip1.UseZip64WhenSaving = options.Zip64; + /// + /// if (options.ZipFlavor == 1) + /// zip1.SaveSelfExtractor(options.ZipName, SelfExtractorFlavor.WinFormsApplication); + /// else if (options.ZipFlavor == 2) + /// zip1.SaveSelfExtractor(options.ZipName, SelfExtractorFlavor.ConsoleApplication); + /// else + /// zip1.Save(options.ZipName); + /// } + /// } + /// catch (System.Exception exc1) + /// { + /// MessageBox.Show(String.Format("Exception while zipping: {0}", exc1.Message)); + /// btnCancel_Click(null, null); + /// } + /// } + /// + /// + /// + /// void zip1_SaveProgress(object sender, SaveProgressEventArgs e) + /// { + /// switch (e.EventType) + /// { + /// case ZipProgressEventType.Saving_AfterWriteEntry: + /// StepArchiveProgress(e); + /// break; + /// case ZipProgressEventType.Saving_EntryBytesRead: + /// StepEntryProgress(e); + /// break; + /// case ZipProgressEventType.Saving_Completed: + /// SaveCompleted(); + /// break; + /// case ZipProgressEventType.Saving_AfterSaveTempArchive: + /// // this event only occurs when saving an SFX file + /// TempArchiveSaved(); + /// break; + /// } + /// if (_saveCanceled) + /// e.Cancel = true; + /// } + /// + /// + /// + /// private void StepArchiveProgress(SaveProgressEventArgs e) + /// { + /// if (this.progressBar1.InvokeRequired) + /// { + /// this.progressBar1.Invoke(new SaveEntryProgress(this.StepArchiveProgress), new object[] { e }); + /// } + /// else + /// { + /// if (!_saveCanceled) + /// { + /// _nFilesCompleted++; + /// this.progressBar1.PerformStep(); + /// _totalBytesAfterCompress += e.CurrentEntry.CompressedSize; + /// _totalBytesBeforeCompress += e.CurrentEntry.UncompressedSize; + /// + /// // reset the progress bar for the entry: + /// this.progressBar2.Value = this.progressBar2.Maximum = 1; + /// + /// this.Update(); + /// } + /// } + /// } + /// + /// + /// private void StepEntryProgress(SaveProgressEventArgs e) + /// { + /// if (this.progressBar2.InvokeRequired) + /// { + /// this.progressBar2.Invoke(new SaveEntryProgress(this.StepEntryProgress), new object[] { e }); + /// } + /// else + /// { + /// if (!_saveCanceled) + /// { + /// if (this.progressBar2.Maximum == 1) + /// { + /// // reset + /// Int64 max = e.TotalBytesToTransfer; + /// _progress2MaxFactor = 0; + /// while (max > System.Int32.MaxValue) + /// { + /// max /= 2; + /// _progress2MaxFactor++; + /// } + /// this.progressBar2.Maximum = (int)max; + /// lblStatus.Text = String.Format("{0} of {1} files...({2})", + /// _nFilesCompleted + 1, _entriesToZip, e.CurrentEntry.FileName); + /// } + /// + /// int xferred = e.BytesTransferred >> _progress2MaxFactor; + /// + /// this.progressBar2.Value = (xferred >= this.progressBar2.Maximum) + /// ? this.progressBar2.Maximum + /// : xferred; + /// + /// this.Update(); + /// } + /// } + /// } + /// + /// private void SaveCompleted() + /// { + /// if (this.lblStatus.InvokeRequired) + /// { + /// this.lblStatus.Invoke(new MethodInvoker(this.SaveCompleted)); + /// } + /// else + /// { + /// lblStatus.Text = String.Format("Done, Compressed {0} files, {1:N0}% of original.", + /// _nFilesCompleted, (100.00 * _totalBytesAfterCompress) / _totalBytesBeforeCompress); + /// ResetState(); + /// } + /// } + /// + /// private void ResetState() + /// { + /// this.btnCancel.Enabled = false; + /// this.btnOk.Enabled = true; + /// this.btnOk.Text = "Zip it!"; + /// this.progressBar1.Value = 0; + /// this.progressBar2.Value = 0; + /// this.Cursor = Cursors.Default; + /// if (!_workerThread.IsAlive) + /// _workerThread.Join(); + /// } + /// + /// + /// + /// + /// + /// + /// + public event EventHandler SaveProgress; + + + internal bool OnSaveBlock(ZipEntry entry, Int64 bytesXferred, Int64 totalBytesToXfer) + { + EventHandler sp = SaveProgress; + if (sp != null) + { + var e = SaveProgressEventArgs.ByteUpdate(ArchiveNameForEvent, entry, + bytesXferred, totalBytesToXfer); + sp(this, e); + if (e.Cancel) + _saveOperationCanceled = true; + } + return _saveOperationCanceled; + } + + private void OnSaveEntry(int current, ZipEntry entry, bool before) + { + EventHandler sp = SaveProgress; + if (sp != null) + { + var e = new SaveProgressEventArgs(ArchiveNameForEvent, before, _entries.Count, current, entry); + sp(this, e); + if (e.Cancel) + _saveOperationCanceled = true; + } + } + + private void OnSaveEvent(ZipProgressEventType eventFlavor) + { + EventHandler sp = SaveProgress; + if (sp != null) + { + var e = new SaveProgressEventArgs(ArchiveNameForEvent, eventFlavor); + sp(this, e); + if (e.Cancel) + _saveOperationCanceled = true; + } + } + + private void OnSaveStarted() + { + EventHandler sp = SaveProgress; + if (sp != null) + { + var e = SaveProgressEventArgs.Started(ArchiveNameForEvent); + sp(this, e); + if (e.Cancel) + _saveOperationCanceled = true; + } + } + private void OnSaveCompleted() + { + EventHandler sp = SaveProgress; + if (sp != null) + { + var e = SaveProgressEventArgs.Completed(ArchiveNameForEvent); + sp(this, e); + } + } + #endregion + + + #region Read + /// + /// An event handler invoked before, during, and after the reading of a zip archive. + /// + /// + /// + /// + /// Depending on the particular event being signaled, different properties on the + /// parameter are set. The following table + /// summarizes the available EventTypes and the conditions under which this + /// event handler is invoked with a ReadProgressEventArgs with the given EventType. + /// + /// + /// + /// + /// value of EntryType + /// Meaning and conditions + /// + /// + /// + /// ZipProgressEventType.Reading_Started + /// Fired just as ZipFile.Read() begins. Meaningful properties: ArchiveName. + /// + /// + /// + /// + /// ZipProgressEventType.Reading_Completed + /// Fired when ZipFile.Read() has completed. Meaningful properties: ArchiveName. + /// + /// + /// + /// + /// ZipProgressEventType.Reading_ArchiveBytesRead + /// Fired while reading, updates the number of bytes read for the entire archive. + /// Meaningful properties: ArchiveName, CurrentEntry, BytesTransferred, TotalBytesToTransfer. + /// + /// + /// + /// + /// ZipProgressEventType.Reading_BeforeReadEntry + /// Indicates an entry is about to be read from the archive. + /// Meaningful properties: ArchiveName, EntriesTotal. + /// + /// + /// + /// + /// ZipProgressEventType.Reading_AfterReadEntry + /// Indicates an entry has just been read from the archive. + /// Meaningful properties: ArchiveName, EntriesTotal, CurrentEntry. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public event EventHandler ReadProgress; + + private void OnReadStarted() + { + EventHandler rp = ReadProgress; + if (rp != null) + { + var e = ReadProgressEventArgs.Started(ArchiveNameForEvent); + rp(this, e); + } + } + + private void OnReadCompleted() + { + EventHandler rp = ReadProgress; + if (rp != null) + { + var e = ReadProgressEventArgs.Completed(ArchiveNameForEvent); + rp(this, e); + } + } + + internal void OnReadBytes(ZipEntry entry) + { + EventHandler rp = ReadProgress; + if (rp != null) + { + var e = ReadProgressEventArgs.ByteUpdate(ArchiveNameForEvent, + entry, + ReadStream.Position, + LengthOfReadStream); + rp(this, e); + } + } + + internal void OnReadEntry(bool before, ZipEntry entry) + { + EventHandler rp = ReadProgress; + if (rp != null) + { + ReadProgressEventArgs e = (before) + ? ReadProgressEventArgs.Before(ArchiveNameForEvent, _entries.Count) + : ReadProgressEventArgs.After(ArchiveNameForEvent, entry, _entries.Count); + rp(this, e); + } + } + + private Int64 _lengthOfReadStream = -99; + private Int64 LengthOfReadStream + { + get + { + if (_lengthOfReadStream == -99) + { + _lengthOfReadStream = (_ReadStreamIsOurs) + ? SharedUtilities.GetFileLength(_name) + : -1L; + } + return _lengthOfReadStream; + } + } + #endregion + + + #region Extract + /// + /// An event handler invoked before, during, and after extraction of + /// entries in the zip archive. + /// + /// + /// + /// + /// Depending on the particular event, different properties on the parameter are set. The following + /// table summarizes the available EventTypes and the conditions under + /// which this event handler is invoked with a + /// ExtractProgressEventArgs with the given EventType. + /// + /// + /// + /// + /// value of EntryType + /// Meaning and conditions + /// + /// + /// + /// ZipProgressEventType.Extracting_BeforeExtractAll + /// + /// Set when ExtractAll() begins. The ArchiveName, Overwrite, and + /// ExtractLocation properties are meaningful. + /// + /// + /// + /// ZipProgressEventType.Extracting_AfterExtractAll + /// + /// Set when ExtractAll() has completed. The ArchiveName, Overwrite, + /// and ExtractLocation properties are meaningful. + /// + /// + /// + /// + /// ZipProgressEventType.Extracting_BeforeExtractEntry + /// + /// Set when an Extract() on an entry in the ZipFile has begun. + /// Properties that are meaningful: ArchiveName, EntriesTotal, + /// CurrentEntry, Overwrite, ExtractLocation, EntriesExtracted. + /// + /// + /// + /// + /// ZipProgressEventType.Extracting_AfterExtractEntry + /// + /// Set when an Extract() on an entry in the ZipFile has completed. + /// Properties that are meaningful: ArchiveName, EntriesTotal, + /// CurrentEntry, Overwrite, ExtractLocation, EntriesExtracted. + /// + /// + /// + /// + /// ZipProgressEventType.Extracting_EntryBytesWritten + /// + /// Set within a call to Extract() on an entry in the ZipFile, as data + /// is extracted for the entry. Properties that are meaningful: + /// ArchiveName, CurrentEntry, BytesTransferred, TotalBytesToTransfer. + /// + /// + /// + /// + /// ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite + /// + /// Set within a call to Extract() on an entry in the ZipFile, when the + /// extraction would overwrite an existing file. This event type is used + /// only when ExtractExistingFileAction on the ZipFile or + /// ZipEntry is set to InvokeExtractProgressEvent. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// private static bool justHadByteUpdate = false; + /// public static void ExtractProgress(object sender, ExtractProgressEventArgs e) + /// { + /// if(e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) + /// { + /// if (justHadByteUpdate) + /// Console.SetCursorPosition(0, Console.CursorTop); + /// + /// Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, + /// e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); + /// justHadByteUpdate = true; + /// } + /// else if(e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) + /// { + /// if (justHadByteUpdate) + /// Console.WriteLine(); + /// Console.WriteLine("Extracting: {0}", e.CurrentEntry.FileName); + /// justHadByteUpdate= false; + /// } + /// } + /// + /// public static ExtractZip(string zipToExtract, string directory) + /// { + /// string TargetDirectory= "extract"; + /// using (var zip = ZipFile.Read(zipToExtract)) { + /// zip.ExtractProgress += ExtractProgress; + /// foreach (var e in zip1) + /// { + /// e.Extract(TargetDirectory, true); + /// } + /// } + /// } + /// + /// + /// + /// Public Shared Sub Main(ByVal args As String()) + /// Dim ZipToUnpack As String = "C1P3SML.zip" + /// Dim TargetDir As String = "ExtractTest_Extract" + /// Console.WriteLine("Extracting file {0} to {1}", ZipToUnpack, TargetDir) + /// Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack) + /// AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress + /// Dim e As ZipEntry + /// For Each e In zip1 + /// e.Extract(TargetDir, True) + /// Next + /// End Using + /// End Sub + /// + /// Private Shared justHadByteUpdate As Boolean = False + /// + /// Public Shared Sub MyExtractProgress(ByVal sender As Object, ByVal e As ExtractProgressEventArgs) + /// If (e.EventType = ZipProgressEventType.Extracting_EntryBytesWritten) Then + /// If ExtractTest.justHadByteUpdate Then + /// Console.SetCursorPosition(0, Console.CursorTop) + /// End If + /// Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, (CDbl(e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))) + /// ExtractTest.justHadByteUpdate = True + /// ElseIf (e.EventType = ZipProgressEventType.Extracting_BeforeExtractEntry) Then + /// If ExtractTest.justHadByteUpdate Then + /// Console.WriteLine + /// End If + /// Console.WriteLine("Extracting: {0}", e.CurrentEntry.FileName) + /// ExtractTest.justHadByteUpdate = False + /// End If + /// End Sub + /// + /// + /// + /// + /// + /// + public event EventHandler ExtractProgress; + + + + private void OnExtractEntry(int current, bool before, ZipEntry currentEntry, string path) + { + EventHandler ep = ExtractProgress; + if (ep != null) + { + var e = new ExtractProgressEventArgs(ArchiveNameForEvent, before, _entries.Count, current, currentEntry, path); + ep(this, e); + if (e.Cancel) + _extractOperationCanceled = true; + } + } + + + // Can be called from within ZipEntry._ExtractOne. + internal bool OnExtractBlock(ZipEntry entry, Int64 bytesWritten, Int64 totalBytesToWrite) + { + EventHandler ep = ExtractProgress; + if (ep != null) + { + var e = ExtractProgressEventArgs.ByteUpdate(ArchiveNameForEvent, entry, + bytesWritten, totalBytesToWrite); + ep(this, e); + if (e.Cancel) + _extractOperationCanceled = true; + } + return _extractOperationCanceled; + } + + + // Can be called from within ZipEntry.InternalExtract. + internal bool OnSingleEntryExtract(ZipEntry entry, string path, bool before) + { + EventHandler ep = ExtractProgress; + if (ep != null) + { + var e = (before) + ? ExtractProgressEventArgs.BeforeExtractEntry(ArchiveNameForEvent, entry, path) + : ExtractProgressEventArgs.AfterExtractEntry(ArchiveNameForEvent, entry, path); + ep(this, e); + if (e.Cancel) + _extractOperationCanceled = true; + } + return _extractOperationCanceled; + } + + internal bool OnExtractExisting(ZipEntry entry, string path) + { + EventHandler ep = ExtractProgress; + if (ep != null) + { + var e = ExtractProgressEventArgs.ExtractExisting(ArchiveNameForEvent, entry, path); + ep(this, e); + if (e.Cancel) + _extractOperationCanceled = true; + } + return _extractOperationCanceled; + } + + + private void OnExtractAllCompleted(string path) + { + EventHandler ep = ExtractProgress; + if (ep != null) + { + var e = ExtractProgressEventArgs.ExtractAllCompleted(ArchiveNameForEvent, + path ); + ep(this, e); + } + } + + + private void OnExtractAllStarted(string path) + { + EventHandler ep = ExtractProgress; + if (ep != null) + { + var e = ExtractProgressEventArgs.ExtractAllStarted(ArchiveNameForEvent, + path ); + ep(this, e); + } + } + + + #endregion + + + + #region Add + /// + /// An event handler invoked before, during, and after Adding entries to a zip archive. + /// + /// + /// + /// Adding a large number of entries to a zip file can take a long + /// time. For example, when calling on a + /// directory that contains 50,000 files, it could take 3 minutes or so. + /// This event handler allws an application to track the progress of the Add + /// operation, and to optionally cancel a lengthy Add operation. + /// + /// + /// + /// + /// + /// int _numEntriesToAdd= 0; + /// int _numEntriesAdded= 0; + /// void AddProgressHandler(object sender, AddProgressEventArgs e) + /// { + /// switch (e.EventType) + /// { + /// case ZipProgressEventType.Adding_Started: + /// Console.WriteLine("Adding files to the zip..."); + /// break; + /// case ZipProgressEventType.Adding_AfterAddEntry: + /// _numEntriesAdded++; + /// Console.WriteLine(String.Format("Adding file {0}/{1} :: {2}", + /// _numEntriesAdded, _numEntriesToAdd, e.CurrentEntry.FileName)); + /// break; + /// case ZipProgressEventType.Adding_Completed: + /// Console.WriteLine("Added all files"); + /// break; + /// } + /// } + /// + /// void CreateTheZip() + /// { + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddProgress += AddProgressHandler; + /// zip.AddDirectory(System.IO.Path.GetFileName(DirToZip)); + /// zip.Save(ZipFileToCreate); + /// } + /// } + /// + /// + /// + /// + /// + /// Private Sub AddProgressHandler(ByVal sender As Object, ByVal e As AddProgressEventArgs) + /// Select Case e.EventType + /// Case ZipProgressEventType.Adding_Started + /// Console.WriteLine("Adding files to the zip...") + /// Exit Select + /// Case ZipProgressEventType.Adding_AfterAddEntry + /// Console.WriteLine(String.Format("Adding file {0}", e.CurrentEntry.FileName)) + /// Exit Select + /// Case ZipProgressEventType.Adding_Completed + /// Console.WriteLine("Added all files") + /// Exit Select + /// End Select + /// End Sub + /// + /// Sub CreateTheZip() + /// Using zip as ZipFile = New ZipFile + /// AddHandler zip.AddProgress, AddressOf AddProgressHandler + /// zip.AddDirectory(System.IO.Path.GetFileName(DirToZip)) + /// zip.Save(ZipFileToCreate); + /// End Using + /// End Sub + /// + /// + /// + /// + /// + /// + /// + /// + public event EventHandler AddProgress; + + private void OnAddStarted() + { + EventHandler ap = AddProgress; + if (ap != null) + { + var e = AddProgressEventArgs.Started(ArchiveNameForEvent); + ap(this, e); + if (e.Cancel) // workitem 13371 + _addOperationCanceled = true; + } + } + + private void OnAddCompleted() + { + EventHandler ap = AddProgress; + if (ap != null) + { + var e = AddProgressEventArgs.Completed(ArchiveNameForEvent); + ap(this, e); + } + } + + internal void AfterAddEntry(ZipEntry entry) + { + EventHandler ap = AddProgress; + if (ap != null) + { + var e = AddProgressEventArgs.AfterEntry(ArchiveNameForEvent, entry, _entries.Count); + ap(this, e); + if (e.Cancel) // workitem 13371 + _addOperationCanceled = true; + } + } + + #endregion + + + + #region Error + /// + /// An event that is raised when an error occurs during open or read of files + /// while saving a zip archive. + /// + /// + /// + /// + /// Errors can occur as a file is being saved to the zip archive. For + /// example, the File.Open may fail, or a File.Read may fail, because of + /// lock conflicts or other reasons. If you add a handler to this event, + /// you can handle such errors in your own code. If you don't add a + /// handler, the library will throw an exception if it encounters an I/O + /// error during a call to Save(). + /// + /// + /// + /// Setting a handler implicitly sets to + /// ZipErrorAction.InvokeErrorEvent. + /// + /// + /// + /// The handler you add applies to all items that are + /// subsequently added to the ZipFile instance. If you set this + /// property after you have added items to the ZipFile, but before you + /// have called Save(), errors that occur while saving those items + /// will not cause the error handler to be invoked. + /// + /// + /// + /// If you want to handle any errors that occur with any entry in the zip + /// file using the same error handler, then add your error handler once, + /// before adding any entries to the zip archive. + /// + /// + /// + /// In the error handler method, you need to set the property on the + /// ZipErrorEventArgs.CurrentEntry. This communicates back to + /// DotNetZip what you would like to do with this particular error. Within + /// an error handler, if you set the ZipEntry.ZipErrorAction property + /// on the ZipEntry to ZipErrorAction.InvokeErrorEvent or if + /// you don't set it at all, the library will throw the exception. (It is the + /// same as if you had set the ZipEntry.ZipErrorAction property on the + /// ZipEntry to ZipErrorAction.Throw.) If you set the + /// ZipErrorEventArgs.Cancel to true, the entire Save() will be + /// canceled. + /// + /// + /// + /// In the case that you use ZipErrorAction.Skip, implying that + /// you want to skip the entry for which there's been an error, DotNetZip + /// tries to seek backwards in the output stream, and truncate all bytes + /// written on behalf of that particular entry. This works only if the + /// output stream is seekable. It will not work, for example, when using + /// ASPNET's Response.OutputStream. + /// + /// + /// + /// + /// + /// + /// This example shows how to use an event handler to handle + /// errors during save of the zip file. + /// + /// + /// public static void MyZipError(object sender, ZipErrorEventArgs e) + /// { + /// Console.WriteLine("Error saving {0}...", e.FileName); + /// Console.WriteLine(" Exception: {0}", e.exception); + /// ZipEntry entry = e.CurrentEntry; + /// string response = null; + /// // Ask the user whether he wants to skip this error or not + /// do + /// { + /// Console.Write("Retry, Skip, Throw, or Cancel ? (R/S/T/C) "); + /// response = Console.ReadLine(); + /// Console.WriteLine(); + /// + /// } while (response != null && + /// response[0]!='S' && response[0]!='s' && + /// response[0]!='R' && response[0]!='r' && + /// response[0]!='T' && response[0]!='t' && + /// response[0]!='C' && response[0]!='c'); + /// + /// e.Cancel = (response[0]=='C' || response[0]=='c'); + /// + /// if (response[0]=='S' || response[0]=='s') + /// entry.ZipErrorAction = ZipErrorAction.Skip; + /// else if (response[0]=='R' || response[0]=='r') + /// entry.ZipErrorAction = ZipErrorAction.Retry; + /// else if (response[0]=='T' || response[0]=='t') + /// entry.ZipErrorAction = ZipErrorAction.Throw; + /// } + /// + /// public void SaveTheFile() + /// { + /// string directoryToZip = "fodder"; + /// string directoryInArchive = "files"; + /// string zipFileToCreate = "Archive.zip"; + /// using (var zip = new ZipFile()) + /// { + /// // set the event handler before adding any entries + /// zip.ZipError += MyZipError; + /// zip.AddDirectory(directoryToZip, directoryInArchive); + /// zip.Save(zipFileToCreate); + /// } + /// } + /// + /// + /// + /// Private Sub MyZipError(ByVal sender As Object, ByVal e As Ionic.Zip.ZipErrorEventArgs) + /// ' At this point, the application could prompt the user for an action to take. + /// ' But in this case, this application will simply automatically skip the file, in case of error. + /// Console.WriteLine("Zip Error, entry {0}", e.CurrentEntry.FileName) + /// Console.WriteLine(" Exception: {0}", e.exception) + /// ' set the desired ZipErrorAction on the CurrentEntry to communicate that to DotNetZip + /// e.CurrentEntry.ZipErrorAction = Zip.ZipErrorAction.Skip + /// End Sub + /// + /// Public Sub SaveTheFile() + /// Dim directoryToZip As String = "fodder" + /// Dim directoryInArchive As String = "files" + /// Dim zipFileToCreate as String = "Archive.zip" + /// Using zipArchive As ZipFile = New ZipFile + /// ' set the event handler before adding any entries + /// AddHandler zipArchive.ZipError, AddressOf MyZipError + /// zipArchive.AddDirectory(directoryToZip, directoryInArchive) + /// zipArchive.Save(zipFileToCreate) + /// End Using + /// End Sub + /// + /// + /// + /// + /// + public event EventHandler ZipError; + + internal bool OnZipErrorSaving(ZipEntry entry, Exception exc) + { + if (ZipError != null) + { + lock (LOCK) + { + var e = ZipErrorEventArgs.Saving(this.Name, entry, exc); + ZipError(this, e); + if (e.Cancel) + _saveOperationCanceled = true; + } + } + return _saveOperationCanceled; + } + #endregion + + } +} diff --git a/dotNetZip/Zip/ZipFile.Extract.cs b/dotNetZip/Zip/ZipFile.Extract.cs new file mode 100644 index 0000000..531c0f3 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.Extract.cs @@ -0,0 +1,298 @@ +// ZipFile.Extract.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-31 14:45:18> +// +// ------------------------------------------------------------------ +// +// This module defines the methods for Extract operations on zip files. +// +// ------------------------------------------------------------------ +// + + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + + public partial class ZipFile + { + + /// + /// Extracts all of the items in the zip archive, to the specified path in the + /// filesystem. The path can be relative or fully-qualified. + /// + /// + /// + /// + /// This method will extract all entries in the ZipFile to the + /// specified path. + /// + /// + /// + /// If an extraction of a file from the zip archive would overwrite an + /// existing file in the filesystem, the action taken is dictated by the + /// ExtractExistingFile property, which overrides any setting you may have + /// made on individual ZipEntry instances. By default, if you have not + /// set that property on the ZipFile instance, the entry will not + /// be extracted, the existing file will not be overwritten and an + /// exception will be thrown. To change this, set the property, or use the + /// overload that allows you to + /// specify an ExtractExistingFileAction parameter. + /// + /// + /// + /// The action to take when an extract would overwrite an existing file + /// applies to all entries. If you want to set this on a per-entry basis, + /// then you must use one of the ZipEntry.Extract methods. + /// + /// + /// + /// This method will send verbose output messages to the , if it is set on the ZipFile + /// instance. + /// + /// + /// + /// You may wish to take advantage of the ExtractProgress event. + /// + /// + /// + /// About timestamps: When extracting a file entry from a zip archive, the + /// extracted file gets the last modified time of the entry as stored in + /// the archive. The archive may also store extended file timestamp + /// information, including last accessed and created times. If these are + /// present in the ZipEntry, then the extracted file will also get + /// these times. + /// + /// + /// + /// A Directory entry is somewhat different. It will get the times as + /// described for a file entry, but, if there are file entries in the zip + /// archive that, when extracted, appear in the just-created directory, + /// then when those file entries are extracted, the last modified and last + /// accessed times of the directory will change, as a side effect. The + /// result is that after an extraction of a directory and a number of + /// files within the directory, the last modified and last accessed + /// timestamps on the directory will reflect the time that the last file + /// was extracted into the directory, rather than the time stored in the + /// zip archive for the directory. + /// + /// + /// + /// To compensate, when extracting an archive with ExtractAll, + /// DotNetZip will extract all the file and directory entries as described + /// above, but it will then make a second pass on the directories, and + /// reset the times on the directories to reflect what is stored in the + /// zip archive. + /// + /// + /// + /// This compensation is performed only within the context of an + /// ExtractAll. If you call ZipEntry.Extract on a directory + /// entry, the timestamps on directory in the filesystem will reflect the + /// times stored in the zip. If you then call ZipEntry.Extract on + /// a file entry, which is extracted into the directory, the timestamps on + /// the directory will be updated to the current time. + /// + /// + /// + /// + /// This example extracts all the entries in a zip archive file, to the + /// specified target directory. The extraction will overwrite any + /// existing files silently. + /// + /// + /// String TargetDirectory= "unpack"; + /// using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) + /// { + /// zip.ExtractExistingFile= ExtractExistingFileAction.OverwriteSilently; + /// zip.ExtractAll(TargetDirectory); + /// } + /// + /// + /// + /// Dim TargetDirectory As String = "unpack" + /// Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) + /// zip.ExtractExistingFile= ExtractExistingFileAction.OverwriteSilently + /// zip.ExtractAll(TargetDirectory) + /// End Using + /// + /// + /// + /// + /// + /// + /// + /// The path to which the contents of the zipfile will be extracted. + /// The path can be relative or fully-qualified. + /// + /// + public void ExtractAll(string path) + { + _InternalExtractAll(path, true); + } + + + + /// + /// Extracts all of the items in the zip archive, to the specified path in the + /// filesystem, using the specified behavior when extraction would overwrite an + /// existing file. + /// + /// + /// + /// + /// + /// This method will extract all entries in the ZipFile to the specified + /// path. For an extraction that would overwrite an existing file, the behavior + /// is dictated by , which overrides any + /// setting you may have made on individual ZipEntry instances. + /// + /// + /// + /// The action to take when an extract would overwrite an existing file + /// applies to all entries. If you want to set this on a per-entry basis, + /// then you must use or one of the similar methods. + /// + /// + /// + /// Calling this method is equivalent to setting the property and then calling . + /// + /// + /// + /// This method will send verbose output messages to the + /// , if it is set on the ZipFile instance. + /// + /// + /// + /// + /// This example extracts all the entries in a zip archive file, to the + /// specified target directory. It does not overwrite any existing files. + /// + /// String TargetDirectory= "c:\\unpack"; + /// using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) + /// { + /// zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite); + /// } + /// + /// + /// + /// Dim TargetDirectory As String = "c:\unpack" + /// Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) + /// zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite) + /// End Using + /// + /// + /// + /// + /// The path to which the contents of the zipfile will be extracted. + /// The path can be relative or fully-qualified. + /// + /// + /// + /// The action to take if extraction would overwrite an existing file. + /// + /// + public void ExtractAll(string path, ExtractExistingFileAction extractExistingFile) + { + ExtractExistingFile = extractExistingFile; + _InternalExtractAll(path, true); + } + + + private void _InternalExtractAll(string path, bool overrideExtractExistingProperty) + { + bool header = Verbose; + _inExtractAll = true; + try + { + OnExtractAllStarted(path); + + int n = 0; + foreach (ZipEntry e in _entries.Values) + { + if (header) + { + StatusMessageTextWriter.WriteLine("\n{1,-22} {2,-8} {3,4} {4,-8} {0}", + "Name", "Modified", "Size", "Ratio", "Packed"); + StatusMessageTextWriter.WriteLine(new System.String('-', 72)); + header = false; + } + if (Verbose) + { + StatusMessageTextWriter.WriteLine("{1,-22} {2,-8} {3,4:F0}% {4,-8} {0}", + e.FileName, + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + e.UncompressedSize, + e.CompressionRatio, + e.CompressedSize); + if (!String.IsNullOrEmpty(e.Comment)) + StatusMessageTextWriter.WriteLine(" Comment: {0}", e.Comment); + } + e.Password = _Password; // this may be null + OnExtractEntry(n, true, e, path); + if (overrideExtractExistingProperty) + e.ExtractExistingFile = this.ExtractExistingFile; + e.Extract(path); + n++; + OnExtractEntry(n, false, e, path); + if (_extractOperationCanceled) + break; + } + + if (!_extractOperationCanceled) + { + // workitem 8264: + // now, set times on directory entries, again. + // The problem is, extracting a file changes the times on the parent + // directory. So after all files have been extracted, we have to + // run through the directories again. + foreach (ZipEntry e in _entries.Values) + { + // check if it is a directory + if ((e.IsDirectory) || (e.FileName.EndsWith("/"))) + { + string outputFile = (e.FileName.StartsWith("/")) + ? Path.Combine(path, e.FileName.Substring(1)) + : Path.Combine(path, e.FileName); + + e._SetTimes(outputFile, false); + } + } + OnExtractAllCompleted(path); + } + + } + finally + { + + _inExtractAll = false; + } + } + + + } +} diff --git a/dotNetZip/Zip/ZipFile.Read.cs b/dotNetZip/Zip/ZipFile.Read.cs new file mode 100644 index 0000000..2dac1e5 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.Read.cs @@ -0,0 +1,1110 @@ +// ZipFile.Read.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-05 11:38:59> +// +// ------------------------------------------------------------------ +// +// This module defines the methods for Reading zip files. +// +// ------------------------------------------------------------------ +// + + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + /// + /// A class for collecting the various options that can be used when + /// Reading zip files for extraction or update. + /// + /// + /// + /// + /// When reading a zip file, there are several options an + /// application can set, to modify how the file is read, or what + /// the library does while reading. This class collects those + /// options into one container. + /// + /// + /// + /// Pass an instance of the ReadOptions class into the + /// ZipFile.Read() method. + /// + /// + /// . + /// . + /// + public class ReadOptions + { + /// + /// An event handler for Read operations. When opening large zip + /// archives, you may want to display a progress bar or other + /// indicator of status progress while reading. This parameter + /// allows you to specify a ReadProgress Event Handler directly. + /// When you call Read(), the progress event is invoked as + /// necessary. + /// + public EventHandler ReadProgress { get; set; } + + /// + /// The System.IO.TextWriter to use for writing verbose status messages + /// during operations on the zip archive. A console application may wish to + /// pass System.Console.Out to get messages on the Console. A graphical + /// or headless application may wish to capture the messages in a different + /// TextWriter, such as a System.IO.StringWriter. + /// + public TextWriter StatusMessageWriter { get; set; } + + /// + /// The System.Text.Encoding to use when reading in the zip archive. Be + /// careful specifying the encoding. If the value you use here is not the same + /// as the Encoding used when the zip archive was created (possibly by a + /// different archiver) you will get unexpected results and possibly exceptions. + /// + /// + /// + /// + public System.Text.Encoding @Encoding { get; set; } + } + + + public partial class ZipFile + { + /// + /// Reads a zip file archive and returns the instance. + /// + /// + /// + /// + /// The stream is read using the default System.Text.Encoding, which is the + /// IBM437 codepage. + /// + /// + /// + /// + /// Thrown if the ZipFile cannot be read. The implementation of this method + /// relies on System.IO.File.OpenRead, which can throw a variety of exceptions, + /// including specific exceptions if a file is not found, an unauthorized access + /// exception, exceptions for poorly formatted filenames, and so on. + /// + /// + /// + /// The name of the zip archive to open. This can be a fully-qualified or relative + /// pathname. + /// + /// + /// . + /// + /// The instance read from the zip archive. + /// + public static ZipFile Read(string fileName) + { + return ZipFile.Read(fileName, null, null, null); + } + + + /// + /// Reads a zip file archive from the named filesystem file using the + /// specified options. + /// + /// + /// + /// + /// This version of the Read() method allows the caller to pass + /// in a TextWriter an Encoding, via an instance of the + /// ReadOptions class. The ZipFile is read in using the + /// specified encoding for entries where UTF-8 encoding is not + /// explicitly specified. + /// + /// + /// + /// + /// + /// + /// This example shows how to read a zip file using the Big-5 Chinese + /// code page (950), and extract each entry in the zip file, while + /// sending status messages out to the Console. + /// + /// + /// + /// For this code to work as intended, the zipfile must have been + /// created using the big5 code page (CP950). This is typical, for + /// example, when using WinRar on a machine with CP950 set as the + /// default code page. In that case, the names of entries within the + /// Zip archive will be stored in that code page, and reading the zip + /// archive must be done using that code page. If the application did + /// not use the correct code page in ZipFile.Read(), then names of + /// entries within the zip archive would not be correctly retrieved. + /// + /// + /// + /// string zipToExtract = "MyArchive.zip"; + /// string extractDirectory = "extract"; + /// var options = new ReadOptions + /// { + /// StatusMessageWriter = System.Console.Out, + /// Encoding = System.Text.Encoding.GetEncoding(950) + /// }; + /// using (ZipFile zip = ZipFile.Read(zipToExtract, options)) + /// { + /// foreach (ZipEntry e in zip) + /// { + /// e.Extract(extractDirectory); + /// } + /// } + /// + /// + /// + /// + /// Dim zipToExtract as String = "MyArchive.zip" + /// Dim extractDirectory as String = "extract" + /// Dim options as New ReadOptions + /// options.Encoding = System.Text.Encoding.GetEncoding(950) + /// options.StatusMessageWriter = System.Console.Out + /// Using zip As ZipFile = ZipFile.Read(zipToExtract, options) + /// Dim e As ZipEntry + /// For Each e In zip + /// e.Extract(extractDirectory) + /// Next + /// End Using + /// + /// + /// + /// + /// + /// + /// + /// This example shows how to read a zip file using the default + /// code page, to remove entries that have a modified date before a given threshold, + /// sending status messages out to a StringWriter. + /// + /// + /// + /// var options = new ReadOptions + /// { + /// StatusMessageWriter = new System.IO.StringWriter() + /// }; + /// using (ZipFile zip = ZipFile.Read("PackedDocuments.zip", options)) + /// { + /// var Threshold = new DateTime(2007,7,4); + /// // We cannot remove the entry from the list, within the context of + /// // an enumeration of said list. + /// // So we add the doomed entry to a list to be removed later. + /// // pass 1: mark the entries for removal + /// var MarkedEntries = new System.Collections.Generic.List<ZipEntry>(); + /// foreach (ZipEntry e in zip) + /// { + /// if (e.LastModified < Threshold) + /// MarkedEntries.Add(e); + /// } + /// // pass 2: actually remove the entry. + /// foreach (ZipEntry zombie in MarkedEntries) + /// zip.RemoveEntry(zombie); + /// zip.Comment = "This archive has been updated."; + /// zip.Save(); + /// } + /// // can now use contents of sw, eg store in an audit log + /// + /// + /// + /// Dim options as New ReadOptions + /// options.StatusMessageWriter = New System.IO.StringWriter + /// Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip", options) + /// Dim Threshold As New DateTime(2007, 7, 4) + /// ' We cannot remove the entry from the list, within the context of + /// ' an enumeration of said list. + /// ' So we add the doomed entry to a list to be removed later. + /// ' pass 1: mark the entries for removal + /// Dim MarkedEntries As New System.Collections.Generic.List(Of ZipEntry) + /// Dim e As ZipEntry + /// For Each e In zip + /// If (e.LastModified < Threshold) Then + /// MarkedEntries.Add(e) + /// End If + /// Next + /// ' pass 2: actually remove the entry. + /// Dim zombie As ZipEntry + /// For Each zombie In MarkedEntries + /// zip.RemoveEntry(zombie) + /// Next + /// zip.Comment = "This archive has been updated." + /// zip.Save + /// End Using + /// ' can now use contents of sw, eg store in an audit log + /// + /// + /// + /// + /// Thrown if the zipfile cannot be read. The implementation of + /// this method relies on System.IO.File.OpenRead, which + /// can throw a variety of exceptions, including specific + /// exceptions if a file is not found, an unauthorized access + /// exception, exceptions for poorly formatted filenames, and so + /// on. + /// + /// + /// + /// The name of the zip archive to open. + /// This can be a fully-qualified or relative pathname. + /// + /// + /// + /// The set of options to use when reading the zip file. + /// + /// + /// The ZipFile instance read from the zip archive. + /// + /// + /// + public static ZipFile Read(string fileName, + ReadOptions options) + { + if (options == null) + throw new ArgumentNullException("options"); + return Read(fileName, + options.StatusMessageWriter, + options.Encoding, + options.ReadProgress); + } + + /// + /// Reads a zip file archive using the specified text encoding, the specified + /// TextWriter for status messages, and the specified ReadProgress event handler, + /// and returns the instance. + /// + /// + /// + /// The name of the zip archive to open. + /// This can be a fully-qualified or relative pathname. + /// + /// + /// + /// An event handler for Read operations. + /// + /// + /// + /// The System.IO.TextWriter to use for writing verbose status messages + /// during operations on the zip archive. A console application may wish to + /// pass System.Console.Out to get messages on the Console. A graphical + /// or headless application may wish to capture the messages in a different + /// TextWriter, such as a System.IO.StringWriter. + /// + /// + /// + /// The System.Text.Encoding to use when reading in the zip archive. Be + /// careful specifying the encoding. If the value you use here is not the same + /// as the Encoding used when the zip archive was created (possibly by a + /// different archiver) you will get unexpected results and possibly exceptions. + /// + /// + /// The instance read from the zip archive. + /// + private static ZipFile Read(string fileName, + TextWriter statusMessageWriter, + System.Text.Encoding encoding, + EventHandler readProgress) + { + ZipFile zf = new ZipFile(); + zf.AlternateEncoding = encoding ?? DefaultEncoding; + zf.AlternateEncodingUsage = ZipOption.Always; + zf._StatusMessageTextWriter = statusMessageWriter; + zf._name = fileName; + if (readProgress != null) + zf.ReadProgress = readProgress; + + if (zf.Verbose) zf._StatusMessageTextWriter.WriteLine("reading from {0}...", fileName); + + ReadIntoInstance(zf); + zf._fileAlreadyExists = true; + + return zf; + } + + /// + /// Reads a zip archive from a stream. + /// + /// + /// + /// + /// + /// When reading from a file, it's probably easier to just use + /// ZipFile.Read(String, ReadOptions). This + /// overload is useful when when the zip archive content is + /// available from an already-open stream. The stream must be + /// open and readable and seekable when calling this method. The + /// stream is left open when the reading is completed. + /// + /// + /// + /// Using this overload, the stream is read using the default + /// System.Text.Encoding, which is the IBM437 + /// codepage. If you want to specify the encoding to use when + /// reading the zipfile content, see + /// ZipFile.Read(Stream, ReadOptions). This + /// + /// + /// + /// Reading of zip content begins at the current position in the + /// stream. This means if you have a stream that concatenates + /// regular data and zip data, if you position the open, readable + /// stream at the start of the zip data, you will be able to read + /// the zip archive using this constructor, or any of the ZipFile + /// constructors that accept a as + /// input. Some examples of where this might be useful: the zip + /// content is concatenated at the end of a regular EXE file, as + /// some self-extracting archives do. (Note: SFX files produced + /// by DotNetZip do not work this way; they can be read as normal + /// ZIP files). Another example might be a stream being read from + /// a database, where the zip content is embedded within an + /// aggregate stream of data. + /// + /// + /// + /// + /// + /// + /// This example shows how to Read zip content from a stream, and + /// extract one entry into a different stream. In this example, + /// the filename "NameOfEntryInArchive.doc", refers only to the + /// name of the entry within the zip archive. A file by that + /// name is not created in the filesystem. The I/O is done + /// strictly with the given streams. + /// + /// + /// + /// using (ZipFile zip = ZipFile.Read(InputStream)) + /// { + /// zip.Extract("NameOfEntryInArchive.doc", OutputStream); + /// } + /// + /// + /// + /// Using zip as ZipFile = ZipFile.Read(InputStream) + /// zip.Extract("NameOfEntryInArchive.doc", OutputStream) + /// End Using + /// + /// + /// + /// the stream containing the zip data. + /// + /// The ZipFile instance read from the stream + /// + public static ZipFile Read(Stream zipStream) + { + return Read(zipStream, null, null, null); + } + + /// + /// Reads a zip file archive from the given stream using the + /// specified options. + /// + /// + /// + /// + /// + /// When reading from a file, it's probably easier to just use + /// ZipFile.Read(String, ReadOptions). This + /// overload is useful when when the zip archive content is + /// available from an already-open stream. The stream must be + /// open and readable and seekable when calling this method. The + /// stream is left open when the reading is completed. + /// + /// + /// + /// Reading of zip content begins at the current position in the + /// stream. This means if you have a stream that concatenates + /// regular data and zip data, if you position the open, readable + /// stream at the start of the zip data, you will be able to read + /// the zip archive using this constructor, or any of the ZipFile + /// constructors that accept a as + /// input. Some examples of where this might be useful: the zip + /// content is concatenated at the end of a regular EXE file, as + /// some self-extracting archives do. (Note: SFX files produced + /// by DotNetZip do not work this way; they can be read as normal + /// ZIP files). Another example might be a stream being read from + /// a database, where the zip content is embedded within an + /// aggregate stream of data. + /// + /// + /// + /// the stream containing the zip data. + /// + /// + /// The set of options to use when reading the zip file. + /// + /// + /// + /// Thrown if the zip archive cannot be read. + /// + /// + /// The ZipFile instance read from the stream. + /// + /// + /// + public static ZipFile Read(Stream zipStream, ReadOptions options) + { + if (options == null) + throw new ArgumentNullException("options"); + + return Read(zipStream, + options.StatusMessageWriter, + options.Encoding, + options.ReadProgress); + } + + + + /// + /// Reads a zip archive from a stream, using the specified text Encoding, the + /// specified TextWriter for status messages, + /// and the specified ReadProgress event handler. + /// + /// + /// + /// + /// Reading of zip content begins at the current position in the stream. This + /// means if you have a stream that concatenates regular data and zip data, if + /// you position the open, readable stream at the start of the zip data, you + /// will be able to read the zip archive using this constructor, or any of the + /// ZipFile constructors that accept a as + /// input. Some examples of where this might be useful: the zip content is + /// concatenated at the end of a regular EXE file, as some self-extracting + /// archives do. (Note: SFX files produced by DotNetZip do not work this + /// way). Another example might be a stream being read from a database, where + /// the zip content is embedded within an aggregate stream of data. + /// + /// + /// + /// the stream containing the zip data. + /// + /// + /// The System.IO.TextWriter to which verbose status messages are written + /// during operations on the ZipFile. For example, in a console + /// application, System.Console.Out works, and will get a message for each entry + /// added to the ZipFile. If the TextWriter is null, no verbose messages + /// are written. + /// + /// + /// + /// The text encoding to use when reading entries that do not have the UTF-8 + /// encoding bit set. Be careful specifying the encoding. If the value you use + /// here is not the same as the Encoding used when the zip archive was created + /// (possibly by a different archiver) you will get unexpected results and + /// possibly exceptions. See the + /// property for more information. + /// + /// + /// + /// An event handler for Read operations. + /// + /// + /// an instance of ZipFile + private static ZipFile Read(Stream zipStream, + TextWriter statusMessageWriter, + System.Text.Encoding encoding, + EventHandler readProgress) + { + if (zipStream == null) + throw new ArgumentNullException("zipStream"); + + ZipFile zf = new ZipFile(); + zf._StatusMessageTextWriter = statusMessageWriter; + zf._alternateEncoding = encoding ?? ZipFile.DefaultEncoding; + zf._alternateEncodingUsage = ZipOption.Always; + if (readProgress != null) + zf.ReadProgress += readProgress; + zf._readstream = (zipStream.Position == 0L) + ? zipStream + : new OffsetStream(zipStream); + zf._ReadStreamIsOurs = false; + if (zf.Verbose) zf._StatusMessageTextWriter.WriteLine("reading from stream..."); + + ReadIntoInstance(zf); + return zf; + } + + + + private static void ReadIntoInstance(ZipFile zf) + { + Stream s = zf.ReadStream; + try + { + zf._readName = zf._name; // workitem 13915 + if (!s.CanSeek) + { + ReadIntoInstance_Orig(zf); + return; + } + + zf.OnReadStarted(); + + // change for workitem 8098 + //zf._originPosition = s.Position; + + // Try reading the central directory, rather than scanning the file. + + uint datum = ReadFirstFourBytes(s); + + if (datum == ZipConstants.EndOfCentralDirectorySignature) + return; + + + // start at the end of the file... + // seek backwards a bit, then look for the EoCD signature. + int nTries = 0; + bool success = false; + + // The size of the end-of-central-directory-footer plus 2 bytes is 18. + // This implies an archive comment length of 0. We'll add a margin of + // safety and start "in front" of that, when looking for the + // EndOfCentralDirectorySignature + long posn = s.Length - 64; + long maxSeekback = Math.Max(s.Length - 0x4000, 10); + do + { + if (posn < 0) posn = 0; // BOF + s.Seek(posn, SeekOrigin.Begin); + long bytesRead = SharedUtilities.FindSignature(s, (int)ZipConstants.EndOfCentralDirectorySignature); + if (bytesRead != -1) + success = true; + else + { + if (posn==0) break; // started at the BOF and found nothing + nTries++; + // Weird: with NETCF, negative offsets from SeekOrigin.End DO + // NOT WORK. So rather than seek a negative offset, we seek + // from SeekOrigin.Begin using a smaller number. + posn -= (32 * (nTries + 1) * nTries); + } + } + while (!success && posn > maxSeekback); + + if (success) + { + // workitem 8299 + zf._locEndOfCDS = s.Position - 4; + + byte[] block = new byte[16]; + s.Read(block, 0, block.Length); + + zf._diskNumberWithCd = BitConverter.ToUInt16(block, 2); + + if (zf._diskNumberWithCd == 0xFFFF) + throw new ZipException("Spanned archives with more than 65534 segments are not supported at this time."); + + zf._diskNumberWithCd++; // I think the number in the file differs from reality by 1 + + int i = 12; + + uint offset32 = (uint) BitConverter.ToUInt32(block, i); + if (offset32 == 0xFFFFFFFF) + { + Zip64SeekToCentralDirectory(zf); + } + else + { + zf._OffsetOfCentralDirectory = offset32; + // change for workitem 8098 + s.Seek(offset32, SeekOrigin.Begin); + } + + ReadCentralDirectory(zf); + } + else + { + // Could not find the central directory. + // Fallback to the old method. + // workitem 8098: ok + //s.Seek(zf._originPosition, SeekOrigin.Begin); + s.Seek(0L, SeekOrigin.Begin); + ReadIntoInstance_Orig(zf); + } + } + catch (Exception ex1) + { + if (zf._ReadStreamIsOurs && zf._readstream != null) + { + try + { +#if NETCF + zf._readstream.Close(); +#else + zf._readstream.Dispose(); +#endif + zf._readstream = null; + } + finally { } + } + + throw new ZipException("Cannot read that as a ZipFile", ex1); + } + + // the instance has been read in + zf._contentsChanged = false; + } + + + + private static void Zip64SeekToCentralDirectory(ZipFile zf) + { + Stream s = zf.ReadStream; + byte[] block = new byte[16]; + + // seek back to find the ZIP64 EoCD. + // I think this might not work for .NET CF ? + s.Seek(-40, SeekOrigin.Current); + s.Read(block, 0, 16); + + Int64 offset64 = BitConverter.ToInt64(block, 8); + zf._OffsetOfCentralDirectory = 0xFFFFFFFF; + zf._OffsetOfCentralDirectory64 = offset64; + // change for workitem 8098 + s.Seek(offset64, SeekOrigin.Begin); + //zf.SeekFromOrigin(Offset64); + + uint datum = (uint)Ionic.Zip.SharedUtilities.ReadInt(s); + if (datum != ZipConstants.Zip64EndOfCentralDirectoryRecordSignature) + throw new BadReadException(String.Format(" Bad signature (0x{0:X8}) looking for ZIP64 EoCD Record at position 0x{1:X8}", datum, s.Position)); + + s.Read(block, 0, 8); + Int64 Size = BitConverter.ToInt64(block, 0); + + block = new byte[Size]; + s.Read(block, 0, block.Length); + + offset64 = BitConverter.ToInt64(block, 36); + // change for workitem 8098 + s.Seek(offset64, SeekOrigin.Begin); + //zf.SeekFromOrigin(Offset64); + } + + + private static uint ReadFirstFourBytes(Stream s) + { + uint datum = (uint)Ionic.Zip.SharedUtilities.ReadInt(s); + return datum; + } + + + + private static void ReadCentralDirectory(ZipFile zf) + { + // We must have the central directory footer record, in order to properly + // read zip dir entries from the central directory. This because the logic + // knows when to open a spanned file when the volume number for the central + // directory differs from the volume number for the zip entry. The + // _diskNumberWithCd was set when originally finding the offset for the + // start of the Central Directory. + + // workitem 9214 + bool inputUsesZip64 = false; + ZipEntry de; + // in lieu of hashset, use a dictionary + var previouslySeen = new Dictionary(); + while ((de = ZipEntry.ReadDirEntry(zf, previouslySeen)) != null) + { + de.ResetDirEntry(); + zf.OnReadEntry(true, null); + + if (zf.Verbose) + zf.StatusMessageTextWriter.WriteLine("entry {0}", de.FileName); + + zf._entries.Add(de.FileName,de); + + // workitem 9214 + if (de._InputUsesZip64) inputUsesZip64 = true; + previouslySeen.Add(de.FileName, null); // to prevent dupes + } + + // workitem 9214; auto-set the zip64 flag + if (inputUsesZip64) zf.UseZip64WhenSaving = Zip64Option.Always; + + // workitem 8299 + if (zf._locEndOfCDS > 0) + zf.ReadStream.Seek(zf._locEndOfCDS, SeekOrigin.Begin); + + ReadCentralDirectoryFooter(zf); + + if (zf.Verbose && !String.IsNullOrEmpty(zf.Comment)) + zf.StatusMessageTextWriter.WriteLine("Zip file Comment: {0}", zf.Comment); + + // We keep the read stream open after reading. + + if (zf.Verbose) + zf.StatusMessageTextWriter.WriteLine("read in {0} entries.", zf._entries.Count); + + zf.OnReadCompleted(); + } + + + + + // build the TOC by reading each entry in the file. + private static void ReadIntoInstance_Orig(ZipFile zf) + { + zf.OnReadStarted(); + //zf._entries = new System.Collections.Generic.List(); + zf._entries = new System.Collections.Generic.Dictionary(); + + ZipEntry e; + if (zf.Verbose) + if (zf.Name == null) + zf.StatusMessageTextWriter.WriteLine("Reading zip from stream..."); + else + zf.StatusMessageTextWriter.WriteLine("Reading zip {0}...", zf.Name); + + // work item 6647: PK00 (packed to removable disk) + bool firstEntry = true; + ZipContainer zc = new ZipContainer(zf); + while ((e = ZipEntry.ReadEntry(zc, firstEntry)) != null) + { + if (zf.Verbose) + zf.StatusMessageTextWriter.WriteLine(" {0}", e.FileName); + + zf._entries.Add(e.FileName,e); + firstEntry = false; + } + + // read the zipfile's central directory structure here. + // workitem 9912 + // But, because it may be corrupted, ignore errors. + try + { + ZipEntry de; + // in lieu of hashset, use a dictionary + var previouslySeen = new Dictionary(); + while ((de = ZipEntry.ReadDirEntry(zf, previouslySeen)) != null) + { + // Housekeeping: Since ZipFile exposes ZipEntry elements in the enumerator, + // we need to copy the comment that we grab from the ZipDirEntry + // into the ZipEntry, so the application can access the comment. + // Also since ZipEntry is used to Write zip files, we need to copy the + // file attributes to the ZipEntry as appropriate. + ZipEntry e1 = zf._entries[de.FileName]; + if (e1 != null) + { + e1._Comment = de.Comment; + if (de.IsDirectory) e1.MarkAsDirectory(); + } + previouslySeen.Add(de.FileName,null); // to prevent dupes + } + + // workitem 8299 + if (zf._locEndOfCDS > 0) + zf.ReadStream.Seek(zf._locEndOfCDS, SeekOrigin.Begin); + + ReadCentralDirectoryFooter(zf); + + if (zf.Verbose && !String.IsNullOrEmpty(zf.Comment)) + zf.StatusMessageTextWriter.WriteLine("Zip file Comment: {0}", zf.Comment); + } + catch (ZipException) { } + catch (IOException) { } + + zf.OnReadCompleted(); + } + + + + + private static void ReadCentralDirectoryFooter(ZipFile zf) + { + Stream s = zf.ReadStream; + int signature = Ionic.Zip.SharedUtilities.ReadSignature(s); + + byte[] block = null; + int j = 0; + if (signature == ZipConstants.Zip64EndOfCentralDirectoryRecordSignature) + { + // We have a ZIP64 EOCD + // This data block is 4 bytes sig, 8 bytes size, 44 bytes fixed data, + // followed by a variable-sized extension block. We have read the sig already. + // 8 - datasize (64 bits) + // 2 - version made by + // 2 - version needed to extract + // 4 - number of this disk + // 4 - number of the disk with the start of the CD + // 8 - total number of entries in the CD on this disk + // 8 - total number of entries in the CD + // 8 - size of the CD + // 8 - offset of the CD + // ----------------------- + // 52 bytes + + block = new byte[8 + 44]; + s.Read(block, 0, block.Length); + + Int64 DataSize = BitConverter.ToInt64(block, 0); // == 44 + the variable length + + if (DataSize < 44) + throw new ZipException("Bad size in the ZIP64 Central Directory."); + + zf._versionMadeBy = BitConverter.ToUInt16(block, j); + j += 2; + zf._versionNeededToExtract = BitConverter.ToUInt16(block, j); + j += 2; + zf._diskNumberWithCd = BitConverter.ToUInt32(block, j); + j += 2; + + //zf._diskNumberWithCd++; // hack!! + + // read the extended block + block = new byte[DataSize - 44]; + s.Read(block, 0, block.Length); + // discard the result + + signature = Ionic.Zip.SharedUtilities.ReadSignature(s); + if (signature != ZipConstants.Zip64EndOfCentralDirectoryLocatorSignature) + throw new ZipException("Inconsistent metadata in the ZIP64 Central Directory."); + + block = new byte[16]; + s.Read(block, 0, block.Length); + // discard the result + + signature = Ionic.Zip.SharedUtilities.ReadSignature(s); + } + + // Throw if this is not a signature for "end of central directory record" + // This is a sanity check. + if (signature != ZipConstants.EndOfCentralDirectorySignature) + { + s.Seek(-4, SeekOrigin.Current); + throw new BadReadException(String.Format("Bad signature ({0:X8}) at position 0x{1:X8}", + signature, s.Position)); + } + + // read the End-of-Central-Directory-Record + block = new byte[16]; + zf.ReadStream.Read(block, 0, block.Length); + + // off sz data + // ------------------------------------------------------- + // 0 4 end of central dir signature (0x06054b50) + // 4 2 number of this disk + // 6 2 number of the disk with start of the central directory + // 8 2 total number of entries in the central directory on this disk + // 10 2 total number of entries in the central directory + // 12 4 size of the central directory + // 16 4 offset of start of central directory with respect to the starting disk number + // 20 2 ZIP file comment length + // 22 ?? ZIP file comment + + if (zf._diskNumberWithCd == 0) + { + zf._diskNumberWithCd = BitConverter.ToUInt16(block, 2); + //zf._diskNumberWithCd++; // hack!! + } + + // read the comment here + ReadZipFileComment(zf); + } + + + + private static void ReadZipFileComment(ZipFile zf) + { + // read the comment here + byte[] block = new byte[2]; + zf.ReadStream.Read(block, 0, block.Length); + + Int16 commentLength = (short)(block[0] + block[1] * 256); + if (commentLength > 0) + { + block = new byte[commentLength]; + zf.ReadStream.Read(block, 0, block.Length); + + // workitem 10392 - prefer ProvisionalAlternateEncoding, + // first. The fix for workitem 6513 tried to use UTF8 + // only as necessary, but that is impossible to test + // for, in this direction. There's no way to know what + // characters the already-encoded bytes refer + // to. Therefore, must do what the user tells us. + + string s1 = zf.AlternateEncoding.GetString(block, 0, block.Length); + zf.Comment = s1; + } + } + + + // private static bool BlocksAreEqual(byte[] a, byte[] b) + // { + // if (a.Length != b.Length) return false; + // for (int i = 0; i < a.Length; i++) + // { + // if (a[i] != b[i]) return false; + // } + // return true; + // } + + + + /// + /// Checks the given file to see if it appears to be a valid zip file. + /// + /// + /// + /// + /// Calling this method is equivalent to calling with the testExtract parameter set to false. + /// + /// + /// + /// The file to check. + /// true if the file appears to be a zip file. + public static bool IsZipFile(string fileName) + { + return IsZipFile(fileName, false); + } + + + /// + /// Checks a file to see if it is a valid zip file. + /// + /// + /// + /// + /// This method opens the specified zip file, reads in the zip archive, + /// verifying the ZIP metadata as it reads. + /// + /// + /// + /// If everything succeeds, then the method returns true. If anything fails - + /// for example if an incorrect signature or CRC is found, indicating a + /// corrupt file, the the method returns false. This method also returns + /// false for a file that does not exist. + /// + /// + /// + /// If is true, as part of its check, this + /// method reads in the content for each entry, expands it, and checks CRCs. + /// This provides an additional check beyond verifying the zip header and + /// directory data. + /// + /// + /// + /// If is true, and if any of the zip entries + /// are protected with a password, this method will return false. If you want + /// to verify a ZipFile that has entries which are protected with a + /// password, you will need to do that manually. + /// + /// + /// + /// + /// The zip file to check. + /// true if the caller wants to extract each entry. + /// true if the file contains a valid zip file. + public static bool IsZipFile(string fileName, bool testExtract) + { + bool result = false; + try + { + if (!File.Exists(fileName)) return false; + + using (var s = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + result = IsZipFile(s, testExtract); + } + } + catch (IOException) { } + catch (ZipException) { } + return result; + } + + + /// + /// Checks a stream to see if it contains a valid zip archive. + /// + /// + /// + /// + /// This method reads the zip archive contained in the specified stream, verifying + /// the ZIP metadata as it reads. If testExtract is true, this method also extracts + /// each entry in the archive, dumping all the bits into . + /// + /// + /// + /// If everything succeeds, then the method returns true. If anything fails - + /// for example if an incorrect signature or CRC is found, indicating a corrupt + /// file, the the method returns false. This method also returns false for a + /// file that does not exist. + /// + /// + /// + /// If testExtract is true, this method reads in the content for each + /// entry, expands it, and checks CRCs. This provides an additional check + /// beyond verifying the zip header data. + /// + /// + /// + /// If testExtract is true, and if any of the zip entries are protected + /// with a password, this method will return false. If you want to verify a + /// ZipFile that has entries which are protected with a password, you will need + /// to do that manually. + /// + /// + /// + /// + /// + /// The stream to check. + /// true if the caller wants to extract each entry. + /// true if the stream contains a valid zip archive. + public static bool IsZipFile(Stream stream, bool testExtract) + { + if (stream == null) + throw new ArgumentNullException("stream"); + + bool result = false; + try + { + if (!stream.CanRead) return false; + + var bitBucket = Stream.Null; + + using (ZipFile zip1 = ZipFile.Read(stream, null, null, null)) + { + if (testExtract) + { + foreach (var e in zip1) + { + if (!e.IsDirectory) + { + e.Extract(bitBucket); + } + } + } + } + result = true; + } + catch (IOException) { } + catch (ZipException) { } + return result; + } + + + + + } + +} diff --git a/dotNetZip/Zip/ZipFile.Save.cs b/dotNetZip/Zip/ZipFile.Save.cs new file mode 100644 index 0000000..9b07751 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.Save.cs @@ -0,0 +1,964 @@ +// ZipFile.Save.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-05 13:31:23> +// +// ------------------------------------------------------------------ +// +// This module defines the methods for Save operations on zip files. +// +// ------------------------------------------------------------------ +// + + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + + public partial class ZipFile + { + + /// + /// Delete file with retry on UnauthorizedAccessException. + /// + /// + /// + /// + /// When calling File.Delete() on a file that has been "recently" + /// created, the call sometimes fails with + /// UnauthorizedAccessException. This method simply retries the Delete 3 + /// times with a sleep between tries. + /// + /// + /// + /// the name of the file to be deleted + private void DeleteFileWithRetry(string filename) + { + bool done = false; + int nRetries = 3; + for (int i=0; i < nRetries && !done; i++) + { + try + { + File.Delete(filename); + done = true; + } + catch (System.UnauthorizedAccessException) + { + Console.WriteLine("************************************************** Retry delete."); + System.Threading.Thread.Sleep(200+i*200); + } + } + } + + + /// + /// Saves the Zip archive to a file, specified by the Name property of the + /// ZipFile. + /// + /// + /// + /// + /// The ZipFile instance is written to storage, typically a zip file + /// in a filesystem, only when the caller calls Save. In the typical + /// case, the Save operation writes the zip content to a temporary file, and + /// then renames the temporary file to the desired name. If necessary, this + /// method will delete a pre-existing file before the rename. + /// + /// + /// + /// The property is specified either explicitly, + /// or implicitly using one of the parameterized ZipFile constructors. For + /// COM Automation clients, the Name property must be set explicitly, + /// because COM Automation clients cannot call parameterized constructors. + /// + /// + /// + /// When using a filesystem file for the Zip output, it is possible to call + /// Save multiple times on the ZipFile instance. With each + /// call the zip content is re-written to the same output file. + /// + /// + /// + /// Data for entries that have been added to the ZipFile instance is + /// written to the output when the Save method is called. This means + /// that the input streams for those entries must be available at the time + /// the application calls Save. If, for example, the application + /// adds entries with AddEntry using a dynamically-allocated + /// MemoryStream, the memory stream must not have been disposed + /// before the call to Save. See the property for more discussion of the + /// availability requirements of the input stream for an entry, and an + /// approach for providing just-in-time stream lifecycle management. + /// + /// + /// + /// + /// + /// + /// + /// Thrown if you haven't specified a location or stream for saving the zip, + /// either in the constructor or by setting the Name property, or if you try + /// to save a regular zip archive to a filename with a .exe extension. + /// + /// + /// + /// Thrown if is non-zero, and the number + /// of segments that would be generated for the spanned zip file during the + /// save operation exceeds 99. If this happens, you need to increase the + /// segment size. + /// + /// + public void Save() + { + try + { + bool thisSaveUsedZip64 = false; + _saveOperationCanceled = false; + _numberOfSegmentsForMostRecentSave = 0; + OnSaveStarted(); + + if (WriteStream == null) + throw new BadStateException("You haven't specified where to save the zip."); + + if (_name != null && _name.EndsWith(".exe") && !_SavingSfx) + throw new BadStateException("You specified an EXE for a plain zip file."); + + // check if modified, before saving. + if (!_contentsChanged) + { + OnSaveCompleted(); + if (Verbose) StatusMessageTextWriter.WriteLine("No save is necessary...."); + return; + } + + Reset(true); + + if (Verbose) StatusMessageTextWriter.WriteLine("saving...."); + + // validate the number of entries + if (_entries.Count >= 0xFFFF && _zip64 == Zip64Option.Never) + throw new ZipException("The number of entries is 65535 or greater. Consider setting the UseZip64WhenSaving property on the ZipFile instance."); + + + // write an entry in the zip for each file + int n = 0; + // workitem 9831 + ICollection c = (SortEntriesBeforeSaving) ? EntriesSorted : Entries; + foreach (ZipEntry e in c) // _entries.Values + { + OnSaveEntry(n, e, true); + e.Write(WriteStream); + if (_saveOperationCanceled) + break; + + n++; + OnSaveEntry(n, e, false); + if (_saveOperationCanceled) + break; + + // Some entries can be skipped during the save. + if (e.IncludedInMostRecentSave) + thisSaveUsedZip64 |= e.OutputUsedZip64.Value; + } + + + + if (_saveOperationCanceled) + return; + + var zss = WriteStream as ZipSegmentedStream; + + _numberOfSegmentsForMostRecentSave = (zss!=null) + ? zss.CurrentSegment + : 1; + + bool directoryNeededZip64 = + ZipOutput.WriteCentralDirectoryStructure + (WriteStream, + c, + _numberOfSegmentsForMostRecentSave, + _zip64, + Comment, + new ZipContainer(this)); + + OnSaveEvent(ZipProgressEventType.Saving_AfterSaveTempArchive); + + _hasBeenSaved = true; + _contentsChanged = false; + + thisSaveUsedZip64 |= directoryNeededZip64; + _OutputUsesZip64 = new Nullable(thisSaveUsedZip64); + + + // do the rename as necessary + if (_name != null && + (_temporaryFileName!=null || zss != null)) + { + // _temporaryFileName may remain null if we are writing to a stream. + // only close the stream if there is a file behind it. +#if NETCF + WriteStream.Close(); +#else + WriteStream.Dispose(); +#endif + if (_saveOperationCanceled) + return; + + if (_fileAlreadyExists && this._readstream != null) + { + // This means we opened and read a zip file. + // If we are now saving to the same file, we need to close the + // orig file, first. + this._readstream.Close(); + this._readstream = null; + // the archiveStream for each entry needs to be null + foreach (var e in c) + { + var zss1 = e._archiveStream as ZipSegmentedStream; + if (zss1 != null) +#if NETCF + zss1.Close(); +#else + zss1.Dispose(); +#endif + e._archiveStream = null; + } + } + + string tmpName = null; + if (File.Exists(_name)) + { + // the steps: + // + // 1. Delete tmpName + // 2. move existing zip to tmpName + // 3. rename (File.Move) working file to name of existing zip + // 4. delete tmpName + // + // This series of steps avoids the exception, + // System.IO.IOException: + // "Cannot create a file when that file already exists." + // + // Cannot just call File.Replace() here because + // there is a possibility that the TEMP volume is different + // that the volume for the final file (c:\ vs d:\). + // So we need to do a Delete+Move pair. + // + // But, when doing the delete, Windows allows a process to + // delete the file, even though it is held open by, say, a + // virus scanner. It gets internally marked as "delete + // pending". The file does not actually get removed from the + // file system, it is still there after the File.Delete + // call. + // + // Therefore, we need to move the existing zip, which may be + // held open, to some other name. Then rename our working + // file to the desired name, then delete (possibly delete + // pending) the "other name". + // + // Ideally this would be transactional. It's possible that the + // delete succeeds and the move fails. Lacking transactions, if + // this kind of failure happens, we're hosed, and this logic will + // throw on the next File.Move(). + // + //File.Delete(_name); + // workitem 10447 +#if NETCF || SILVERLIGHT + tmpName = _name + "." + SharedUtilities.GenerateRandomStringImpl(8,0) + ".tmp"; +#else + tmpName = _name + "." + Path.GetRandomFileName(); +#endif + if (File.Exists(tmpName)) + DeleteFileWithRetry(tmpName); + File.Move(_name, tmpName); + } + + OnSaveEvent(ZipProgressEventType.Saving_BeforeRenameTempArchive); + File.Move((zss != null) ? zss.CurrentTempName : _temporaryFileName, + _name); + + OnSaveEvent(ZipProgressEventType.Saving_AfterRenameTempArchive); + + if (tmpName != null) + { + try + { + // not critical + if (File.Exists(tmpName)) + File.Delete(tmpName); + } + catch + { + // don't care about exceptions here. + } + + } + _fileAlreadyExists = true; + } + + NotifyEntriesSaveComplete(c); + OnSaveCompleted(); + _JustSaved = true; + } + + // workitem 5043 + finally + { + CleanupAfterSaveOperation(); + } + + return; + } + + + + private static void NotifyEntriesSaveComplete(ICollection c) + { + foreach (ZipEntry e in c) + { + e.NotifySaveComplete(); + } + } + + + private void RemoveTempFile() + { + try + { + if (File.Exists(_temporaryFileName)) + { + File.Delete(_temporaryFileName); + } + } + catch (IOException ex1) + { + if (Verbose) + StatusMessageTextWriter.WriteLine("ZipFile::Save: could not delete temp file: {0}.", ex1.Message); + } + } + + + private void CleanupAfterSaveOperation() + { + if (_name != null) + { + // close the stream if there is a file behind it. + if (_writestream != null) + { + try + { + // workitem 7704 +#if NETCF + _writestream.Close(); +#else + _writestream.Dispose(); +#endif + } + catch (System.IO.IOException) { } + } + _writestream = null; + + if (_temporaryFileName != null) + { + RemoveTempFile(); + _temporaryFileName = null; + } + } + } + + + /// + /// Save the file to a new zipfile, with the given name. + /// + /// + /// + /// + /// This method allows the application to explicitly specify the name of the zip + /// file when saving. Use this when creating a new zip file, or when + /// updating a zip archive. + /// + /// + /// + /// An application can also save a zip archive in several places by calling this + /// method multiple times in succession, with different filenames. + /// + /// + /// + /// The ZipFile instance is written to storage, typically a zip file in a + /// filesystem, only when the caller calls Save. The Save operation writes + /// the zip content to a temporary file, and then renames the temporary file + /// to the desired name. If necessary, this method will delete a pre-existing file + /// before the rename. + /// + /// + /// + /// + /// + /// Thrown if you specify a directory for the filename. + /// + /// + /// + /// The name of the zip archive to save to. Existing files will + /// be overwritten with great prejudice. + /// + /// + /// + /// This example shows how to create and Save a zip file. + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddDirectory(@"c:\reports\January"); + /// zip.Save("January.zip"); + /// } + /// + /// + /// + /// Using zip As New ZipFile() + /// zip.AddDirectory("c:\reports\January") + /// zip.Save("January.zip") + /// End Using + /// + /// + /// + /// + /// + /// This example shows how to update a zip file. + /// + /// using (ZipFile zip = ZipFile.Read("ExistingArchive.zip")) + /// { + /// zip.AddFile("NewData.csv"); + /// zip.Save("UpdatedArchive.zip"); + /// } + /// + /// + /// + /// Using zip As ZipFile = ZipFile.Read("ExistingArchive.zip") + /// zip.AddFile("NewData.csv") + /// zip.Save("UpdatedArchive.zip") + /// End Using + /// + /// + /// + public void Save(String fileName) + { + // Check for the case where we are re-saving a zip archive + // that was originally instantiated with a stream. In that case, + // the _name will be null. If so, we set _writestream to null, + // which insures that we'll cons up a new WriteStream (with a filesystem + // file backing it) in the Save() method. + if (_name == null) + _writestream = null; + + else _readName = _name; // workitem 13915 + + _name = fileName; + if (Directory.Exists(_name)) + throw new ZipException("Bad Directory", new System.ArgumentException("That name specifies an existing directory. Please specify a filename.", "fileName")); + _contentsChanged = true; + _fileAlreadyExists = File.Exists(_name); + Save(); + } + + + /// + /// Save the zip archive to the specified stream. + /// + /// + /// + /// + /// The ZipFile instance is written to storage - typically a zip file + /// in a filesystem, but using this overload, the storage can be anything + /// accessible via a writable stream - only when the caller calls Save. + /// + /// + /// + /// Use this method to save the zip content to a stream directly. A common + /// scenario is an ASP.NET application that dynamically generates a zip file + /// and allows the browser to download it. The application can call + /// Save(Response.OutputStream) to write a zipfile directly to the + /// output stream, without creating a zip file on the disk on the ASP.NET + /// server. + /// + /// + /// + /// Be careful when saving a file to a non-seekable stream, including + /// Response.OutputStream. When DotNetZip writes to a non-seekable + /// stream, the zip archive is formatted in such a way that may not be + /// compatible with all zip tools on all platforms. It's a perfectly legal + /// and compliant zip file, but some people have reported problems opening + /// files produced this way using the Mac OS archive utility. + /// + /// + /// + /// + /// + /// + /// This example saves the zipfile content into a MemoryStream, and + /// then gets the array of bytes from that MemoryStream. + /// + /// + /// using (var zip = new Ionic.Zip.ZipFile()) + /// { + /// zip.CompressionLevel= Ionic.Zlib.CompressionLevel.BestCompression; + /// zip.Password = "VerySecret."; + /// zip.Encryption = EncryptionAlgorithm.WinZipAes128; + /// zip.AddFile(sourceFileName); + /// MemoryStream output = new MemoryStream(); + /// zip.Save(output); + /// + /// byte[] zipbytes = output.ToArray(); + /// } + /// + /// + /// + /// + /// + /// This example shows a pitfall you should avoid. DO NOT read + /// from a stream, then try to save to the same stream. DO + /// NOT DO THIS: + /// + /// + /// + /// using (var fs = new FileSteeam(filename, FileMode.Open)) + /// { + /// using (var zip = Ionic.Zip.ZipFile.Read(inputStream)) + /// { + /// zip.AddEntry("Name1.txt", "this is the content"); + /// zip.Save(inputStream); // NO NO NO!! + /// } + /// } + /// + /// + /// + /// Better like this: + /// + /// + /// + /// using (var zip = Ionic.Zip.ZipFile.Read(filename)) + /// { + /// zip.AddEntry("Name1.txt", "this is the content"); + /// zip.Save(); // YES! + /// } + /// + /// + /// + /// + /// + /// The System.IO.Stream to write to. It must be + /// writable. If you created the ZipFile instanct by calling + /// ZipFile.Read(), this stream must not be the same stream + /// you passed to ZipFile.Read(). + /// + public void Save(Stream outputStream) + { + if (outputStream == null) + throw new ArgumentNullException("outputStream"); + if (!outputStream.CanWrite) + throw new ArgumentException("Must be a writable stream.", "outputStream"); + + // if we had a filename to save to, we are now obliterating it. + _name = null; + + _writestream = new CountingStream(outputStream); + + _contentsChanged = true; + _fileAlreadyExists = false; + Save(); + } + + + } + + + + internal static class ZipOutput + { + public static bool WriteCentralDirectoryStructure(Stream s, + ICollection entries, + uint numSegments, + Zip64Option zip64, + String comment, + ZipContainer container) + { + var zss = s as ZipSegmentedStream; + if (zss != null) + zss.ContiguousWrite = true; + + // write to a memory stream in order to keep the + // CDR contiguous + Int64 aLength = 0; + using (var ms = new MemoryStream()) + { + foreach (ZipEntry e in entries) + { + if (e.IncludedInMostRecentSave) + { + // this writes a ZipDirEntry corresponding to the ZipEntry + e.WriteCentralDirectoryEntry(ms); + } + } + var a = ms.ToArray(); + s.Write(a, 0, a.Length); + aLength = a.Length; + } + + + // We need to keep track of the start and + // Finish of the Central Directory Structure. + + // Cannot always use WriteStream.Length or Position; some streams do + // not support these. (eg, ASP.NET Response.OutputStream) In those + // cases we have a CountingStream. + + // Also, we cannot just set Start as s.Position bfore the write, and Finish + // as s.Position after the write. In a split zip, the write may actually + // flip to the next segment. In that case, Start will be zero. But we + // don't know that til after we know the size of the thing to write. So the + // answer is to compute the directory, then ask the ZipSegmentedStream which + // segment that directory would fall in, it it were written. Then, include + // that data into the directory, and finally, write the directory to the + // output stream. + + var output = s as CountingStream; + long Finish = (output != null) ? output.ComputedPosition : s.Position; // BytesWritten + long Start = Finish - aLength; + + // need to know which segment the EOCD record starts in + UInt32 startSegment = (zss != null) + ? zss.CurrentSegment + : 0; + + Int64 SizeOfCentralDirectory = Finish - Start; + + int countOfEntries = CountEntries(entries); + + bool needZip64CentralDirectory = + zip64 == Zip64Option.Always || + countOfEntries >= 0xFFFF || + SizeOfCentralDirectory > 0xFFFFFFFF || + Start > 0xFFFFFFFF; + + byte[] a2 = null; + + // emit ZIP64 extensions as required + if (needZip64CentralDirectory) + { + if (zip64 == Zip64Option.Never) + { +#if NETCF + throw new ZipException("The archive requires a ZIP64 Central Directory. Consider enabling ZIP64 extensions."); +#else + System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(1); + if (sf.GetMethod().DeclaringType == typeof(ZipFile)) + throw new ZipException("The archive requires a ZIP64 Central Directory. Consider setting the ZipFile.UseZip64WhenSaving property."); + else + throw new ZipException("The archive requires a ZIP64 Central Directory. Consider setting the ZipOutputStream.EnableZip64 property."); +#endif + + } + + var a = GenZip64EndOfCentralDirectory(Start, Finish, countOfEntries, numSegments); + a2 = GenCentralDirectoryFooter(Start, Finish, zip64, countOfEntries, comment, container); + if (startSegment != 0) + { + UInt32 thisSegment = zss.ComputeSegment(a.Length + a2.Length); + int i = 16; + // number of this disk + Array.Copy(BitConverter.GetBytes(thisSegment), 0, a, i, 4); + i += 4; + // number of the disk with the start of the central directory + //Array.Copy(BitConverter.GetBytes(startSegment), 0, a, i, 4); + Array.Copy(BitConverter.GetBytes(thisSegment), 0, a, i, 4); + + i = 60; + // offset 60 + // number of the disk with the start of the zip64 eocd + Array.Copy(BitConverter.GetBytes(thisSegment), 0, a, i, 4); + i += 4; + i += 8; + + // offset 72 + // total number of disks + Array.Copy(BitConverter.GetBytes(thisSegment), 0, a, i, 4); + } + s.Write(a, 0, a.Length); + } + else + a2 = GenCentralDirectoryFooter(Start, Finish, zip64, countOfEntries, comment, container); + + + // now, the regular footer + if (startSegment != 0) + { + // The assumption is the central directory is never split across + // segment boundaries. + + UInt16 thisSegment = (UInt16) zss.ComputeSegment(a2.Length); + int i = 4; + // number of this disk + Array.Copy(BitConverter.GetBytes(thisSegment), 0, a2, i, 2); + i += 2; + // number of the disk with the start of the central directory + //Array.Copy(BitConverter.GetBytes((UInt16)startSegment), 0, a2, i, 2); + Array.Copy(BitConverter.GetBytes(thisSegment), 0, a2, i, 2); + i += 2; + } + + s.Write(a2, 0, a2.Length); + + // reset the contiguous write property if necessary + if (zss != null) + zss.ContiguousWrite = false; + + return needZip64CentralDirectory; + } + + + private static System.Text.Encoding GetEncoding(ZipContainer container, string t) + { + switch (container.AlternateEncodingUsage) + { + case ZipOption.Always: + return container.AlternateEncoding; + case ZipOption.Never: + return container.DefaultEncoding; + } + + // AsNecessary is in force + var e = container.DefaultEncoding; + if (t == null) return e; + + var bytes = e.GetBytes(t); + var t2 = e.GetString(bytes,0,bytes.Length); + if (t2.Equals(t)) return e; + return container.AlternateEncoding; + } + + + + private static byte[] GenCentralDirectoryFooter(long StartOfCentralDirectory, + long EndOfCentralDirectory, + Zip64Option zip64, + int entryCount, + string comment, + ZipContainer container) + { + System.Text.Encoding encoding = GetEncoding(container, comment); + int j = 0; + int bufferLength = 22; + byte[] block = null; + Int16 commentLength = 0; + if ((comment != null) && (comment.Length != 0)) + { + block = encoding.GetBytes(comment); + commentLength = (Int16)block.Length; + } + bufferLength += commentLength; + byte[] bytes = new byte[bufferLength]; + + int i = 0; + // signature + byte[] sig = BitConverter.GetBytes(ZipConstants.EndOfCentralDirectorySignature); + Array.Copy(sig, 0, bytes, i, 4); + i+=4; + + // number of this disk + // (this number may change later) + bytes[i++] = 0; + bytes[i++] = 0; + + // number of the disk with the start of the central directory + // (this number may change later) + bytes[i++] = 0; + bytes[i++] = 0; + + // handle ZIP64 extensions for the end-of-central-directory + if (entryCount >= 0xFFFF || zip64 == Zip64Option.Always) + { + // the ZIP64 version. + for (j = 0; j < 4; j++) + bytes[i++] = 0xFF; + } + else + { + // the standard version. + // total number of entries in the central dir on this disk + bytes[i++] = (byte)(entryCount & 0x00FF); + bytes[i++] = (byte)((entryCount & 0xFF00) >> 8); + + // total number of entries in the central directory + bytes[i++] = (byte)(entryCount & 0x00FF); + bytes[i++] = (byte)((entryCount & 0xFF00) >> 8); + } + + // size of the central directory + Int64 SizeOfCentralDirectory = EndOfCentralDirectory - StartOfCentralDirectory; + + if (SizeOfCentralDirectory >= 0xFFFFFFFF || StartOfCentralDirectory >= 0xFFFFFFFF) + { + // The actual data is in the ZIP64 central directory structure + for (j = 0; j < 8; j++) + bytes[i++] = 0xFF; + } + else + { + // size of the central directory (we just get the low 4 bytes) + bytes[i++] = (byte)(SizeOfCentralDirectory & 0x000000FF); + bytes[i++] = (byte)((SizeOfCentralDirectory & 0x0000FF00) >> 8); + bytes[i++] = (byte)((SizeOfCentralDirectory & 0x00FF0000) >> 16); + bytes[i++] = (byte)((SizeOfCentralDirectory & 0xFF000000) >> 24); + + // offset of the start of the central directory (we just get the low 4 bytes) + bytes[i++] = (byte)(StartOfCentralDirectory & 0x000000FF); + bytes[i++] = (byte)((StartOfCentralDirectory & 0x0000FF00) >> 8); + bytes[i++] = (byte)((StartOfCentralDirectory & 0x00FF0000) >> 16); + bytes[i++] = (byte)((StartOfCentralDirectory & 0xFF000000) >> 24); + } + + + // zip archive comment + if ((comment == null) || (comment.Length == 0)) + { + // no comment! + bytes[i++] = (byte)0; + bytes[i++] = (byte)0; + } + else + { + // the size of our buffer defines the max length of the comment we can write + if (commentLength + i + 2 > bytes.Length) commentLength = (Int16)(bytes.Length - i - 2); + bytes[i++] = (byte)(commentLength & 0x00FF); + bytes[i++] = (byte)((commentLength & 0xFF00) >> 8); + + if (commentLength != 0) + { + // now actually write the comment itself into the byte buffer + for (j = 0; (j < commentLength) && (i + j < bytes.Length); j++) + { + bytes[i + j] = block[j]; + } + i += j; + } + } + + // s.Write(bytes, 0, i); + return bytes; + } + + + + private static byte[] GenZip64EndOfCentralDirectory(long StartOfCentralDirectory, + long EndOfCentralDirectory, + int entryCount, + uint numSegments) + { + const int bufferLength = 12 + 44 + 20; + + byte[] bytes = new byte[bufferLength]; + + int i = 0; + // signature + byte[] sig = BitConverter.GetBytes(ZipConstants.Zip64EndOfCentralDirectoryRecordSignature); + Array.Copy(sig, 0, bytes, i, 4); + i+=4; + + // There is a possibility to include "Extensible" data in the zip64 + // end-of-central-dir record. I cannot figure out what it might be used to + // store, so the size of this record is always fixed. Maybe it is used for + // strong encryption data? That is for another day. + long DataSize = 44; + Array.Copy(BitConverter.GetBytes(DataSize), 0, bytes, i, 8); + i += 8; + + // offset 12 + // VersionMadeBy = 45; + bytes[i++] = 45; + bytes[i++] = 0x00; + + // VersionNeededToExtract = 45; + bytes[i++] = 45; + bytes[i++] = 0x00; + + // offset 16 + // number of the disk, and the disk with the start of the central dir. + // (this may change later) + for (int j = 0; j < 8; j++) + bytes[i++] = 0x00; + + // offset 24 + long numberOfEntries = entryCount; + Array.Copy(BitConverter.GetBytes(numberOfEntries), 0, bytes, i, 8); + i += 8; + Array.Copy(BitConverter.GetBytes(numberOfEntries), 0, bytes, i, 8); + i += 8; + + // offset 40 + Int64 SizeofCentraldirectory = EndOfCentralDirectory - StartOfCentralDirectory; + Array.Copy(BitConverter.GetBytes(SizeofCentraldirectory), 0, bytes, i, 8); + i += 8; + Array.Copy(BitConverter.GetBytes(StartOfCentralDirectory), 0, bytes, i, 8); + i += 8; + + // offset 56 + // now, the locator + // signature + sig = BitConverter.GetBytes(ZipConstants.Zip64EndOfCentralDirectoryLocatorSignature); + Array.Copy(sig, 0, bytes, i, 4); + i+=4; + + // offset 60 + // number of the disk with the start of the zip64 eocd + // (this will change later) (it will?) + uint x2 = (numSegments==0)?0:(uint)(numSegments-1); + Array.Copy(BitConverter.GetBytes(x2), 0, bytes, i, 4); + i+=4; + + // offset 64 + // relative offset of the zip64 eocd + Array.Copy(BitConverter.GetBytes(EndOfCentralDirectory), 0, bytes, i, 8); + i += 8; + + // offset 72 + // total number of disks + // (this will change later) + Array.Copy(BitConverter.GetBytes(numSegments), 0, bytes, i, 4); + i+=4; + + return bytes; + } + + + + private static int CountEntries(ICollection _entries) + { + // Cannot just emit _entries.Count, because some of the entries + // may have been skipped. + int count = 0; + foreach (var entry in _entries) + if (entry.IncludedInMostRecentSave) count++; + return count; + } + + + + + } +} diff --git a/dotNetZip/Zip/ZipFile.SaveSelfExtractor.cs b/dotNetZip/Zip/ZipFile.SaveSelfExtractor.cs new file mode 100644 index 0000000..9de5dc8 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.SaveSelfExtractor.cs @@ -0,0 +1,1101 @@ +// ZipFile.saveSelfExtractor.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2008-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-10 19:22:46> +// +// ------------------------------------------------------------------ +// +// This is a the source module that implements the stuff for saving to a +// self-extracting Zip archive. +// +// ZipFile is set up as a "partial class" - defined in multiple .cs source modules. +// This is one of the source modules for the ZipFile class. +// +// Here's the design: The self-extracting zip file is just a regular managed EXE +// file, with embedded resources. The managed code logic instantiates a ZipFile, and +// then extracts each entry. The embedded resources include the zip archive content, +// as well as the Zip library itself. The latter is required so that self-extracting +// can work on any machine, whether or not it has the DotNetZip library installed on +// it. +// +// What we need to do is create the animal I just described, within a method on the +// ZipFile class. This source module provides that capability. The method is +// SaveSelfExtractor(). +// +// The way the method works: it uses the programmatic interface to the csc.exe +// compiler, Microsoft.CSharp.CSharpCodeProvider, to compile "boilerplate" +// extraction logic into a new assembly. As part of that compile, we embed within +// that assembly the zip archive itself, as well as the Zip library. +// +// Therefore we need to first save to a temporary zip file, then produce the exe. +// +// There are a few twists. +// +// The Visual Studio Project structure is a little weird. There are code files +// that ARE NOT compiled during a normal build of the VS Solution. They are +// marked as embedded resources. These are the various "boilerplate" modules that +// are used in the self-extractor. These modules are: WinFormsSelfExtractorStub.cs +// WinFormsSelfExtractorStub.Designer.cs CommandLineSelfExtractorStub.cs +// PasswordDialog.cs PasswordDialog.Designer.cs +// +// At design time, if you want to modify the way the GUI looks, you have to +// mark those modules to have a "compile" build action. Then tweak em, test, +// etc. Then again mark them as "Embedded resource". +// +// ------------------------------------------------------------------ + +using System; +using System.Reflection; +using System.IO; +using System.Collections.Generic; + + +namespace Ionic.Zip +{ +#if !NO_SFX + /// + /// An enum that provides the different self-extractor flavors + /// + public enum SelfExtractorFlavor + { + /// + /// A self-extracting zip archive that runs from the console or + /// command line. + /// + ConsoleApplication = 0, + + /// + /// A self-extracting zip archive that presents a graphical user + /// interface when it is executed. + /// + WinFormsApplication, + } + + /// + /// The options for generating a self-extracting archive. + /// + public class SelfExtractorSaveOptions + { + /// + /// The type of SFX to create. + /// + public SelfExtractorFlavor Flavor + { + get; + set; + } + + /// + /// The command to run after extraction. + /// + /// + /// + /// + /// This is optional. Leave it empty (null in C# or Nothing in + /// VB) to run no command after extraction. + /// + /// + /// + /// If it is non-empty, the SFX will execute the command specified in this + /// string on the user's machine, and using the extract directory as the + /// working directory for the process, after unpacking the archive. The + /// program to execute can include a path, if you like. If you want to execute + /// a program that accepts arguments, specify the program name, followed by a + /// space, and then the arguments for the program, each separated by a space, + /// just as you would on a normal command line. Example: program.exe arg1 + /// arg2. The string prior to the first space will be taken as the + /// program name, and the string following the first space specifies the + /// arguments to the program. + /// + /// + /// + /// If you want to execute a program that has a space in the name or path of + /// the file, surround the program name in double-quotes. The first character + /// of the command line should be a double-quote character, and there must be + /// a matching double-quote following the end of the program file name. Any + /// optional arguments to the program follow that, separated by + /// spaces. Example: "c:\project files\program name.exe" arg1 arg2. + /// + /// + /// + /// If the flavor of the SFX is SelfExtractorFlavor.ConsoleApplication, + /// then the SFX starts a new process, using this string as the post-extract + /// command line. The SFX waits for the process to exit. The exit code of + /// the post-extract command line is returned as the exit code of the + /// command-line self-extractor exe. A non-zero exit code is typically used to + /// indicated a failure by the program. In the case of an SFX, a non-zero exit + /// code may indicate a failure during extraction, OR, it may indicate a + /// failure of the run-after-extract program if specified, OR, it may indicate + /// the run-after-extract program could not be fuond. There is no way to + /// distinguish these conditions from the calling shell, aside from parsing + /// the output of the SFX. If you have Quiet set to true, you may not + /// see error messages, if a problem occurs. + /// + /// + /// + /// If the flavor of the SFX is + /// SelfExtractorFlavor.WinFormsApplication, then the SFX starts a new + /// process, using this string as the post-extract command line, and using the + /// extract directory as the working directory for the process. The SFX does + /// not wait for the command to complete, and does not check the exit code of + /// the program. If the run-after-extract program cannot be fuond, a message + /// box is displayed indicating that fact. + /// + /// + /// + /// You can specify environment variables within this string, with a format like + /// %NAME%. The value of these variables will be expanded at the time + /// the SFX is run. Example: %WINDIR%\system32\xcopy.exe may expand at + /// runtime to c:\Windows\System32\xcopy.exe. + /// + /// + /// + /// By combining this with the RemoveUnpackedFilesAfterExecute + /// flag, you can create an SFX that extracts itself, runs a file that + /// was extracted, then deletes all the files that were extracted. If + /// you want it to run "invisibly" then set Flavor to + /// SelfExtractorFlavor.ConsoleApplication, and set Quiet + /// to true. The user running such an EXE will see a console window + /// appear, then disappear quickly. You may also want to specify the + /// default extract location, with DefaultExtractDirectory. + /// + /// + /// + /// If you set Flavor to + /// SelfExtractorFlavor.WinFormsApplication, and set Quiet to + /// true, then a GUI with progressbars is displayed, but it is + /// "non-interactive" - it accepts no input from the user. Instead the SFX + /// just automatically unpacks and exits. + /// + /// + /// + public String PostExtractCommandLine + { + get; + set; + } + + /// + /// The default extract directory the user will see when + /// running the self-extracting archive. + /// + /// + /// + /// + /// Passing null (or Nothing in VB) here will cause the Self Extractor to use + /// the the user's personal directory () for the default extract + /// location. + /// + /// + /// + /// This is only a default location. The actual extract location will be + /// settable on the command line when the SFX is executed. + /// + /// + /// + /// You can specify environment variables within this string, + /// with %NAME%. The value of these variables will be + /// expanded at the time the SFX is run. Example: + /// %USERPROFILE%\Documents\unpack may expand at runtime to + /// c:\users\melvin\Documents\unpack. + /// + /// + public String DefaultExtractDirectory + { + get; + set; + } + + /// + /// The name of an .ico file in the filesystem to use for the application icon + /// for the generated SFX. + /// + /// + /// + /// + /// Normally, DotNetZip will embed an "zipped folder" icon into the generated + /// SFX. If you prefer to use a different icon, you can specify it here. It + /// should be a .ico file. This file is passed as the /win32icon + /// option to the csc.exe compiler when constructing the SFX file. + /// + /// + /// + public string IconFile + { + get; + set; + } + + /// + /// Whether the ConsoleApplication SFX will be quiet during extraction. + /// + /// + /// + /// + /// This option affects the way the generated SFX runs. By default it is + /// false. When you set it to true,... + /// + /// + /// + /// + /// Flavor + /// Behavior + /// + /// + /// + /// ConsoleApplication + /// no messages will be emitted during successful + /// operation. Double-clicking the SFX in Windows + /// Explorer or as an attachment in an email will cause a console + /// window to appear briefly, before it disappears. If you run the + /// ConsoleApplication SFX from the cmd.exe prompt, it runs as a + /// normal console app; by default, because it is quiet, it displays + /// no messages to the console. If you pass the -v+ command line + /// argument to the Console SFX when you run it, you will get verbose + /// messages to the console. + /// + /// + /// + /// + /// WinFormsApplication + /// the SFX extracts automatically when the application + /// is launched, with no additional user input. + /// + /// + /// + /// + /// + /// + /// When you set it to false,... + /// + /// + /// + /// + /// Flavor + /// Behavior + /// + /// + /// + /// ConsoleApplication + /// the extractor will emit a + /// message to the console for each entry extracted. + /// + /// When double-clicking to launch the SFX, the console window will + /// remain, and the SFX will emit a message for each file as it + /// extracts. The messages fly by quickly, they won't be easily + /// readable, unless the extracted files are fairly large. + /// + /// + /// + /// + /// + /// WinFormsApplication + /// the SFX presents a forms UI and allows the user to select + /// options before extracting. + /// + /// + /// + /// + /// + /// + public bool Quiet + { + get; + set; + } + + + /// + /// Specify what the self-extractor will do when extracting an entry + /// would overwrite an existing file. + /// + /// + /// + /// The default behavvior is to Throw. + /// + /// + public Ionic.Zip.ExtractExistingFileAction ExtractExistingFile + { + get; + set; + } + + + /// + /// Whether to remove the files that have been unpacked, after executing the + /// PostExtractCommandLine. + /// + /// + /// + /// + /// If true, and if there is a + /// PostExtractCommandLine, and if the command runs successfully, + /// then the files that the SFX unpacked will be removed, afterwards. If + /// the command does not complete successfully (non-zero return code), + /// that is interpreted as a failure, and the extracted files will not be + /// removed. + /// + /// + /// + /// Setting this flag, and setting Flavor to + /// SelfExtractorFlavor.ConsoleApplication, and setting Quiet to + /// true, results in an SFX that extracts itself, runs a file that was + /// extracted, then deletes all the files that were extracted, with no + /// intervention by the user. You may also want to specify the default + /// extract location, with DefaultExtractDirectory. + /// + /// + /// + public bool RemoveUnpackedFilesAfterExecute + { + get; + set; + } + + + /// + /// The file version number to embed into the generated EXE. It will show up, for + /// example, during a mouseover in Windows Explorer. + /// + /// + public Version FileVersion + { + get; + set; + } + + /// + /// The product version to embed into the generated EXE. It will show up, for + /// example, during a mouseover in Windows Explorer. + /// + /// + /// + /// You can use any arbitrary string, but a human-readable version number is + /// recommended. For example "v1.2 alpha" or "v4.2 RC2". If you specify nothing, + /// then there is no product version embedded into the EXE. + /// + /// + public String ProductVersion + { + get; + set; + } + + /// + /// The copyright notice, if any, to embed into the generated EXE. + /// + /// + /// + /// It will show up, for example, while viewing properties of the file in + /// Windows Explorer. You can use any arbitrary string, but typically you + /// want something like "Copyright Dino Chiesa 2011". + /// + /// + public String Copyright + { + get; + set; + } + + + /// + /// The description to embed into the generated EXE. + /// + /// + /// + /// Use any arbitrary string. This text will be displayed during a + /// mouseover in Windows Explorer. If you specify nothing, then the string + /// "DotNetZip SFX Archive" is embedded into the EXE as the description. + /// + /// + public String Description + { + get; + set; + } + + /// + /// The product name to embed into the generated EXE. + /// + /// + /// + /// Use any arbitrary string. This text will be displayed + /// while viewing properties of the EXE file in + /// Windows Explorer. + /// + /// + public String ProductName + { + get; + set; + } + + /// + /// The title to display in the Window of a GUI SFX, while it extracts. + /// + /// + /// + /// + /// By default the title show in the GUI window of a self-extractor + /// is "DotNetZip Self-extractor (http://DotNetZip.codeplex.com/)". + /// You can change that by setting this property before saving the SFX. + /// + /// + /// + /// This property has an effect only when producing a Self-extractor + /// of flavor SelfExtractorFlavor.WinFormsApplication. + /// + /// + /// + public String SfxExeWindowTitle + { + // workitem 12608 + get; + set; + } + + /// + /// Additional options for the csc.exe compiler, when producing the SFX + /// EXE. + /// + /// + public string AdditionalCompilerSwitches + { + get; set; + } + } + + + + + partial class ZipFile + { + class ExtractorSettings + { + public SelfExtractorFlavor Flavor; + public List ReferencedAssemblies; + public List CopyThroughResources; + public List ResourcesToCompile; + } + + + private static ExtractorSettings[] SettingsList = { + new ExtractorSettings() { + Flavor = SelfExtractorFlavor.WinFormsApplication, + ReferencedAssemblies= new List{ + "System.dll", "System.Windows.Forms.dll", "System.Drawing.dll"}, + CopyThroughResources = new List{ + "Ionic.Zip.WinFormsSelfExtractorStub.resources", + "Ionic.Zip.Forms.PasswordDialog.resources", + "Ionic.Zip.Forms.ZipContentsDialog.resources"}, + ResourcesToCompile = new List{ + "WinFormsSelfExtractorStub.cs", + "WinFormsSelfExtractorStub.Designer.cs", // .Designer.cs? + "PasswordDialog.cs", + "PasswordDialog.Designer.cs", //.Designer.cs" + "ZipContentsDialog.cs", + "ZipContentsDialog.Designer.cs", //.Designer.cs" + "FolderBrowserDialogEx.cs", + } + }, + new ExtractorSettings() { + Flavor = SelfExtractorFlavor.ConsoleApplication, + ReferencedAssemblies= new List { "System.dll", }, + CopyThroughResources = null, + ResourcesToCompile = new List{"CommandLineSelfExtractorStub.cs"} + } + }; + + + + //string _defaultExtractLocation; + //string _postExtractCmdLine; + // string _SetDefaultLocationCode = + // "namespace Ionic.Zip { public partial class WinFormsSelfExtractorStub { partial void _SetDefaultExtractLocation() {" + + // " txtExtractDirectory.Text = \"@@VALUE\"; } }}"; + + + + /// + /// Saves the ZipFile instance to a self-extracting zip archive. + /// + /// + /// + /// + /// + /// The generated exe image will execute on any machine that has the .NET + /// Framework 2.0 installed on it. The generated exe image is also a + /// valid ZIP file, readable with DotNetZip or another Zip library or tool + /// such as WinZip. + /// + /// + /// + /// There are two "flavors" of self-extracting archive. The + /// WinFormsApplication version will pop up a GUI and allow the + /// user to select a target directory into which to extract. There's also + /// a checkbox allowing the user to specify to overwrite existing files, + /// and another checkbox to allow the user to request that Explorer be + /// opened to see the extracted files after extraction. The other flavor + /// is ConsoleApplication. A self-extractor generated with that + /// flavor setting will run from the command line. It accepts command-line + /// options to set the overwrite behavior, and to specify the target + /// extraction directory. + /// + /// + /// + /// There are a few temporary files created during the saving to a + /// self-extracting zip. These files are created in the directory pointed + /// to by , which defaults to . These temporary files are + /// removed upon successful completion of this method. + /// + /// + /// + /// When a user runs the WinForms SFX, the user's personal directory (Environment.SpecialFolder.Personal) + /// will be used as the default extract location. If you want to set the + /// default extract location, you should use the other overload of + /// SaveSelfExtractor()/ The user who runs the SFX will have the + /// opportunity to change the extract directory before extracting. When + /// the user runs the Command-Line SFX, the user must explicitly specify + /// the directory to which to extract. The .NET Framework 2.0 is required + /// on the computer when the self-extracting archive is run. + /// + /// + /// + /// NB: This method is not available in the version of DotNetZip build for + /// the .NET Compact Framework, nor in the "Reduced" DotNetZip library. + /// + /// + /// + /// + /// + /// + /// string DirectoryPath = "c:\\Documents\\Project7"; + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)); + /// zip.Comment = "This will be embedded into a self-extracting console-based exe"; + /// zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication); + /// } + /// + /// + /// Dim DirectoryPath As String = "c:\Documents\Project7" + /// Using zip As New ZipFile() + /// zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)) + /// zip.Comment = "This will be embedded into a self-extracting console-based exe" + /// zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication) + /// End Using + /// + /// + /// + /// + /// a pathname, possibly fully qualified, to be created. Typically it + /// will end in an .exe extension. + /// + /// Indicates whether a Winforms or Console self-extractor is + /// desired. + public void SaveSelfExtractor(string exeToGenerate, SelfExtractorFlavor flavor) + { + SelfExtractorSaveOptions options = new SelfExtractorSaveOptions(); + options.Flavor = flavor; + SaveSelfExtractor(exeToGenerate, options); + } + + + + /// + /// Saves the ZipFile instance to a self-extracting zip archive, using + /// the specified save options. + /// + /// + /// + /// + /// This method saves a self extracting archive, using the specified save + /// options. These options include the flavor of the SFX, the default extract + /// directory, the icon file, and so on. See the documentation + /// for for more + /// details. + /// + /// + /// + /// The user who runs the SFX will have the opportunity to change the extract + /// directory before extracting. If at the time of extraction, the specified + /// directory does not exist, the SFX will create the directory before + /// extracting the files. + /// + /// + /// + /// + /// + /// This example saves a WinForms-based self-extracting archive EXE that + /// will use c:\ExtractHere as the default extract location. The C# code + /// shows syntax for .NET 3.0, which uses an object initializer for + /// the SelfExtractorOptions object. + /// + /// string DirectoryPath = "c:\\Documents\\Project7"; + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)); + /// zip.Comment = "This will be embedded into a self-extracting WinForms-based exe"; + /// var options = new SelfExtractorOptions + /// { + /// Flavor = SelfExtractorFlavor.WinFormsApplication, + /// DefaultExtractDirectory = "%USERPROFILE%\\ExtractHere", + /// PostExtractCommandLine = ExeToRunAfterExtract, + /// SfxExeWindowTitle = "My Custom Window Title", + /// RemoveUnpackedFilesAfterExecute = true + /// }; + /// zip.SaveSelfExtractor("archive.exe", options); + /// } + /// + /// + /// Dim DirectoryPath As String = "c:\Documents\Project7" + /// Using zip As New ZipFile() + /// zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)) + /// zip.Comment = "This will be embedded into a self-extracting console-based exe" + /// Dim options As New SelfExtractorOptions() + /// options.Flavor = SelfExtractorFlavor.WinFormsApplication + /// options.DefaultExtractDirectory = "%USERPROFILE%\\ExtractHere" + /// options.PostExtractCommandLine = ExeToRunAfterExtract + /// options.SfxExeWindowTitle = "My Custom Window Title" + /// options.RemoveUnpackedFilesAfterExecute = True + /// zip.SaveSelfExtractor("archive.exe", options) + /// End Using + /// + /// + /// + /// The name of the EXE to generate. + /// provides the options for creating the + /// Self-extracting archive. + public void SaveSelfExtractor(string exeToGenerate, SelfExtractorSaveOptions options) + { + // Save an SFX that is both an EXE and a ZIP. + + // Check for the case where we are re-saving a zip archive + // that was originally instantiated with a stream. In that case, + // the _name will be null. If so, we set _writestream to null, + // which insures that we'll cons up a new WriteStream (with a filesystem + // file backing it) in the Save() method. + if (_name == null) + _writestream = null; + + _SavingSfx = true; + _name = exeToGenerate; + if (Directory.Exists(_name)) + throw new ZipException("Bad Directory", new System.ArgumentException("That name specifies an existing directory. Please specify a filename.", "exeToGenerate")); + _contentsChanged = true; + _fileAlreadyExists = File.Exists(_name); + + _SaveSfxStub(exeToGenerate, options); + + Save(); + _SavingSfx = false; + } + + + + + private static void ExtractResourceToFile(Assembly a, string resourceName, string filename) + { + int n = 0; + byte[] bytes = new byte[1024]; + using (Stream instream = a.GetManifestResourceStream(resourceName)) + { + if (instream == null) + throw new ZipException(String.Format("missing resource '{0}'", resourceName)); + + using (FileStream outstream = File.OpenWrite(filename)) + { + do + { + n = instream.Read(bytes, 0, bytes.Length); + outstream.Write(bytes, 0, n); + } while (n > 0); + } + } + } + + + private void _SaveSfxStub(string exeToGenerate, SelfExtractorSaveOptions options) + { + string nameOfIconFile = null; + string stubExe = null; + string unpackedResourceDir = null; + string tmpDir = null; + try + { + if (File.Exists(exeToGenerate)) + { + if (Verbose) StatusMessageTextWriter.WriteLine("The existing file ({0}) will be overwritten.", exeToGenerate); + } + if (!exeToGenerate.EndsWith(".exe")) + { + if (Verbose) StatusMessageTextWriter.WriteLine("Warning: The generated self-extracting file will not have an .exe extension."); + } + + // workitem 10553 + tmpDir = TempFileFolder ?? Path.GetDirectoryName(exeToGenerate); + stubExe = GenerateTempPathname(tmpDir, "exe"); + + // get the Ionic.Zip assembly + Assembly a1 = typeof(ZipFile).Assembly; + + using (var csharp = new Microsoft.CSharp.CSharpCodeProvider + (new Dictionary() { { "CompilerVersion", "v2.0" } })) { + + // The following is a perfect opportunity for a linq query, but + // I cannot use it. DotNetZip needs to run on .NET 2.0, + // and using LINQ would break that. Here's what it would look + // like: + // + // var settings = (from x in SettingsList + // where x.Flavor == flavor + // select x).First(); + + ExtractorSettings settings = null; + foreach (var x in SettingsList) + { + if (x.Flavor == options.Flavor) + { + settings = x; + break; + } + } + + // sanity check; should never happen + if (settings == null) + throw new BadStateException(String.Format("While saving a Self-Extracting Zip, Cannot find that flavor ({0})?", options.Flavor)); + + // This is the list of referenced assemblies. Ionic.Zip is + // needed here. Also if it is the winforms (gui) extractor, we + // need other referenced assemblies, like + // System.Windows.Forms.dll, etc. + var cp = new System.CodeDom.Compiler.CompilerParameters(); + cp.ReferencedAssemblies.Add(a1.Location); + if (settings.ReferencedAssemblies != null) + foreach (string ra in settings.ReferencedAssemblies) + cp.ReferencedAssemblies.Add(ra); + + cp.GenerateInMemory = false; + cp.GenerateExecutable = true; + cp.IncludeDebugInformation = false; + cp.CompilerOptions = ""; + + Assembly a2 = Assembly.GetExecutingAssembly(); + + // Use this to concatenate all the source code resources into a + // single module. + var sb = new System.Text.StringBuilder(); + + // In case there are compiler errors later, we allocate a source + // file name now. If errors are detected, we'll spool the source + // code as well as the errors (in comments) into that filename, + // and throw an exception with the filename. Makes it easier to + // diagnose. This should be rare; most errors happen only + // during devlpmt of DotNetZip itself, but there are rare + // occasions when they occur in other cases. + string sourceFile = GenerateTempPathname(tmpDir, "cs"); + + + // // debugging: enumerate the resources in this assembly + // Console.WriteLine("Resources in this assembly:"); + // foreach (string rsrc in a2.GetManifestResourceNames()) + // { + // Console.WriteLine(rsrc); + // } + // Console.WriteLine(); + + + // all the source code is embedded in the DLL as a zip file. + using (ZipFile zip = ZipFile.Read(a2.GetManifestResourceStream("Ionic.Zip.Resources.ZippedResources.zip"))) + { + // // debugging: enumerate the files in the embedded zip + // Console.WriteLine("Entries in the embbedded zip:"); + // foreach (ZipEntry entry in zip) + // { + // Console.WriteLine(entry.FileName); + // } + // Console.WriteLine(); + + unpackedResourceDir = GenerateTempPathname(tmpDir, "tmp"); + + if (String.IsNullOrEmpty(options.IconFile)) + { + // Use the ico file that is embedded into the Ionic.Zip + // DLL itself. To do this we must unpack the icon to + // the filesystem, in order to specify it on the cmdline + // of csc.exe. This method will remove the unpacked + // file later. + System.IO.Directory.CreateDirectory(unpackedResourceDir); + ZipEntry e = zip["zippedFile.ico"]; + // Must not extract a readonly file - it will be impossible to + // delete later. + if ((e.Attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) + e.Attributes ^= FileAttributes.ReadOnly; + e.Extract(unpackedResourceDir); + nameOfIconFile = Path.Combine(unpackedResourceDir, "zippedFile.ico"); + cp.CompilerOptions += String.Format("/win32icon:\"{0}\"", nameOfIconFile); + } + else + cp.CompilerOptions += String.Format("/win32icon:\"{0}\"", options.IconFile); + + cp.OutputAssembly = stubExe; + + if (options.Flavor == SelfExtractorFlavor.WinFormsApplication) + cp.CompilerOptions += " /target:winexe"; + + if (!String.IsNullOrEmpty(options.AdditionalCompilerSwitches)) + cp.CompilerOptions += " " + options.AdditionalCompilerSwitches; + + if (String.IsNullOrEmpty(cp.CompilerOptions)) + cp.CompilerOptions = null; + + if ((settings.CopyThroughResources != null) && (settings.CopyThroughResources.Count != 0)) + { + if (!Directory.Exists(unpackedResourceDir)) System.IO.Directory.CreateDirectory(unpackedResourceDir); + foreach (string re in settings.CopyThroughResources) + { + string filename = Path.Combine(unpackedResourceDir, re); + + ExtractResourceToFile(a2, re, filename); + // add the file into the target assembly as an embedded resource + cp.EmbeddedResources.Add(filename); + } + } + + // add the Ionic.Utils.Zip DLL as an embedded resource + cp.EmbeddedResources.Add(a1.Location); + + // file header + sb.Append("// " + Path.GetFileName(sourceFile) + "\n") + .Append("// --------------------------------------------\n//\n") + .Append("// This SFX source file was generated by DotNetZip ") + .Append(ZipFile.LibraryVersion.ToString()) + .Append("\n// at ") + .Append(System.DateTime.Now.ToString("yyyy MMMM dd HH:mm:ss")) + .Append("\n//\n// --------------------------------------------\n\n\n"); + + // assembly attributes + if (!String.IsNullOrEmpty(options.Description)) + sb.Append("[assembly: System.Reflection.AssemblyTitle(\"" + + options.Description.Replace("\"", "") + + "\")]\n"); + else + sb.Append("[assembly: System.Reflection.AssemblyTitle(\"DotNetZip SFX Archive\")]\n"); + + if (!String.IsNullOrEmpty(options.ProductVersion)) + sb.Append("[assembly: System.Reflection.AssemblyInformationalVersion(\"" + + options.ProductVersion.Replace("\"", "") + + "\")]\n"); + + // workitem + string copyright = + (String.IsNullOrEmpty(options.Copyright)) + ? "Extractor: Copyright Dino Chiesa 2008-2011" + : options.Copyright.Replace("\"", ""); + + if (!String.IsNullOrEmpty(options.ProductName)) + sb.Append("[assembly: System.Reflection.AssemblyProduct(\"") + .Append(options.ProductName.Replace("\"", "")) + .Append("\")]\n"); + else + sb.Append("[assembly: System.Reflection.AssemblyProduct(\"DotNetZip\")]\n"); + + + sb.Append("[assembly: System.Reflection.AssemblyCopyright(\"" + copyright + "\")]\n") + .Append(String.Format("[assembly: System.Reflection.AssemblyVersion(\"{0}\")]\n", ZipFile.LibraryVersion.ToString())); + if (options.FileVersion != null) + sb.Append(String.Format("[assembly: System.Reflection.AssemblyFileVersion(\"{0}\")]\n", + options.FileVersion.ToString())); + + sb.Append("\n\n\n"); + + // Set the default extract location if it is available + string extractLoc = options.DefaultExtractDirectory; + if (extractLoc != null) + { + // remove double-quotes and replace slash with double-slash. + // This, because the value is going to be embedded into a + // cs file as a quoted string, and it needs to be escaped. + extractLoc = extractLoc.Replace("\"", "").Replace("\\", "\\\\"); + } + + string postExCmdLine = options.PostExtractCommandLine; + if (postExCmdLine != null) + { + postExCmdLine = postExCmdLine.Replace("\\", "\\\\"); + postExCmdLine = postExCmdLine.Replace("\"", "\\\""); + } + + + foreach (string rc in settings.ResourcesToCompile) + { + using (Stream s = zip[rc].OpenReader()) + { + if (s == null) + throw new ZipException(String.Format("missing resource '{0}'", rc)); + using (StreamReader sr = new StreamReader(s)) + { + while (sr.Peek() >= 0) + { + string line = sr.ReadLine(); + if (extractLoc != null) + line = line.Replace("@@EXTRACTLOCATION", extractLoc); + + line = line.Replace("@@REMOVE_AFTER_EXECUTE", options.RemoveUnpackedFilesAfterExecute.ToString()); + line = line.Replace("@@QUIET", options.Quiet.ToString()); + if (!String.IsNullOrEmpty(options.SfxExeWindowTitle)) + + line = line.Replace("@@SFX_EXE_WINDOW_TITLE", options.SfxExeWindowTitle); + + line = line.Replace("@@EXTRACT_EXISTING_FILE", ((int)options.ExtractExistingFile).ToString()); + + if (postExCmdLine != null) + line = line.Replace("@@POST_UNPACK_CMD_LINE", postExCmdLine); + + sb.Append(line).Append("\n"); + } + } + sb.Append("\n\n"); + } + } + } + + string LiteralSource = sb.ToString(); + +#if DEBUGSFX + // for debugging only + string sourceModule = GenerateTempPathname(tmpDir, "cs"); + using (StreamWriter sw = File.CreateText(sourceModule)) + { + sw.Write(LiteralSource); + } + Console.WriteLine("source: {0}", sourceModule); +#endif + + var cr = csharp.CompileAssemblyFromSource(cp, LiteralSource); + + + if (cr == null) + throw new SfxGenerationException("Cannot compile the extraction logic!"); + + if (Verbose) + foreach (string output in cr.Output) + StatusMessageTextWriter.WriteLine(output); + + if (cr.Errors.Count != 0) + { + using (TextWriter tw = new StreamWriter(sourceFile)) + { + // first, the source we compiled + tw.Write(LiteralSource); + + // now, append the compile errors + tw.Write("\n\n\n// ------------------------------------------------------------------\n"); + tw.Write("// Errors during compilation: \n//\n"); + string p = Path.GetFileName(sourceFile); + + foreach (System.CodeDom.Compiler.CompilerError error in cr.Errors) + { + tw.Write(String.Format("// {0}({1},{2}): {3} {4}: {5}\n//\n", + p, // 0 + error.Line, // 1 + error.Column, // 2 + error.IsWarning ? "Warning" : "error", // 3 + error.ErrorNumber, // 4 + error.ErrorText)); // 5 + } + } + throw new SfxGenerationException(String.Format("Errors compiling the extraction logic! {0}", sourceFile)); + } + + OnSaveEvent(ZipProgressEventType.Saving_AfterCompileSelfExtractor); + + // Now, copy the resulting EXE image to the _writestream. + // Because this stub exe is being saved first, the effect will be to + // concatenate the exe and the zip data together. + using (System.IO.Stream input = System.IO.File.OpenRead(stubExe)) + { + byte[] buffer = new byte[4000]; + int n = 1; + while (n != 0) + { + n = input.Read(buffer, 0, buffer.Length); + if (n != 0) + WriteStream.Write(buffer, 0, n); + } + } + } + + OnSaveEvent(ZipProgressEventType.Saving_AfterSaveTempArchive); + } + finally + { + try + { + if (Directory.Exists(unpackedResourceDir)) + { + try { Directory.Delete(unpackedResourceDir, true); } + catch (System.IO.IOException exc1) + { + StatusMessageTextWriter.WriteLine("Warning: Exception: {0}", exc1); + } + } + if (File.Exists(stubExe)) + { + try { File.Delete(stubExe); } + catch (System.IO.IOException exc1) + { + StatusMessageTextWriter.WriteLine("Warning: Exception: {0}", exc1); + } + } + } + catch (System.IO.IOException) { } + } + + return; + + } + + + + internal static string GenerateTempPathname(string dir, string extension) + { + string candidate = null; + String AppName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; + do + { + // workitem 13475 + string uuid = System.Guid.NewGuid().ToString(); + + string Name = String.Format("{0}-{1}-{2}.{3}", + AppName, System.DateTime.Now.ToString("yyyyMMMdd-HHmmss"), + uuid, extension); + candidate = System.IO.Path.Combine(dir, Name); + } while (System.IO.File.Exists(candidate) || System.IO.Directory.Exists(candidate)); + + // The candidate path does not exist as a file or directory. + // It can now be created, as a file or directory. + return candidate; + } + + } +#endif +} diff --git a/dotNetZip/Zip/ZipFile.Selector.cs b/dotNetZip/Zip/ZipFile.Selector.cs new file mode 100644 index 0000000..31c3fd8 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.Selector.cs @@ -0,0 +1,1464 @@ +// ZipFile.Selector.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2010 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 09:35:58> +// +// ------------------------------------------------------------------ +// +// This module defines methods in the ZipFile class associated to the FileFilter +// capability - selecting files to add into the archive, or selecting entries to +// retrieve from the archive based on criteria including the filename, size, date, or +// attributes. It is something like a "poor man's LINQ". I included it into DotNetZip +// because not everyone has .NET 3.5 yet. When using DotNetZip on .NET 3.5, the LINQ +// query/selection will be superior. +// +// These methods are segregated into a different module to facilitate easy exclusion for +// those people who wish to have a smaller library without this function. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Ionic.Zip +{ + + partial class ZipFile + { + /// + /// Adds to the ZipFile a set of files from the current working directory on + /// disk, that conform to the specified criteria. + /// + /// + /// + /// + /// This method selects files from the the current working directory matching + /// the specified criteria, and adds them to the ZipFile. + /// + /// + /// + /// Specify the criteria in statements of 3 elements: a noun, an operator, and + /// a value. Consider the string "name != *.doc" . The noun is "name". The + /// operator is "!=", implying "Not Equal". The value is "*.doc". That + /// criterion, in English, says "all files with a name that does not end in + /// the .doc extension." + /// + /// + /// + /// Supported nouns include "name" (or "filename") for the filename; "atime", + /// "mtime", and "ctime" for last access time, last modfied time, and created + /// time of the file, respectively; "attributes" (or "attrs") for the file + /// attributes; "size" (or "length") for the file length (uncompressed), and + /// "type" for the type of object, either a file or a directory. The + /// "attributes", "name" and "type" nouns both support = and != as operators. + /// The "size", "atime", "mtime", and "ctime" nouns support = and !=, and + /// >, >=, <, <= as well. The times are taken to be expressed in + /// local time. + /// + /// + /// + /// Specify values for the file attributes as a string with one or more of the + /// characters H,R,S,A,I,L in any order, implying file attributes of Hidden, + /// ReadOnly, System, Archive, NotContextIndexed, and ReparsePoint (symbolic + /// link) respectively. + /// + /// + /// + /// To specify a time, use YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as the + /// format. If you omit the HH:mm:ss portion, it is assumed to be 00:00:00 + /// (midnight). + /// + /// + /// + /// The value for a size criterion is expressed in integer quantities of bytes, + /// kilobytes (use k or kb after the number), megabytes (m or mb), or gigabytes + /// (g or gb). + /// + /// + /// + /// The value for a name is a pattern to match against the filename, potentially + /// including wildcards. The pattern follows CMD.exe glob rules: * implies one + /// or more of any character, while ? implies one character. If the name + /// pattern contains any slashes, it is matched to the entire filename, + /// including the path; otherwise, it is matched against only the filename + /// without the path. This means a pattern of "*\*.*" matches all files one + /// directory level deep, while a pattern of "*.*" matches all files in all + /// directories. + /// + /// + /// + /// To specify a name pattern that includes spaces, use single quotes around the + /// pattern. A pattern of "'* *.*'" will match all files that have spaces in + /// the filename. The full criteria string for that would be "name = '* *.*'" . + /// + /// + /// + /// The value for a type criterion is either F (implying a file) or D (implying + /// a directory). + /// + /// + /// + /// Some examples: + /// + /// + /// + /// + /// criteria + /// Files retrieved + /// + /// + /// + /// name != *.xls + /// any file with an extension that is not .xls + /// + /// + /// + /// + /// name = *.mp3 + /// any file with a .mp3 extension. + /// + /// + /// + /// + /// *.mp3 + /// (same as above) any file with a .mp3 extension. + /// + /// + /// + /// + /// attributes = A + /// all files whose attributes include the Archive bit. + /// + /// + /// + /// + /// attributes != H + /// all files whose attributes do not include the Hidden bit. + /// + /// + /// + /// + /// mtime > 2009-01-01 + /// all files with a last modified time after January 1st, 2009. + /// + /// + /// + /// + /// size > 2gb + /// all files whose uncompressed size is greater than 2gb. + /// + /// + /// + /// + /// type = D + /// all directories in the filesystem. + /// + /// + /// + /// + /// + /// You can combine criteria with the conjunctions AND or OR. Using a string + /// like "name = *.txt AND size >= 100k" for the selectionCriteria retrieves + /// entries whose names end in .txt, and whose uncompressed size is greater than + /// or equal to 100 kilobytes. + /// + /// + /// + /// For more complex combinations of criteria, you can use parenthesis to group + /// clauses in the boolean logic. Without parenthesis, the precedence of the + /// criterion atoms is determined by order of appearance. Unlike the C# + /// language, the AND conjunction does not take precendence over the logical OR. + /// This is important only in strings that contain 3 or more criterion atoms. + /// In other words, "name = *.txt and size > 1000 or attributes = H" implies + /// "((name = *.txt AND size > 1000) OR attributes = H)" while "attributes = + /// H OR name = *.txt and size > 1000" evaluates to "((attributes = H OR name + /// = *.txt) AND size > 1000)". When in doubt, use parenthesis. + /// + /// + /// + /// Using time properties requires some extra care. If you want to retrieve all + /// entries that were last updated on 2009 February 14, specify a time range + /// like so:"mtime >= 2009-02-14 AND mtime < 2009-02-15". Read this to + /// say: all files updated after 12:00am on February 14th, until 12:00am on + /// February 15th. You can use the same bracketing approach to specify any time + /// period - a year, a month, a week, and so on. + /// + /// + /// + /// The syntax allows one special case: if you provide a string with no spaces, it is + /// treated as a pattern to match for the filename. Therefore a string like "*.xls" + /// will be equivalent to specifying "name = *.xls". + /// + /// + /// + /// There is no logic in this method that insures that the file inclusion + /// criteria are internally consistent. For example, it's possible to specify + /// criteria that says the file must have a size of less than 100 bytes, as well + /// as a size that is greater than 1000 bytes. Obviously no file will ever + /// satisfy such criteria, but this method does not detect such logical + /// inconsistencies. The caller is responsible for insuring the criteria are + /// sensible. + /// + /// + /// + /// Using this method, the file selection does not recurse into + /// subdirectories, and the full path of the selected files is included in the + /// entries added into the zip archive. If you don't like these behaviors, + /// see the other overloads of this method. + /// + /// + /// + /// + /// This example zips up all *.csv files in the current working directory. + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// // To just match on filename wildcards, + /// // use the shorthand form of the selectionCriteria string. + /// zip.AddSelectedFiles("*.csv"); + /// zip.Save(PathToZipArchive); + /// } + /// + /// + /// Using zip As ZipFile = New ZipFile() + /// zip.AddSelectedFiles("*.csv") + /// zip.Save(PathToZipArchive) + /// End Using + /// + /// + /// + /// The criteria for file selection + public void AddSelectedFiles(String selectionCriteria) + { + this.AddSelectedFiles(selectionCriteria, ".", null, false); + } + + /// + /// Adds to the ZipFile a set of files from the disk that conform to the + /// specified criteria, optionally recursing into subdirectories. + /// + /// + /// + /// + /// This method selects files from the the current working directory matching + /// the specified criteria, and adds them to the ZipFile. If + /// recurseDirectories is true, files are also selected from + /// subdirectories, and the directory structure in the filesystem is + /// reproduced in the zip archive, rooted at the current working directory. + /// + /// + /// + /// Using this method, the full path of the selected files is included in the + /// entries added into the zip archive. If you don't want this behavior, use + /// one of the overloads of this method that allows the specification of a + /// directoryInArchive. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// + /// + /// + /// This example zips up all *.xml files in the current working directory, or any + /// subdirectory, that are larger than 1mb. + /// + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.xml and size > 1024kb", true); + /// zip.Save(PathToZipArchive); + /// } + /// + /// + /// Using zip As ZipFile = New ZipFile() + /// ' Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.xml and size > 1024kb", true) + /// zip.Save(PathToZipArchive) + /// End Using + /// + /// + /// + /// The criteria for file selection + /// + /// + /// If true, the file selection will recurse into subdirectories. + /// + public void AddSelectedFiles(String selectionCriteria, bool recurseDirectories) + { + this.AddSelectedFiles(selectionCriteria, ".", null, recurseDirectories); + } + + /// + /// Adds to the ZipFile a set of files from a specified directory in the + /// filesystem, that conform to the specified criteria. + /// + /// + /// + /// + /// This method selects files that conform to the specified criteria, from the + /// the specified directory on disk, and adds them to the ZipFile. The search + /// does not recurse into subdirectores. + /// + /// + /// + /// Using this method, the full filesystem path of the files on disk is + /// reproduced on the entries added to the zip file. If you don't want this + /// behavior, use one of the other overloads of this method. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// + /// + /// + /// This example zips up all *.xml files larger than 1mb in the directory + /// given by "d:\rawdata". + /// + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\\rawdata"); + /// zip.Save(PathToZipArchive); + /// } + /// + /// + /// + /// Using zip As ZipFile = New ZipFile() + /// ' Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\rawdata) + /// zip.Save(PathToZipArchive) + /// End Using + /// + /// + /// + /// The criteria for file selection + /// + /// + /// The name of the directory on the disk from which to select files. + /// + public void AddSelectedFiles(String selectionCriteria, String directoryOnDisk) + { + this.AddSelectedFiles(selectionCriteria, directoryOnDisk, null, false); + } + + + /// + /// Adds to the ZipFile a set of files from the specified directory on disk, + /// that conform to the specified criteria. + /// + /// + /// + /// + /// + /// This method selects files from the the specified disk directory matching + /// the specified selection criteria, and adds them to the ZipFile. If + /// recurseDirectories is true, files are also selected from + /// subdirectories. + /// + /// + /// + /// The full directory structure in the filesystem is reproduced on the + /// entries added to the zip archive. If you don't want this behavior, use + /// one of the overloads of this method that allows the specification of a + /// directoryInArchive. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// + /// + /// This example zips up all *.csv files in the "files" directory, or any + /// subdirectory, that have been saved since 2009 February 14th. + /// + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.csv and mtime > 2009-02-14", "files", true); + /// zip.Save(PathToZipArchive); + /// } + /// + /// + /// Using zip As ZipFile = New ZipFile() + /// ' Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.csv and mtime > 2009-02-14", "files", true) + /// zip.Save(PathToZipArchive) + /// End Using + /// + /// + /// + /// + /// This example zips up all files in the current working + /// directory, and all its child directories, except those in + /// the excludethis subdirectory. + /// + /// Using Zip As ZipFile = New ZipFile(zipfile) + /// Zip.AddSelectedFfiles("name != 'excludethis\*.*'", datapath, True) + /// Zip.Save() + /// End Using + /// + /// + /// + /// The criteria for file selection + /// + /// + /// The filesystem path from which to select files. + /// + /// + /// + /// If true, the file selection will recurse into subdirectories. + /// + public void AddSelectedFiles(String selectionCriteria, String directoryOnDisk, bool recurseDirectories) + { + this.AddSelectedFiles(selectionCriteria, directoryOnDisk, null, recurseDirectories); + } + + + /// + /// Adds to the ZipFile a selection of files from the specified directory on + /// disk, that conform to the specified criteria, and using a specified root + /// path for entries added to the zip archive. + /// + /// + /// + /// + /// This method selects files from the specified disk directory matching the + /// specified selection criteria, and adds those files to the ZipFile, using + /// the specified directory path in the archive. The search does not recurse + /// into subdirectories. For details on the syntax for the selectionCriteria + /// parameter, see . + /// + /// + /// + /// + /// + /// + /// This example zips up all *.psd files in the "photos" directory that have + /// been saved since 2009 February 14th, and puts them all in a zip file, + /// using the directory name of "content" in the zip archive itself. When the + /// zip archive is unzipped, the folder containing the .psd files will be + /// named "content". + /// + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Use a compound expression in the selectionCriteria string. + /// zip.AddSelectedFiles("name = *.psd and mtime > 2009-02-14", "photos", "content"); + /// zip.Save(PathToZipArchive); + /// } + /// + /// + /// Using zip As ZipFile = New ZipFile + /// zip.AddSelectedFiles("name = *.psd and mtime > 2009-02-14", "photos", "content") + /// zip.Save(PathToZipArchive) + /// End Using + /// + /// + /// + /// + /// The criteria for selection of files to add to the ZipFile. + /// + /// + /// + /// The path to the directory in the filesystem from which to select files. + /// + /// + /// + /// Specifies a directory path to use to in place of the + /// directoryOnDisk. This path may, or may not, correspond to a real + /// directory in the current filesystem. If the files within the zip are + /// later extracted, this is the path used for the extracted file. Passing + /// null (nothing in VB) will use the path on the file name, if any; in other + /// words it would use directoryOnDisk, plus any subdirectory. Passing + /// the empty string ("") will insert the item at the root path within the + /// archive. + /// + public void AddSelectedFiles(String selectionCriteria, + String directoryOnDisk, + String directoryPathInArchive) + { + this.AddSelectedFiles(selectionCriteria, directoryOnDisk, directoryPathInArchive, false); + } + + /// + /// Adds to the ZipFile a selection of files from the specified directory on + /// disk, that conform to the specified criteria, optionally recursing through + /// subdirectories, and using a specified root path for entries added to the + /// zip archive. + /// + /// + /// + /// This method selects files from the specified disk directory that match the + /// specified selection criteria, and adds those files to the ZipFile, using + /// the specified directory path in the archive. If recurseDirectories + /// is true, files are also selected from subdirectories, and the directory + /// structure in the filesystem is reproduced in the zip archive, rooted at + /// the directory specified by directoryOnDisk. For details on the + /// syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// + /// This example zips up all files that are NOT *.pst files, in the current + /// working directory and any subdirectories. + /// + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddSelectedFiles("name != *.pst", SourceDirectory, "backup", true); + /// zip.Save(PathToZipArchive); + /// } + /// + /// + /// Using zip As ZipFile = New ZipFile + /// zip.AddSelectedFiles("name != *.pst", SourceDirectory, "backup", true) + /// zip.Save(PathToZipArchive) + /// End Using + /// + /// + /// + /// + /// The criteria for selection of files to add to the ZipFile. + /// + /// + /// + /// The path to the directory in the filesystem from which to select files. + /// + /// + /// + /// Specifies a directory path to use to in place of the + /// directoryOnDisk. This path may, or may not, correspond to a real + /// directory in the current filesystem. If the files within the zip are + /// later extracted, this is the path used for the extracted file. Passing + /// null (nothing in VB) will use the path on the file name, if any; in other + /// words it would use directoryOnDisk, plus any subdirectory. Passing + /// the empty string ("") will insert the item at the root path within the + /// archive. + /// + /// + /// + /// If true, the method also scans subdirectories for files matching the + /// criteria. + /// + public void AddSelectedFiles(String selectionCriteria, + String directoryOnDisk, + String directoryPathInArchive, + bool recurseDirectories) + { + _AddOrUpdateSelectedFiles(selectionCriteria, + directoryOnDisk, + directoryPathInArchive, + recurseDirectories, + false); + } + + /// + /// Updates the ZipFile with a selection of files from the disk that conform + /// to the specified criteria. + /// + /// + /// + /// This method selects files from the specified disk directory that match the + /// specified selection criteria, and Updates the ZipFile with those + /// files, using the specified directory path in the archive. If + /// recurseDirectories is true, files are also selected from + /// subdirectories, and the directory structure in the filesystem is + /// reproduced in the zip archive, rooted at the directory specified by + /// directoryOnDisk. For details on the syntax for the + /// selectionCriteria parameter, see . + /// + /// + /// + /// The criteria for selection of files to add to the ZipFile. + /// + /// + /// + /// The path to the directory in the filesystem from which to select files. + /// + /// + /// + /// Specifies a directory path to use to in place of the + /// directoryOnDisk. This path may, or may not, correspond to a + /// real directory in the current filesystem. If the files within the zip + /// are later extracted, this is the path used for the extracted file. + /// Passing null (nothing in VB) will use the path on the file name, if + /// any; in other words it would use directoryOnDisk, plus any + /// subdirectory. Passing the empty string ("") will insert the item at + /// the root path within the archive. + /// + /// + /// + /// If true, the method also scans subdirectories for files matching the criteria. + /// + /// + /// + public void UpdateSelectedFiles(String selectionCriteria, + String directoryOnDisk, + String directoryPathInArchive, + bool recurseDirectories) + { + _AddOrUpdateSelectedFiles(selectionCriteria, + directoryOnDisk, + directoryPathInArchive, + recurseDirectories, + true); + } + + + private string EnsureendInSlash(string s) + { + if (s.EndsWith("\\")) return s; + return s + "\\"; + } + + private void _AddOrUpdateSelectedFiles(String selectionCriteria, + String directoryOnDisk, + String directoryPathInArchive, + bool recurseDirectories, + bool wantUpdate) + { + if (directoryOnDisk == null && (Directory.Exists(selectionCriteria))) + { + directoryOnDisk = selectionCriteria; + selectionCriteria = "*.*"; + } + else if (String.IsNullOrEmpty(directoryOnDisk)) + { + directoryOnDisk = "."; + } + + // workitem 9176 + while (directoryOnDisk.EndsWith("\\")) directoryOnDisk = directoryOnDisk.Substring(0, directoryOnDisk.Length - 1); + if (Verbose) StatusMessageTextWriter.WriteLine("adding selection '{0}' from dir '{1}'...", + selectionCriteria, directoryOnDisk); + Ionic.FileSelector ff = new Ionic.FileSelector(selectionCriteria, + AddDirectoryWillTraverseReparsePoints); + var itemsToAdd = ff.SelectFiles(directoryOnDisk, recurseDirectories); + + if (Verbose) StatusMessageTextWriter.WriteLine("found {0} files...", itemsToAdd.Count); + + OnAddStarted(); + + AddOrUpdateAction action = (wantUpdate) ? AddOrUpdateAction.AddOrUpdate : AddOrUpdateAction.AddOnly; + foreach (var item in itemsToAdd) + { + // workitem 10153 + string dirInArchive = (directoryPathInArchive == null) + ? null + // workitem 12260 + : ReplaceLeadingDirectory(Path.GetDirectoryName(item), + directoryOnDisk, + directoryPathInArchive); + + if (File.Exists(item)) + { + if (wantUpdate) + this.UpdateFile(item, dirInArchive); + else + this.AddFile(item, dirInArchive); + } + else + { + // this adds "just" the directory, without recursing to the contained files + AddOrUpdateDirectoryImpl(item, dirInArchive, action, false, 0); + } + } + + OnAddCompleted(); + } + + + // workitem 12260 + private static string ReplaceLeadingDirectory(string original, + string pattern, + string replacement) + { + string upperString = original.ToUpper(); + string upperPattern = pattern.ToUpper(); + int p1 = upperString.IndexOf(upperPattern); + if (p1 != 0) return original; + return replacement + original.Substring(upperPattern.Length); + } + +#if NOT + private static string ReplaceEx(string original, + string pattern, + string replacement) + { + int count, position0, position1; + count = position0 = position1 = 0; + string upperString = original.ToUpper(); + string upperPattern = pattern.ToUpper(); + int inc = (original.Length/pattern.Length) * + (replacement.Length-pattern.Length); + char [] chars = new char[original.Length + Math.Max(0, inc)]; + while( (position1 = upperString.IndexOf(upperPattern, + position0)) != -1 ) + { + for ( int i=position0 ; i < position1 ; ++i ) + chars[count++] = original[i]; + for ( int i=0 ; i < replacement.Length ; ++i ) + chars[count++] = replacement[i]; + position0 = position1+pattern.Length; + } + if ( position0 == 0 ) return original; + for ( int i=position0 ; i < original.Length ; ++i ) + chars[count++] = original[i]; + return new string(chars, 0, count); + } +#endif + + /// + /// Retrieve entries from the zipfile by specified criteria. + /// + /// + /// + /// + /// This method allows callers to retrieve the collection of entries from the zipfile + /// that fit the specified criteria. The criteria are described in a string format, and + /// can include patterns for the filename; constraints on the size of the entry; + /// constraints on the last modified, created, or last accessed time for the file + /// described by the entry; or the attributes of the entry. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// This method is intended for use with a ZipFile that has been read from storage. + /// When creating a new ZipFile, this method will work only after the ZipArchive has + /// been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + /// archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + /// saved will deliver undefined results. + /// + /// + /// + /// + /// Thrown if selectionCriteria has an invalid syntax. + /// + /// + /// + /// This example selects all the PhotoShop files from within an archive, and extracts them + /// to the current working directory. + /// + /// using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + /// { + /// var PhotoShopFiles = zip1.SelectEntries("*.psd"); + /// foreach (ZipEntry psd in PhotoShopFiles) + /// { + /// psd.Extract(); + /// } + /// } + /// + /// + /// Using zip1 As ZipFile = ZipFile.Read(ZipFileName) + /// Dim PhotoShopFiles as ICollection(Of ZipEntry) + /// PhotoShopFiles = zip1.SelectEntries("*.psd") + /// Dim psd As ZipEntry + /// For Each psd In PhotoShopFiles + /// psd.Extract + /// Next + /// End Using + /// + /// + /// the string that specifies which entries to select + /// a collection of ZipEntry objects that conform to the inclusion spec + public ICollection SelectEntries(String selectionCriteria) + { + Ionic.FileSelector ff = new Ionic.FileSelector(selectionCriteria, + AddDirectoryWillTraverseReparsePoints); + return ff.SelectEntries(this); + } + + + /// + /// Retrieve entries from the zipfile by specified criteria. + /// + /// + /// + /// + /// This method allows callers to retrieve the collection of entries from the zipfile + /// that fit the specified criteria. The criteria are described in a string format, and + /// can include patterns for the filename; constraints on the size of the entry; + /// constraints on the last modified, created, or last accessed time for the file + /// described by the entry; or the attributes of the entry. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// This method is intended for use with a ZipFile that has been read from storage. + /// When creating a new ZipFile, this method will work only after the ZipArchive has + /// been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + /// archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + /// saved will deliver undefined results. + /// + /// + /// + /// + /// Thrown if selectionCriteria has an invalid syntax. + /// + /// + /// + /// + /// using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + /// { + /// var UpdatedPhotoShopFiles = zip1.SelectEntries("*.psd", "UpdatedFiles"); + /// foreach (ZipEntry e in UpdatedPhotoShopFiles) + /// { + /// // prompt for extract here + /// if (WantExtract(e.FileName)) + /// e.Extract(); + /// } + /// } + /// + /// + /// Using zip1 As ZipFile = ZipFile.Read(ZipFileName) + /// Dim UpdatedPhotoShopFiles As ICollection(Of ZipEntry) = zip1.SelectEntries("*.psd", "UpdatedFiles") + /// Dim e As ZipEntry + /// For Each e In UpdatedPhotoShopFiles + /// ' prompt for extract here + /// If Me.WantExtract(e.FileName) Then + /// e.Extract + /// End If + /// Next + /// End Using + /// + /// + /// the string that specifies which entries to select + /// + /// + /// the directory in the archive from which to select entries. If null, then + /// all directories in the archive are used. + /// + /// + /// a collection of ZipEntry objects that conform to the inclusion spec + public ICollection SelectEntries(String selectionCriteria, string directoryPathInArchive) + { + Ionic.FileSelector ff = new Ionic.FileSelector(selectionCriteria, + AddDirectoryWillTraverseReparsePoints); + return ff.SelectEntries(this, directoryPathInArchive); + } + + + + /// + /// Remove entries from the zipfile by specified criteria. + /// + /// + /// + /// + /// This method allows callers to remove the collection of entries from the zipfile + /// that fit the specified criteria. The criteria are described in a string format, and + /// can include patterns for the filename; constraints on the size of the entry; + /// constraints on the last modified, created, or last accessed time for the file + /// described by the entry; or the attributes of the entry. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// This method is intended for use with a ZipFile that has been read from storage. + /// When creating a new ZipFile, this method will work only after the ZipArchive has + /// been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + /// archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + /// saved will deliver undefined results. + /// + /// + /// + /// + /// Thrown if selectionCriteria has an invalid syntax. + /// + /// + /// + /// This example removes all entries in a zip file that were modified prior to January 1st, 2008. + /// + /// using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + /// { + /// // remove all entries from prior to Jan 1, 2008 + /// zip1.RemoveEntries("mtime < 2008-01-01"); + /// // don't forget to save the archive! + /// zip1.Save(); + /// } + /// + /// + /// Using zip As ZipFile = ZipFile.Read(ZipFileName) + /// ' remove all entries from prior to Jan 1, 2008 + /// zip1.RemoveEntries("mtime < 2008-01-01") + /// ' do not forget to save the archive! + /// zip1.Save + /// End Using + /// + /// + /// the string that specifies which entries to select + /// the number of entries removed + public int RemoveSelectedEntries(String selectionCriteria) + { + var selection = this.SelectEntries(selectionCriteria); + this.RemoveEntries(selection); + return selection.Count; + } + + + /// + /// Remove entries from the zipfile by specified criteria, and within the specified + /// path in the archive. + /// + /// + /// + /// + /// This method allows callers to remove the collection of entries from the zipfile + /// that fit the specified criteria. The criteria are described in a string format, and + /// can include patterns for the filename; constraints on the size of the entry; + /// constraints on the last modified, created, or last accessed time for the file + /// described by the entry; or the attributes of the entry. + /// + /// + /// + /// For details on the syntax for the selectionCriteria parameter, see . + /// + /// + /// + /// This method is intended for use with a ZipFile that has been read from storage. + /// When creating a new ZipFile, this method will work only after the ZipArchive has + /// been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + /// archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + /// saved will deliver undefined results. + /// + /// + /// + /// + /// Thrown if selectionCriteria has an invalid syntax. + /// + /// + /// + /// + /// using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + /// { + /// // remove all entries from prior to Jan 1, 2008 + /// zip1.RemoveEntries("mtime < 2008-01-01", "documents"); + /// // a call to ZipFile.Save will make the modifications permanent + /// zip1.Save(); + /// } + /// + /// + /// Using zip As ZipFile = ZipFile.Read(ZipFileName) + /// ' remove all entries from prior to Jan 1, 2008 + /// zip1.RemoveEntries("mtime < 2008-01-01", "documents") + /// ' a call to ZipFile.Save will make the modifications permanent + /// zip1.Save + /// End Using + /// + /// + /// + /// the string that specifies which entries to select + /// + /// the directory in the archive from which to select entries. If null, then + /// all directories in the archive are used. + /// + /// the number of entries removed + public int RemoveSelectedEntries(String selectionCriteria, string directoryPathInArchive) + { + var selection = this.SelectEntries(selectionCriteria, directoryPathInArchive); + this.RemoveEntries(selection); + return selection.Count; + } + + + /// + /// Selects and Extracts a set of Entries from the ZipFile. + /// + /// + /// + /// + /// The entries are extracted into the current working directory. + /// + /// + /// + /// If any of the files to be extracted already exist, then the action taken is as + /// specified in the property on the + /// corresponding ZipEntry instance. By default, the action taken in this case is to + /// throw an exception. + /// + /// + /// + /// For information on the syntax of the selectionCriteria string, + /// see . + /// + /// + /// + /// + /// This example shows how extract all XML files modified after 15 January 2009. + /// + /// using (ZipFile zip = ZipFile.Read(zipArchiveName)) + /// { + /// zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15"); + /// } + /// + /// + /// the selection criteria for entries to extract. + /// + /// + public void ExtractSelectedEntries(String selectionCriteria) + { + foreach (ZipEntry e in SelectEntries(selectionCriteria)) + { + e.Password = _Password; // possibly null + e.Extract(); + } + } + + + /// + /// Selects and Extracts a set of Entries from the ZipFile. + /// + /// + /// + /// + /// The entries are extracted into the current working directory. When extraction would would + /// overwrite an existing filesystem file, the action taken is as specified in the + /// parameter. + /// + /// + /// + /// For information on the syntax of the string describing the entry selection criteria, + /// see . + /// + /// + /// + /// + /// This example shows how extract all XML files modified after 15 January 2009, + /// overwriting any existing files. + /// + /// using (ZipFile zip = ZipFile.Read(zipArchiveName)) + /// { + /// zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15", + /// ExtractExistingFileAction.OverwriteSilently); + /// } + /// + /// + /// + /// the selection criteria for entries to extract. + /// + /// + /// The action to take if extraction would overwrite an existing file. + /// + public void ExtractSelectedEntries(String selectionCriteria, ExtractExistingFileAction extractExistingFile) + { + foreach (ZipEntry e in SelectEntries(selectionCriteria)) + { + e.Password = _Password; // possibly null + e.Extract(extractExistingFile); + } + } + + + /// + /// Selects and Extracts a set of Entries from the ZipFile. + /// + /// + /// + /// + /// The entries are selected from the specified directory within the archive, and then + /// extracted into the current working directory. + /// + /// + /// + /// If any of the files to be extracted already exist, then the action taken is as + /// specified in the property on the + /// corresponding ZipEntry instance. By default, the action taken in this case is to + /// throw an exception. + /// + /// + /// + /// For information on the syntax of the string describing the entry selection criteria, + /// see . + /// + /// + /// + /// + /// This example shows how extract all XML files modified after 15 January 2009, + /// and writes them to the "unpack" directory. + /// + /// using (ZipFile zip = ZipFile.Read(zipArchiveName)) + /// { + /// zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15","unpack"); + /// } + /// + /// + /// + /// the selection criteria for entries to extract. + /// + /// + /// the directory in the archive from which to select entries. If null, then + /// all directories in the archive are used. + /// + /// + /// + public void ExtractSelectedEntries(String selectionCriteria, String directoryPathInArchive) + { + foreach (ZipEntry e in SelectEntries(selectionCriteria, directoryPathInArchive)) + { + e.Password = _Password; // possibly null + e.Extract(); + } + } + + + /// + /// Selects and Extracts a set of Entries from the ZipFile. + /// + /// + /// + /// + /// The entries are extracted into the specified directory. If any of the files to be + /// extracted already exist, an exception will be thrown. + /// + /// + /// For information on the syntax of the string describing the entry selection criteria, + /// see . + /// + /// + /// + /// the selection criteria for entries to extract. + /// + /// + /// the directory in the archive from which to select entries. If null, then + /// all directories in the archive are used. + /// + /// + /// + /// the directory on the disk into which to extract. It will be created + /// if it does not exist. + /// + public void ExtractSelectedEntries(String selectionCriteria, string directoryInArchive, string extractDirectory) + { + foreach (ZipEntry e in SelectEntries(selectionCriteria, directoryInArchive)) + { + e.Password = _Password; // possibly null + e.Extract(extractDirectory); + } + } + + + /// + /// Selects and Extracts a set of Entries from the ZipFile. + /// + /// + /// + /// + /// The entries are extracted into the specified directory. When extraction would would + /// overwrite an existing filesystem file, the action taken is as specified in the + /// parameter. + /// + /// + /// + /// For information on the syntax of the string describing the entry selection criteria, + /// see . + /// + /// + /// + /// + /// This example shows how extract all files with an XML extension or with a size larger than 100,000 bytes, + /// and puts them in the unpack directory. For any files that already exist in + /// that destination directory, they will not be overwritten. + /// + /// using (ZipFile zip = ZipFile.Read(zipArchiveName)) + /// { + /// zip.ExtractSelectedEntries("name = *.xml or size > 100000", + /// null, + /// "unpack", + /// ExtractExistingFileAction.DontOverwrite); + /// } + /// + /// + /// + /// the selection criteria for entries to extract. + /// + /// + /// The directory on the disk into which to extract. It will be created if it does not exist. + /// + /// + /// + /// The directory in the archive from which to select entries. If null, then + /// all directories in the archive are used. + /// + /// + /// + /// The action to take if extraction would overwrite an existing file. + /// + /// + public void ExtractSelectedEntries(String selectionCriteria, string directoryPathInArchive, string extractDirectory, ExtractExistingFileAction extractExistingFile) + { + foreach (ZipEntry e in SelectEntries(selectionCriteria, directoryPathInArchive)) + { + e.Password = _Password; // possibly null + e.Extract(extractDirectory, extractExistingFile); + } + } + + } + +} + + + +namespace Ionic +{ + internal abstract partial class SelectionCriterion + { + internal abstract bool Evaluate(Ionic.Zip.ZipEntry entry); + } + + + internal partial class NameCriterion : SelectionCriterion + { + internal override bool Evaluate(Ionic.Zip.ZipEntry entry) + { + // swap forward slashes in the entry.FileName for backslashes + string transformedFileName = entry.FileName.Replace("/", "\\"); + + return _Evaluate(transformedFileName); + } + } + + + internal partial class SizeCriterion : SelectionCriterion + { + internal override bool Evaluate(Ionic.Zip.ZipEntry entry) + { + return _Evaluate(entry.UncompressedSize); + } + } + + internal partial class TimeCriterion : SelectionCriterion + { + internal override bool Evaluate(Ionic.Zip.ZipEntry entry) + { + DateTime x; + switch (Which) + { + case WhichTime.atime: + x = entry.AccessedTime; + break; + case WhichTime.mtime: + x = entry.ModifiedTime; + break; + case WhichTime.ctime: + x = entry.CreationTime; + break; + default: throw new ArgumentException("??time"); + } + return _Evaluate(x); + } + } + + + internal partial class TypeCriterion : SelectionCriterion + { + internal override bool Evaluate(Ionic.Zip.ZipEntry entry) + { + bool result = (ObjectType == 'D') + ? entry.IsDirectory + : !entry.IsDirectory; + + if (Operator != ComparisonOperator.EqualTo) + result = !result; + return result; + } + } + +#if !SILVERLIGHT + internal partial class AttributesCriterion : SelectionCriterion + { + internal override bool Evaluate(Ionic.Zip.ZipEntry entry) + { + FileAttributes fileAttrs = entry.Attributes; + return _Evaluate(fileAttrs); + } + } +#endif + + internal partial class CompoundCriterion : SelectionCriterion + { + internal override bool Evaluate(Ionic.Zip.ZipEntry entry) + { + bool result = Left.Evaluate(entry); + switch (Conjunction) + { + case LogicalConjunction.AND: + if (result) + result = Right.Evaluate(entry); + break; + case LogicalConjunction.OR: + if (!result) + result = Right.Evaluate(entry); + break; + case LogicalConjunction.XOR: + result ^= Right.Evaluate(entry); + break; + } + return result; + } + } + + + + public partial class FileSelector + { + private bool Evaluate(Ionic.Zip.ZipEntry entry) + { + bool result = _Criterion.Evaluate(entry); + return result; + } + + /// + /// Retrieve the ZipEntry items in the ZipFile that conform to the specified criteria. + /// + /// + /// + /// + /// This method applies the criteria set in the FileSelector instance (as described in + /// the ) to the specified ZipFile. Using this + /// method, for example, you can retrieve all entries from the given ZipFile that + /// have filenames ending in .txt. + /// + /// + /// + /// Normally, applications would not call this method directly. This method is used + /// by the ZipFile class. + /// + /// + /// + /// Using the appropriate SelectionCriteria, you can retrieve entries based on size, + /// time, and attributes. See for a + /// description of the syntax of the SelectionCriteria string. + /// + /// + /// + /// + /// The ZipFile from which to retrieve entries. + /// + /// a collection of ZipEntry objects that conform to the criteria. + public ICollection SelectEntries(Ionic.Zip.ZipFile zip) + { + if (zip == null) + throw new ArgumentNullException("zip"); + + var list = new List(); + + foreach (Ionic.Zip.ZipEntry e in zip) + { + if (this.Evaluate(e)) + list.Add(e); + } + + return list; + } + + + /// + /// Retrieve the ZipEntry items in the ZipFile that conform to the specified criteria. + /// + /// + /// + /// + /// This method applies the criteria set in the FileSelector instance (as described in + /// the ) to the specified ZipFile. Using this + /// method, for example, you can retrieve all entries from the given ZipFile that + /// have filenames ending in .txt. + /// + /// + /// + /// Normally, applications would not call this method directly. This method is used + /// by the ZipFile class. + /// + /// + /// + /// This overload allows the selection of ZipEntry instances from the ZipFile to be restricted + /// to entries contained within a particular directory in the ZipFile. + /// + /// + /// + /// Using the appropriate SelectionCriteria, you can retrieve entries based on size, + /// time, and attributes. See for a + /// description of the syntax of the SelectionCriteria string. + /// + /// + /// + /// + /// The ZipFile from which to retrieve entries. + /// + /// + /// the directory in the archive from which to select entries. If null, then + /// all directories in the archive are used. + /// + /// + /// a collection of ZipEntry objects that conform to the criteria. + public ICollection SelectEntries(Ionic.Zip.ZipFile zip, string directoryPathInArchive) + { + if (zip == null) + throw new ArgumentNullException("zip"); + + var list = new List(); + // workitem 8559 + string slashSwapped = (directoryPathInArchive == null) ? null : directoryPathInArchive.Replace("/", "\\"); + // workitem 9174 + if (slashSwapped != null) + { + while (slashSwapped.EndsWith("\\")) + slashSwapped = slashSwapped.Substring(0, slashSwapped.Length - 1); + } + foreach (Ionic.Zip.ZipEntry e in zip) + { + if (directoryPathInArchive == null || (Path.GetDirectoryName(e.FileName) == directoryPathInArchive) + || (Path.GetDirectoryName(e.FileName) == slashSwapped)) // workitem 8559 + if (this.Evaluate(e)) + list.Add(e); + } + + return list; + } + + } +} diff --git a/dotNetZip/Zip/ZipFile.cs b/dotNetZip/Zip/ZipFile.cs new file mode 100644 index 0000000..cd49a88 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.cs @@ -0,0 +1,3910 @@ +// ZipFile.cs +// +// Copyright (c) 2006-2010 Dino Chiesa +// All rights reserved. +// +// This module is part of DotNetZip, a zipfile class library. +// The class library reads and writes zip files, according to the format +// described by PKware, at: +// http://www.pkware.com/business_and_developers/developer/popups/appnote.txt +// +// +// There are other Zip class libraries available. +// +// - it is possible to read and write zip files within .NET via the J# runtime. +// But some people don't like to install the extra DLL, which is no longer +// supported by MS. And also, the J# libraries don't support advanced zip +// features, like ZIP64, spanned archives, or AES encryption. +// +// - There are third-party GPL and LGPL libraries available. Some people don't +// like the license, and some of them don't support all the ZIP features, like AES. +// +// - Finally, there are commercial tools (From ComponentOne, XCeed, etc). But +// some people don't want to incur the cost. +// +// This alternative implementation is **not** GPL licensed. It is free of cost, and +// does not require J#. It does require .NET 2.0. It balances a good set of +// features, with ease of use and speed of performance. +// +// This code is released under the Microsoft Public License . +// See the License.txt for details. +// +// +// NB: This implementation originally relied on the +// System.IO.Compression.DeflateStream base class in the .NET Framework +// v2.0 base class library, but now includes a managed-code port of Zlib. +// +// Thu, 08 Oct 2009 17:04 +// + + +using System; +using System.IO; +using System.Collections.Generic; +using Interop = System.Runtime.InteropServices; + + +namespace Ionic.Zip +{ + /// + /// The ZipFile type represents a zip archive file. + /// + /// + /// + /// + /// This is the main type in the DotNetZip class library. This class reads and + /// writes zip files, as defined in the specification + /// for zip files described by PKWare. The compression for this + /// implementation is provided by a managed-code version of Zlib, included with + /// DotNetZip in the classes in the Ionic.Zlib namespace. + /// + /// + /// + /// This class provides a general purpose zip file capability. Use it to read, + /// create, or update zip files. When you want to create zip files using a + /// Stream type to write the zip file, you may want to consider the class. + /// + /// + /// + /// Both the ZipOutputStream class and the ZipFile class can + /// be used to create zip files. Both of them support many of the common zip + /// features, including Unicode, different compression methods and levels, + /// and ZIP64. They provide very similar performance when creating zip + /// files. + /// + /// + /// + /// The ZipFile class is generally easier to use than + /// ZipOutputStream and should be considered a higher-level interface. For + /// example, when creating a zip file via calls to the PutNextEntry() and + /// Write() methods on the ZipOutputStream class, the caller is + /// responsible for opening the file, reading the bytes from the file, writing + /// those bytes into the ZipOutputStream, setting the attributes on the + /// ZipEntry, and setting the created, last modified, and last accessed + /// timestamps on the zip entry. All of these things are done automatically by a + /// call to ZipFile.AddFile(). + /// For this reason, the ZipOutputStream is generally recommended for use + /// only when your application emits arbitrary data, not necessarily data from a + /// filesystem file, directly into a zip file, and does so using a Stream + /// metaphor. + /// + /// + /// + /// Aside from the differences in programming model, there are other + /// differences in capability between the two classes. + /// + /// + /// + /// + /// ZipFile can be used to read and extract zip files, in addition to + /// creating zip files. ZipOutputStream cannot read zip files. If you want + /// to use a stream to read zip files, check out the class. + /// + /// + /// + /// ZipOutputStream does not support the creation of segmented or spanned + /// zip files. + /// + /// + /// + /// ZipOutputStream cannot produce a self-extracting archive. + /// + /// + /// + /// + /// Be aware that the ZipFile class implements the interface. In order for ZipFile to + /// produce a valid zip file, you use use it within a using clause (Using + /// in VB), or call the Dispose() method explicitly. See the examples + /// for how to employ a using clause. + /// + /// + /// + [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d00005")] + [Interop.ComVisible(true)] +#if !NETCF + [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)] +#endif + public partial class ZipFile : + System.Collections.IEnumerable, + System.Collections.Generic.IEnumerable, + IDisposable + { + + #region public properties + + /// + /// Indicates whether to perform a full scan of the zip file when reading it. + /// + /// + /// + /// + /// + /// You almost never want to use this property. + /// + /// + /// + /// When reading a zip file, if this flag is true (True in + /// VB), the entire zip archive will be scanned and searched for entries. + /// For large archives, this can take a very, long time. The much more + /// efficient default behavior is to read the zip directory, which is + /// stored at the end of the zip file. But, in some cases the directory is + /// corrupted and you need to perform a full scan of the zip file to + /// determine the contents of the zip file. This property lets you do + /// that, when necessary. + /// + /// + /// + /// This flag is effective only when calling . Normally you would read a ZipFile with the + /// static ZipFile.Read + /// method. But you can't set the FullScan property on the + /// ZipFile instance when you use a static factory method like + /// ZipFile.Read. + /// + /// + /// + /// + /// + /// + /// This example shows how to read a zip file using the full scan approach, + /// and then save it, thereby producing a corrected zip file. + /// + /// + /// using (var zip = new ZipFile()) + /// { + /// zip.FullScan = true; + /// zip.Initialize(zipFileName); + /// zip.Save(newName); + /// } + /// + /// + /// + /// Using zip As New ZipFile + /// zip.FullScan = True + /// zip.Initialize(zipFileName) + /// zip.Save(newName) + /// End Using + /// + /// + /// + public bool FullScan + { + get; + set; + } + + + /// + /// Whether to sort the ZipEntries before saving the file. + /// + /// + /// + /// The default is false. If you have a large number of zip entries, the sort + /// alone can consume significant time. + /// + /// + /// + /// + /// using (var zip = new ZipFile()) + /// { + /// zip.AddFiles(filesToAdd); + /// zip.SortEntriesBeforeSaving = true; + /// zip.Save(name); + /// } + /// + /// + /// + /// Using zip As New ZipFile + /// zip.AddFiles(filesToAdd) + /// zip.SortEntriesBeforeSaving = True + /// zip.Save(name) + /// End Using + /// + /// + /// + public bool SortEntriesBeforeSaving + { + get; + set; + } + + + + /// + /// Indicates whether NTFS Reparse Points, like junctions, should be + /// traversed during calls to AddDirectory(). + /// + /// + /// + /// By default, calls to AddDirectory() will traverse NTFS reparse + /// points, like mounted volumes, and directory junctions. An example + /// of a junction is the "My Music" directory in Windows Vista. In some + /// cases you may not want DotNetZip to traverse those directories. In + /// that case, set this property to false. + /// + /// + /// + /// + /// using (var zip = new ZipFile()) + /// { + /// zip.AddDirectoryWillTraverseReparsePoints = false; + /// zip.AddDirectory(dirToZip,"fodder"); + /// zip.Save(zipFileToCreate); + /// } + /// + /// + public bool AddDirectoryWillTraverseReparsePoints { get; set; } + + + /// + /// Size of the IO buffer used while saving. + /// + /// + /// + /// + /// + /// First, let me say that you really don't need to bother with this. It is + /// here to allow for optimizations that you probably won't make! It will work + /// fine if you don't set or get this property at all. Ok? + /// + /// + /// + /// Now that we have that out of the way, the fine print: This + /// property affects the size of the buffer that is used for I/O for each + /// entry contained in the zip file. When a file is read in to be compressed, + /// it uses a buffer given by the size here. When you update a zip file, the + /// data for unmodified entries is copied from the first zip file to the + /// other, through a buffer given by the size here. + /// + /// + /// + /// Changing the buffer size affects a few things: first, for larger buffer + /// sizes, the memory used by the ZipFile, obviously, will be larger + /// during I/O operations. This may make operations faster for very much + /// larger files. Last, for any given entry, when you use a larger buffer + /// there will be fewer progress events during I/O operations, because there's + /// one progress event generated for each time the buffer is filled and then + /// emptied. + /// + /// + /// + /// The default buffer size is 8k. Increasing the buffer size may speed + /// things up as you compress larger files. But there are no hard-and-fast + /// rules here, eh? You won't know til you test it. And there will be a + /// limit where ever larger buffers actually slow things down. So as I said + /// in the beginning, it's probably best if you don't set or get this property + /// at all. + /// + /// + /// + /// + /// + /// This example shows how you might set a large buffer size for efficiency when + /// dealing with zip entries that are larger than 1gb. + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.SaveProgress += this.zip1_SaveProgress; + /// zip.AddDirectory(directoryToZip, ""); + /// zip.UseZip64WhenSaving = Zip64Option.Always; + /// zip.BufferSize = 65536*8; // 65536 * 8 = 512k + /// zip.Save(ZipFileToCreate); + /// } + /// + /// + + public int BufferSize + { + get { return _BufferSize; } + set { _BufferSize = value; } + } + + /// + /// Size of the work buffer to use for the ZLIB codec during compression. + /// + /// + /// + /// + /// When doing ZLIB or Deflate compression, the library fills a buffer, + /// then passes it to the compressor for compression. Then the library + /// reads out the compressed bytes. This happens repeatedly until there + /// is no more uncompressed data to compress. This property sets the + /// size of the buffer that will be used for chunk-wise compression. In + /// order for the setting to take effect, your application needs to set + /// this property before calling one of the ZipFile.Save() + /// overloads. + /// + /// + /// Setting this affects the performance and memory efficiency of + /// compression and decompression. For larger files, setting this to a + /// larger size may improve compression performance, but the exact + /// numbers vary depending on available memory, the size of the streams + /// you are compressing, and a bunch of other variables. I don't have + /// good firm recommendations on how to set it. You'll have to test it + /// yourself. Or just leave it alone and accept the default. + /// + /// + public int CodecBufferSize + { + get; + set; + } + + /// + /// Indicates whether extracted files should keep their paths as + /// stored in the zip archive. + /// + /// + /// + /// + /// This property affects Extraction. It is not used when creating zip + /// archives. + /// + /// + /// + /// With this property set to false, the default, extracting entries + /// from a zip file will create files in the filesystem that have the full + /// path associated to the entry within the zip file. With this property set + /// to true, extracting entries from the zip file results in files + /// with no path: the folders are "flattened." + /// + /// + /// + /// An example: suppose the zip file contains entries /directory1/file1.txt and + /// /directory2/file2.txt. With FlattenFoldersOnExtract set to false, + /// the files created will be \directory1\file1.txt and \directory2\file2.txt. + /// With the property set to true, the files created are file1.txt and file2.txt. + /// + /// + /// + public bool FlattenFoldersOnExtract + { + get; + set; + } + + + /// + /// The compression strategy to use for all entries. + /// + /// + /// + /// Set the Strategy used by the ZLIB-compatible compressor, when + /// compressing entries using the DEFLATE method. Different compression + /// strategies work better on different sorts of data. The strategy + /// parameter can affect the compression ratio and the speed of + /// compression but not the correctness of the compresssion. For more + /// information see Ionic.Zlib.CompressionStrategy. + /// + public Ionic.Zlib.CompressionStrategy Strategy + { + get { return _Strategy; } + set { _Strategy = value; } + } + + + /// + /// The name of the ZipFile, on disk. + /// + /// + /// + /// + /// + /// When the ZipFile instance was created by reading an archive using + /// one of the ZipFile.Read methods, this property represents the name + /// of the zip file that was read. When the ZipFile instance was + /// created by using the no-argument constructor, this value is null + /// (Nothing in VB). + /// + /// + /// + /// If you use the no-argument constructor, and you then explicitly set this + /// property, when you call , this name will + /// specify the name of the zip file created. Doing so is equivalent to + /// calling . When instantiating a + /// ZipFile by reading from a stream or byte array, the Name + /// property remains null. When saving to a stream, the Name + /// property is implicitly set to null. + /// + /// + public string Name + { + get { return _name; } + set { _name = value; } + } + + + /// + /// Sets the compression level to be used for entries subsequently added to + /// the zip archive. + /// + /// + /// + /// + /// Varying the compression level used on entries can affect the + /// size-vs-speed tradeoff when compression and decompressing data streams + /// or files. + /// + /// + /// + /// As with some other properties on the ZipFile class, like , , and , setting this property on a ZipFile + /// instance will cause the specified CompressionLevel to be used on all + /// items that are subsequently added to the + /// ZipFile instance. If you set this property after you have added + /// items to the ZipFile, but before you have called Save(), + /// those items will not use the specified compression level. + /// + /// + /// + /// If you do not set this property, the default compression level is used, + /// which normally gives a good balance of compression efficiency and + /// compression speed. In some tests, using BestCompression can + /// double the time it takes to compress, while delivering just a small + /// increase in compression efficiency. This behavior will vary with the + /// type of data you compress. If you are in doubt, just leave this setting + /// alone, and accept the default. + /// + /// + public Ionic.Zlib.CompressionLevel CompressionLevel + { + get; + set; + } + + /// + /// The compression method for the zipfile. + /// + /// + /// + /// By default, the compression method is CompressionMethod.Deflate. + /// + /// + /// + public Ionic.Zip.CompressionMethod CompressionMethod + { + get + { + return _compressionMethod; + } + set + { + _compressionMethod = value; + } + } + + + + /// + /// A comment attached to the zip archive. + /// + /// + /// + /// + /// + /// This property is read/write. It allows the application to specify a + /// comment for the ZipFile, or read the comment for the + /// ZipFile. After setting this property, changes are only made + /// permanent when you call a Save() method. + /// + /// + /// + /// According to PKWARE's + /// zip specification, the comment is not encrypted, even if there is a + /// password set on the zip file. + /// + /// + /// + /// The specification does not describe how to indicate the encoding used + /// on a comment string. Many "compliant" zip tools and libraries use + /// IBM437 as the code page for comments; DotNetZip, too, follows that + /// practice. On the other hand, there are situations where you want a + /// Comment to be encoded with something else, for example using code page + /// 950 "Big-5 Chinese". To fill that need, DotNetZip will encode the + /// comment following the same procedure it follows for encoding + /// filenames: (a) if is + /// Never, it uses the default encoding (IBM437). (b) if is Always, it always uses the + /// alternate encoding (). (c) if is AsNecessary, it uses the + /// alternate encoding only if the default encoding is not sufficient for + /// encoding the comment - in other words if decoding the result does not + /// produce the original string. This decision is taken at the time of + /// the call to ZipFile.Save(). + /// + /// + /// + /// When creating a zip archive using this library, it is possible to change + /// the value of between each + /// entry you add, and between adding entries and the call to + /// Save(). Don't do this. It will likely result in a zip file that is + /// not readable by any tool or application. For best interoperability, leave + /// alone, or specify it only + /// once, before adding any entries to the ZipFile instance. + /// + /// + /// + public string Comment + { + get { return _Comment; } + set + { + _Comment = value; + _contentsChanged = true; + } + } + + + + + /// + /// Specifies whether the Creation, Access, and Modified times for entries + /// added to the zip file will be emitted in “Windows format” + /// when the zip archive is saved. + /// + /// + /// + /// + /// An application creating a zip archive can use this flag to explicitly + /// specify that the file times for the entries should or should not be stored + /// in the zip archive in the format used by Windows. By default this flag is + /// true, meaning the Windows-format times are stored in the zip + /// archive. + /// + /// + /// + /// When adding an entry from a file or directory, the Creation (), Access (), and Modified () times for the given entry are + /// automatically set from the filesystem values. When adding an entry from a + /// stream or string, all three values are implicitly set to + /// DateTime.Now. Applications can also explicitly set those times by + /// calling . + /// + /// + /// + /// PKWARE's + /// zip specification describes multiple ways to format these times in a + /// zip file. One is the format Windows applications normally use: 100ns ticks + /// since January 1, 1601 UTC. The other is a format Unix applications typically + /// use: seconds since January 1, 1970 UTC. Each format can be stored in an + /// "extra field" in the zip entry when saving the zip archive. The former + /// uses an extra field with a Header Id of 0x000A, while the latter uses a + /// header ID of 0x5455, although you probably don't need to know that. + /// + /// + /// + /// Not all tools and libraries can interpret these fields. Windows + /// compressed folders is one that can read the Windows Format timestamps, + /// while I believe the Infozip + /// tools can read the Unix format timestamps. Some tools and libraries + /// may be able to read only one or the other. DotNetZip can read or write + /// times in either or both formats. + /// + /// + /// + /// The times stored are taken from , , and . + /// + /// + /// + /// The value set here applies to all entries subsequently added to the + /// ZipFile. + /// + /// + /// + /// This property is not mutually exclusive of the property. It is possible and + /// legal and valid to produce a zip file that contains timestamps encoded in + /// the Unix format as well as in the Windows format, in addition to the LastModified time attached to each + /// entry in the archive, a time that is always stored in "DOS format". And, + /// notwithstanding the names PKWare uses for these time formats, any of them + /// can be read and written by any computer, on any operating system. But, + /// there are no guarantees that a program running on Mac or Linux will + /// gracefully handle a zip file with "Windows" formatted times, or that an + /// application that does not use DotNetZip but runs on Windows will be able to + /// handle file times in Unix format. + /// + /// + /// + /// When in doubt, test. Sorry, I haven't got a complete list of tools and + /// which sort of timestamps they can use and will tolerate. If you get any + /// good information and would like to pass it on, please do so and I will + /// include that information in this documentation. + /// + /// + /// + /// + /// This example shows how to save a zip file that contains file timestamps + /// in a format normally used by Unix. + /// + /// using (var zip = new ZipFile()) + /// { + /// // produce a zip file the Mac will like + /// zip.EmitTimesInWindowsFormatWhenSaving = false; + /// zip.EmitTimesInUnixFormatWhenSaving = true; + /// zip.AddDirectory(directoryToZip, "files"); + /// zip.Save(outputFile); + /// } + /// + /// + /// + /// Using zip As New ZipFile + /// '' produce a zip file the Mac will like + /// zip.EmitTimesInWindowsFormatWhenSaving = False + /// zip.EmitTimesInUnixFormatWhenSaving = True + /// zip.AddDirectory(directoryToZip, "files") + /// zip.Save(outputFile) + /// End Using + /// + /// + /// + /// + /// + public bool EmitTimesInWindowsFormatWhenSaving + { + get + { + return _emitNtfsTimes; + } + set + { + _emitNtfsTimes = value; + } + } + + + /// + /// Specifies whether the Creation, Access, and Modified times + /// for entries added to the zip file will be emitted in "Unix(tm) + /// format" when the zip archive is saved. + /// + /// + /// + /// + /// An application creating a zip archive can use this flag to explicitly + /// specify that the file times for the entries should or should not be stored + /// in the zip archive in the format used by Unix. By default this flag is + /// false, meaning the Unix-format times are not stored in the zip + /// archive. + /// + /// + /// + /// When adding an entry from a file or directory, the Creation (), Access (), and Modified () times for the given entry are + /// automatically set from the filesystem values. When adding an entry from a + /// stream or string, all three values are implicitly set to DateTime.Now. + /// Applications can also explicitly set those times by calling . + /// + /// + /// + /// PKWARE's + /// zip specification describes multiple ways to format these times in a + /// zip file. One is the format Windows applications normally use: 100ns ticks + /// since January 1, 1601 UTC. The other is a format Unix applications + /// typically use: seconds since January 1, 1970 UTC. Each format can be + /// stored in an "extra field" in the zip entry when saving the zip + /// archive. The former uses an extra field with a Header Id of 0x000A, while + /// the latter uses a header ID of 0x5455, although you probably don't need to + /// know that. + /// + /// + /// + /// Not all tools and libraries can interpret these fields. Windows + /// compressed folders is one that can read the Windows Format timestamps, + /// while I believe the Infozip + /// tools can read the Unix format timestamps. Some tools and libraries may be + /// able to read only one or the other. DotNetZip can read or write times in + /// either or both formats. + /// + /// + /// + /// The times stored are taken from , , and . + /// + /// + /// + /// This property is not mutually exclusive of the property. It is possible and + /// legal and valid to produce a zip file that contains timestamps encoded in + /// the Unix format as well as in the Windows format, in addition to the LastModified time attached to each + /// entry in the zip archive, a time that is always stored in "DOS + /// format". And, notwithstanding the names PKWare uses for these time + /// formats, any of them can be read and written by any computer, on any + /// operating system. But, there are no guarantees that a program running on + /// Mac or Linux will gracefully handle a zip file with "Windows" formatted + /// times, or that an application that does not use DotNetZip but runs on + /// Windows will be able to handle file times in Unix format. + /// + /// + /// + /// When in doubt, test. Sorry, I haven't got a complete list of tools and + /// which sort of timestamps they can use and will tolerate. If you get any + /// good information and would like to pass it on, please do so and I will + /// include that information in this documentation. + /// + /// + /// + /// + /// + public bool EmitTimesInUnixFormatWhenSaving + { + get + { + return _emitUnixTimes; + } + set + { + _emitUnixTimes = value; + } + } + + + + /// + /// Indicates whether verbose output is sent to the during AddXxx() and + /// ReadXxx() operations. + /// + /// + /// + /// This is a synthetic property. It returns true if the is non-null. + /// + internal bool Verbose + { + get { return (_StatusMessageTextWriter != null); } + } + + + /// + /// Returns true if an entry by the given name exists in the ZipFile. + /// + /// + /// the name of the entry to find + /// true if an entry with the given name exists; otherwise false. + /// + public bool ContainsEntry(string name) + { + // workitem 12534 + return _entries.ContainsKey(SharedUtilities.NormalizePathForUseInZipFile(name)); + } + + + + /// + /// Indicates whether to perform case-sensitive matching on the filename when + /// retrieving entries in the zipfile via the string-based indexer. + /// + /// + /// + /// The default value is false, which means don't do case-sensitive + /// matching. In other words, retrieving zip["ReadMe.Txt"] is the same as + /// zip["readme.txt"]. It really makes sense to set this to true only + /// if you are not running on Windows, which has case-insensitive + /// filenames. But since this library is not built for non-Windows platforms, + /// in most cases you should just leave this property alone. + /// + public bool CaseSensitiveRetrieval + { + get + { + return _CaseSensitiveRetrieval; + } + + set + { + // workitem 9868 + if (value != _CaseSensitiveRetrieval) + { + _CaseSensitiveRetrieval = value; + _initEntriesDictionary(); + } + } + } + + + /// + /// Indicates whether to encode entry filenames and entry comments using Unicode + /// (UTF-8). + /// + /// + /// + /// + /// The + /// PKWare zip specification provides for encoding file names and file + /// comments in either the IBM437 code page, or in UTF-8. This flag selects + /// the encoding according to that specification. By default, this flag is + /// false, and filenames and comments are encoded into the zip file in the + /// IBM437 codepage. Setting this flag to true will specify that filenames + /// and comments that cannot be encoded with IBM437 will be encoded with + /// UTF-8. + /// + /// + /// + /// Zip files created with strict adherence to the PKWare specification with + /// respect to UTF-8 encoding can contain entries with filenames containing + /// any combination of Unicode characters, including the full range of + /// characters from Chinese, Latin, Hebrew, Greek, Cyrillic, and many other + /// alphabets. However, because at this time, the UTF-8 portion of the PKWare + /// specification is not broadly supported by other zip libraries and + /// utilities, such zip files may not be readable by your favorite zip tool or + /// archiver. In other words, interoperability will decrease if you set this + /// flag to true. + /// + /// + /// + /// In particular, Zip files created with strict adherence to the PKWare + /// specification with respect to UTF-8 encoding will not work well with + /// Explorer in Windows XP or Windows Vista, because Windows compressed + /// folders, as far as I know, do not support UTF-8 in zip files. Vista can + /// read the zip files, but shows the filenames incorrectly. Unpacking from + /// Windows Vista Explorer will result in filenames that have rubbish + /// characters in place of the high-order UTF-8 bytes. + /// + /// + /// + /// Also, zip files that use UTF-8 encoding will not work well with Java + /// applications that use the java.util.zip classes, as of v5.0 of the Java + /// runtime. The Java runtime does not correctly implement the PKWare + /// specification in this regard. + /// + /// + /// + /// As a result, we have the unfortunate situation that "correct" behavior by + /// the DotNetZip library with regard to Unicode encoding of filenames during + /// zip creation will result in zip files that are readable by strictly + /// compliant and current tools (for example the most recent release of the + /// commercial WinZip tool); but these zip files will not be readable by + /// various other tools or libraries, including Windows Explorer. + /// + /// + /// + /// The DotNetZip library can read and write zip files with UTF8-encoded + /// entries, according to the PKware spec. If you use DotNetZip for both + /// creating and reading the zip file, and you use UTF-8, there will be no + /// loss of information in the filenames. For example, using a self-extractor + /// created by this library will allow you to unpack files correctly with no + /// loss of information in the filenames. + /// + /// + /// + /// If you do not set this flag, it will remain false. If this flag is false, + /// your ZipFile will encode all filenames and comments using the + /// IBM437 codepage. This can cause "loss of information" on some filenames, + /// but the resulting zipfile will be more interoperable with other + /// utilities. As an example of the loss of information, diacritics can be + /// lost. The o-tilde character will be down-coded to plain o. The c with a + /// cedilla (Unicode 0xE7) used in Portugese will be downcoded to a c. + /// Likewise, the O-stroke character (Unicode 248), used in Danish and + /// Norwegian, will be down-coded to plain o. Chinese characters cannot be + /// represented in codepage IBM437; when using the default encoding, Chinese + /// characters in filenames will be represented as ?. These are all examples + /// of "information loss". + /// + /// + /// + /// The loss of information associated to the use of the IBM437 encoding is + /// inconvenient, and can also lead to runtime errors. For example, using + /// IBM437, any sequence of 4 Chinese characters will be encoded as ????. If + /// your application creates a ZipFile, then adds two files, each with + /// names of four Chinese characters each, this will result in a duplicate + /// filename exception. In the case where you add a single file with a name + /// containing four Chinese characters, calling Extract() on the entry that + /// has question marks in the filename will result in an exception, because + /// the question mark is not legal for use within filenames on Windows. These + /// are just a few examples of the problems associated to loss of information. + /// + /// + /// + /// This flag is independent of the encoding of the content within the entries + /// in the zip file. Think of the zip file as a container - it supports an + /// encoding. Within the container are other "containers" - the file entries + /// themselves. The encoding within those entries is independent of the + /// encoding of the zip archive container for those entries. + /// + /// + /// + /// Rather than specify the encoding in a binary fashion using this flag, an + /// application can specify an arbitrary encoding via the property. Setting the encoding + /// explicitly when creating zip archives will result in non-compliant zip + /// files that, curiously, are fairly interoperable. The challenge is, the + /// PKWare specification does not provide for a way to specify that an entry + /// in a zip archive uses a code page that is neither IBM437 nor UTF-8. + /// Therefore if you set the encoding explicitly when creating a zip archive, + /// you must take care upon reading the zip archive to use the same code page. + /// If you get it wrong, the behavior is undefined and may result in incorrect + /// filenames, exceptions, stomach upset, hair loss, and acne. + /// + /// + /// + [Obsolete("Beginning with v1.9.1.6 of DotNetZip, this property is obsolete. It will be removed in a future version of the library. Your applications should use AlternateEncoding and AlternateEncodingUsage instead.")] + public bool UseUnicodeAsNecessary + { + get + { + return (_alternateEncoding == System.Text.Encoding.GetEncoding("UTF-8")) && + (_alternateEncodingUsage == ZipOption.AsNecessary); + } + set + { + if (value) + { + _alternateEncoding = System.Text.Encoding.GetEncoding("UTF-8"); + _alternateEncodingUsage = ZipOption.AsNecessary; + + } + else + { + _alternateEncoding = Ionic.Zip.ZipFile.DefaultEncoding; + _alternateEncodingUsage = ZipOption.Never; + } + } + } + + + /// + /// Specify whether to use ZIP64 extensions when saving a zip archive. + /// + /// + /// + /// + /// + /// When creating a zip file, the default value for the property is . is + /// safest, in the sense that you will not get an Exception if a pre-ZIP64 + /// limit is exceeded. + /// + /// + /// + /// You may set the property at any time before calling Save(). + /// + /// + /// + /// When reading a zip file via the Zipfile.Read() method, DotNetZip + /// will properly read ZIP64-endowed zip archives, regardless of the value of + /// this property. DotNetZip will always read ZIP64 archives. This property + /// governs only whether DotNetZip will write them. Therefore, when updating + /// archives, be careful about setting this property after reading an archive + /// that may use ZIP64 extensions. + /// + /// + /// + /// An interesting question is, if you have set this property to + /// AsNecessary, and then successfully saved, does the resulting + /// archive use ZIP64 extensions or not? To learn this, check the property, after calling Save(). + /// + /// + /// + /// Have you thought about + /// donating? + /// + /// + /// + /// + public Zip64Option UseZip64WhenSaving + { + get + { + return _zip64; + } + set + { + _zip64 = value; + } + } + + + + /// + /// Indicates whether the archive requires ZIP64 extensions. + /// + /// + /// + /// + /// + /// This property is null (or Nothing in VB) if the archive has + /// not been saved, and there are fewer than 65334 ZipEntry items + /// contained in the archive. + /// + /// + /// + /// The Value is true if any of the following four conditions holds: + /// the uncompressed size of any entry is larger than 0xFFFFFFFF; the + /// compressed size of any entry is larger than 0xFFFFFFFF; the relative + /// offset of any entry within the zip archive is larger than 0xFFFFFFFF; or + /// there are more than 65534 entries in the archive. (0xFFFFFFFF = + /// 4,294,967,295). The result may not be known until a Save() is attempted + /// on the zip archive. The Value of this + /// property may be set only AFTER one of the Save() methods has been called. + /// + /// + /// + /// If none of the four conditions holds, and the archive has been saved, then + /// the Value is false. + /// + /// + /// + /// A Value of false does not indicate that the zip archive, as saved, + /// does not use ZIP64. It merely indicates that ZIP64 is not required. An + /// archive may use ZIP64 even when not required if the property is set to , or if the property is set to and the output stream was not + /// seekable. Use the property to determine if + /// the most recent Save() method resulted in an archive that utilized + /// the ZIP64 extensions. + /// + /// + /// + /// + /// + public Nullable RequiresZip64 + { + get + { + if (_entries.Count > 65534) + return new Nullable(true); + + // If the ZipFile has not been saved or if the contents have changed, then + // it is not known if ZIP64 is required. + if (!_hasBeenSaved || _contentsChanged) return null; + + // Whether ZIP64 is required is knowable. + foreach (ZipEntry e in _entries.Values) + { + if (e.RequiresZip64.Value) return new Nullable(true); + } + + return new Nullable(false); + } + } + + + /// + /// Indicates whether the most recent Save() operation used ZIP64 extensions. + /// + /// + /// + /// + /// The use of ZIP64 extensions within an archive is not always necessary, and + /// for interoperability concerns, it may be desired to NOT use ZIP64 if + /// possible. The property can be + /// set to use ZIP64 extensions only when necessary. In those cases, + /// Sometimes applications want to know whether a Save() actually used ZIP64 + /// extensions. Applications can query this read-only property to learn + /// whether ZIP64 has been used in a just-saved ZipFile. + /// + /// + /// + /// The value is null (or Nothing in VB) if the archive has not + /// been saved. + /// + /// + /// + /// Non-null values (HasValue is true) indicate whether ZIP64 + /// extensions were used during the most recent Save() operation. The + /// ZIP64 extensions may have been used as required by any particular entry + /// because of its uncompressed or compressed size, or because the archive is + /// larger than 4294967295 bytes, or because there are more than 65534 entries + /// in the archive, or because the UseZip64WhenSaving property was set + /// to , or because the + /// UseZip64WhenSaving property was set to and the output stream was not seekable. + /// The value of this property does not indicate the reason the ZIP64 + /// extensions were used. + /// + /// + /// + /// + /// + public Nullable OutputUsedZip64 + { + get + { + return _OutputUsesZip64; + } + } + + + /// + /// Indicates whether the most recent Read() operation read a zip file that uses + /// ZIP64 extensions. + /// + /// + /// + /// This property will return null (Nothing in VB) if you've added an entry after reading + /// the zip file. + /// + public Nullable InputUsesZip64 + { + get + { + if (_entries.Count > 65534) + return true; + + foreach (ZipEntry e in this) + { + // if any entry was added after reading the zip file, then the result is null + if (e.Source != ZipEntrySource.ZipFile) return null; + + // if any entry read from the zip used zip64, then the result is true + if (e._InputUsesZip64) return true; + } + return false; + } + } + + + /// + /// The text encoding to use when writing new entries to the ZipFile, + /// for those entries that cannot be encoded with the default (IBM437) + /// encoding; or, the text encoding that was used when reading the entries + /// from the ZipFile. + /// + /// + /// + /// + /// In its + /// zip specification, PKWare describes two options for encoding + /// filenames and comments: using IBM437 or UTF-8. But, some archiving tools + /// or libraries do not follow the specification, and instead encode + /// characters using the system default code page. For example, WinRAR when + /// run on a machine in Shanghai may encode filenames with the Big-5 Chinese + /// (950) code page. This behavior is contrary to the Zip specification, but + /// it occurs anyway. + /// + /// + /// + /// When using DotNetZip to write zip archives that will be read by one of + /// these other archivers, set this property to specify the code page to use + /// when encoding the and for each ZipEntry in the zip file, for + /// values that cannot be encoded with the default codepage for zip files, + /// IBM437. This is why this property is "provisional". In all cases, IBM437 + /// is used where possible, in other words, where no loss of data would + /// result. It is possible, therefore, to have a given entry with a + /// Comment encoded in IBM437 and a FileName encoded with the + /// specified "provisional" codepage. + /// + /// + /// + /// Be aware that a zip file created after you've explicitly set the property to a value other than + /// IBM437 may not be compliant to the PKWare specification, and may not be + /// readable by compliant archivers. On the other hand, many (most?) + /// archivers are non-compliant and can read zip files created in arbitrary + /// code pages. The trick is to use or specify the proper codepage when + /// reading the zip. + /// + /// + /// + /// When creating a zip archive using this library, it is possible to change + /// the value of between each + /// entry you add, and between adding entries and the call to + /// Save(). Don't do this. It will likely result in a zipfile that is + /// not readable. For best interoperability, either leave alone, or specify it only once, + /// before adding any entries to the ZipFile instance. There is one + /// exception to this recommendation, described later. + /// + /// + /// + /// When using an arbitrary, non-UTF8 code page for encoding, there is no + /// standard way for the creator application - whether DotNetZip, WinZip, + /// WinRar, or something else - to formally specify in the zip file which + /// codepage has been used for the entries. As a result, readers of zip files + /// are not able to inspect the zip file and determine the codepage that was + /// used for the entries contained within it. It is left to the application + /// or user to determine the necessary codepage when reading zip files encoded + /// this way. In other words, if you explicitly specify the codepage when you + /// create the zipfile, you must explicitly specify the same codepage when + /// reading the zipfile. + /// + /// + /// + /// The way you specify the code page to use when reading a zip file varies + /// depending on the tool or library you use to read the zip. In DotNetZip, + /// you use a ZipFile.Read() method that accepts an encoding parameter. It + /// isn't possible with Windows Explorer, as far as I know, to specify an + /// explicit codepage to use when reading a zip. If you use an incorrect + /// codepage when reading a zipfile, you will get entries with filenames that + /// are incorrect, and the incorrect filenames may even contain characters + /// that are not legal for use within filenames in Windows. Extracting entries + /// with illegal characters in the filenames will lead to exceptions. It's too + /// bad, but this is just the way things are with code pages in zip + /// files. Caveat Emptor. + /// + /// + /// + /// Example: Suppose you create a zipfile that contains entries with + /// filenames that have Danish characters. If you use equal to "iso-8859-1" (cp 28591), + /// the filenames will be correctly encoded in the zip. But, to read that + /// zipfile correctly, you have to specify the same codepage at the time you + /// read it. If try to read that zip file with Windows Explorer or another + /// application that is not flexible with respect to the codepage used to + /// decode filenames in zipfiles, you will get a filename like "Inf.txt". + /// + /// + /// + /// When using DotNetZip to read a zip archive, and the zip archive uses an + /// arbitrary code page, you must specify the encoding to use before or when + /// the Zipfile is READ. This means you must use a ZipFile.Read() + /// method that allows you to specify a System.Text.Encoding parameter. Setting + /// the ProvisionalAlternateEncoding property after your application has read in + /// the zip archive will not affect the entry names of entries that have already + /// been read in. + /// + /// + /// + /// And now, the exception to the rule described above. One strategy for + /// specifying the code page for a given zip file is to describe the code page + /// in a human-readable form in the Zip comment. For example, the comment may + /// read "Entries in this archive are encoded in the Big5 code page". For + /// maximum interoperability, the zip comment in this case should be encoded + /// in the default, IBM437 code page. In this case, the zip comment is + /// encoded using a different page than the filenames. To do this, Specify + /// ProvisionalAlternateEncoding to your desired region-specific code + /// page, once before adding any entries, and then reset + /// ProvisionalAlternateEncoding to IBM437 before setting the property and calling Save(). + /// + /// + /// + /// + /// This example shows how to read a zip file using the Big-5 Chinese code page + /// (950), and extract each entry in the zip file. For this code to work as + /// desired, the Zipfile must have been created using the big5 code page + /// (CP950). This is typical, for example, when using WinRar on a machine with + /// CP950 set as the default code page. In that case, the names of entries + /// within the Zip archive will be stored in that code page, and reading the zip + /// archive must be done using that code page. If the application did not use + /// the correct code page in ZipFile.Read(), then names of entries within the + /// zip archive would not be correctly retrieved. + /// + /// using (var zip = ZipFile.Read(zipFileName, System.Text.Encoding.GetEncoding("big5"))) + /// { + /// // retrieve and extract an entry using a name encoded with CP950 + /// zip[MyDesiredEntry].Extract("unpack"); + /// } + /// + /// + /// + /// Using zip As ZipFile = ZipFile.Read(ZipToExtract, System.Text.Encoding.GetEncoding("big5")) + /// ' retrieve and extract an entry using a name encoded with CP950 + /// zip(MyDesiredEntry).Extract("unpack") + /// End Using + /// + /// + /// + /// DefaultEncoding + [Obsolete("use AlternateEncoding instead.")] + public System.Text.Encoding ProvisionalAlternateEncoding + { + get + { + if (_alternateEncodingUsage == ZipOption.AsNecessary) + return _alternateEncoding; + return null; + } + set + { + _alternateEncoding = value; + _alternateEncodingUsage = ZipOption.AsNecessary; + } + } + + + /// + /// A Text Encoding to use when encoding the filenames and comments for + /// all the ZipEntry items, during a ZipFile.Save() operation. + /// + /// + /// + /// Whether the encoding specified here is used during the save depends + /// on . + /// + /// + public System.Text.Encoding AlternateEncoding + { + get + { + return _alternateEncoding; + } + set + { + _alternateEncoding = value; + } + } + + + /// + /// A flag that tells if and when this instance should apply + /// AlternateEncoding to encode the filenames and comments associated to + /// of ZipEntry objects contained within this instance. + /// + public ZipOption AlternateEncodingUsage + { + get + { + return _alternateEncodingUsage; + } + set + { + _alternateEncodingUsage = value; + } + } + + + /// + /// The default text encoding used in zip archives. It is numeric 437, also + /// known as IBM437. + /// + /// + public static System.Text.Encoding DefaultEncoding + { + get + { + return _defaultEncoding; + } + } + + + /// + /// Gets or sets the TextWriter to which status messages are delivered + /// for the instance. + /// + /// + /// + /// If the TextWriter is set to a non-null value, then verbose output is sent + /// to the TextWriter during Add, Read, Save and + /// Extract operations. Typically, console applications might use + /// Console.Out and graphical or headless applications might use a + /// System.IO.StringWriter. The output of this is suitable for viewing + /// by humans. + /// + /// + /// + /// + /// In this example, a console application instantiates a ZipFile, then + /// sets the StatusMessageTextWriter to Console.Out. At that + /// point, all verbose status messages for that ZipFile are sent to the + /// console. + /// + /// + /// + /// using (ZipFile zip= ZipFile.Read(FilePath)) + /// { + /// zip.StatusMessageTextWriter= System.Console.Out; + /// // messages are sent to the console during extraction + /// zip.ExtractAll(); + /// } + /// + /// + /// + /// Using zip As ZipFile = ZipFile.Read(FilePath) + /// zip.StatusMessageTextWriter= System.Console.Out + /// 'Status Messages will be sent to the console during extraction + /// zip.ExtractAll() + /// End Using + /// + /// + /// + /// In this example, a Windows Forms application instantiates a + /// ZipFile, then sets the StatusMessageTextWriter to a + /// StringWriter. At that point, all verbose status messages for that + /// ZipFile are sent to the StringWriter. + /// + /// + /// + /// var sw = new System.IO.StringWriter(); + /// using (ZipFile zip= ZipFile.Read(FilePath)) + /// { + /// zip.StatusMessageTextWriter= sw; + /// zip.ExtractAll(); + /// } + /// Console.WriteLine("{0}", sw.ToString()); + /// + /// + /// + /// Dim sw as New System.IO.StringWriter + /// Using zip As ZipFile = ZipFile.Read(FilePath) + /// zip.StatusMessageTextWriter= sw + /// zip.ExtractAll() + /// End Using + /// 'Status Messages are now available in sw + /// + /// + /// + public TextWriter StatusMessageTextWriter + { + get { return _StatusMessageTextWriter; } + set { _StatusMessageTextWriter = value; } + } + + + + + /// + /// Gets or sets the name for the folder to store the temporary file + /// this library writes when saving a zip archive. + /// + /// + /// + /// + /// This library will create a temporary file when saving a Zip archive to a + /// file. This file is written when calling one of the Save() methods + /// that does not save to a stream, or one of the SaveSelfExtractor() + /// methods. + /// + /// + /// + /// By default, the library will create the temporary file in the directory + /// specified for the file itself, via the property or via + /// the method. + /// + /// + /// + /// Setting this property allows applications to override this default + /// behavior, so that the library will create the temporary file in the + /// specified folder. For example, to have the library create the temporary + /// file in the current working directory, regardless where the ZipFile + /// is saved, specfy ".". To revert to the default behavior, set this + /// property to null (Nothing in VB). + /// + /// + /// + /// When setting the property to a non-null value, the folder specified must + /// exist; if it does not an exception is thrown. The application should have + /// write and delete permissions on the folder. The permissions are not + /// explicitly checked ahead of time; if the application does not have the + /// appropriate rights, an exception will be thrown at the time Save() + /// is called. + /// + /// + /// + /// There is no temporary file created when reading a zip archive. When + /// saving to a Stream, there is no temporary file created. For example, if + /// the application is an ASP.NET application and calls Save() + /// specifying the Response.OutputStream as the output stream, there is + /// no temporary file created. + /// + /// + /// + /// + /// Thrown when setting the property if the directory does not exist. + /// + /// + public String TempFileFolder + { + get { return _TempFileFolder; } + + set + { + _TempFileFolder = value; + if (value == null) return; + + if (!Directory.Exists(value)) + throw new FileNotFoundException(String.Format("That directory ({0}) does not exist.", value)); + + } + } + + /// + /// Sets the password to be used on the ZipFile instance. + /// + /// + /// + /// + /// + /// When writing a zip archive, this password is applied to the entries, not + /// to the zip archive itself. It applies to any ZipEntry subsequently + /// added to the ZipFile, using one of the AddFile, + /// AddDirectory, AddEntry, or AddItem methods, etc. + /// When reading a zip archive, this property applies to any entry + /// subsequently extracted from the ZipFile using one of the Extract + /// methods on the ZipFile class. + /// + /// + /// + /// When writing a zip archive, keep this in mind: though the password is set + /// on the ZipFile object, according to the Zip spec, the "directory" of the + /// archive - in other words the list of entries or files contained in the archive - is + /// not encrypted with the password, or protected in any way. If you set the + /// Password property, the password actually applies to individual entries + /// that are added to the archive, subsequent to the setting of this property. + /// The list of filenames in the archive that is eventually created will + /// appear in clear text, but the contents of the individual files are + /// encrypted. This is how Zip encryption works. + /// + /// + /// + /// One simple way around this limitation is to simply double-wrap sensitive + /// filenames: Store the files in a zip file, and then store that zip file + /// within a second, "outer" zip file. If you apply a password to the outer + /// zip file, then readers will be able to see that the outer zip file + /// contains an inner zip file. But readers will not be able to read the + /// directory or file list of the inner zip file. + /// + /// + /// + /// If you set the password on the ZipFile, and then add a set of files + /// to the archive, then each entry is encrypted with that password. You may + /// also want to change the password between adding different entries. If you + /// set the password, add an entry, then set the password to null + /// (Nothing in VB), and add another entry, the first entry is + /// encrypted and the second is not. If you call AddFile(), then set + /// the Password property, then call ZipFile.Save, the file + /// added will not be password-protected, and no warning will be generated. + /// + /// + /// + /// When setting the Password, you may also want to explicitly set the property, to specify how to encrypt the entries added + /// to the ZipFile. If you set the Password to a non-null value and do not + /// set , then PKZip 2.0 ("Weak") encryption is used. + /// This encryption is relatively weak but is very interoperable. If you set + /// the password to a null value (Nothing in VB), Encryption is + /// reset to None. + /// + /// + /// + /// All of the preceding applies to writing zip archives, in other words when + /// you use one of the Save methods. To use this property when reading or an + /// existing ZipFile, do the following: set the Password property on the + /// ZipFile, then call one of the Extract() overloads on the . In this case, the entry is extracted using the + /// Password that is specified on the ZipFile instance. If you + /// have not set the Password property, then the password is + /// null, and the entry is extracted with no password. + /// + /// + /// + /// If you set the Password property on the ZipFile, then call + /// Extract() an entry that has not been encrypted with a password, the + /// password is not used for that entry, and the ZipEntry is extracted + /// as normal. In other words, the password is used only if necessary. + /// + /// + /// + /// The class also has a Password property. It takes precedence + /// over this property on the ZipFile. Typically, you would use the + /// per-entry Password when most entries in the zip archive use one password, + /// and a few entries use a different password. If all entries in the zip + /// file use the same password, then it is simpler to just set this property + /// on the ZipFile itself, whether creating a zip archive or extracting + /// a zip archive. + /// + /// + /// + /// + /// + /// + /// This example creates a zip file, using password protection for the + /// entries, and then extracts the entries from the zip file. When creating + /// the zip file, the Readme.txt file is not protected with a password, but + /// the other two are password-protected as they are saved. During extraction, + /// each file is extracted with the appropriate password. + /// + /// + /// // create a file with encryption + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddFile("ReadMe.txt"); + /// zip.Password= "!Secret1"; + /// zip.AddFile("MapToTheSite-7440-N49th.png"); + /// zip.AddFile("2008-Regional-Sales-Report.pdf"); + /// zip.Save("EncryptedArchive.zip"); + /// } + /// + /// // extract entries that use encryption + /// using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + /// { + /// zip.Password= "!Secret1"; + /// zip.ExtractAll("extractDir"); + /// } + /// + /// + /// + /// + /// Using zip As New ZipFile + /// zip.AddFile("ReadMe.txt") + /// zip.Password = "123456!" + /// zip.AddFile("MapToTheSite-7440-N49th.png") + /// zip.Password= "!Secret1"; + /// zip.AddFile("2008-Regional-Sales-Report.pdf") + /// zip.Save("EncryptedArchive.zip") + /// End Using + /// + /// + /// ' extract entries that use encryption + /// Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + /// zip.Password= "!Secret1" + /// zip.ExtractAll("extractDir") + /// End Using + /// + /// + /// + /// + /// + /// ZipFile.Encryption + /// ZipEntry.Password + public String Password + { + set + { + _Password = value; + if (_Password == null) + { + Encryption = EncryptionAlgorithm.None; + } + else if (Encryption == EncryptionAlgorithm.None) + { + Encryption = EncryptionAlgorithm.PkzipWeak; + } + } + private get + { + return _Password; + } + } + + + + + + /// + /// The action the library should take when extracting a file that already + /// exists. + /// + /// + /// + /// + /// This property affects the behavior of the Extract methods (one of the + /// Extract() or ExtractWithPassword() overloads), when + /// extraction would would overwrite an existing filesystem file. If you do + /// not set this property, the library throws an exception when extracting an + /// entry would overwrite an existing file. + /// + /// + /// + /// This property has no effect when extracting to a stream, or when the file + /// to be extracted does not already exist. + /// + /// + /// + public ExtractExistingFileAction ExtractExistingFile + { + get; + set; + } + + + /// + /// The action the library should take when an error is encountered while + /// opening or reading files as they are saved into a zip archive. + /// + /// + /// + /// + /// Errors can occur as a file is being saved to the zip archive. For + /// example, the File.Open may fail, or a File.Read may fail, because of + /// lock conflicts or other reasons. + /// + /// + /// + /// The first problem might occur after having called AddDirectory() on a + /// directory that contains a Clipper .dbf file; the file is locked by + /// Clipper and cannot be opened for read by another process. An example of + /// the second problem might occur when trying to zip a .pst file that is in + /// use by Microsoft Outlook. Outlook locks a range on the file, which allows + /// other processes to open the file, but not read it in its entirety. + /// + /// + /// + /// This property tells DotNetZip what you would like to do in the case of + /// these errors. The primary options are: ZipErrorAction.Throw to + /// throw an exception (this is the default behavior if you don't set this + /// property); ZipErrorAction.Skip to Skip the file for which there + /// was an error and continue saving; ZipErrorAction.Retry to Retry + /// the entry that caused the problem; or + /// ZipErrorAction.InvokeErrorEvent to invoke an event handler. + /// + /// + /// + /// This property is implicitly set to ZipErrorAction.InvokeErrorEvent + /// if you add a handler to the event. If you set + /// this property to something other than + /// ZipErrorAction.InvokeErrorEvent, then the ZipError + /// event is implicitly cleared. What it means is you can set one or the + /// other (or neither), depending on what you want, but you never need to set + /// both. + /// + /// + /// + /// As with some other properties on the ZipFile class, like , , and , setting this property on a ZipFile + /// instance will cause the specified ZipErrorAction to be used on all + /// items that are subsequently added to the + /// ZipFile instance. If you set this property after you have added + /// items to the ZipFile, but before you have called Save(), + /// those items will not use the specified error handling action. + /// + /// + /// + /// If you want to handle any errors that occur with any entry in the zip + /// file in the same way, then set this property once, before adding any + /// entries to the zip archive. + /// + /// + /// + /// If you set this property to ZipErrorAction.Skip and you'd like to + /// learn which files may have been skipped after a Save(), you can + /// set the on the ZipFile before + /// calling Save(). A message will be emitted into that writer for + /// each skipped file, if any. + /// + /// + /// + /// + /// + /// This example shows how to tell DotNetZip to skip any files for which an + /// error is generated during the Save(). + /// + /// Public Sub SaveZipFile() + /// Dim SourceFolder As String = "fodder" + /// Dim DestFile As String = "eHandler.zip" + /// Dim sw as New StringWriter + /// Using zipArchive As ZipFile = New ZipFile + /// ' Tell DotNetZip to skip any files for which it encounters an error + /// zipArchive.ZipErrorAction = ZipErrorAction.Skip + /// zipArchive.StatusMessageTextWriter = sw + /// zipArchive.AddDirectory(SourceFolder) + /// zipArchive.Save(DestFile) + /// End Using + /// ' examine sw here to see any messages + /// End Sub + /// + /// + /// + /// + /// + /// + + public ZipErrorAction ZipErrorAction + { + get + { + if (ZipError != null) + _zipErrorAction = ZipErrorAction.InvokeErrorEvent; + return _zipErrorAction; + } + set + { + _zipErrorAction = value; + if (_zipErrorAction != ZipErrorAction.InvokeErrorEvent && ZipError != null) + ZipError = null; + } + } + + + /// + /// The Encryption to use for entries added to the ZipFile. + /// + /// + /// + /// + /// Set this when creating a zip archive, or when updating a zip archive. The + /// specified Encryption is applied to the entries subsequently added to the + /// ZipFile instance. Applications do not need to set the + /// Encryption property when reading or extracting a zip archive. + /// + /// + /// + /// If you set this to something other than EncryptionAlgorithm.None, you + /// will also need to set the . + /// + /// + /// + /// As with some other properties on the ZipFile class, like and , setting this + /// property on a ZipFile instance will cause the specified + /// EncryptionAlgorithm to be used on all items + /// that are subsequently added to the ZipFile instance. In other + /// words, if you set this property after you have added items to the + /// ZipFile, but before you have called Save(), those items will + /// not be encrypted or protected with a password in the resulting zip + /// archive. To get a zip archive with encrypted entries, set this property, + /// along with the property, before calling + /// AddFile, AddItem, or AddDirectory (etc.) on the + /// ZipFile instance. + /// + /// + /// + /// If you read a ZipFile, you can modify the Encryption on an + /// encrypted entry, only by setting the Encryption property on the + /// ZipEntry itself. Setting the Encryption property on the + /// ZipFile, once it has been created via a call to + /// ZipFile.Read(), does not affect entries that were previously read. + /// + /// + /// + /// For example, suppose you read a ZipFile, and there is an encrypted + /// entry. Setting the Encryption property on that ZipFile and + /// then calling Save() on the ZipFile does not update the + /// Encryption used for the entries in the archive. Neither is an + /// exception thrown. Instead, what happens during the Save() is that + /// all previously existing entries are copied through to the new zip archive, + /// with whatever encryption and password that was used when originally + /// creating the zip archive. Upon re-reading that archive, to extract + /// entries, applications should use the original password or passwords, if + /// any. + /// + /// + /// + /// Suppose an application reads a ZipFile, and there is an encrypted + /// entry. Setting the Encryption property on that ZipFile and + /// then adding new entries (via AddFile(), AddEntry(), etc) + /// and then calling Save() on the ZipFile does not update the + /// Encryption on any of the entries that had previously been in the + /// ZipFile. The Encryption property applies only to the + /// newly-added entries. + /// + /// + /// + /// + /// + /// + /// This example creates a zip archive that uses encryption, and then extracts + /// entries from the archive. When creating the zip archive, the ReadMe.txt + /// file is zipped without using a password or encryption. The other files + /// use encryption. + /// + /// + /// + /// // Create a zip archive with AES Encryption. + /// using (ZipFile zip = new ZipFile()) + /// { + /// zip.AddFile("ReadMe.txt"); + /// zip.Encryption= EncryptionAlgorithm.WinZipAes256; + /// zip.Password= "Top.Secret.No.Peeking!"; + /// zip.AddFile("7440-N49th.png"); + /// zip.AddFile("2008-Regional-Sales-Report.pdf"); + /// zip.Save("EncryptedArchive.zip"); + /// } + /// + /// // Extract a zip archive that uses AES Encryption. + /// // You do not need to specify the algorithm during extraction. + /// using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + /// { + /// zip.Password= "Top.Secret.No.Peeking!"; + /// zip.ExtractAll("extractDirectory"); + /// } + /// + /// + /// + /// ' Create a zip that uses Encryption. + /// Using zip As New ZipFile() + /// zip.Encryption= EncryptionAlgorithm.WinZipAes256 + /// zip.Password= "Top.Secret.No.Peeking!" + /// zip.AddFile("ReadMe.txt") + /// zip.AddFile("7440-N49th.png") + /// zip.AddFile("2008-Regional-Sales-Report.pdf") + /// zip.Save("EncryptedArchive.zip") + /// End Using + /// + /// ' Extract a zip archive that uses AES Encryption. + /// ' You do not need to specify the algorithm during extraction. + /// Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + /// zip.Password= "Top.Secret.No.Peeking!" + /// zip.ExtractAll("extractDirectory") + /// End Using + /// + /// + /// + /// + /// ZipFile.Password + /// ZipEntry.Encryption + public EncryptionAlgorithm Encryption + { + get + { + return _Encryption; + } + set + { + if (value == EncryptionAlgorithm.Unsupported) + throw new InvalidOperationException("You may not set Encryption to that value."); + _Encryption = value; + } + } + + + + /// + /// A callback that allows the application to specify the compression level + /// to use for entries subsequently added to the zip archive. + /// + /// + /// + /// + /// + /// With this callback, the DotNetZip library allows the application to + /// determine whether compression will be used, at the time of the + /// Save. This may be useful if the application wants to favor + /// speed over size, and wants to defer the decision until the time of + /// Save. + /// + /// + /// + /// Typically applications set the property on + /// the ZipFile or on each ZipEntry to determine the level of + /// compression used. This is done at the time the entry is added to the + /// ZipFile. Setting the property to + /// Ionic.Zlib.CompressionLevel.None means no compression will be used. + /// + /// + /// + /// This callback allows the application to defer the decision on the + /// CompressionLevel to use, until the time of the call to + /// ZipFile.Save(). The callback is invoked once per ZipEntry, + /// at the time the data for the entry is being written out as part of a + /// Save() operation. The application can use whatever criteria it + /// likes in determining the level to return. For example, an application may + /// wish that no .mp3 files should be compressed, because they are already + /// compressed and the extra compression is not worth the CPU time incurred, + /// and so can return None for all .mp3 entries. + /// + /// + /// + /// The library determines whether compression will be attempted for an entry + /// this way: If the entry is a zero length file, or a directory, no + /// compression is used. Otherwise, if this callback is set, it is invoked + /// and the CompressionLevel is set to the return value. If this + /// callback has not been set, then the previously set value for + /// CompressionLevel is used. + /// + /// + /// + public SetCompressionCallback SetCompression + { + get; + set; + } + + + /// + /// The maximum size of an output segment, when saving a split Zip file. + /// + /// + /// + /// Set this to a non-zero value before calling or to specify that the ZipFile should be saved as a + /// split archive, also sometimes called a spanned archive. Some also + /// call them multi-file archives. + /// + /// + /// + /// A split zip archive is saved in a set of discrete filesystem files, + /// rather than in a single file. This is handy when transmitting the + /// archive in email or some other mechanism that has a limit to the size of + /// each file. The first file in a split archive will be named + /// basename.z01, the second will be named basename.z02, and + /// so on. The final file is named basename.zip. According to the zip + /// specification from PKWare, the minimum value is 65536, for a 64k segment + /// size. The maximum number of segments allows in a split archive is 99. + /// + /// + /// + /// The value of this property determines the maximum size of a split + /// segment when writing a split archive. For example, suppose you have a + /// ZipFile that would save to a single file of 200k. If you set the + /// MaxOutputSegmentSize to 65536 before calling Save(), you + /// will get four distinct output files. On the other hand if you set this + /// property to 256k, then you will get a single-file archive for that + /// ZipFile. + /// + /// + /// + /// The size of each split output file will be as large as possible, up to + /// the maximum size set here. The zip specification requires that some data + /// fields in a zip archive may not span a split boundary, and an output + /// segment may be smaller than the maximum if necessary to avoid that + /// problem. Also, obviously the final segment of the archive may be smaller + /// than the maximum segment size. Segments will never be larger than the + /// value set with this property. + /// + /// + /// + /// You can save a split Zip file only when saving to a regular filesystem + /// file. It's not possible to save a split zip file as a self-extracting + /// archive, nor is it possible to save a split zip file to a stream. When + /// saving to a SFX or to a Stream, this property is ignored. + /// + /// + /// + /// About interoperability: Split or spanned zip files produced by DotNetZip + /// can be read by WinZip or PKZip, and vice-versa. Segmented zip files may + /// not be readable by other tools, if those other tools don't support zip + /// spanning or splitting. When in doubt, test. I don't believe Windows + /// Explorer can extract a split archive. + /// + /// + /// + /// This property has no effect when reading a split archive. You can read + /// a split archive in the normal way with DotNetZip. + /// + /// + /// + /// When saving a zip file, if you want a regular zip file rather than a + /// split zip file, don't set this property, or set it to Zero. + /// + /// + /// + /// If you read a split archive, with and + /// then subsequently call ZipFile.Save(), unless you set this + /// property before calling Save(), you will get a normal, + /// single-file archive. + /// + /// + /// + /// + public Int32 MaxOutputSegmentSize + { + get + { + return _maxOutputSegmentSize; + } + set + { + if (value < 65536 && value != 0) + throw new ZipException("The minimum acceptable segment size is 65536."); + _maxOutputSegmentSize = value; + } + } + + + /// + /// Returns the number of segments used in the most recent Save() operation. + /// + /// + /// + /// This is normally zero, unless you have set the property. If you have set , and then you save a file, after the call to + /// Save() completes, you can read this value to learn the number of segments that + /// were created. + /// + /// + /// If you call Save("Archive.zip"), and it creates 5 segments, then you + /// will have filesystem files named Archive.z01, Archive.z02, Archive.z03, + /// Archive.z04, and Archive.zip, and the value of this property will be 5. + /// + /// + /// + public Int32 NumberOfSegmentsForMostRecentSave + { + get + { + return unchecked((Int32)_numberOfSegmentsForMostRecentSave + 1); + } + } + + +#if !NETCF + /// + /// The size threshold for an entry, above which a parallel deflate is used. + /// + /// + /// + /// + /// + /// DotNetZip will use multiple threads to compress any ZipEntry, + /// if the entry is larger than the given size. Zero means "always + /// use parallel deflate", while -1 means "never use parallel + /// deflate". The default value for this property is 512k. Aside + /// from the special values of 0 and 1, the minimum value is 65536. + /// + /// + /// + /// If the entry size cannot be known before compression, as with a + /// read-forward stream, then Parallel deflate will never be + /// performed, unless the value of this property is zero. + /// + /// + /// + /// A parallel deflate operations will speed up the compression of + /// large files, on computers with multiple CPUs or multiple CPU + /// cores. For files above 1mb, on a dual core or dual-cpu (2p) + /// machine, the time required to compress the file can be 70% of the + /// single-threaded deflate. For very large files on 4p machines the + /// compression can be done in 30% of the normal time. The downside + /// is that parallel deflate consumes extra memory during the deflate, + /// and the deflation is not as effective. + /// + /// + /// + /// Parallel deflate tends to yield slightly less compression when + /// compared to as single-threaded deflate; this is because the original + /// data stream is split into multiple independent buffers, each of which + /// is compressed in parallel. But because they are treated + /// independently, there is no opportunity to share compression + /// dictionaries. For that reason, a deflated stream may be slightly + /// larger when compressed using parallel deflate, as compared to a + /// traditional single-threaded deflate. Sometimes the increase over the + /// normal deflate is as much as 5% of the total compressed size. For + /// larger files it can be as small as 0.1%. + /// + /// + /// + /// Multi-threaded compression does not give as much an advantage when + /// using Encryption. This is primarily because encryption tends to slow + /// down the entire pipeline. Also, multi-threaded compression gives less + /// of an advantage when using lower compression levels, for example . You may have to + /// perform some tests to determine the best approach for your situation. + /// + /// + /// + /// + /// + /// + public long ParallelDeflateThreshold + { + set + { + if ((value != 0) && (value != -1) && (value < 64 * 1024)) + throw new ArgumentOutOfRangeException("ParallelDeflateThreshold should be -1, 0, or > 65536"); + _ParallelDeflateThreshold = value; + } + get + { + return _ParallelDeflateThreshold; + } + } + + /// + /// The maximum number of buffer pairs to use when performing + /// parallel compression. + /// + /// + /// + /// + /// This property sets an upper limit on the number of memory + /// buffer pairs to create when performing parallel + /// compression. The implementation of the parallel + /// compression stream allocates multiple buffers to + /// facilitate parallel compression. As each buffer fills up, + /// the stream uses + /// ThreadPool.QueueUserWorkItem() to compress those + /// buffers in a background threadpool thread. After a buffer + /// is compressed, it is re-ordered and written to the output + /// stream. + /// + /// + /// + /// A higher number of buffer pairs enables a higher degree of + /// parallelism, which tends to increase the speed of compression on + /// multi-cpu computers. On the other hand, a higher number of buffer + /// pairs also implies a larger memory consumption, more active worker + /// threads, and a higher cpu utilization for any compression. This + /// property enables the application to limit its memory consumption and + /// CPU utilization behavior depending on requirements. + /// + /// + /// + /// For each compression "task" that occurs in parallel, there are 2 + /// buffers allocated: one for input and one for output. This property + /// sets a limit for the number of pairs. The total amount of storage + /// space allocated for buffering will then be (N*S*2), where N is the + /// number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + /// pairs per CPU core, so if your machine has 4 cores, and you retain + /// the default buffer size of 128k, then the + /// ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + /// memory in total, or 4mb, in blocks of 128kb. If you then set this + /// property to 8, then the number will be 8 * 2 * 128kb of buffer + /// memory, or 2mb. + /// + /// + /// + /// CPU utilization will also go up with additional buffers, because a + /// larger number of buffer pairs allows a larger number of background + /// threads to compress in parallel. If you find that parallel + /// compression is consuming too much memory or CPU, you can adjust this + /// value downward. + /// + /// + /// + /// The default value is 16. Different values may deliver better or + /// worse results, depending on your priorities and the dynamic + /// performance characteristics of your storage and compute resources. + /// + /// + /// + /// This property is not the number of buffer pairs to use; it is an + /// upper limit. An illustration: Suppose you have an application that + /// uses the default value of this property (which is 16), and it runs + /// on a machine with 2 CPU cores. In that case, DotNetZip will allocate + /// 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + /// limit specified by this property has no effect. + /// + /// + /// + /// The application can set this value at any time + /// before calling ZipFile.Save(). + /// + /// + /// + /// + /// + public int ParallelDeflateMaxBufferPairs + { + get + { + return _maxBufferPairs; + } + set + { + if (value < 4) + throw new ArgumentOutOfRangeException("ParallelDeflateMaxBufferPairs", + "Value must be 4 or greater."); + _maxBufferPairs = value; + } + } +#endif + + + /// Provides a string representation of the instance. + /// a string representation of the instance. + public override String ToString() + { + return String.Format("ZipFile::{0}", Name); + } + + + /// + /// Returns the version number on the DotNetZip assembly. + /// + /// + /// + /// + /// This property is exposed as a convenience. Callers could also get the + /// version value by retrieving GetName().Version on the + /// System.Reflection.Assembly object pointing to the DotNetZip + /// assembly. But sometimes it is not clear which assembly is being loaded. + /// This property makes it clear. + /// + /// + /// This static property is primarily useful for diagnostic purposes. + /// + /// + public static System.Version LibraryVersion + { + get + { + return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + } + } + + internal void NotifyEntryChanged() + { + _contentsChanged = true; + } + + + internal Stream StreamForDiskNumber(uint diskNumber) + { + if (diskNumber + 1 == this._diskNumberWithCd || + (diskNumber == 0 && this._diskNumberWithCd == 0)) + { + //return (this.ReadStream as FileStream); + return this.ReadStream; + } + return ZipSegmentedStream.ForReading(this._readName ?? this._name, + diskNumber, _diskNumberWithCd); + } + + + + // called by ZipEntry in ZipEntry.Extract(), when there is no stream set for the + // ZipEntry. + internal void Reset(bool whileSaving) + { + if (_JustSaved) + { + // read in the just-saved zip archive + using (ZipFile x = new ZipFile()) + { + // workitem 10735 + x._readName = x._name = whileSaving + ? (this._readName ?? this._name) + : this._name; + x.AlternateEncoding = this.AlternateEncoding; + x.AlternateEncodingUsage = this.AlternateEncodingUsage; + ReadIntoInstance(x); + // copy the contents of the entries. + // cannot just replace the entries - the app may be holding them + foreach (ZipEntry e1 in x) + { + foreach (ZipEntry e2 in this) + { + if (e1.FileName == e2.FileName) + { + e2.CopyMetaData(e1); + break; + } + } + } + } + _JustSaved = false; + } + } + + + #endregion + + #region Constructors + + /// + /// Creates a new ZipFile instance, using the specified filename. + /// + /// + /// + /// + /// Applications can use this constructor to create a new ZipFile for writing, + /// or to slurp in an existing zip archive for read and update purposes. + /// + /// + /// + /// To create a new zip archive, an application can call this constructor, + /// passing the name of a file that does not exist. The name may be a fully + /// qualified path. Then the application can add directories or files to the + /// ZipFile via AddDirectory(), AddFile(), AddItem() + /// and then write the zip archive to the disk by calling Save(). The + /// zip file is not actually opened and written to the disk until the + /// application calls ZipFile.Save(). At that point the new zip file + /// with the given name is created. + /// + /// + /// + /// If you won't know the name of the Zipfile until the time you call + /// ZipFile.Save(), or if you plan to save to a stream (which has no + /// name), then you should use the no-argument constructor. + /// + /// + /// + /// The application can also call this constructor to read an existing zip + /// archive. passing the name of a valid zip file that does exist. But, it's + /// better form to use the static method, + /// passing the name of the zip file, because using ZipFile.Read() in + /// your code communicates very clearly what you are doing. In either case, + /// the file is then read into the ZipFile instance. The app can then + /// enumerate the entries or can modify the zip file, for example adding + /// entries, removing entries, changing comments, and so on. + /// + /// + /// + /// One advantage to this parameterized constructor: it allows applications to + /// use the same code to add items to a zip archive, regardless of whether the + /// zip file exists. + /// + /// + /// + /// Instances of the ZipFile class are not multi-thread safe. You may + /// not party on a single instance with multiple threads. You may have + /// multiple threads that each use a distinct ZipFile instance, or you + /// can synchronize multi-thread access to a single instance. + /// + /// + /// + /// By the way, since DotNetZip is so easy to use, don't you think you should + /// donate $5 or $10? + /// + /// + /// + /// + /// + /// Thrown if name refers to an existing file that is not a valid zip file. + /// + /// + /// + /// This example shows how to create a zipfile, and add a few files into it. + /// + /// String ZipFileToCreate = "archive1.zip"; + /// String DirectoryToZip = "c:\\reports"; + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Store all files found in the top level directory, into the zip archive. + /// String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + /// zip.AddFiles(filenames, "files"); + /// zip.Save(ZipFileToCreate); + /// } + /// + /// + /// + /// Dim ZipFileToCreate As String = "archive1.zip" + /// Dim DirectoryToZip As String = "c:\reports" + /// Using zip As ZipFile = New ZipFile() + /// Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + /// zip.AddFiles(filenames, "files") + /// zip.Save(ZipFileToCreate) + /// End Using + /// + /// + /// + /// The filename to use for the new zip archive. + /// + public ZipFile(string fileName) + { + try + { + _InitInstance(fileName, null); + } + catch (Exception e1) + { + throw new ZipException(String.Format("Could not read {0} as a zip file", fileName), e1); + } + } + + + /// + /// Creates a new ZipFile instance, using the specified name for the + /// filename, and the specified Encoding. + /// + /// + /// + /// + /// See the documentation on the ZipFile + /// constructor that accepts a single string argument for basic + /// information on all the ZipFile constructors. + /// + /// + /// + /// The Encoding is used as the default alternate encoding for entries with + /// filenames or comments that cannot be encoded with the IBM437 code page. + /// This is equivalent to setting the property on the ZipFile + /// instance after construction. + /// + /// + /// + /// Instances of the ZipFile class are not multi-thread safe. You may + /// not party on a single instance with multiple threads. You may have + /// multiple threads that each use a distinct ZipFile instance, or you + /// can synchronize multi-thread access to a single instance. + /// + /// + /// + /// + /// + /// Thrown if name refers to an existing file that is not a valid zip file. + /// + /// + /// The filename to use for the new zip archive. + /// The Encoding is used as the default alternate + /// encoding for entries with filenames or comments that cannot be encoded + /// with the IBM437 code page. + public ZipFile(string fileName, System.Text.Encoding encoding) + { + try + { + AlternateEncoding = encoding; + AlternateEncodingUsage = ZipOption.Always; + _InitInstance(fileName, null); + } + catch (Exception e1) + { + throw new ZipException(String.Format("{0} is not a valid zip file", fileName), e1); + } + } + + + + /// + /// Create a zip file, without specifying a target filename or stream to save to. + /// + /// + /// + /// + /// See the documentation on the ZipFile + /// constructor that accepts a single string argument for basic + /// information on all the ZipFile constructors. + /// + /// + /// + /// After instantiating with this constructor and adding entries to the + /// archive, the application should call or + /// to save to a file or a + /// stream, respectively. The application can also set the + /// property and then call the no-argument method. (This + /// is the preferred approach for applications that use the library through + /// COM interop.) If you call the no-argument method + /// without having set the Name of the ZipFile, either through + /// the parameterized constructor or through the explicit property , the + /// Save() will throw, because there is no place to save the file. + /// + /// + /// Instances of the ZipFile class are not multi-thread safe. You may + /// have multiple threads that each use a distinct ZipFile instance, or + /// you can synchronize multi-thread access to a single instance. + /// + /// + /// + /// + /// This example creates a Zip archive called Backup.zip, containing all the files + /// in the directory DirectoryToZip. Files within subdirectories are not zipped up. + /// + /// using (ZipFile zip = new ZipFile()) + /// { + /// // Store all files found in the top level directory, into the zip archive. + /// // note: this code does not recurse subdirectories! + /// String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + /// zip.AddFiles(filenames, "files"); + /// zip.Save("Backup.zip"); + /// } + /// + /// + /// + /// Using zip As New ZipFile + /// ' Store all files found in the top level directory, into the zip archive. + /// ' note: this code does not recurse subdirectories! + /// Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + /// zip.AddFiles(filenames, "files") + /// zip.Save("Backup.zip") + /// End Using + /// + /// + public ZipFile() + { + _InitInstance(null, null); + } + + + /// + /// Create a zip file, specifying a text Encoding, but without specifying a + /// target filename or stream to save to. + /// + /// + /// + /// + /// See the documentation on the ZipFile + /// constructor that accepts a single string argument for basic + /// information on all the ZipFile constructors. + /// + /// + /// + /// + /// + /// The Encoding is used as the default alternate encoding for entries with + /// filenames or comments that cannot be encoded with the IBM437 code page. + /// + public ZipFile(System.Text.Encoding encoding) + { + AlternateEncoding = encoding; + AlternateEncodingUsage = ZipOption.Always; + _InitInstance(null, null); + } + + + /// + /// Creates a new ZipFile instance, using the specified name for the + /// filename, and the specified status message writer. + /// + /// + /// + /// + /// See the documentation on the ZipFile + /// constructor that accepts a single string argument for basic + /// information on all the ZipFile constructors. + /// + /// + /// + /// This version of the constructor allows the caller to pass in a TextWriter, + /// to which verbose messages will be written during extraction or creation of + /// the zip archive. A console application may wish to pass + /// System.Console.Out to get messages on the Console. A graphical or headless + /// application may wish to capture the messages in a different + /// TextWriter, for example, a StringWriter, and then display + /// the messages in a TextBox, or generate an audit log of ZipFile operations. + /// + /// + /// + /// To encrypt the data for the files added to the ZipFile instance, + /// set the Password property after creating the ZipFile instance. + /// + /// + /// + /// Instances of the ZipFile class are not multi-thread safe. You may + /// not party on a single instance with multiple threads. You may have + /// multiple threads that each use a distinct ZipFile instance, or you + /// can synchronize multi-thread access to a single instance. + /// + /// + /// + /// + /// + /// Thrown if name refers to an existing file that is not a valid zip file. + /// + /// + /// + /// + /// using (ZipFile zip = new ZipFile("Backup.zip", Console.Out)) + /// { + /// // Store all files found in the top level directory, into the zip archive. + /// // note: this code does not recurse subdirectories! + /// // Status messages will be written to Console.Out + /// String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + /// zip.AddFiles(filenames); + /// zip.Save(); + /// } + /// + /// + /// + /// Using zip As New ZipFile("Backup.zip", Console.Out) + /// ' Store all files found in the top level directory, into the zip archive. + /// ' note: this code does not recurse subdirectories! + /// ' Status messages will be written to Console.Out + /// Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + /// zip.AddFiles(filenames) + /// zip.Save() + /// End Using + /// + /// + /// + /// The filename to use for the new zip archive. + /// A TextWriter to use for writing + /// verbose status messages. + public ZipFile(string fileName, TextWriter statusMessageWriter) + { + try + { + _InitInstance(fileName, statusMessageWriter); + } + catch (Exception e1) + { + throw new ZipException(String.Format("{0} is not a valid zip file", fileName), e1); + } + } + + + /// + /// Creates a new ZipFile instance, using the specified name for the + /// filename, the specified status message writer, and the specified Encoding. + /// + /// + /// + /// + /// This constructor works like the ZipFile + /// constructor that accepts a single string argument. See that + /// reference for detail on what this constructor does. + /// + /// + /// + /// This version of the constructor allows the caller to pass in a + /// TextWriter, and an Encoding. The TextWriter will collect + /// verbose messages that are generated by the library during extraction or + /// creation of the zip archive. A console application may wish to pass + /// System.Console.Out to get messages on the Console. A graphical or + /// headless application may wish to capture the messages in a different + /// TextWriter, for example, a StringWriter, and then display + /// the messages in a TextBox, or generate an audit log of + /// ZipFile operations. + /// + /// + /// + /// The Encoding is used as the default alternate encoding for entries + /// with filenames or comments that cannot be encoded with the IBM437 code + /// page. This is a equivalent to setting the property on the ZipFile + /// instance after construction. + /// + /// + /// + /// To encrypt the data for the files added to the ZipFile instance, + /// set the Password property after creating the ZipFile + /// instance. + /// + /// + /// + /// Instances of the ZipFile class are not multi-thread safe. You may + /// not party on a single instance with multiple threads. You may have + /// multiple threads that each use a distinct ZipFile instance, or you + /// can synchronize multi-thread access to a single instance. + /// + /// + /// + /// + /// + /// Thrown if fileName refers to an existing file that is not a valid zip file. + /// + /// + /// The filename to use for the new zip archive. + /// A TextWriter to use for writing verbose + /// status messages. + /// + /// The Encoding is used as the default alternate encoding for entries with + /// filenames or comments that cannot be encoded with the IBM437 code page. + /// + public ZipFile(string fileName, TextWriter statusMessageWriter, + System.Text.Encoding encoding) + { + try + { + AlternateEncoding = encoding; + AlternateEncodingUsage = ZipOption.Always; + _InitInstance(fileName, statusMessageWriter); + } + catch (Exception e1) + { + throw new ZipException(String.Format("{0} is not a valid zip file", fileName), e1); + } + } + + + + + /// + /// Initialize a ZipFile instance by reading in a zip file. + /// + /// + /// + /// + /// + /// This method is primarily useful from COM Automation environments, when + /// reading or extracting zip files. In COM, it is not possible to invoke + /// parameterized constructors for a class. A COM Automation application can + /// update a zip file by using the default (no argument) + /// constructor, then calling Initialize() to read the contents + /// of an on-disk zip archive into the ZipFile instance. + /// + /// + /// + /// .NET applications are encouraged to use the ZipFile.Read() methods + /// for better clarity. + /// + /// + /// + /// the name of the existing zip file to read in. + public void Initialize(string fileName) + { + try + { + _InitInstance(fileName, null); + } + catch (Exception e1) + { + throw new ZipException(String.Format("{0} is not a valid zip file", fileName), e1); + } + } + + + + private void _initEntriesDictionary() + { + // workitem 9868 + StringComparer sc = (CaseSensitiveRetrieval) ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase; + _entries = (_entries == null) + ? new Dictionary(sc) + : new Dictionary(_entries, sc); + } + + + private void _InitInstance(string zipFileName, TextWriter statusMessageWriter) + { + // create a new zipfile + _name = zipFileName; + _StatusMessageTextWriter = statusMessageWriter; + _contentsChanged = true; + AddDirectoryWillTraverseReparsePoints = true; // workitem 8617 + CompressionLevel = Ionic.Zlib.CompressionLevel.Default; +#if !NETCF + ParallelDeflateThreshold = 512 * 1024; +#endif + // workitem 7685, 9868 + _initEntriesDictionary(); + + if (File.Exists(_name)) + { + if (FullScan) + ReadIntoInstance_Orig(this); + else + ReadIntoInstance(this); + this._fileAlreadyExists = true; + } + + return; + } + #endregion + + + + #region Indexers and Collections + + private List ZipEntriesAsList + { + get + { + if (_zipEntriesAsList == null) + _zipEntriesAsList = new List(_entries.Values); + return _zipEntriesAsList; + } + } + + /// + /// This is an integer indexer into the Zip archive. + /// + /// + /// + /// + /// This property is read-only. + /// + /// + /// + /// Internally, the ZipEntry instances that belong to the + /// ZipFile are stored in a Dictionary. When you use this + /// indexer the first time, it creates a read-only + /// List<ZipEntry> from the Dictionary.Values Collection. + /// If at any time you modify the set of entries in the ZipFile, + /// either by adding an entry, removing an entry, or renaming an + /// entry, a new List will be created, and the numeric indexes for the + /// remaining entries may be different. + /// + /// + /// + /// This means you cannot rename any ZipEntry from + /// inside an enumeration of the zip file. + /// + /// + /// + /// The index value. + /// + /// + /// + /// + /// + /// The ZipEntry within the Zip archive at the specified index. If the + /// entry does not exist in the archive, this indexer throws. + /// + /// + public ZipEntry this[int ix] + { + // workitem 6402 + get + { + return ZipEntriesAsList[ix]; + } + } + + + /// + /// This is a name-based indexer into the Zip archive. + /// + /// + /// + /// + /// This property is read-only. + /// + /// + /// + /// The property on the ZipFile + /// determines whether retrieval via this indexer is done via case-sensitive + /// comparisons. By default, retrieval is not case sensitive. This makes + /// sense on Windows, in which filesystems are not case sensitive. + /// + /// + /// + /// Regardless of case-sensitivity, it is not always the case that + /// this[value].FileName == value. In other words, the FileName + /// property of the ZipEntry retrieved with this indexer, may or may + /// not be equal to the index value. + /// + /// + /// + /// This is because DotNetZip performs a normalization of filenames passed to + /// this indexer, before attempting to retrieve the item. That normalization + /// includes: removal of a volume letter and colon, swapping backward slashes + /// for forward slashes. So, zip["dir1\\entry1.txt"].FileName == + /// "dir1/entry.txt". + /// + /// + /// + /// Directory entries in the zip file may be retrieved via this indexer only + /// with names that have a trailing slash. DotNetZip automatically appends a + /// trailing slash to the names of any directory entries added to a zip. + /// + /// + /// + /// + /// + /// This example extracts only the entries in a zip file that are .txt files. + /// + /// using (ZipFile zip = ZipFile.Read("PackedDocuments.zip")) + /// { + /// foreach (string s1 in zip.EntryFilenames) + /// { + /// if (s1.EndsWith(".txt")) + /// zip[s1].Extract("textfiles"); + /// } + /// } + /// + /// + /// Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip") + /// Dim s1 As String + /// For Each s1 In zip.EntryFilenames + /// If s1.EndsWith(".txt") Then + /// zip(s1).Extract("textfiles") + /// End If + /// Next + /// End Using + /// + /// + /// + /// + /// + /// Thrown if the caller attempts to assign a non-null value to the indexer. + /// + /// + /// + /// The name of the file, including any directory path, to retrieve from the + /// zip. The filename match is not case-sensitive by default; you can use the + /// property to change this behavior. The + /// pathname can use forward-slashes or backward slashes. + /// + /// + /// + /// The ZipEntry within the Zip archive, given by the specified + /// filename. If the named entry does not exist in the archive, this indexer + /// returns null (Nothing in VB). + /// + /// + public ZipEntry this[String fileName] + { + get + { + var key = SharedUtilities.NormalizePathForUseInZipFile(fileName); + if (_entries.ContainsKey(key)) + return _entries[key]; + // workitem 11056 + key = key.Replace("/", "\\"); + if (_entries.ContainsKey(key)) + return _entries[key]; + return null; + +#if MESSY + foreach (ZipEntry e in _entries.Values) + { + if (this.CaseSensitiveRetrieval) + { + // check for the file match with a case-sensitive comparison. + if (e.FileName == fileName) return e; + // also check for equivalence + if (fileName.Replace("\\", "/") == e.FileName) return e; + if (e.FileName.Replace("\\", "/") == fileName) return e; + + // check for a difference only in trailing slash + if (e.FileName.EndsWith("/")) + { + var fileNameNoSlash = e.FileName.Trim("/".ToCharArray()); + if (fileNameNoSlash == fileName) return e; + // also check for equivalence + if (fileName.Replace("\\", "/") == fileNameNoSlash) return e; + if (fileNameNoSlash.Replace("\\", "/") == fileName) return e; + } + + } + else + { + // check for the file match in a case-insensitive manner. + if (String.Compare(e.FileName, fileName, StringComparison.CurrentCultureIgnoreCase) == 0) return e; + // also check for equivalence + if (String.Compare(fileName.Replace("\\", "/"), e.FileName, StringComparison.CurrentCultureIgnoreCase) == 0) return e; + if (String.Compare(e.FileName.Replace("\\", "/"), fileName, StringComparison.CurrentCultureIgnoreCase) == 0) return e; + + // check for a difference only in trailing slash + if (e.FileName.EndsWith("/")) + { + var fileNameNoSlash = e.FileName.Trim("/".ToCharArray()); + + if (String.Compare(fileNameNoSlash, fileName, StringComparison.CurrentCultureIgnoreCase) == 0) return e; + // also check for equivalence + if (String.Compare(fileName.Replace("\\", "/"), fileNameNoSlash, StringComparison.CurrentCultureIgnoreCase) == 0) return e; + if (String.Compare(fileNameNoSlash.Replace("\\", "/"), fileName, StringComparison.CurrentCultureIgnoreCase) == 0) return e; + + } + + } + + } + return null; + +#endif + } + } + + + /// + /// The list of filenames for the entries contained within the zip archive. + /// + /// + /// + /// According to the ZIP specification, the names of the entries use forward + /// slashes in pathnames. If you are scanning through the list, you may have + /// to swap forward slashes for backslashes. + /// + /// + /// + /// + /// + /// This example shows one way to test if a filename is already contained + /// within a zip archive. + /// + /// String zipFileToRead= "PackedDocuments.zip"; + /// string candidate = "DatedMaterial.xps"; + /// using (ZipFile zip = new ZipFile(zipFileToRead)) + /// { + /// if (zip.EntryFilenames.Contains(candidate)) + /// Console.WriteLine("The file '{0}' exists in the zip archive '{1}'", + /// candidate, + /// zipFileName); + /// else + /// Console.WriteLine("The file, '{0}', does not exist in the zip archive '{1}'", + /// candidate, + /// zipFileName); + /// Console.WriteLine(); + /// } + /// + /// + /// Dim zipFileToRead As String = "PackedDocuments.zip" + /// Dim candidate As String = "DatedMaterial.xps" + /// Using zip As ZipFile.Read(ZipFileToRead) + /// If zip.EntryFilenames.Contains(candidate) Then + /// Console.WriteLine("The file '{0}' exists in the zip archive '{1}'", _ + /// candidate, _ + /// zipFileName) + /// Else + /// Console.WriteLine("The file, '{0}', does not exist in the zip archive '{1}'", _ + /// candidate, _ + /// zipFileName) + /// End If + /// Console.WriteLine + /// End Using + /// + /// + /// + /// + /// The list of strings for the filenames contained within the Zip archive. + /// + /// + public System.Collections.Generic.ICollection EntryFileNames + { + get + { + return _entries.Keys; + } + } + + + /// + /// Returns the readonly collection of entries in the Zip archive. + /// + /// + /// + /// + /// + /// If there are no entries in the current ZipFile, the value returned is a + /// non-null zero-element collection. If there are entries in the zip file, + /// the elements are returned in no particular order. + /// + /// + /// This is the implied enumerator on the ZipFile class. If you use a + /// ZipFile instance in a context that expects an enumerator, you will + /// get this collection. + /// + /// + /// + public System.Collections.Generic.ICollection Entries + { + get + { + return _entries.Values; + } + } + + + /// + /// Returns a readonly collection of entries in the Zip archive, sorted by FileName. + /// + /// + /// + /// If there are no entries in the current ZipFile, the value returned + /// is a non-null zero-element collection. If there are entries in the zip + /// file, the elements are returned sorted by the name of the entry. + /// + /// + /// + /// + /// This example fills a Windows Forms ListView with the entries in a zip file. + /// + /// + /// using (ZipFile zip = ZipFile.Read(zipFile)) + /// { + /// foreach (ZipEntry entry in zip.EntriesSorted) + /// { + /// ListViewItem item = new ListViewItem(n.ToString()); + /// n++; + /// string[] subitems = new string[] { + /// entry.FileName.Replace("/","\\"), + /// entry.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + /// entry.UncompressedSize.ToString(), + /// String.Format("{0,5:F0}%", entry.CompressionRatio), + /// entry.CompressedSize.ToString(), + /// (entry.UsesEncryption) ? "Y" : "N", + /// String.Format("{0:X8}", entry.Crc)}; + /// + /// foreach (String s in subitems) + /// { + /// ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(); + /// subitem.Text = s; + /// item.SubItems.Add(subitem); + /// } + /// + /// this.listView1.Items.Add(item); + /// } + /// } + /// + /// + /// + /// + public System.Collections.Generic.ICollection EntriesSorted + { + get + { + var coll = new System.Collections.Generic.List(); + foreach (var e in this.Entries) + { + coll.Add(e); + } + StringComparison sc = (CaseSensitiveRetrieval) ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase; + + coll.Sort((x, y) => { return String.Compare(x.FileName, y.FileName, sc); }); + return coll.AsReadOnly(); + } + } + + + /// + /// Returns the number of entries in the Zip archive. + /// + public int Count + { + get + { + return _entries.Count; + } + } + + + + /// + /// Removes the given ZipEntry from the zip archive. + /// + /// + /// + /// + /// After calling RemoveEntry, the application must call Save to + /// make the changes permanent. + /// + /// + /// + /// + /// Thrown if the specified ZipEntry does not exist in the ZipFile. + /// + /// + /// + /// In this example, all entries in the zip archive dating from before + /// December 31st, 2007, are removed from the archive. This is actually much + /// easier if you use the RemoveSelectedEntries method. But I needed an + /// example for RemoveEntry, so here it is. + /// + /// String ZipFileToRead = "ArchiveToModify.zip"; + /// System.DateTime Threshold = new System.DateTime(2007,12,31); + /// using (ZipFile zip = ZipFile.Read(ZipFileToRead)) + /// { + /// var EntriesToRemove = new System.Collections.Generic.List<ZipEntry>(); + /// foreach (ZipEntry e in zip) + /// { + /// if (e.LastModified < Threshold) + /// { + /// // We cannot remove the entry from the list, within the context of + /// // an enumeration of said list. + /// // So we add the doomed entry to a list to be removed later. + /// EntriesToRemove.Add(e); + /// } + /// } + /// + /// // actually remove the doomed entries. + /// foreach (ZipEntry zombie in EntriesToRemove) + /// zip.RemoveEntry(zombie); + /// + /// zip.Comment= String.Format("This zip archive was updated at {0}.", + /// System.DateTime.Now.ToString("G")); + /// + /// // save with a different name + /// zip.Save("Archive-Updated.zip"); + /// } + /// + /// + /// + /// Dim ZipFileToRead As String = "ArchiveToModify.zip" + /// Dim Threshold As New DateTime(2007, 12, 31) + /// Using zip As ZipFile = ZipFile.Read(ZipFileToRead) + /// Dim EntriesToRemove As New System.Collections.Generic.List(Of ZipEntry) + /// Dim e As ZipEntry + /// For Each e In zip + /// If (e.LastModified < Threshold) Then + /// ' We cannot remove the entry from the list, within the context of + /// ' an enumeration of said list. + /// ' So we add the doomed entry to a list to be removed later. + /// EntriesToRemove.Add(e) + /// End If + /// Next + /// + /// ' actually remove the doomed entries. + /// Dim zombie As ZipEntry + /// For Each zombie In EntriesToRemove + /// zip.RemoveEntry(zombie) + /// Next + /// zip.Comment = String.Format("This zip archive was updated at {0}.", DateTime.Now.ToString("G")) + /// 'save as a different name + /// zip.Save("Archive-Updated.zip") + /// End Using + /// + /// + /// + /// + /// The ZipEntry to remove from the zip. + /// + /// + /// + /// + public void RemoveEntry(ZipEntry entry) + { + //if (!_entries.Values.Contains(entry)) + // throw new ArgumentException("The entry you specified does not exist in the zip archive."); + if (entry == null) + throw new ArgumentNullException("entry"); + + _entries.Remove(SharedUtilities.NormalizePathForUseInZipFile(entry.FileName)); + _zipEntriesAsList = null; + +#if NOTNEEDED + if (_direntries != null) + { + bool FoundAndRemovedDirEntry = false; + foreach (ZipDirEntry de1 in _direntries) + { + if (entry.FileName == de1.FileName) + { + _direntries.Remove(de1); + FoundAndRemovedDirEntry = true; + break; + } + } + + if (!FoundAndRemovedDirEntry) + throw new BadStateException("The entry to be removed was not found in the directory."); + } +#endif + _contentsChanged = true; + } + + + + + /// + /// Removes the ZipEntry with the given filename from the zip archive. + /// + /// + /// + /// + /// After calling RemoveEntry, the application must call Save to + /// make the changes permanent. + /// + /// + /// + /// + /// + /// Thrown if the ZipFile is not updatable. + /// + /// + /// + /// Thrown if a ZipEntry with the specified filename does not exist in + /// the ZipFile. + /// + /// + /// + /// + /// This example shows one way to remove an entry with a given filename from + /// an existing zip archive. + /// + /// + /// String zipFileToRead= "PackedDocuments.zip"; + /// string candidate = "DatedMaterial.xps"; + /// using (ZipFile zip = ZipFile.Read(zipFileToRead)) + /// { + /// if (zip.EntryFilenames.Contains(candidate)) + /// { + /// zip.RemoveEntry(candidate); + /// zip.Comment= String.Format("The file '{0}' has been removed from this archive.", + /// Candidate); + /// zip.Save(); + /// } + /// } + /// + /// + /// Dim zipFileToRead As String = "PackedDocuments.zip" + /// Dim candidate As String = "DatedMaterial.xps" + /// Using zip As ZipFile = ZipFile.Read(zipFileToRead) + /// If zip.EntryFilenames.Contains(candidate) Then + /// zip.RemoveEntry(candidate) + /// zip.Comment = String.Format("The file '{0}' has been removed from this archive.", Candidate) + /// zip.Save + /// End If + /// End Using + /// + /// + /// + /// + /// The name of the file, including any directory path, to remove from the zip. + /// The filename match is not case-sensitive by default; you can use the + /// CaseSensitiveRetrieval property to change this behavior. The + /// pathname can use forward-slashes or backward slashes. + /// + /// + public void RemoveEntry(String fileName) + { + string modifiedName = ZipEntry.NameInArchive(fileName, null); + ZipEntry e = this[modifiedName]; + if (e == null) + throw new ArgumentException("The entry you specified was not found in the zip archive."); + + RemoveEntry(e); + } + + + #endregion + + #region Destructors and Disposers + + // /// + // /// This is the class Destructor, which gets called implicitly when the instance + // /// is destroyed. Because the ZipFile type implements IDisposable, this + // /// method calls Dispose(false). + // /// + // ~ZipFile() + // { + // // call Dispose with false. Since we're in the + // // destructor call, the managed resources will be + // // disposed of anyways. + // Dispose(false); + // } + + /// + /// Closes the read and write streams associated + /// to the ZipFile, if necessary. + /// + /// + /// + /// The Dispose() method is generally employed implicitly, via a using(..) {..} + /// statement. (Using...End Using in VB) If you do not employ a using + /// statement, insure that your application calls Dispose() explicitly. For + /// example, in a Powershell application, or an application that uses the COM + /// interop interface, you must call Dispose() explicitly. + /// + /// + /// + /// This example extracts an entry selected by name, from the Zip file to the + /// Console. + /// + /// using (ZipFile zip = ZipFile.Read(zipfile)) + /// { + /// foreach (ZipEntry e in zip) + /// { + /// if (WantThisEntry(e.FileName)) + /// zip.Extract(e.FileName, Console.OpenStandardOutput()); + /// } + /// } // Dispose() is called implicitly here. + /// + /// + /// + /// Using zip As ZipFile = ZipFile.Read(zipfile) + /// Dim e As ZipEntry + /// For Each e In zip + /// If WantThisEntry(e.FileName) Then + /// zip.Extract(e.FileName, Console.OpenStandardOutput()) + /// End If + /// Next + /// End Using ' Dispose is implicity called here + /// + /// + public void Dispose() + { + // dispose of the managed and unmanaged resources + Dispose(true); + + // tell the GC that the Finalize process no longer needs + // to be run for this object. + GC.SuppressFinalize(this); + } + + /// + /// Disposes any managed resources, if the flag is set, then marks the + /// instance disposed. This method is typically not called explicitly from + /// application code. + /// + /// + /// + /// Applications should call the no-arg Dispose method. + /// + /// + /// + /// indicates whether the method should dispose streams or not. + /// + protected virtual void Dispose(bool disposeManagedResources) + { + if (!this._disposed) + { + if (disposeManagedResources) + { + // dispose managed resources + if (_ReadStreamIsOurs) + { + if (_readstream != null) + { + // workitem 7704 +#if NETCF + _readstream.Close(); +#else + _readstream.Dispose(); +#endif + _readstream = null; + } + } + // only dispose the writestream if there is a backing file + if ((_temporaryFileName != null) && (_name != null)) + if (_writestream != null) + { + // workitem 7704 +#if NETCF + _writestream.Close(); +#else + _writestream.Dispose(); +#endif + _writestream = null; + } + +#if !NETCF + // workitem 10030 + if (this.ParallelDeflater != null) + { + this.ParallelDeflater.Dispose(); + this.ParallelDeflater = null; + } +#endif + } + this._disposed = true; + } + } + #endregion + + + #region private properties + + internal Stream ReadStream + { + get + { + if (_readstream == null) + { + if (_readName != null || _name !=null) + { + _readstream = File.Open(_readName ?? _name, + FileMode.Open, + FileAccess.Read, + FileShare.Read | FileShare.Write); + _ReadStreamIsOurs = true; + } + } + return _readstream; + } + } + + + + private Stream WriteStream + { + // workitem 9763 + get + { + if (_writestream != null) return _writestream; + if (_name == null) return _writestream; + + if (_maxOutputSegmentSize != 0) + { + _writestream = ZipSegmentedStream.ForWriting(this._name, _maxOutputSegmentSize); + return _writestream; + } + + SharedUtilities.CreateAndOpenUniqueTempFile(TempFileFolder ?? Path.GetDirectoryName(_name), + out _writestream, + out _temporaryFileName); + return _writestream; + } + set + { + if (value != null) + throw new ZipException("Cannot set the stream to a non-null value."); + _writestream = null; + } + } + #endregion + + #region private fields + private TextWriter _StatusMessageTextWriter; + private bool _CaseSensitiveRetrieval; + private Stream _readstream; + private Stream _writestream; + private UInt16 _versionMadeBy; + private UInt16 _versionNeededToExtract; + private UInt32 _diskNumberWithCd; + private Int32 _maxOutputSegmentSize; + private UInt32 _numberOfSegmentsForMostRecentSave; + private ZipErrorAction _zipErrorAction; + private bool _disposed; + //private System.Collections.Generic.List _entries; + private System.Collections.Generic.Dictionary _entries; + private List _zipEntriesAsList; + private string _name; + private string _readName; + private string _Comment; + internal string _Password; + private bool _emitNtfsTimes = true; + private bool _emitUnixTimes; + private Ionic.Zlib.CompressionStrategy _Strategy = Ionic.Zlib.CompressionStrategy.Default; + private Ionic.Zip.CompressionMethod _compressionMethod = Ionic.Zip.CompressionMethod.Deflate; + private bool _fileAlreadyExists; + private string _temporaryFileName; + private bool _contentsChanged; + private bool _hasBeenSaved; + private String _TempFileFolder; + private bool _ReadStreamIsOurs = true; + private object LOCK = new object(); + private bool _saveOperationCanceled; + private bool _extractOperationCanceled; + private bool _addOperationCanceled; + private EncryptionAlgorithm _Encryption; + private bool _JustSaved; + private long _locEndOfCDS = -1; + private uint _OffsetOfCentralDirectory; + private Int64 _OffsetOfCentralDirectory64; + private Nullable _OutputUsesZip64; + internal bool _inExtractAll; + private System.Text.Encoding _alternateEncoding = System.Text.Encoding.GetEncoding("IBM437"); // UTF-8 + private ZipOption _alternateEncodingUsage = ZipOption.Never; + private static System.Text.Encoding _defaultEncoding = System.Text.Encoding.GetEncoding("IBM437"); + + private int _BufferSize = BufferSizeDefault; + +#if !NETCF + internal Ionic.Zlib.ParallelDeflateOutputStream ParallelDeflater; + private long _ParallelDeflateThreshold; + private int _maxBufferPairs = 16; +#endif + + internal Zip64Option _zip64 = Zip64Option.Default; +#pragma warning disable 649 + private bool _SavingSfx; +#pragma warning restore 649 + + /// + /// Default size of the buffer used for IO. + /// + public static readonly int BufferSizeDefault = 32768; + + #endregion + } + + /// + /// Options for using ZIP64 extensions when saving zip archives. + /// + /// + /// + /// + /// + /// Designed many years ago, the original zip + /// specification from PKWARE allowed for 32-bit quantities for the + /// compressed and uncompressed sizes of zip entries, as well as a 32-bit quantity + /// for specifying the length of the zip archive itself, and a maximum of 65535 + /// entries. These limits are now regularly exceeded in many backup and archival + /// scenarios. Recently, PKWare added extensions to the original zip spec, called + /// "ZIP64 extensions", to raise those limitations. This property governs whether + /// DotNetZip will use those extensions when writing zip archives. The use of + /// these extensions is optional and explicit in DotNetZip because, despite the + /// status of ZIP64 as a bona fide standard, many other zip tools and libraries do + /// not support ZIP64, and therefore a zip file with ZIP64 extensions may be + /// unreadable by some of those other tools. + /// + /// + /// + /// Set this property to to always use ZIP64 + /// extensions when saving, regardless of whether your zip archive needs it. + /// Suppose you add 5 files, each under 100k, to a ZipFile. If you specify Always + /// for this flag, you will get a ZIP64 archive, though the archive does not need + /// to use ZIP64 because none of the original zip limits had been exceeded. + /// + /// + /// + /// Set this property to to tell the DotNetZip + /// library to never use ZIP64 extensions. This is useful for maximum + /// compatibility and interoperability, at the expense of the capability of + /// handling large files or large archives. NB: Windows Explorer in Windows XP + /// and Windows Vista cannot currently extract files from a zip64 archive, so if + /// you want to guarantee that a zip archive produced by this library will work in + /// Windows Explorer, use Never. If you set this property to , and your application creates a zip that would + /// exceed one of the Zip limits, the library will throw an exception while saving + /// the zip file. + /// + /// + /// + /// Set this property to to tell the + /// DotNetZip library to use the ZIP64 extensions when required by the + /// entry. After the file is compressed, the original and compressed sizes are + /// checked, and if they exceed the limits described above, then zip64 can be + /// used. That is the general idea, but there is an additional wrinkle when saving + /// to a non-seekable device, like the ASP.NET Response.OutputStream, or + /// Console.Out. When using non-seekable streams for output, the entry + /// header - which indicates whether zip64 is in use - is emitted before it is + /// known if zip64 is necessary. It is only after all entries have been saved + /// that it can be known if ZIP64 will be required. On seekable output streams, + /// after saving all entries, the library can seek backward and re-emit the zip + /// file header to be consistent with the actual ZIP64 requirement. But using a + /// non-seekable output stream, the library cannot seek backward, so the header + /// can never be changed. In other words, the archive's use of ZIP64 extensions is + /// not alterable after the header is emitted. Therefore, when saving to + /// non-seekable streams, using is the same + /// as using : it will always produce a zip + /// archive that uses ZIP64 extensions. + /// + /// + /// + public enum Zip64Option + { + /// + /// The default behavior, which is "Never". + /// (For COM clients, this is a 0 (zero).) + /// + Default = 0, + /// + /// Do not use ZIP64 extensions when writing zip archives. + /// (For COM clients, this is a 0 (zero).) + /// + Never = 0, + /// + /// Use ZIP64 extensions when writing zip archives, as necessary. + /// For example, when a single entry exceeds 0xFFFFFFFF in size, or when the archive as a whole + /// exceeds 0xFFFFFFFF in size, or when there are more than 65535 entries in an archive. + /// (For COM clients, this is a 1.) + /// + AsNecessary = 1, + /// + /// Always use ZIP64 extensions when writing zip archives, even when unnecessary. + /// (For COM clients, this is a 2.) + /// + Always + } + + + /// + /// An enum representing the values on a three-way toggle switch + /// for various options in the library. This might be used to + /// specify whether to employ a particular text encoding, or to use + /// ZIP64 extensions, or some other option. + /// + public enum ZipOption + { + /// + /// The default behavior. This is the same as "Never". + /// (For COM clients, this is a 0 (zero).) + /// + Default = 0, + /// + /// Never use the associated option. + /// (For COM clients, this is a 0 (zero).) + /// + Never = 0, + /// + /// Use the associated behavior "as necessary." + /// (For COM clients, this is a 1.) + /// + AsNecessary = 1, + /// + /// Use the associated behavior Always, whether necessary or not. + /// (For COM clients, this is a 2.) + /// + Always + } + + + enum AddOrUpdateAction + { + AddOnly = 0, + AddOrUpdate + } + +} + + + +// ================================================================== +// +// Information on the ZIP format: +// +// From +// http://www.pkware.com/documents/casestudies/APPNOTE.TXT +// +// Overall .ZIP file format: +// +// [local file header 1] +// [file data 1] +// [data descriptor 1] ** sometimes +// . +// . +// . +// [local file header n] +// [file data n] +// [data descriptor n] ** sometimes +// [archive decryption header] +// [archive extra data record] +// [central directory] +// [zip64 end of central directory record] +// [zip64 end of central directory locator] +// [end of central directory record] +// +// Local File Header format: +// local file header signature ... 4 bytes (0x04034b50) +// version needed to extract ..... 2 bytes +// general purpose bit field ..... 2 bytes +// compression method ............ 2 bytes +// last mod file time ............ 2 bytes +// last mod file date............. 2 bytes +// crc-32 ........................ 4 bytes +// compressed size................ 4 bytes +// uncompressed size.............. 4 bytes +// file name length............... 2 bytes +// extra field length ............ 2 bytes +// file name varies +// extra field varies +// +// +// Data descriptor: (used only when bit 3 of the general purpose bitfield is set) +// (although, I have found zip files where bit 3 is not set, yet this descriptor is present!) +// local file header signature 4 bytes (0x08074b50) ** sometimes!!! Not always +// crc-32 4 bytes +// compressed size 4 bytes +// uncompressed size 4 bytes +// +// +// Central directory structure: +// +// [file header 1] +// . +// . +// . +// [file header n] +// [digital signature] +// +// +// File header: (This is a ZipDirEntry) +// central file header signature 4 bytes (0x02014b50) +// version made by 2 bytes +// version needed to extract 2 bytes +// general purpose bit flag 2 bytes +// compression method 2 bytes +// last mod file time 2 bytes +// last mod file date 2 bytes +// crc-32 4 bytes +// compressed size 4 bytes +// uncompressed size 4 bytes +// file name length 2 bytes +// extra field length 2 bytes +// file comment length 2 bytes +// disk number start 2 bytes +// internal file attributes ** 2 bytes +// external file attributes *** 4 bytes +// relative offset of local header 4 bytes +// file name (variable size) +// extra field (variable size) +// file comment (variable size) +// +// ** The internal file attributes, near as I can tell, +// uses 0x01 for a file and a 0x00 for a directory. +// +// ***The external file attributes follows the MS-DOS file attribute byte, described here: +// at http://support.microsoft.com/kb/q125019/ +// 0x0010 => directory +// 0x0020 => file +// +// +// End of central directory record: +// +// end of central dir signature 4 bytes (0x06054b50) +// number of this disk 2 bytes +// number of the disk with the +// start of the central directory 2 bytes +// total number of entries in the +// central directory on this disk 2 bytes +// total number of entries in +// the central directory 2 bytes +// size of the central directory 4 bytes +// offset of start of central +// directory with respect to +// the starting disk number 4 bytes +// .ZIP file comment length 2 bytes +// .ZIP file comment (variable size) +// +// date and time are packed values, as MSDOS did them +// time: bits 0-4 : seconds (divided by 2) +// 5-10: minute +// 11-15: hour +// date bits 0-4 : day +// 5-8: month +// 9-15 year (since 1980) +// +// see http://msdn.microsoft.com/en-us/library/ms724274(VS.85).aspx + diff --git a/dotNetZip/Zip/ZipFile.x-IEnumerable.cs b/dotNetZip/Zip/ZipFile.x-IEnumerable.cs new file mode 100644 index 0000000..b6cd816 --- /dev/null +++ b/dotNetZip/Zip/ZipFile.x-IEnumerable.cs @@ -0,0 +1,154 @@ +// ZipFile.x-IEnumerable.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2006, 2007, 2008, 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-December-26 15:13:26> +// +// ------------------------------------------------------------------ +// +// This module defines smoe methods for IEnumerable support. It is +// particularly important for COM to have these things in a separate module. +// +// ------------------------------------------------------------------ + + +namespace Ionic.Zip +{ + + // For some weird reason, the method with the DispId(-4) attribute, which is used as + // the _NewEnum() method, and which is required to get enumeration to work from COM + // environments like VBScript and Javascript (etc) must be the LAST MEMBER in the + // source. In the event of Partial classes, it needs to be the last member defined + // in the last source module. The source modules are ordered alphabetically by + // filename. Not sure why this is true. In any case, we put the enumeration stuff + // here in this oddly-named module, for this reason. + // + + + + public partial class ZipFile + { + + + + + /// + /// Generic IEnumerator support, for use of a ZipFile in an enumeration. + /// + /// + /// + /// You probably do not want to call GetEnumerator explicitly. Instead + /// it is implicitly called when you use a loop in C#, or a + /// For Each loop in VB.NET. + /// + /// + /// + /// This example reads a zipfile of a given name, then enumerates the + /// entries in that zip file, and displays the information about each + /// entry on the Console. + /// + /// using (ZipFile zip = ZipFile.Read(zipfile)) + /// { + /// bool header = true; + /// foreach (ZipEntry e in zip) + /// { + /// if (header) + /// { + /// System.Console.WriteLine("Zipfile: {0}", zip.Name); + /// System.Console.WriteLine("Version Needed: 0x{0:X2}", e.VersionNeeded); + /// System.Console.WriteLine("BitField: 0x{0:X2}", e.BitField); + /// System.Console.WriteLine("Compression Method: 0x{0:X2}", e.CompressionMethod); + /// System.Console.WriteLine("\n{1,-22} {2,-6} {3,4} {4,-8} {0}", + /// "Filename", "Modified", "Size", "Ratio", "Packed"); + /// System.Console.WriteLine(new System.String('-', 72)); + /// header = false; + /// } + /// + /// System.Console.WriteLine("{1,-22} {2,-6} {3,4:F0}% {4,-8} {0}", + /// e.FileName, + /// e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + /// e.UncompressedSize, + /// e.CompressionRatio, + /// e.CompressedSize); + /// + /// e.Extract(); + /// } + /// } + /// + /// + /// + /// Dim ZipFileToExtract As String = "c:\foo.zip" + /// Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) + /// Dim header As Boolean = True + /// Dim e As ZipEntry + /// For Each e In zip + /// If header Then + /// Console.WriteLine("Zipfile: {0}", zip.Name) + /// Console.WriteLine("Version Needed: 0x{0:X2}", e.VersionNeeded) + /// Console.WriteLine("BitField: 0x{0:X2}", e.BitField) + /// Console.WriteLine("Compression Method: 0x{0:X2}", e.CompressionMethod) + /// Console.WriteLine(ChrW(10) & "{1,-22} {2,-6} {3,4} {4,-8} {0}", _ + /// "Filename", "Modified", "Size", "Ratio", "Packed" ) + /// Console.WriteLine(New String("-"c, 72)) + /// header = False + /// End If + /// Console.WriteLine("{1,-22} {2,-6} {3,4:F0}% {4,-8} {0}", _ + /// e.FileName, _ + /// e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), _ + /// e.UncompressedSize, _ + /// e.CompressionRatio, _ + /// e.CompressedSize ) + /// e.Extract + /// Next + /// End Using + /// + /// + /// + /// A generic enumerator suitable for use within a foreach loop. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + foreach (ZipEntry e in _entries.Values) + yield return e; + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + + /// + /// An IEnumerator, for use of a ZipFile in a foreach construct. + /// + /// + /// + /// This method is included for COM support. An application generally does not call + /// this method directly. It is called implicitly by COM clients when enumerating + /// the entries in the ZipFile instance. In VBScript, this is done with a For Each + /// statement. In Javascript, this is done with new Enumerator(zipfile). + /// + /// + /// + /// The IEnumerator over the entries in the ZipFile. + /// + [System.Runtime.InteropServices.DispId(-4)] + public System.Collections.IEnumerator GetNewEnum() // the name of this method is not significant + { + return GetEnumerator(); + } + + } +} diff --git a/dotNetZip/Zip/ZipInputStream.cs b/dotNetZip/Zip/ZipInputStream.cs new file mode 100644 index 0000000..25622f6 --- /dev/null +++ b/dotNetZip/Zip/ZipInputStream.cs @@ -0,0 +1,827 @@ +// ZipInputStream.cs +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2010 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-31 14:48:30> +// +// ------------------------------------------------------------------ +// +// This module defines the ZipInputStream class, which is a stream metaphor for +// reading zip files. This class does not depend on Ionic.Zip.ZipFile, but rather +// stands alongside it as an alternative "container" for ZipEntry, when reading zips. +// +// It adds one interesting method to the normal "stream" interface: GetNextEntry. +// +// ------------------------------------------------------------------ +// + +using System; +using System.Threading; +using System.Collections.Generic; +using System.IO; +using Ionic.Zip; + +namespace Ionic.Zip +{ + /// + /// Provides a stream metaphor for reading zip files. + /// + /// + /// + /// + /// This class provides an alternative programming model for reading zip files to + /// the one enabled by the class. Use this when reading zip + /// files, as an alternative to the class, when you would + /// like to use a Stream class to read the file. + /// + /// + /// + /// Some application designs require a readable stream for input. This stream can + /// be used to read a zip file, and extract entries. + /// + /// + /// + /// Both the ZipInputStream class and the ZipFile class can be used + /// to read and extract zip files. Both of them support many of the common zip + /// features, including Unicode, different compression levels, and ZIP64. The + /// programming models differ. For example, when extracting entries via calls to + /// the GetNextEntry() and Read() methods on the + /// ZipInputStream class, the caller is responsible for creating the file, + /// writing the bytes into the file, setting the attributes on the file, and + /// setting the created, last modified, and last accessed timestamps on the + /// file. All of these things are done automatically by a call to ZipEntry.Extract(). For this reason, the + /// ZipInputStream is generally recommended for when your application wants + /// to extract the data, without storing that data into a file. + /// + /// + /// + /// Aside from the obvious differences in programming model, there are some + /// differences in capability between the ZipFile class and the + /// ZipInputStream class. + /// + /// + /// + /// + /// ZipFile can be used to create or update zip files, or read and + /// extract zip files. ZipInputStream can be used only to read and + /// extract zip files. If you want to use a stream to create zip files, check + /// out the . + /// + /// + /// + /// ZipInputStream cannot read segmented or spanned + /// zip files. + /// + /// + /// + /// ZipInputStream will not read Zip file comments. + /// + /// + /// + /// When reading larger files, ZipInputStream will always underperform + /// ZipFile. This is because the ZipInputStream does a full scan on the + /// zip file, while the ZipFile class reads the central directory of the + /// zip file. + /// + /// + /// + /// + /// + public class ZipInputStream : Stream + { + /// + /// Create a ZipInputStream, wrapping it around an existing stream. + /// + /// + /// + /// + /// + /// While the class is generally easier + /// to use, this class provides an alternative to those + /// applications that want to read from a zipfile directly, + /// using a . + /// + /// + /// + /// Both the ZipInputStream class and the ZipFile class can be used + /// to read and extract zip files. Both of them support many of the common zip + /// features, including Unicode, different compression levels, and ZIP64. The + /// programming models differ. For example, when extracting entries via calls to + /// the GetNextEntry() and Read() methods on the + /// ZipInputStream class, the caller is responsible for creating the file, + /// writing the bytes into the file, setting the attributes on the file, and + /// setting the created, last modified, and last accessed timestamps on the + /// file. All of these things are done automatically by a call to ZipEntry.Extract(). For this reason, the + /// ZipInputStream is generally recommended for when your application wants + /// to extract the data, without storing that data into a file. + /// + /// + /// + /// Aside from the obvious differences in programming model, there are some + /// differences in capability between the ZipFile class and the + /// ZipInputStream class. + /// + /// + /// + /// + /// ZipFile can be used to create or update zip files, or read and extract + /// zip files. ZipInputStream can be used only to read and extract zip + /// files. If you want to use a stream to create zip files, check out the . + /// + /// + /// + /// ZipInputStream cannot read segmented or spanned + /// zip files. + /// + /// + /// + /// ZipInputStream will not read Zip file comments. + /// + /// + /// + /// When reading larger files, ZipInputStream will always underperform + /// ZipFile. This is because the ZipInputStream does a full scan on the + /// zip file, while the ZipFile class reads the central directory of the + /// zip file. + /// + /// + /// + /// + /// + /// + /// + /// The stream to read. It must be readable. This stream will be closed at + /// the time the ZipInputStream is closed. + /// + /// + /// + /// + /// This example shows how to read a zip file, and extract entries, using the + /// ZipInputStream class. + /// + /// + /// private void Unzip() + /// { + /// byte[] buffer= new byte[2048]; + /// int n; + /// using (var raw = File.Open(inputFileName, FileMode.Open, FileAccess.Read)) + /// { + /// using (var input= new ZipInputStream(raw)) + /// { + /// ZipEntry e; + /// while (( e = input.GetNextEntry()) != null) + /// { + /// if (e.IsDirectory) continue; + /// string outputPath = Path.Combine(extractDir, e.FileName); + /// using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) + /// { + /// while ((n= input.Read(buffer, 0, buffer.Length)) > 0) + /// { + /// output.Write(buffer,0,n); + /// } + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Private Sub UnZip() + /// Dim inputFileName As String = "MyArchive.zip" + /// Dim extractDir As String = "extract" + /// Dim buffer As Byte() = New Byte(2048) {} + /// Using raw As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read) + /// Using input As ZipInputStream = New ZipInputStream(raw) + /// Dim e As ZipEntry + /// Do While (Not e = input.GetNextEntry Is Nothing) + /// If Not e.IsDirectory Then + /// Using output As FileStream = File.Open(Path.Combine(extractDir, e.FileName), _ + /// FileMode.Create, FileAccess.ReadWrite) + /// Dim n As Integer + /// Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + /// output.Write(buffer, 0, n) + /// Loop + /// End Using + /// End If + /// Loop + /// End Using + /// End Using + /// End Sub + /// + /// + public ZipInputStream(Stream stream) : this (stream, false) { } + + + + /// + /// Create a ZipInputStream, given the name of an existing zip file. + /// + /// + /// + /// + /// + /// This constructor opens a FileStream for the given zipfile, and + /// wraps a ZipInputStream around that. See the documentation for the + /// constructor for full details. + /// + /// + /// + /// While the class is generally easier + /// to use, this class provides an alternative to those + /// applications that want to read from a zipfile directly, + /// using a . + /// + /// + /// + /// + /// + /// The name of the filesystem file to read. + /// + /// + /// + /// + /// This example shows how to read a zip file, and extract entries, using the + /// ZipInputStream class. + /// + /// + /// private void Unzip() + /// { + /// byte[] buffer= new byte[2048]; + /// int n; + /// using (var input= new ZipInputStream(inputFileName)) + /// { + /// ZipEntry e; + /// while (( e = input.GetNextEntry()) != null) + /// { + /// if (e.IsDirectory) continue; + /// string outputPath = Path.Combine(extractDir, e.FileName); + /// using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) + /// { + /// while ((n= input.Read(buffer, 0, buffer.Length)) > 0) + /// { + /// output.Write(buffer,0,n); + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Private Sub UnZip() + /// Dim inputFileName As String = "MyArchive.zip" + /// Dim extractDir As String = "extract" + /// Dim buffer As Byte() = New Byte(2048) {} + /// Using input As ZipInputStream = New ZipInputStream(inputFileName) + /// Dim e As ZipEntry + /// Do While (Not e = input.GetNextEntry Is Nothing) + /// If Not e.IsDirectory Then + /// Using output As FileStream = File.Open(Path.Combine(extractDir, e.FileName), _ + /// FileMode.Create, FileAccess.ReadWrite) + /// Dim n As Integer + /// Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + /// output.Write(buffer, 0, n) + /// Loop + /// End Using + /// End If + /// Loop + /// End Using + /// End Sub + /// + /// + public ZipInputStream(String fileName) + { + Stream stream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read ); + _Init(stream, false, fileName); + } + + + /// + /// Create a ZipInputStream, explicitly specifying whether to + /// keep the underlying stream open. + /// + /// + /// + /// See the documentation for the ZipInputStream(Stream) + /// constructor for a discussion of the class, and an example of how to use the class. + /// + /// + /// + /// The stream to read from. It must be readable. + /// + /// + /// + /// true if the application would like the stream + /// to remain open after the ZipInputStream has been closed. + /// + public ZipInputStream(Stream stream, bool leaveOpen) + { + _Init(stream, leaveOpen, null); + } + + private void _Init(Stream stream, bool leaveOpen, string name) + { + _inputStream = stream; + if (!_inputStream.CanRead) + throw new ZipException("The stream must be readable."); + _container= new ZipContainer(this); + _provisionalAlternateEncoding = System.Text.Encoding.GetEncoding("IBM437"); + _leaveUnderlyingStreamOpen = leaveOpen; + _findRequired= true; + _name = name ?? "(stream)"; + } + + + /// Provides a string representation of the instance. + /// + /// + /// This can be useful for debugging purposes. + /// + /// + /// a string representation of the instance. + public override String ToString() + { + return String.Format ("ZipInputStream::{0}(leaveOpen({1})))", _name, _leaveUnderlyingStreamOpen); + } + + + /// + /// The text encoding to use when reading entries into the zip archive, for + /// those entries whose filenames or comments cannot be encoded with the + /// default (IBM437) encoding. + /// + /// + /// + /// + /// In its + /// zip specification, PKWare describes two options for encoding + /// filenames and comments: using IBM437 or UTF-8. But, some archiving tools + /// or libraries do not follow the specification, and instead encode + /// characters using the system default code page. For example, WinRAR when + /// run on a machine in Shanghai may encode filenames with the Big-5 Chinese + /// (950) code page. This behavior is contrary to the Zip specification, but + /// it occurs anyway. + /// + /// + /// + /// When using DotNetZip to read zip archives that use something other than + /// UTF-8 or IBM437, set this property to specify the code page to use when + /// reading encoded filenames and comments for each ZipEntry in the zip + /// file. + /// + /// + /// + /// This property is "provisional". When the entry in the zip archive is not + /// explicitly marked as using UTF-8, then IBM437 is used to decode filenames + /// and comments. If a loss of data would result from using IBM436 - + /// specifically when encoding and decoding is not reflexive - the codepage + /// specified here is used. It is possible, therefore, to have a given entry + /// with a Comment encoded in IBM437 and a FileName encoded with + /// the specified "provisional" codepage. + /// + /// + /// + /// When a zip file uses an arbitrary, non-UTF8 code page for encoding, there + /// is no standard way for the reader application - whether DotNetZip, WinZip, + /// WinRar, or something else - to know which codepage has been used for the + /// entries. Readers of zip files are not able to inspect the zip file and + /// determine the codepage that was used for the entries contained within it. + /// It is left to the application or user to determine the necessary codepage + /// when reading zip files encoded this way. If you use an incorrect codepage + /// when reading a zipfile, you will get entries with filenames that are + /// incorrect, and the incorrect filenames may even contain characters that + /// are not legal for use within filenames in Windows. Extracting entries with + /// illegal characters in the filenames will lead to exceptions. It's too bad, + /// but this is just the way things are with code pages in zip files. Caveat + /// Emptor. + /// + /// + /// + public System.Text.Encoding ProvisionalAlternateEncoding + { + get + { + return _provisionalAlternateEncoding; + } + set + { + _provisionalAlternateEncoding = value; + } + } + + + /// + /// Size of the work buffer to use for the ZLIB codec during decompression. + /// + /// + /// + /// Setting this affects the performance and memory efficiency of compression + /// and decompression. For larger files, setting this to a larger size may + /// improve performance, but the exact numbers vary depending on available + /// memory, and a bunch of other variables. I don't have good firm + /// recommendations on how to set it. You'll have to test it yourself. Or + /// just leave it alone and accept the default. + /// + public int CodecBufferSize + { + get; + set; + } + + + /// + /// Sets the password to be used on the ZipInputStream instance. + /// + /// + /// + /// + /// + /// When reading a zip archive, this password is used to read and decrypt the + /// entries that are encrypted within the zip file. When entries within a zip + /// file use different passwords, set the appropriate password for the entry + /// before the first call to Read() for each entry. + /// + /// + /// + /// When reading an entry that is not encrypted, the value of this property is + /// ignored. + /// + /// + /// + /// + /// + /// + /// This example uses the ZipInputStream to read and extract entries from a + /// zip file, using a potentially different password for each entry. + /// + /// + /// byte[] buffer= new byte[2048]; + /// int n; + /// using (var raw = File.Open(_inputFileName, FileMode.Open, FileAccess.Read )) + /// { + /// using (var input= new ZipInputStream(raw)) + /// { + /// ZipEntry e; + /// while (( e = input.GetNextEntry()) != null) + /// { + /// input.Password = PasswordForEntry(e.FileName); + /// if (e.IsDirectory) continue; + /// string outputPath = Path.Combine(_extractDir, e.FileName); + /// using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) + /// { + /// while ((n= input.Read(buffer,0,buffer.Length)) > 0) + /// { + /// output.Write(buffer,0,n); + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + public String Password + { + set + { + if (_closed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + _Password = value; + } + } + + + private void SetupStream() + { + // Seek to the correct posn in the file, and open a + // stream that can be read. + _crcStream= _currentEntry.InternalOpenReader(_Password); + _LeftToRead = _crcStream.Length; + _needSetup = false; + } + + + + internal Stream ReadStream + { + get + { + return _inputStream; + } + } + + + /// + /// Read the data from the stream into the buffer. + /// + /// + /// + /// + /// The data for the zipentry will be decrypted and uncompressed, as + /// necessary, before being copied into the buffer. + /// + /// + /// + /// You must set the property before calling + /// Read() the first time for an encrypted entry. To determine if an + /// entry is encrypted and requires a password, check the ZipEntry.Encryption property. + /// + /// + /// + /// The buffer to hold the data read from the stream. + /// the offset within the buffer to copy the first byte read. + /// the number of bytes to read. + /// the number of bytes read, after decryption and decompression. + public override int Read(byte[] buffer, int offset, int count) + { + if (_closed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + + if (_needSetup) + SetupStream(); + + if (_LeftToRead == 0) return 0; + + int len = (_LeftToRead > count) ? count : (int)_LeftToRead; + int n = _crcStream.Read(buffer, offset, len); + + _LeftToRead -= n; + + if (_LeftToRead == 0) + { + int CrcResult = _crcStream.Crc; + _currentEntry.VerifyCrcAfterExtract(CrcResult); + _inputStream.Seek(_endOfEntry, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_inputStream); + } + + return n; + } + + + + /// + /// Read the next entry from the zip file. + /// + /// + /// + /// + /// Call this method just before calling , + /// to position the pointer in the zip file to the next entry that can be + /// read. Subsequent calls to Read(), will decrypt and decompress the + /// data in the zip file, until Read() returns 0. + /// + /// + /// + /// Each time you call GetNextEntry(), the pointer in the wrapped + /// stream is moved to the next entry in the zip file. If you call , and thus re-position the pointer within + /// the file, you will need to call GetNextEntry() again, to insure + /// that the file pointer is positioned at the beginning of a zip entry. + /// + /// + /// + /// This method returns the ZipEntry. Using a stream approach, you will + /// read the raw bytes for an entry in a zip file via calls to Read(). + /// Alternatively, you can extract an entry into a file, or a stream, by + /// calling , or one of its siblings. + /// + /// + /// + /// + /// + /// The ZipEntry read. Returns null (or Nothing in VB) if there are no more + /// entries in the zip file. + /// + /// + public ZipEntry GetNextEntry() + { + if (_findRequired) + { + // find the next signature + long d = SharedUtilities.FindSignature(_inputStream, ZipConstants.ZipEntrySignature); + if (d == -1) return null; + // back up 4 bytes: ReadEntry assumes the file pointer is positioned before the entry signature + _inputStream.Seek(-4, SeekOrigin.Current); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_inputStream); + } + // workitem 10923 + else if (_firstEntry) + { + // we've already read one entry. + // Seek to the end of it. + _inputStream.Seek(_endOfEntry, SeekOrigin.Begin); + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_inputStream); + } + + _currentEntry = ZipEntry.ReadEntry(_container, !_firstEntry); + // ReadEntry leaves the file position after all the entry + // data and the optional bit-3 data descriptpr. This is + // where the next entry would normally start. + _endOfEntry = _inputStream.Position; + _firstEntry = true; + _needSetup = true; + _findRequired= false; + return _currentEntry; + } + + + /// + /// Dispose the stream. + /// + /// + /// + /// + /// This method disposes the ZipInputStream. It may also close the + /// underlying stream, depending on which constructor was used. + /// + /// + /// + /// Typically the application will call Dispose() implicitly, via + /// a using statement in C#, or a Using statement in VB. + /// + /// + /// + /// Application code won't call this code directly. This method may + /// be invoked in two distinct scenarios. If disposing == true, the + /// method has been called directly or indirectly by a user's code, + /// for example via the public Dispose() method. In this case, both + /// managed and unmanaged resources can be referenced and disposed. + /// If disposing == false, the method has been called by the runtime + /// from inside the object finalizer and this method should not + /// reference other objects; in that case only unmanaged resources + /// must be referenced or disposed. + /// + /// + /// + /// + /// true if the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + if (_closed) return; + + if (disposing) // not called from finalizer + { + // When ZipInputStream is used within a using clause, and an + // exception is thrown, Close() is invoked. But we don't want to + // try to write anything in that case. Eventually the exception + // will be propagated to the application. + if (_exceptionPending) return; + + if (!_leaveUnderlyingStreamOpen) + { +#if NETCF + _inputStream.Close(); +#else + _inputStream.Dispose(); +#endif + } + } + _closed= true; + } + + + /// + /// Always returns true. + /// + public override bool CanRead { get { return true; }} + + /// + /// Returns the value of CanSeek for the underlying (wrapped) stream. + /// + public override bool CanSeek { get { return _inputStream.CanSeek; } } + + /// + /// Always returns false. + /// + public override bool CanWrite { get { return false; } } + + /// + /// Returns the length of the underlying stream. + /// + public override long Length { get { return _inputStream.Length; }} + + /// + /// Gets or sets the position of the underlying stream. + /// + /// + /// Setting the position is equivalent to calling Seek(value, SeekOrigin.Begin). + /// + public override long Position + { + get { return _inputStream.Position;} + set { Seek(value, SeekOrigin.Begin); } + } + + /// + /// This is a no-op. + /// + public override void Flush() + { + throw new NotSupportedException("Flush"); + } + + + /// + /// This method always throws a NotSupportedException. + /// + /// ignored + /// ignored + /// ignored + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("Write"); + } + + + /// + /// This method seeks in the underlying stream. + /// + /// + /// + /// + /// Call this method if you want to seek around within the zip file for random access. + /// + /// + /// + /// Applications can intermix calls to Seek() with calls to . After a call to Seek(), + /// GetNextEntry() will get the next ZipEntry that falls after + /// the current position in the input stream. You're on your own for finding + /// out just where to seek in the stream, to get to the various entries. + /// + /// + /// + /// + /// the offset point to seek to + /// the reference point from which to seek + /// The new position + public override long Seek(long offset, SeekOrigin origin) + { + _findRequired= true; + var x = _inputStream.Seek(offset, origin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_inputStream); + return x; + } + + /// + /// This method always throws a NotSupportedException. + /// + /// ignored + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + + private Stream _inputStream; + private System.Text.Encoding _provisionalAlternateEncoding; + private ZipEntry _currentEntry; + private bool _firstEntry; + private bool _needSetup; + private ZipContainer _container; + private Ionic.Crc.CrcCalculatorStream _crcStream; + private Int64 _LeftToRead; + internal String _Password; + private Int64 _endOfEntry; + private string _name; + + private bool _leaveUnderlyingStreamOpen; + private bool _closed; + private bool _findRequired; + private bool _exceptionPending; + } + + + +} \ No newline at end of file diff --git a/dotNetZip/Zip/ZipOutputStream.cs b/dotNetZip/Zip/ZipOutputStream.cs new file mode 100644 index 0000000..71f7633 --- /dev/null +++ b/dotNetZip/Zip/ZipOutputStream.cs @@ -0,0 +1,1817 @@ +// ZipOutputStream.cs +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-28 06:34:30> +// +// ------------------------------------------------------------------ +// +// This module defines the ZipOutputStream class, which is a stream metaphor for +// generating zip files. This class does not depend on Ionic.Zip.ZipFile, but rather +// stands alongside it as an alternative "container" for ZipEntry. It replicates a +// subset of the properties, including these: +// +// - Comment +// - Encryption +// - Password +// - CodecBufferSize +// - CompressionLevel +// - CompressionMethod +// - EnableZip64 (UseZip64WhenSaving) +// - IgnoreCase (!CaseSensitiveRetrieval) +// +// It adds these novel methods: +// +// - PutNextEntry +// +// +// ------------------------------------------------------------------ +// + +using System; +using System.Threading; +using System.Collections.Generic; +using System.IO; +using Ionic.Zip; + +namespace Ionic.Zip +{ + /// + /// Provides a stream metaphor for generating zip files. + /// + /// + /// + /// + /// This class writes zip files, as defined in the specification + /// for zip files described by PKWare. The compression for this + /// implementation is provided by a managed-code version of Zlib, included with + /// DotNetZip in the classes in the Ionic.Zlib namespace. + /// + /// + /// + /// This class provides an alternative programming model to the one enabled by the + /// class. Use this when creating zip files, as an + /// alternative to the class, when you would like to use a + /// Stream type to write the zip file. + /// + /// + /// + /// Both the ZipOutputStream class and the ZipFile class can be used + /// to create zip files. Both of them support many of the common zip features, + /// including Unicode, different compression levels, and ZIP64. They provide + /// very similar performance when creating zip files. + /// + /// + /// + /// The ZipFile class is generally easier to use than + /// ZipOutputStream and should be considered a higher-level interface. For + /// example, when creating a zip file via calls to the PutNextEntry() and + /// Write() methods on the ZipOutputStream class, the caller is + /// responsible for opening the file, reading the bytes from the file, writing + /// those bytes into the ZipOutputStream, setting the attributes on the + /// ZipEntry, and setting the created, last modified, and last accessed + /// timestamps on the zip entry. All of these things are done automatically by a + /// call to ZipFile.AddFile(). + /// For this reason, the ZipOutputStream is generally recommended for use + /// only when your application emits arbitrary data, not necessarily data from a + /// filesystem file, directly into a zip file, and does so using a Stream + /// metaphor. + /// + /// + /// + /// Aside from the differences in programming model, there are other + /// differences in capability between the two classes. + /// + /// + /// + /// + /// ZipFile can be used to read and extract zip files, in addition to + /// creating zip files. ZipOutputStream cannot read zip files. If you want + /// to use a stream to read zip files, check out the class. + /// + /// + /// + /// ZipOutputStream does not support the creation of segmented or spanned + /// zip files. + /// + /// + /// + /// ZipOutputStream cannot produce a self-extracting archive. + /// + /// + /// + /// + /// Be aware that the ZipOutputStream class implements the interface. In order for + /// ZipOutputStream to produce a valid zip file, you use use it within + /// a using clause (Using in VB), or call the Dispose() method + /// explicitly. See the examples for how to employ a using clause. + /// + /// + /// + /// Also, a note regarding compression performance: On the desktop .NET + /// Framework, DotNetZip can use a multi-threaded compression implementation + /// that provides significant speed increases on large files, over 300k or so, + /// at the cost of increased memory use at runtime. (The output of the + /// compression is almost exactly the same size). But, the multi-threaded + /// approach incurs a performance hit on smaller files. There's no way for the + /// ZipOutputStream to know whether parallel compression will be beneficial, + /// because the ZipOutputStream does not know how much data you will write + /// through the stream. You may wish to set the property to zero, if you are compressing + /// large files through ZipOutputStream. This will cause parallel + /// compression to be used, always. + /// + /// + public class ZipOutputStream : Stream + { + /// + /// Create a ZipOutputStream, wrapping an existing stream. + /// + /// + /// + /// + /// The class is generally easier to use when creating + /// zip files. The ZipOutputStream offers a different metaphor for creating a + /// zip file, based on the class. + /// + /// + /// + /// + /// + /// The stream to wrap. It must be writable. This stream will be closed at + /// the time the ZipOutputStream is closed. + /// + /// + /// + /// + /// This example shows how to create a zip file, using the + /// ZipOutputStream class. + /// + /// + /// private void Zipup() + /// { + /// if (filesToZip.Count == 0) + /// { + /// System.Console.WriteLine("Nothing to do."); + /// return; + /// } + /// + /// using (var raw = File.Open(_outputFileName, FileMode.Create, FileAccess.ReadWrite )) + /// { + /// using (var output= new ZipOutputStream(raw)) + /// { + /// output.Password = "VerySecret!"; + /// output.Encryption = EncryptionAlgorithm.WinZipAes256; + /// + /// foreach (string inputFileName in filesToZip) + /// { + /// System.Console.WriteLine("file: {0}", inputFileName); + /// + /// output.PutNextEntry(inputFileName); + /// using (var input = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Write )) + /// { + /// byte[] buffer= new byte[2048]; + /// int n; + /// while ((n= input.Read(buffer,0,buffer.Length)) > 0) + /// { + /// output.Write(buffer,0,n); + /// } + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Private Sub Zipup() + /// Dim outputFileName As String = "XmlData.zip" + /// Dim filesToZip As String() = Directory.GetFiles(".", "*.xml") + /// If (filesToZip.Length = 0) Then + /// Console.WriteLine("Nothing to do.") + /// Else + /// Using raw As FileStream = File.Open(outputFileName, FileMode.Create, FileAccess.ReadWrite) + /// Using output As ZipOutputStream = New ZipOutputStream(raw) + /// output.Password = "VerySecret!" + /// output.Encryption = EncryptionAlgorithm.WinZipAes256 + /// Dim inputFileName As String + /// For Each inputFileName In filesToZip + /// Console.WriteLine("file: {0}", inputFileName) + /// output.PutNextEntry(inputFileName) + /// Using input As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + /// Dim n As Integer + /// Dim buffer As Byte() = New Byte(2048) {} + /// Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + /// output.Write(buffer, 0, n) + /// Loop + /// End Using + /// Next + /// End Using + /// End Using + /// End If + /// End Sub + /// + /// + public ZipOutputStream(Stream stream) : this(stream, false) { } + + + /// + /// Create a ZipOutputStream that writes to a filesystem file. + /// + /// + /// + /// The class is generally easier to use when creating + /// zip files. The ZipOutputStream offers a different metaphor for creating a + /// zip file, based on the class. + /// + /// + /// + /// The name of the zip file to create. + /// + /// + /// + /// + /// This example shows how to create a zip file, using the + /// ZipOutputStream class. + /// + /// + /// private void Zipup() + /// { + /// if (filesToZip.Count == 0) + /// { + /// System.Console.WriteLine("Nothing to do."); + /// return; + /// } + /// + /// using (var output= new ZipOutputStream(outputFileName)) + /// { + /// output.Password = "VerySecret!"; + /// output.Encryption = EncryptionAlgorithm.WinZipAes256; + /// + /// foreach (string inputFileName in filesToZip) + /// { + /// System.Console.WriteLine("file: {0}", inputFileName); + /// + /// output.PutNextEntry(inputFileName); + /// using (var input = File.Open(inputFileName, FileMode.Open, FileAccess.Read, + /// FileShare.Read | FileShare.Write )) + /// { + /// byte[] buffer= new byte[2048]; + /// int n; + /// while ((n= input.Read(buffer,0,buffer.Length)) > 0) + /// { + /// output.Write(buffer,0,n); + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Private Sub Zipup() + /// Dim outputFileName As String = "XmlData.zip" + /// Dim filesToZip As String() = Directory.GetFiles(".", "*.xml") + /// If (filesToZip.Length = 0) Then + /// Console.WriteLine("Nothing to do.") + /// Else + /// Using output As ZipOutputStream = New ZipOutputStream(outputFileName) + /// output.Password = "VerySecret!" + /// output.Encryption = EncryptionAlgorithm.WinZipAes256 + /// Dim inputFileName As String + /// For Each inputFileName In filesToZip + /// Console.WriteLine("file: {0}", inputFileName) + /// output.PutNextEntry(inputFileName) + /// Using input As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + /// Dim n As Integer + /// Dim buffer As Byte() = New Byte(2048) {} + /// Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + /// output.Write(buffer, 0, n) + /// Loop + /// End Using + /// Next + /// End Using + /// End If + /// End Sub + /// + /// + public ZipOutputStream(String fileName) + { + Stream stream = File.Open(fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None); + _Init(stream, false, fileName); + } + + + /// + /// Create a ZipOutputStream. + /// + /// + /// + /// See the documentation for the ZipOutputStream(Stream) + /// constructor for an example. + /// + /// + /// + /// The stream to wrap. It must be writable. + /// + /// + /// + /// true if the application would like the stream + /// to remain open after the ZipOutputStream has been closed. + /// + public ZipOutputStream(Stream stream, bool leaveOpen) + { + _Init(stream, leaveOpen, null); + } + + private void _Init(Stream stream, bool leaveOpen, string name) + { + // workitem 9307 + _outputStream = stream.CanRead ? stream : new CountingStream(stream); + CompressionLevel = Ionic.Zlib.CompressionLevel.Default; + CompressionMethod = Ionic.Zip.CompressionMethod.Deflate; + _encryption = EncryptionAlgorithm.None; + _entriesWritten = new Dictionary(StringComparer.Ordinal); + _zip64 = Zip64Option.Never; + _leaveUnderlyingStreamOpen = leaveOpen; + Strategy = Ionic.Zlib.CompressionStrategy.Default; + _name = name ?? "(stream)"; +#if !NETCF + ParallelDeflateThreshold = -1L; +#endif + } + + + /// Provides a string representation of the instance. + /// + /// + /// This can be useful for debugging purposes. + /// + /// + /// a string representation of the instance. + public override String ToString() + { + return String.Format ("ZipOutputStream::{0}(leaveOpen({1})))", _name, _leaveUnderlyingStreamOpen); + } + + + /// + /// Sets the password to be used on the ZipOutputStream instance. + /// + /// + /// + /// + /// + /// When writing a zip archive, this password is applied to the entries, not + /// to the zip archive itself. It applies to any ZipEntry subsequently + /// written to the ZipOutputStream. + /// + /// + /// + /// Using a password does not encrypt or protect the "directory" of the + /// archive - the list of entries contained in the archive. If you set the + /// Password property, the password actually applies to individual + /// entries that are added to the archive, subsequent to the setting of this + /// property. The list of filenames in the archive that is eventually created + /// will appear in clear text, but the contents of the individual files are + /// encrypted. This is how Zip encryption works. + /// + /// + /// + /// If you set this property, and then add a set of entries to the archive via + /// calls to PutNextEntry, then each entry is encrypted with that + /// password. You may also want to change the password between adding + /// different entries. If you set the password, add an entry, then set the + /// password to null (Nothing in VB), and add another entry, the + /// first entry is encrypted and the second is not. + /// + /// + /// + /// When setting the Password, you may also want to explicitly set the property, to specify how to encrypt the entries added + /// to the ZipFile. If you set the Password to a non-null value and do not + /// set , then PKZip 2.0 ("Weak") encryption is used. + /// This encryption is relatively weak but is very interoperable. If + /// you set the password to a null value (Nothing in VB), + /// Encryption is reset to None. + /// + /// + /// + /// Special case: if you wrap a ZipOutputStream around a non-seekable stream, + /// and use encryption, and emit an entry of zero bytes, the Close() or + /// PutNextEntry() following the entry will throw an exception. + /// + /// + /// + public String Password + { + set + { + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + + _password = value; + if (_password == null) + { + _encryption = EncryptionAlgorithm.None; + } + else if (_encryption == EncryptionAlgorithm.None) + { + _encryption = EncryptionAlgorithm.PkzipWeak; + } + } + } + + + /// + /// The Encryption to use for entries added to the ZipOutputStream. + /// + /// + /// + /// + /// The specified Encryption is applied to the entries subsequently + /// written to the ZipOutputStream instance. + /// + /// + /// + /// If you set this to something other than + /// EncryptionAlgorithm.None, you will also need to set the + /// to a non-null, non-empty value in + /// order to actually get encryption on the entry. + /// + /// + /// + /// + /// ZipOutputStream.Password + /// ZipEntry.Encryption + public EncryptionAlgorithm Encryption + { + get + { + return _encryption; + } + set + { + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + if (value == EncryptionAlgorithm.Unsupported) + { + _exceptionPending = true; + throw new InvalidOperationException("You may not set Encryption to that value."); + } + _encryption = value; + } + } + + + /// + /// Size of the work buffer to use for the ZLIB codec during compression. + /// + /// + /// + /// Setting this may affect performance. For larger files, setting this to a + /// larger size may improve performance, but I'm not sure. Sorry, I don't + /// currently have good recommendations on how to set it. You can test it if + /// you like. + /// + public int CodecBufferSize + { + get; + set; + } + + + /// + /// The compression strategy to use for all entries. + /// + /// + /// + /// Set the Strategy used by the ZLIB-compatible compressor, when compressing + /// data for the entries in the zip archive. Different compression strategies + /// work better on different sorts of data. The strategy parameter can affect + /// the compression ratio and the speed of compression but not the correctness + /// of the compresssion. For more information see . + /// + public Ionic.Zlib.CompressionStrategy Strategy + { + get; + set; + } + + + /// + /// The type of timestamp attached to the ZipEntry. + /// + /// + /// + /// Set this in order to specify the kind of timestamp that should be emitted + /// into the zip file for each entry. + /// + public ZipEntryTimestamp Timestamp + { + get + { + return _timestamp; + } + set + { + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + _timestamp = value; + } + } + + + /// + /// Sets the compression level to be used for entries subsequently added to + /// the zip archive. + /// + /// + /// + /// + /// Varying the compression level used on entries can affect the + /// size-vs-speed tradeoff when compression and decompressing data streams + /// or files. + /// + /// + /// + /// As with some other properties on the ZipOutputStream class, like , and , + /// setting this property on a ZipOutputStream + /// instance will cause the specified CompressionLevel to be used on all + /// items that are subsequently added to the + /// ZipOutputStream instance. + /// + /// + /// + /// If you do not set this property, the default compression level is used, + /// which normally gives a good balance of compression efficiency and + /// compression speed. In some tests, using BestCompression can + /// double the time it takes to compress, while delivering just a small + /// increase in compression efficiency. This behavior will vary with the + /// type of data you compress. If you are in doubt, just leave this setting + /// alone, and accept the default. + /// + /// + public Ionic.Zlib.CompressionLevel CompressionLevel + { + get; + set; + } + + /// + /// The compression method used on each entry added to the ZipOutputStream. + /// + public Ionic.Zip.CompressionMethod CompressionMethod + { + get; + set; + } + + + /// + /// A comment attached to the zip archive. + /// + /// + /// + /// + /// + /// The application sets this property to specify a comment to be embedded + /// into the generated zip archive. + /// + /// + /// + /// According to PKWARE's + /// zip specification, the comment is not encrypted, even if there is a + /// password set on the zip file. + /// + /// + /// + /// The specification does not describe how to indicate the encoding used + /// on a comment string. Many "compliant" zip tools and libraries use + /// IBM437 as the code page for comments; DotNetZip, too, follows that + /// practice. On the other hand, there are situations where you want a + /// Comment to be encoded with something else, for example using code page + /// 950 "Big-5 Chinese". To fill that need, DotNetZip will encode the + /// comment following the same procedure it follows for encoding + /// filenames: (a) if is + /// Never, it uses the default encoding (IBM437). (b) if is Always, it always uses the + /// alternate encoding (). (c) if is AsNecessary, it uses the + /// alternate encoding only if the default encoding is not sufficient for + /// encoding the comment - in other words if decoding the result does not + /// produce the original string. This decision is taken at the time of + /// the call to ZipFile.Save(). + /// + /// + /// + public string Comment + { + get { return _comment; } + set + { + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + _comment = value; + } + } + + + + /// + /// Specify whether to use ZIP64 extensions when saving a zip archive. + /// + /// + /// + /// + /// The default value for the property is . is + /// safest, in the sense that you will not get an Exception if a + /// pre-ZIP64 limit is exceeded. + /// + /// + /// + /// You must set this property before calling Write(). + /// + /// + /// + public Zip64Option EnableZip64 + { + get + { + return _zip64; + } + set + { + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + _zip64 = value; + } + } + + + /// + /// Indicates whether ZIP64 extensions were used when saving the zip archive. + /// + /// + /// + /// The value is defined only after the ZipOutputStream has been closed. + /// + public bool OutputUsedZip64 + { + get + { + return _anyEntriesUsedZip64 || _directoryNeededZip64; + } + } + + + /// + /// Whether the ZipOutputStream should use case-insensitive comparisons when + /// checking for uniqueness of zip entries. + /// + /// + /// + /// + /// Though the zip specification doesn't prohibit zipfiles with duplicate + /// entries, Sane zip files have no duplicates, and the DotNetZip library + /// cannot create zip files with duplicate entries. If an application attempts + /// to call with a name that duplicates one + /// already used within the archive, the library will throw an Exception. + /// + /// + /// This property allows the application to specify whether the + /// ZipOutputStream instance considers ordinal case when checking for + /// uniqueness of zip entries. + /// + /// + public bool IgnoreCase + { + get + { + return !_DontIgnoreCase; + } + + set + { + _DontIgnoreCase = !value; + } + + } + + + /// + /// Indicates whether to encode entry filenames and entry comments using + /// Unicode (UTF-8). + /// + /// + /// + /// + /// The + /// PKWare zip specification provides for encoding file names and file + /// comments in either the IBM437 code page, or in UTF-8. This flag selects + /// the encoding according to that specification. By default, this flag is + /// false, and filenames and comments are encoded into the zip file in the + /// IBM437 codepage. Setting this flag to true will specify that filenames + /// and comments that cannot be encoded with IBM437 will be encoded with + /// UTF-8. + /// + /// + /// + /// Zip files created with strict adherence to the PKWare specification with + /// respect to UTF-8 encoding can contain entries with filenames containing + /// any combination of Unicode characters, including the full range of + /// characters from Chinese, Latin, Hebrew, Greek, Cyrillic, and many other + /// alphabets. However, because at this time, the UTF-8 portion of the PKWare + /// specification is not broadly supported by other zip libraries and + /// utilities, such zip files may not be readable by your favorite zip tool or + /// archiver. In other words, interoperability will decrease if you set this + /// flag to true. + /// + /// + /// + /// In particular, Zip files created with strict adherence to the PKWare + /// specification with respect to UTF-8 encoding will not work well with + /// Explorer in Windows XP or Windows Vista, because Windows compressed + /// folders, as far as I know, do not support UTF-8 in zip files. Vista can + /// read the zip files, but shows the filenames incorrectly. Unpacking from + /// Windows Vista Explorer will result in filenames that have rubbish + /// characters in place of the high-order UTF-8 bytes. + /// + /// + /// + /// Also, zip files that use UTF-8 encoding will not work well with Java + /// applications that use the java.util.zip classes, as of v5.0 of the Java + /// runtime. The Java runtime does not correctly implement the PKWare + /// specification in this regard. + /// + /// + /// + /// As a result, we have the unfortunate situation that "correct" behavior by + /// the DotNetZip library with regard to Unicode encoding of filenames during + /// zip creation will result in zip files that are readable by strictly + /// compliant and current tools (for example the most recent release of the + /// commercial WinZip tool); but these zip files will not be readable by + /// various other tools or libraries, including Windows Explorer. + /// + /// + /// + /// The DotNetZip library can read and write zip files with UTF8-encoded + /// entries, according to the PKware spec. If you use DotNetZip for both + /// creating and reading the zip file, and you use UTF-8, there will be no + /// loss of information in the filenames. For example, using a self-extractor + /// created by this library will allow you to unpack files correctly with no + /// loss of information in the filenames. + /// + /// + /// + /// If you do not set this flag, it will remain false. If this flag is false, + /// the ZipOutputStream will encode all filenames and comments using + /// the IBM437 codepage. This can cause "loss of information" on some + /// filenames, but the resulting zipfile will be more interoperable with other + /// utilities. As an example of the loss of information, diacritics can be + /// lost. The o-tilde character will be down-coded to plain o. The c with a + /// cedilla (Unicode 0xE7) used in Portugese will be downcoded to a c. + /// Likewise, the O-stroke character (Unicode 248), used in Danish and + /// Norwegian, will be down-coded to plain o. Chinese characters cannot be + /// represented in codepage IBM437; when using the default encoding, Chinese + /// characters in filenames will be represented as ?. These are all examples + /// of "information loss". + /// + /// + /// + /// The loss of information associated to the use of the IBM437 encoding is + /// inconvenient, and can also lead to runtime errors. For example, using + /// IBM437, any sequence of 4 Chinese characters will be encoded as ????. If + /// your application creates a ZipOutputStream, does not set the + /// encoding, then adds two files, each with names of four Chinese characters + /// each, this will result in a duplicate filename exception. In the case + /// where you add a single file with a name containing four Chinese + /// characters, the zipfile will save properly, but extracting that file + /// later, with any zip tool, will result in an error, because the question + /// mark is not legal for use within filenames on Windows. These are just a + /// few examples of the problems associated to loss of information. + /// + /// + /// + /// This flag is independent of the encoding of the content within the entries + /// in the zip file. Think of the zip file as a container - it supports an + /// encoding. Within the container are other "containers" - the file entries + /// themselves. The encoding within those entries is independent of the + /// encoding of the zip archive container for those entries. + /// + /// + /// + /// Rather than specify the encoding in a binary fashion using this flag, an + /// application can specify an arbitrary encoding via the property. Setting the encoding + /// explicitly when creating zip archives will result in non-compliant zip + /// files that, curiously, are fairly interoperable. The challenge is, the + /// PKWare specification does not provide for a way to specify that an entry + /// in a zip archive uses a code page that is neither IBM437 nor UTF-8. + /// Therefore if you set the encoding explicitly when creating a zip archive, + /// you must take care upon reading the zip archive to use the same code page. + /// If you get it wrong, the behavior is undefined and may result in incorrect + /// filenames, exceptions, stomach upset, hair loss, and acne. + /// + /// + /// + [Obsolete("Beginning with v1.9.1.6 of DotNetZip, this property is obsolete. It will be removed in a future version of the library. Use AlternateEncoding and AlternateEncodingUsage instead.")] + public bool UseUnicodeAsNecessary + { + get + { + return (_alternateEncoding == System.Text.Encoding.UTF8) && + (AlternateEncodingUsage == ZipOption.AsNecessary); + } + set + { + if (value) + { + _alternateEncoding = System.Text.Encoding.UTF8; + _alternateEncodingUsage = ZipOption.AsNecessary; + + } + else + { + _alternateEncoding = Ionic.Zip.ZipOutputStream.DefaultEncoding; + _alternateEncodingUsage = ZipOption.Never; + } + } + } + + + /// + /// The text encoding to use when emitting entries into the zip archive, for + /// those entries whose filenames or comments cannot be encoded with the + /// default (IBM437) encoding. + /// + /// + /// + /// + /// In its + /// zip specification, PKWare describes two options for encoding + /// filenames and comments: using IBM437 or UTF-8. But, some archiving tools + /// or libraries do not follow the specification, and instead encode + /// characters using the system default code page. For example, WinRAR when + /// run on a machine in Shanghai may encode filenames with the Big-5 Chinese + /// (950) code page. This behavior is contrary to the Zip specification, but + /// it occurs anyway. + /// + /// + /// + /// When using DotNetZip to write zip archives that will be read by one of + /// these other archivers, set this property to specify the code page to use + /// when encoding the and for each ZipEntry in the zip file, for + /// values that cannot be encoded with the default codepage for zip files, + /// IBM437. This is why this property is "provisional". In all cases, IBM437 + /// is used where possible, in other words, where no loss of data would + /// result. It is possible, therefore, to have a given entry with a + /// Comment encoded in IBM437 and a FileName encoded with the + /// specified "provisional" codepage. + /// + /// + /// + /// Be aware that a zip file created after you've explicitly set the + /// ProvisionalAlternateEncoding property to a value other than + /// IBM437 may not be compliant to the PKWare specification, and may not be + /// readable by compliant archivers. On the other hand, many (most?) + /// archivers are non-compliant and can read zip files created in arbitrary + /// code pages. The trick is to use or specify the proper codepage when + /// reading the zip. + /// + /// + /// + /// When creating a zip archive using this library, it is possible to change + /// the value of ProvisionalAlternateEncoding between each entry you + /// add, and between adding entries and the call to Close(). Don't do + /// this. It will likely result in a zipfile that is not readable. For best + /// interoperability, either leave ProvisionalAlternateEncoding + /// alone, or specify it only once, before adding any entries to the + /// ZipOutputStream instance. There is one exception to this + /// recommendation, described later. + /// + /// + /// + /// When using an arbitrary, non-UTF8 code page for encoding, there is no + /// standard way for the creator application - whether DotNetZip, WinZip, + /// WinRar, or something else - to formally specify in the zip file which + /// codepage has been used for the entries. As a result, readers of zip files + /// are not able to inspect the zip file and determine the codepage that was + /// used for the entries contained within it. It is left to the application + /// or user to determine the necessary codepage when reading zip files encoded + /// this way. If you use an incorrect codepage when reading a zipfile, you + /// will get entries with filenames that are incorrect, and the incorrect + /// filenames may even contain characters that are not legal for use within + /// filenames in Windows. Extracting entries with illegal characters in the + /// filenames will lead to exceptions. It's too bad, but this is just the way + /// things are with code pages in zip files. Caveat Emptor. + /// + /// + /// + /// One possible approach for specifying the code page for a given zip file is + /// to describe the code page in a human-readable form in the Zip comment. For + /// example, the comment may read "Entries in this archive are encoded in the + /// Big5 code page". For maximum interoperability, the zip comment in this + /// case should be encoded in the default, IBM437 code page. In this case, + /// the zip comment is encoded using a different page than the filenames. To + /// do this, Specify ProvisionalAlternateEncoding to your desired + /// region-specific code page, once before adding any entries, and then set + /// the property and reset + /// ProvisionalAlternateEncoding to IBM437 before calling Close(). + /// + /// + [Obsolete("use AlternateEncoding and AlternateEncodingUsage instead.")] + public System.Text.Encoding ProvisionalAlternateEncoding + { + get + { + if (_alternateEncodingUsage == ZipOption.AsNecessary) + return _alternateEncoding; + return null; + } + set + { + _alternateEncoding = value; + _alternateEncodingUsage = ZipOption.AsNecessary; + } + } + + /// + /// A Text Encoding to use when encoding the filenames and comments for + /// all the ZipEntry items, during a ZipFile.Save() operation. + /// + /// + /// + /// Whether the encoding specified here is used during the save depends + /// on . + /// + /// + public System.Text.Encoding AlternateEncoding + { + get + { + return _alternateEncoding; + } + set + { + _alternateEncoding = value; + } + } + + /// + /// A flag that tells if and when this instance should apply + /// AlternateEncoding to encode the filenames and comments associated to + /// of ZipEntry objects contained within this instance. + /// + public ZipOption AlternateEncodingUsage + { + get + { + return _alternateEncodingUsage; + } + set + { + _alternateEncodingUsage = value; + } + } + + /// + /// The default text encoding used in zip archives. It is numeric 437, also + /// known as IBM437. + /// + /// + public static System.Text.Encoding DefaultEncoding + { + get + { + return System.Text.Encoding.GetEncoding("IBM437"); + } + } + + +#if !NETCF + /// + /// The size threshold for an entry, above which a parallel deflate is used. + /// + /// + /// + /// + /// + /// DotNetZip will use multiple threads to compress any ZipEntry, when + /// the CompressionMethod is Deflate, and if the entry is + /// larger than the given size. Zero means "always use parallel + /// deflate", while -1 means "never use parallel deflate". + /// + /// + /// + /// If the entry size cannot be known before compression, as with any entry + /// added via a ZipOutputStream, then Parallel deflate will never be + /// performed, unless the value of this property is zero. + /// + /// + /// + /// A parallel deflate operations will speed up the compression of + /// large files, on computers with multiple CPUs or multiple CPU + /// cores. For files above 1mb, on a dual core or dual-cpu (2p) + /// machine, the time required to compress the file can be 70% of the + /// single-threaded deflate. For very large files on 4p machines the + /// compression can be done in 30% of the normal time. The downside + /// is that parallel deflate consumes extra memory during the deflate, + /// and the deflation is slightly less effective. + /// + /// + /// + /// Parallel deflate tends to not be as effective as single-threaded deflate + /// because the original data stream is split into multiple independent + /// buffers, each of which is compressed in parallel. But because they are + /// treated independently, there is no opportunity to share compression + /// dictionaries, and additional framing bytes must be added to the output + /// stream. For that reason, a deflated stream may be slightly larger when + /// compressed using parallel deflate, as compared to a traditional + /// single-threaded deflate. For files of about 512k, the increase over the + /// normal deflate is as much as 5% of the total compressed size. For larger + /// files, the difference can be as small as 0.1%. + /// + /// + /// + /// Multi-threaded compression does not give as much an advantage when using + /// Encryption. This is primarily because encryption tends to slow down + /// the entire pipeline. Also, multi-threaded compression gives less of an + /// advantage when using lower compression levels, for example . You may have to perform + /// some tests to determine the best approach for your situation. + /// + /// + /// + /// The default value for this property is -1, which means parallel + /// compression will not be performed unless you set it to zero. + /// + /// + /// + public long ParallelDeflateThreshold + { + set + { + if ((value != 0) && (value != -1) && (value < 64 * 1024)) + throw new ArgumentOutOfRangeException("value must be greater than 64k, or 0, or -1"); + _ParallelDeflateThreshold = value; + } + get + { + return _ParallelDeflateThreshold; + } + } + + + /// + /// The maximum number of buffer pairs to use when performing + /// parallel compression. + /// + /// + /// + /// + /// This property sets an upper limit on the number of memory + /// buffer pairs to create when performing parallel + /// compression. The implementation of the parallel + /// compression stream allocates multiple buffers to + /// facilitate parallel compression. As each buffer fills up, + /// the stream uses + /// ThreadPool.QueueUserWorkItem() to compress those + /// buffers in a background threadpool thread. After a buffer + /// is compressed, it is re-ordered and written to the output + /// stream. + /// + /// + /// + /// A higher number of buffer pairs enables a higher degree of + /// parallelism, which tends to increase the speed of compression on + /// multi-cpu computers. On the other hand, a higher number of buffer + /// pairs also implies a larger memory consumption, more active worker + /// threads, and a higher cpu utilization for any compression. This + /// property enables the application to limit its memory consumption and + /// CPU utilization behavior depending on requirements. + /// + /// + /// + /// For each compression "task" that occurs in parallel, there are 2 + /// buffers allocated: one for input and one for output. This property + /// sets a limit for the number of pairs. The total amount of storage + /// space allocated for buffering will then be (N*S*2), where N is the + /// number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + /// pairs per CPU core, so if your machine has 4 cores, and you retain + /// the default buffer size of 128k, then the + /// ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + /// memory in total, or 4mb, in blocks of 128kb. If you then set this + /// property to 8, then the number will be 8 * 2 * 128kb of buffer + /// memory, or 2mb. + /// + /// + /// + /// CPU utilization will also go up with additional buffers, because a + /// larger number of buffer pairs allows a larger number of background + /// threads to compress in parallel. If you find that parallel + /// compression is consuming too much memory or CPU, you can adjust this + /// value downward. + /// + /// + /// + /// The default value is 16. Different values may deliver better or + /// worse results, depending on your priorities and the dynamic + /// performance characteristics of your storage and compute resources. + /// + /// + /// + /// This property is not the number of buffer pairs to use; it is an + /// upper limit. An illustration: Suppose you have an application that + /// uses the default value of this property (which is 16), and it runs + /// on a machine with 2 CPU cores. In that case, DotNetZip will allocate + /// 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + /// limit specified by this property has no effect. + /// + /// + /// + /// The application can set this value at any time, but it is + /// effective only if set before calling + /// ZipOutputStream.Write() for the first time. + /// + /// + /// + /// + /// + public int ParallelDeflateMaxBufferPairs + { + get + { + return _maxBufferPairs; + } + set + { + if (value < 4) + throw new ArgumentOutOfRangeException("ParallelDeflateMaxBufferPairs", + "Value must be 4 or greater."); + _maxBufferPairs = value; + } + } +#endif + + + private void InsureUniqueEntry(ZipEntry ze1) + { + if (_entriesWritten.ContainsKey(ze1.FileName)) + { + _exceptionPending = true; + throw new ArgumentException(String.Format("The entry '{0}' already exists in the zip archive.", ze1.FileName)); + } + } + + + internal Stream OutputStream + { + get + { + return _outputStream; + } + } + + internal String Name + { + get + { + return _name; + } + } + + /// + /// Returns true if an entry by the given name has already been written + /// to the ZipOutputStream. + /// + /// + /// + /// The name of the entry to scan for. + /// + /// + /// + /// true if an entry by the given name has already been written. + /// + public bool ContainsEntry(string name) + { + return _entriesWritten.ContainsKey(SharedUtilities.NormalizePathForUseInZipFile(name)); + } + + + /// + /// Write the data from the buffer to the stream. + /// + /// + /// + /// As the application writes data into this stream, the data may be + /// compressed and encrypted before being written out to the underlying + /// stream, depending on the settings of the + /// and the properties. + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + + if (buffer==null) + { + _exceptionPending = true; + throw new System.ArgumentNullException("buffer"); + } + + if (_currentEntry == null) + { + _exceptionPending = true; + throw new System.InvalidOperationException("You must call PutNextEntry() before calling Write()."); + } + + if (_currentEntry.IsDirectory) + { + _exceptionPending = true; + throw new System.InvalidOperationException("You cannot Write() data for an entry that is a directory."); + } + + if (_needToWriteEntryHeader) + _InitiateCurrentEntry(false); + + if (count != 0) + _entryOutputStream.Write(buffer, offset, count); + } + + + + /// + /// Specify the name of the next entry that will be written to the zip file. + /// + /// + /// + /// + /// Call this method just before calling , to + /// specify the name of the entry that the next set of bytes written to + /// the ZipOutputStream belongs to. All subsequent calls to Write, + /// until the next call to PutNextEntry, + /// will be inserted into the named entry in the zip file. + /// + /// + /// + /// If the used in PutNextEntry() ends in + /// a slash, then the entry added is marked as a directory. Because directory + /// entries do not contain data, a call to Write(), before an + /// intervening additional call to PutNextEntry(), will throw an + /// exception. + /// + /// + /// + /// If you don't call Write() between two calls to + /// PutNextEntry(), the first entry is inserted into the zip file as a + /// file of zero size. This may be what you want. + /// + /// + /// + /// Because PutNextEntry() closes out the prior entry, if any, this + /// method may throw if there is a problem with the prior entry. + /// + /// + /// + /// This method returns the ZipEntry. You can modify public properties + /// on the ZipEntry, such as , , and so on, until the first call to + /// ZipOutputStream.Write(), or until the next call to + /// PutNextEntry(). If you modify the ZipEntry after + /// having called Write(), you may get a runtime exception, or you may + /// silently get an invalid zip archive. + /// + /// + /// + /// + /// + /// + /// This example shows how to create a zip file, using the + /// ZipOutputStream class. + /// + /// + /// private void Zipup() + /// { + /// using (FileStream fs raw = File.Open(_outputFileName, FileMode.Create, FileAccess.ReadWrite )) + /// { + /// using (var output= new ZipOutputStream(fs)) + /// { + /// output.Password = "VerySecret!"; + /// output.Encryption = EncryptionAlgorithm.WinZipAes256; + /// output.PutNextEntry("entry1.txt"); + /// byte[] buffer= System.Text.Encoding.ASCII.GetBytes("This is the content for entry #1."); + /// output.Write(buffer,0,buffer.Length); + /// output.PutNextEntry("entry2.txt"); // this will be zero length + /// output.PutNextEntry("entry3.txt"); + /// buffer= System.Text.Encoding.ASCII.GetBytes("This is the content for entry #3."); + /// output.Write(buffer,0,buffer.Length); + /// } + /// } + /// } + /// + /// + /// + /// + /// The name of the entry to be added, including any path to be used + /// within the zip file. + /// + /// + /// + /// The ZipEntry created. + /// + /// + public ZipEntry PutNextEntry(String entryName) + { + if (String.IsNullOrEmpty(entryName)) + throw new ArgumentNullException("entryName"); + + if (_disposed) + { + _exceptionPending = true; + throw new System.InvalidOperationException("The stream has been closed."); + } + + _FinishCurrentEntry(); + _currentEntry = ZipEntry.CreateForZipOutputStream(entryName); + _currentEntry._container = new ZipContainer(this); + _currentEntry._BitField |= 0x0008; // workitem 8932 + _currentEntry.SetEntryTimes(DateTime.Now, DateTime.Now, DateTime.Now); + _currentEntry.CompressionLevel = this.CompressionLevel; + _currentEntry.CompressionMethod = this.CompressionMethod; + _currentEntry.Password = _password; // workitem 13909 + _currentEntry.Encryption = this.Encryption; + // workitem 12634 + _currentEntry.AlternateEncoding = this.AlternateEncoding; + _currentEntry.AlternateEncodingUsage = this.AlternateEncodingUsage; + + if (entryName.EndsWith("/")) _currentEntry.MarkAsDirectory(); + + _currentEntry.EmitTimesInWindowsFormatWhenSaving = ((_timestamp & ZipEntryTimestamp.Windows) != 0); + _currentEntry.EmitTimesInUnixFormatWhenSaving = ((_timestamp & ZipEntryTimestamp.Unix) != 0); + InsureUniqueEntry(_currentEntry); + _needToWriteEntryHeader = true; + + return _currentEntry; + } + + + + private void _InitiateCurrentEntry(bool finishing) + { + // If finishing==true, this means we're initiating the entry at the time of + // Close() or PutNextEntry(). If this happens, it means no data was written + // for the entry - Write() was never called. (The usual case us to call + // _InitiateCurrentEntry(bool) from within Write().) If finishing==true, + // the entry could be either a zero-byte file or a directory. + + _entriesWritten.Add(_currentEntry.FileName,_currentEntry); + _entryCount++; // could use _entriesWritten.Count, but I don't want to incur + // the cost. + + if (_entryCount > 65534 && _zip64 == Zip64Option.Never) + { + _exceptionPending = true; + throw new System.InvalidOperationException("Too many entries. Consider setting ZipOutputStream.EnableZip64."); + } + + // Write out the header. + // + // If finishing, and encryption is in use, then we don't want to emit the + // normal encryption header. Signal that with a cycle=99 to turn off + // encryption for zero-byte entries or directories. + // + // If finishing, then we know the stream length is zero. Else, unknown + // stream length. Passing stream length == 0 allows an optimization so as + // not to setup an encryption or deflation stream, when stream length is + // zero. + + _currentEntry.WriteHeader(_outputStream, finishing ? 99 : 0); + _currentEntry.StoreRelativeOffset(); + + if (!_currentEntry.IsDirectory) + { + _currentEntry.WriteSecurityMetadata(_outputStream); + _currentEntry.PrepOutputStream(_outputStream, + finishing ? 0 : -1, + out _outputCounter, + out _encryptor, + out _deflater, + out _entryOutputStream); + } + _needToWriteEntryHeader = false; + } + + + + private void _FinishCurrentEntry() + { + if (_currentEntry != null) + { + if (_needToWriteEntryHeader) + _InitiateCurrentEntry(true); // an empty entry - no writes + + _currentEntry.FinishOutputStream(_outputStream, _outputCounter, _encryptor, _deflater, _entryOutputStream); + _currentEntry.PostProcessOutput(_outputStream); + // workitem 12964 + if (_currentEntry.OutputUsedZip64!=null) + _anyEntriesUsedZip64 |= _currentEntry.OutputUsedZip64.Value; + + // reset all the streams + _outputCounter = null; _encryptor = _deflater = null; _entryOutputStream = null; + } + } + + + + /// + /// Dispose the stream + /// + /// + /// + /// + /// This method writes the Zip Central directory, then closes the stream. The + /// application must call Dispose() (or Close) in order to produce a valid zip file. + /// + /// + /// + /// Typically the application will call Dispose() implicitly, via a using + /// statement in C#, or a Using statement in VB. + /// + /// + /// + /// + /// set this to true, always. + protected override void Dispose(bool disposing) + { + if (_disposed) return; + + if (disposing) // not called from finalizer + { + // handle pending exceptions + if (!_exceptionPending) + { + _FinishCurrentEntry(); + _directoryNeededZip64 = ZipOutput.WriteCentralDirectoryStructure(_outputStream, + _entriesWritten.Values, + 1, // _numberOfSegmentsForMostRecentSave, + _zip64, + Comment, + new ZipContainer(this)); + Stream wrappedStream = null; + CountingStream cs = _outputStream as CountingStream; + if (cs != null) + { + wrappedStream = cs.WrappedStream; +#if NETCF + cs.Close(); +#else + cs.Dispose(); +#endif + } + else + { + wrappedStream = _outputStream; + } + + if (!_leaveUnderlyingStreamOpen) + { +#if NETCF + wrappedStream.Close(); +#else + wrappedStream.Dispose(); +#endif + } + _outputStream = null; + } + } + _disposed = true; + } + + + + /// + /// Always returns false. + /// + public override bool CanRead { get { return false; } } + + /// + /// Always returns false. + /// + public override bool CanSeek { get { return false; } } + + /// + /// Always returns true. + /// + public override bool CanWrite { get { return true; } } + + /// + /// Always returns a NotSupportedException. + /// + public override long Length { get { throw new NotSupportedException(); } } + + /// + /// Setting this property always returns a NotSupportedException. Getting it + /// returns the value of the Position on the underlying stream. + /// + public override long Position + { + get { return _outputStream.Position; } + set { throw new NotSupportedException(); } + } + + /// + /// This is a no-op. + /// + public override void Flush() { } + + /// + /// This method always throws a NotSupportedException. + /// + /// ignored + /// ignored + /// ignored + /// nothing + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException("Read"); + } + + /// + /// This method always throws a NotSupportedException. + /// + /// ignored + /// ignored + /// nothing + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException("Seek"); + } + + /// + /// This method always throws a NotSupportedException. + /// + /// ignored + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + + private EncryptionAlgorithm _encryption; + private ZipEntryTimestamp _timestamp; + internal String _password; + private String _comment; + private Stream _outputStream; + private ZipEntry _currentEntry; + internal Zip64Option _zip64; + private Dictionary _entriesWritten; + private int _entryCount; + private ZipOption _alternateEncodingUsage = ZipOption.Never; + private System.Text.Encoding _alternateEncoding + = System.Text.Encoding.GetEncoding("IBM437"); // default = IBM437 + + private bool _leaveUnderlyingStreamOpen; + private bool _disposed; + private bool _exceptionPending; // **see note below + private bool _anyEntriesUsedZip64, _directoryNeededZip64; + private CountingStream _outputCounter; + private Stream _encryptor; + private Stream _deflater; + private Ionic.Crc.CrcCalculatorStream _entryOutputStream; + private bool _needToWriteEntryHeader; + private string _name; + private bool _DontIgnoreCase; +#if !NETCF + internal Ionic.Zlib.ParallelDeflateOutputStream ParallelDeflater; + private long _ParallelDeflateThreshold; + private int _maxBufferPairs = 16; +#endif + + // **Note regarding exceptions: + + // When ZipOutputStream is employed within a using clause, which + // is the typical scenario, and an exception is thrown within + // the scope of the using, Close()/Dispose() is invoked + // implicitly before processing the initial exception. In that + // case, _exceptionPending is true, and we don't want to try to + // write anything in the Close/Dispose logic. Doing so can + // cause additional exceptions that mask the original one. So, + // the _exceptionPending flag is used to track that, and to + // allow the original exception to be propagated to the + // application without extra "noise." + + } + + + + internal class ZipContainer + { + private ZipFile _zf; + private ZipOutputStream _zos; + private ZipInputStream _zis; + + public ZipContainer(Object o) + { + _zf = (o as ZipFile); + _zos = (o as ZipOutputStream); + _zis = (o as ZipInputStream); + } + + public ZipFile ZipFile + { + get { return _zf; } + } + + public ZipOutputStream ZipOutputStream + { + get { return _zos; } + } + + public string Name + { + get + { + if (_zf != null) return _zf.Name; + if (_zis != null) throw new NotSupportedException(); + return _zos.Name; + } + } + + public string Password + { + get + { + if (_zf != null) return _zf._Password; + if (_zis != null) return _zis._Password; + return _zos._password; + } + } + + public Zip64Option Zip64 + { + get + { + if (_zf != null) return _zf._zip64; + if (_zis != null) throw new NotSupportedException(); + return _zos._zip64; + } + } + + public int BufferSize + { + get + { + if (_zf != null) return _zf.BufferSize; + if (_zis != null) throw new NotSupportedException(); + return 0; + } + } + +#if !NETCF + public Ionic.Zlib.ParallelDeflateOutputStream ParallelDeflater + { + get + { + if (_zf != null) return _zf.ParallelDeflater; + if (_zis != null) return null; + return _zos.ParallelDeflater; + } + set + { + if (_zf != null) _zf.ParallelDeflater = value; + else if (_zos != null) _zos.ParallelDeflater = value; + } + } + + public long ParallelDeflateThreshold + { + get + { + if (_zf != null) return _zf.ParallelDeflateThreshold; + return _zos.ParallelDeflateThreshold; + } + } + public int ParallelDeflateMaxBufferPairs + { + get + { + if (_zf != null) return _zf.ParallelDeflateMaxBufferPairs; + return _zos.ParallelDeflateMaxBufferPairs; + } + } +#endif + + public int CodecBufferSize + { + get + { + if (_zf != null) return _zf.CodecBufferSize; + if (_zis != null) return _zis.CodecBufferSize; + return _zos.CodecBufferSize; + } + } + + public Ionic.Zlib.CompressionStrategy Strategy + { + get + { + if (_zf != null) return _zf.Strategy; + return _zos.Strategy; + } + } + + public Zip64Option UseZip64WhenSaving + { + get + { + if (_zf != null) return _zf.UseZip64WhenSaving; + return _zos.EnableZip64; + } + } + + public System.Text.Encoding AlternateEncoding + { + get + { + if (_zf != null) return _zf.AlternateEncoding; + if (_zos!=null) return _zos.AlternateEncoding; + return null; + } + } + public System.Text.Encoding DefaultEncoding + { + get + { + if (_zf != null) return ZipFile.DefaultEncoding; + if (_zos!=null) return ZipOutputStream.DefaultEncoding; + return null; + } + } + public ZipOption AlternateEncodingUsage + { + get + { + if (_zf != null) return _zf.AlternateEncodingUsage; + if (_zos!=null) return _zos.AlternateEncodingUsage; + return ZipOption.Never; // n/a + } + } + + public Stream ReadStream + { + get + { + if (_zf != null) return _zf.ReadStream; + return _zis.ReadStream; + } + } + } + +} \ No newline at end of file diff --git a/dotNetZip/Zip/ZipSegmentedStream.cs b/dotNetZip/Zip/ZipSegmentedStream.cs new file mode 100644 index 0000000..7fe4f11 --- /dev/null +++ b/dotNetZip/Zip/ZipSegmentedStream.cs @@ -0,0 +1,571 @@ +// ZipSegmentedStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-13 22:25:45> +// +// ------------------------------------------------------------------ +// +// This module defines logic for zip streams that span disk files. +// +// ------------------------------------------------------------------ + + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Ionic.Zip +{ + internal class ZipSegmentedStream : System.IO.Stream + { + enum RwMode + { + None = 0, + ReadOnly = 1, + Write = 2, + //Update = 3 + } + + private RwMode rwMode; + private bool _exceptionPending; // **see note below + private string _baseName; + private string _baseDir; + //private bool _isDisposed; + private string _currentName; + private string _currentTempName; + private uint _currentDiskNumber; + private uint _maxDiskNumber; + private int _maxSegmentSize; + private System.IO.Stream _innerStream; + + // **Note regarding exceptions: + // + // When ZipSegmentedStream is employed within a using clause, + // which is the typical scenario, and an exception is thrown + // within the scope of the using, Dispose() is invoked + // implicitly before processing the initial exception. If that + // happens, this class sets _exceptionPending to true, and then + // within the Dispose(bool), takes special action as + // appropriate. Need to be careful: any additional exceptions + // will mask the original one. + + private ZipSegmentedStream() : base() + { + _exceptionPending = false; + } + + public static ZipSegmentedStream ForReading(string name, + uint initialDiskNumber, + uint maxDiskNumber) + { + ZipSegmentedStream zss = new ZipSegmentedStream() + { + rwMode = RwMode.ReadOnly, + CurrentSegment = initialDiskNumber, + _maxDiskNumber = maxDiskNumber, + _baseName = name, + }; + + // Console.WriteLine("ZSS: ForReading ({0})", + // Path.GetFileName(zss.CurrentName)); + + zss._SetReadStream(); + + return zss; + } + + + public static ZipSegmentedStream ForWriting(string name, int maxSegmentSize) + { + ZipSegmentedStream zss = new ZipSegmentedStream() + { + rwMode = RwMode.Write, + CurrentSegment = 0, + _baseName = name, + _maxSegmentSize = maxSegmentSize, + _baseDir = Path.GetDirectoryName(name) + }; + + // workitem 9522 + if (zss._baseDir=="") zss._baseDir="."; + + zss._SetWriteStream(0); + + // Console.WriteLine("ZSS: ForWriting ({0})", + // Path.GetFileName(zss.CurrentName)); + + return zss; + } + + + /// + /// Sort-of like a factory method, ForUpdate is used only when + /// the application needs to update the zip entry metadata for + /// a segmented zip file, when the starting segment is earlier + /// than the ending segment, for a particular entry. + /// + /// + /// + /// The update is always contiguous, never rolls over. As a + /// result, this method doesn't need to return a ZSS; it can + /// simply return a FileStream. That's why it's "sort of" + /// like a Factory method. + /// + /// + /// Caller must Close/Dispose the stream object returned by + /// this method. + /// + /// + public static Stream ForUpdate(string name, uint diskNumber) + { + if (diskNumber >= 99) + throw new ArgumentOutOfRangeException("diskNumber"); + + string fname = + String.Format("{0}.z{1:D2}", + Path.Combine(Path.GetDirectoryName(name), + Path.GetFileNameWithoutExtension(name)), + diskNumber + 1); + + // Console.WriteLine("ZSS: ForUpdate ({0})", + // Path.GetFileName(fname)); + + // This class assumes that the update will not expand the + // size of the segment. Update is used only for an in-place + // update of zip metadata. It never will try to write beyond + // the end of a segment. + + return File.Open(fname, + FileMode.Open, + FileAccess.ReadWrite, + FileShare.None); + } + + public bool ContiguousWrite + { + get; + set; + } + + + public UInt32 CurrentSegment + { + get + { + return _currentDiskNumber; + } + private set + { + _currentDiskNumber = value; + _currentName = null; // it will get updated next time referenced + } + } + + /// + /// Name of the filesystem file corresponding to the current segment. + /// + /// + /// + /// The name is not always the name currently being used in the + /// filesystem. When rwMode is RwMode.Write, the filesystem file has a + /// temporary name until the stream is closed or until the next segment is + /// started. + /// + /// + public String CurrentName + { + get + { + if (_currentName==null) + _currentName = _NameForSegment(CurrentSegment); + + return _currentName; + } + } + + + public String CurrentTempName + { + get + { + return _currentTempName; + } + } + + private string _NameForSegment(uint diskNumber) + { + if (diskNumber >= 99) + { + _exceptionPending = true; + throw new OverflowException("The number of zip segments would exceed 99."); + } + + return String.Format("{0}.z{1:D2}", + Path.Combine(Path.GetDirectoryName(_baseName), + Path.GetFileNameWithoutExtension(_baseName)), + diskNumber + 1); + } + + + // Returns the segment that WILL be current if writing + // a block of the given length. + // This isn't exactly true. It could roll over beyond + // this number. + public UInt32 ComputeSegment(int length) + { + if (_innerStream.Position + length > _maxSegmentSize) + // the block will go AT LEAST into the next segment + return CurrentSegment + 1; + + // it will fit in the current segment + return CurrentSegment; + } + + + public override String ToString() + { + return String.Format("{0}[{1}][{2}], pos=0x{3:X})", + "ZipSegmentedStream", CurrentName, + rwMode.ToString(), + this.Position); + } + + + private void _SetReadStream() + { + if (_innerStream != null) + { +#if NETCF + _innerStream.Close(); +#else + _innerStream.Dispose(); +#endif + } + + if (CurrentSegment + 1 == _maxDiskNumber) + _currentName = _baseName; + + // Console.WriteLine("ZSS: SRS ({0})", + // Path.GetFileName(CurrentName)); + + _innerStream = File.OpenRead(CurrentName); + } + + + /// + /// Read from the stream + /// + /// the buffer to read + /// the offset at which to start + /// the number of bytes to read + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + if (rwMode != RwMode.ReadOnly) + { + _exceptionPending = true; + throw new InvalidOperationException("Stream Error: Cannot Read."); + } + + int r = _innerStream.Read(buffer, offset, count); + int r1 = r; + + while (r1 != count) + { + if (_innerStream.Position != _innerStream.Length) + { + _exceptionPending = true; + throw new ZipException(String.Format("Read error in file {0}", CurrentName)); + + } + + if (CurrentSegment + 1 == _maxDiskNumber) + return r; // no more to read + + CurrentSegment++; + _SetReadStream(); + offset += r1; + count -= r1; + r1 = _innerStream.Read(buffer, offset, count); + r += r1; + } + return r; + } + + + + private void _SetWriteStream(uint increment) + { + if (_innerStream != null) + { +#if NETCF + _innerStream.Close(); +#else + _innerStream.Dispose(); +#endif + if (File.Exists(CurrentName)) + File.Delete(CurrentName); + File.Move(_currentTempName, CurrentName); + // Console.WriteLine("ZSS: SWS close ({0})", + // Path.GetFileName(CurrentName)); + } + + if (increment > 0) + CurrentSegment += increment; + + SharedUtilities.CreateAndOpenUniqueTempFile(_baseDir, + out _innerStream, + out _currentTempName); + + // Console.WriteLine("ZSS: SWS open ({0})", + // Path.GetFileName(_currentTempName)); + + if (CurrentSegment == 0) + _innerStream.Write(BitConverter.GetBytes(ZipConstants.SplitArchiveSignature), 0, 4); + } + + + /// + /// Write to the stream. + /// + /// the buffer from which to write + /// the offset at which to start writing + /// the number of bytes to write + public override void Write(byte[] buffer, int offset, int count) + { + if (rwMode != RwMode.Write) + { + _exceptionPending = true; + throw new InvalidOperationException("Stream Error: Cannot Write."); + } + + + if (ContiguousWrite) + { + // enough space for a contiguous write? + if (_innerStream.Position + count > _maxSegmentSize) + _SetWriteStream(1); + } + else + { + while (_innerStream.Position + count > _maxSegmentSize) + { + int c = unchecked(_maxSegmentSize - (int)_innerStream.Position); + _innerStream.Write(buffer, offset, c); + _SetWriteStream(1); + count -= c; + offset += c; + } + } + + _innerStream.Write(buffer, offset, count); + } + + + public long TruncateBackward(uint diskNumber, long offset) + { + // Console.WriteLine("***ZSS.Trunc to disk {0}", diskNumber); + // Console.WriteLine("***ZSS.Trunc: current disk {0}", CurrentSegment); + if (diskNumber >= 99) + throw new ArgumentOutOfRangeException("diskNumber"); + + if (rwMode != RwMode.Write) + { + _exceptionPending = true; + throw new ZipException("bad state."); + } + + // Seek back in the segmented stream to a (maybe) prior segment. + + // Check if it is the same segment. If it is, very simple. + if (diskNumber == CurrentSegment) + { + var x =_innerStream.Seek(offset, SeekOrigin.Begin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_innerStream); + return x; + } + + // Seeking back to a prior segment. + // The current segment and any intervening segments must be removed. + // First, close the current segment, and then remove it. + if (_innerStream != null) + { +#if NETCF + _innerStream.Close(); +#else + _innerStream.Dispose(); +#endif + if (File.Exists(_currentTempName)) + File.Delete(_currentTempName); + } + + // Now, remove intervening segments. + for (uint j= CurrentSegment-1; j > diskNumber; j--) + { + string s = _NameForSegment(j); + // Console.WriteLine("***ZSS.Trunc: removing file {0}", s); + if (File.Exists(s)) + File.Delete(s); + } + + // now, open the desired segment. It must exist. + CurrentSegment = diskNumber; + + // get a new temp file, try 3 times: + for (int i = 0; i < 3; i++) + { + try + { + _currentTempName = SharedUtilities.InternalGetTempFileName(); + // move the .z0x file back to a temp name + File.Move(CurrentName, _currentTempName); + break; // workitem 12403 + } + catch(IOException) + { + if (i == 2) throw; + } + } + + // open it + _innerStream = new FileStream(_currentTempName, FileMode.Open); + + var r = _innerStream.Seek(offset, SeekOrigin.Begin); + + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_innerStream); + + return r; + } + + + + public override bool CanRead + { + get + { + return (rwMode == RwMode.ReadOnly && + (_innerStream != null) && + _innerStream.CanRead); + } + } + + + public override bool CanSeek + { + get + { + return (_innerStream != null) && + _innerStream.CanSeek; + } + } + + + public override bool CanWrite + { + get + { + return (rwMode == RwMode.Write) && + (_innerStream != null) && + _innerStream.CanWrite; + } + } + + public override void Flush() + { + _innerStream.Flush(); + } + + public override long Length + { + get + { + return _innerStream.Length; + } + } + + public override long Position + { + get { return _innerStream.Position; } + set { _innerStream.Position = value; } + } + + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + var x = _innerStream.Seek(offset, origin); + // workitem 10178 + Ionic.Zip.SharedUtilities.Workaround_Ladybug318918(_innerStream); + return x; + } + + public override void SetLength(long value) + { + if (rwMode != RwMode.Write) + { + _exceptionPending = true; + throw new InvalidOperationException(); + } + _innerStream.SetLength(value); + } + + + protected override void Dispose(bool disposing) + { + // this gets called by Stream.Close() + + // if (_isDisposed) return; + // _isDisposed = true; + //Console.WriteLine("Dispose (mode={0})\n", rwMode.ToString()); + + try + { + if (_innerStream != null) + { +#if NETCF + _innerStream.Close(); +#else + _innerStream.Dispose(); +#endif + //_innerStream = null; + if (rwMode == RwMode.Write) + { + if (_exceptionPending) + { + // possibly could try to clean up all the + // temp files created so far... + } + else + { + // // move the final temp file to the .zNN name + // if (File.Exists(CurrentName)) + // File.Delete(CurrentName); + // if (File.Exists(_currentTempName)) + // File.Move(_currentTempName, CurrentName); + } + } + } + } + finally + { + base.Dispose(disposing); + } + } + + } + +} \ No newline at end of file diff --git a/dotNetZip/Zip/msbuild.flymake.xml b/dotNetZip/Zip/msbuild.flymake.xml new file mode 100644 index 0000000..10ed060 --- /dev/null +++ b/dotNetZip/Zip/msbuild.flymake.xml @@ -0,0 +1,64 @@ + + + + + + false + true + + .\ + .\ + .\obj\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotNetZip/ZipSrc.ps1 b/dotNetZip/ZipSrc.ps1 new file mode 100644 index 0000000..1e38009 --- /dev/null +++ b/dotNetZip/ZipSrc.ps1 @@ -0,0 +1,89 @@ +# ------------------------------------------------------- +# ZipSrc.ps1 +# +# Zips the source tree for DotNetZip. This is used when producing a +# release. +# +# This script is part of DotNetZip. +# DotNetZip is Copyright 2008-2011 Dino Chiesa. +# +# DotNetZip is licensed under the MS-PL. See the accompanying +# License.txt file. +# +# Last Updated: <2011-July-30 15:56:10> +# +# ------------------------------------------------------- + +function ZipUp-Files ( $directory ) +{ + $children = get-childitem -path $directory + foreach ($o in $children) + { + if (!$BaseDir -or ($BaseDir -eq "")) { + $ix = $o.PSParentPath.IndexOf("::") + $BaseDir = $o.PSParentPath.Substring($ix+2) + $x = get-item $BaseDir + $ix = $x.PSParentPath.IndexOf("::") + $ParentOfBase = $x.PSParentPath.Substring($ix+2) + "\\" + } + + if ($o.Name -ne "TestResults" -and + $o.Name -ne "_UpgradeReport_Files" -and + $o.Name -ne "obj" -and + $o.Name -ne "releases" -and + $o.Name -ne "bin" -and + $o.Name -ne "_tfs" -and + $o.Name -ne "notused" -and + $o.Name -ne "Todo.txt" -and + $o.Name -ne "AppNote.txt" -and + $o.Name -ne "AppNote.iz.txt" -and + $o.Name -ne "CodePlex-Readme.txt" -and + $o.Name -ne "ReadThis.txt" -and + $o.Name -ne "Ionic.snk" -and + $o.Name -ne "Ionic.pfx" -and + $o.Name -ne "Debug" -and + $o.Name -ne "Release" ) + # -and $o.Name -ne "Resources" ) + { + if ($o.PSIsContainer) + { + ZipUp-Files ( $o.FullName ) + } + else + { + #Write-output $o.FullName + if ($o.Name -and + $o.Name -ne "" -and + $o.Name -ne ".tfs-ignore" -and + (!$o.Name.StartsWith("UpgradeLog")) -and + (!$o.Name.EndsWith("~")) -and + (!$o.Name.EndsWith("#")) -and + (!$o.Name.EndsWith(".vsp")) -and + (!$o.Name.EndsWith(".vspscc")) -and + (!$o.Name.EndsWith(".psess")) -and + (!$o.Name.EndsWith(".user")) -and + (!$o.Name.EndsWith(".cache")) + # -and (!$o.Name.EndsWith(".zip")) # was eliminating test cases + ) + { + Write-output $o.FullName.Replace($ParentOfBase, "") + $e= $zipfile.AddFile($o.FullName.Replace($ParentOfBase, "")) + } + } + } + } +} + + +[System.Reflection.Assembly]::LoadFrom("c:\\dev\\dotnet\\Ionic.Zip.dll"); + +$version = get-content -path 'DotNetZip\SolutionInfo.cs' | select-string -pattern 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)' | %{$_ -replace "[^0-9.]",""} + +$ZipFileName = "DotNetZip-src-v$version.zip" + +$zipfile = new-object Ionic.Zip.ZipFile($ZipFileName); + +ZipUp-Files "DotNetZip" + +$zipfile.Save() + diff --git a/dotNetZip/Zlib CF/Properties/AssemblyInfo.cs b/dotNetZip/Zlib CF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9adaed9 Binary files /dev/null and b/dotNetZip/Zlib CF/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zlib CF/Zlib CF DLL.csproj b/dotNetZip/Zlib CF/Zlib CF DLL.csproj new file mode 100644 index 0000000..1025694 --- /dev/null +++ b/dotNetZip/Zlib CF/Zlib CF DLL.csproj @@ -0,0 +1,135 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E082D395-52BE-41EE-812B-8B09C51025B4} + Library + Properties + Ionic.Zip.CF + Ionic.Zlib.CF + Smartphone + f27da329-3269-4191-98e0-c87d3d7f1db9 + 5.2 + Ionic.Zip.CF + v2.0 + Windows Mobile 6 Standard SDK + true + ..\Ionic.snk + + + SAK + SAK + SAK + SAK + + + 4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;Smartphone; NETCF; NETCF20 + true + true + prompt + 512 + 4 + Off + bin\Debug\Ionic.Zlib.CF.XML + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE;Smartphone; NETCF; NETCF20 + true + true + prompt + 512 + 4 + Off + AllRules.ruleset + + + + + + + + + + CRC32.cs + + + Iso8859Dash1Encoding.cs + + + Properties\SolutionInfo.cs + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zlib SL DLL/Properties/AssemblyInfo.cs b/dotNetZip/Zlib SL DLL/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dd63f4b --- /dev/null +++ b/dotNetZip/Zlib SL DLL/Properties/AssemblyInfo.cs @@ -0,0 +1,21 @@ +using System.Reflection; +using System.Security; +using System.Runtime.CompilerServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("Ionic's Managed Zlib for Silverlight")] + +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +[assembly: AssemblyDescription("library for Deflate and ZLIB compression. http://www.codeplex.com/DotNetZip (Flavor=Debug)")] +#else +[assembly: AssemblyConfiguration("Retail")] +[assembly: AssemblyDescription("library for Deflate and ZLIB compression. http://www.codeplex.com/DotNetZip (Flavor=Retail)")] +#endif + + +[assembly: System.CLSCompliant(true)] + diff --git a/dotNetZip/Zlib SL DLL/Zlib SL DLL.csproj b/dotNetZip/Zlib SL DLL/Zlib SL DLL.csproj new file mode 100644 index 0000000..9fc5eff --- /dev/null +++ b/dotNetZip/Zlib SL DLL/Zlib SL DLL.csproj @@ -0,0 +1,137 @@ + + + + v3.5 + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {8E580B45-AECD-46BF-9D63-CD8BECE24D29} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Ionic.Zlib + Ionic.Zlib + v3.0 + false + true + true + SAK + SAK + SAK + SAK + true + ..\Ionic.snk + Silverlight + $(TargetFrameworkVersion) + + + 4.0 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + Bin\Debug + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + Bin\Debug\Ionic.Zlib.XML + AllRules.ruleset + + + pdbonly + true + Bin\Release + TRACE;SILVERLIGHT + true + true + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + + + CRC32.cs + + + Iso8859Dash1Encoding.cs + + + + Properties\SolutionInfo.cs + + + + + Ionic.snk + + + + + LICENSE.txt + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zlib Tests/Properties/AssemblyInfo.cs b/dotNetZip/Zlib Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..57a6454 Binary files /dev/null and b/dotNetZip/Zlib Tests/Properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zlib Tests/Resources/zlibbed.file b/dotNetZip/Zlib Tests/Resources/zlibbed.file new file mode 100644 index 0000000..84b99ff Binary files /dev/null and b/dotNetZip/Zlib Tests/Resources/zlibbed.file differ diff --git a/dotNetZip/Zlib Tests/Zlib Tests.csproj b/dotNetZip/Zlib Tests/Zlib Tests.csproj new file mode 100644 index 0000000..8816675 --- /dev/null +++ b/dotNetZip/Zlib Tests/Zlib Tests.csproj @@ -0,0 +1,115 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {047A98B2-BC96-41B4-ADD8-2167FB1B6502} + Library + Properties + ZlibTest + ZlibTest + v4.0 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + SAK + SAK + SAK + SAK + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + Properties\SolutionInfo.cs + + + + + Always + + + + + {9816BA86-9250-4C00-A912-25F07F8677D1} + Zlib DLL + + + {52542d59-25ec-4ee4-8af2-85de50c70ea6} + GZip + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dotNetZip/Zlib Tests/ZlibUnitTest1.cs b/dotNetZip/Zlib Tests/ZlibUnitTest1.cs new file mode 100644 index 0000000..ce47a4c --- /dev/null +++ b/dotNetZip/Zlib Tests/ZlibUnitTest1.cs @@ -0,0 +1,2066 @@ +using System; +using System.Text; +using System.Collections.Generic; +using Ionic.Zlib; + +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.IO; + +namespace Ionic.Zlib.Tests +{ + /// + /// Summary description for UnitTest1 + /// + [TestClass] + public class UnitTest1 + { + System.Random rnd; + Dictionary TestStrings; + + public UnitTest1() + { + this.rnd = new System.Random(); + TestStrings = new Dictionary () + { + { "LetMeDoItNow", LetMeDoItNow }, + { "GoPlacidly", GoPlacidly }, + { "IhaveaDream", IhaveaDream }, + { "LoremIpsum", LoremIpsum }, + }; + } + + static UnitTest1() + { + LoremIpsumWords = LoremIpsum.Split(" ".ToCharArray(), + StringSplitOptions.RemoveEmptyEntries); + } + + + private TestContext testContextInstance; + + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + public TestContext TestContext + { + get + { + return testContextInstance; + } + set + { + testContextInstance = value; + } + } + + #region Additional test attributes + // + // You can use the following additional attributes as you write your tests: + // + // Use ClassInitialize to run code before running the first test in the class + // [ClassInitialize()] + // public static void MyClassInitialize(TestContext testContext) { } + // + // Use ClassCleanup to run code after all tests in a class have run + // [ClassCleanup()] + // public static void MyClassCleanup() { } + // + // Use TestInitialize to run code before running each test + // [TestInitialize()] + // public void MyTestInitialize() { } + // + // Use TestCleanup to run code after each test has run + // [TestCleanup()] + // public void MyTestCleanup() { } + // + + private string CurrentDir = null; + private string TopLevelDir = null; + + // Use TestInitialize to run code before running each test + [TestInitialize()] + public void MyTestInitialize() + { + CurrentDir = System.IO.Directory.GetCurrentDirectory(); + Assert.AreNotEqual(System.IO.Path.GetFileName(CurrentDir), "Temp", "at start"); + + string parentDir = System.Environment.GetEnvironmentVariable("TEMP"); + + TopLevelDir = System.IO.Path.Combine(parentDir, String.Format("Ionic.ZlibTest-{0}.tmp", System.DateTime.Now.ToString("yyyyMMMdd-HHmmss"))); + System.IO.Directory.CreateDirectory(TopLevelDir); + System.IO.Directory.SetCurrentDirectory(TopLevelDir); + } + + + // Use TestCleanup to run code after each test has run + [TestCleanup()] + public void MyTestCleanup() + { + System.IO.Directory.SetCurrentDirectory(System.Environment.GetEnvironmentVariable("TEMP")); + System.IO.Directory.Delete(TopLevelDir, true); + Assert.AreNotEqual(System.IO.Path.GetFileName(CurrentDir), "Temp", "at finish"); + System.IO.Directory.SetCurrentDirectory(CurrentDir); + } + + + #endregion + + #region Helpers + /// + /// Converts a string to a MemoryStream. + /// + static MemoryStream StringToMemoryStream(string s) + { + System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + int byteCount = enc.GetByteCount(s.ToCharArray(), 0, s.Length); + byte[] ByteArray = new byte[byteCount]; + int bytesEncodedCount = enc.GetBytes(s, 0, s.Length, ByteArray, 0); + System.IO.MemoryStream ms = new System.IO.MemoryStream(ByteArray); + return ms; + } + + /// + /// Converts a MemoryStream to a string. Makes some assumptions about the content of the stream. + /// + /// + /// + static String MemoryStreamToString(System.IO.MemoryStream ms) + { + byte[] ByteArray = ms.ToArray(); + System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + var s = enc.GetString(ByteArray); + return s; + } + + private static void CopyStream(System.IO.Stream src, System.IO.Stream dest) + { + byte[] buffer = new byte[1024]; + int len = 0; + while ((len=src.Read(buffer, 0, buffer.Length)) > 0) + { + dest.Write(buffer, 0, len); + } + dest.Flush(); + } + + private static string GetTestDependentDir(string startingPoint, string subdir) + { + var location = startingPoint; + for (int i = 0; i < 3; i++) + location = Path.GetDirectoryName(location); + + location = Path.Combine(location, subdir); + return location; + } + + private static string GetTestBinDir(string startingPoint) + { + return GetTestDependentDir(startingPoint, "Zlib Tests\\bin\\Debug"); + } + + private string GetContentFile(string fileName) + { + string testBin = GetTestBinDir(CurrentDir); + string path = Path.Combine(testBin, String.Format("Resources\\{0}", fileName)); + Assert.IsTrue(File.Exists(path), "file ({0}) does not exist", path); + return path; + } + + internal string Exec(string program, string args) + { + return Exec(program, args, true); + } + + internal string Exec(string program, string args, bool waitForExit) + { + return Exec(program, args, waitForExit, true); + } + + internal string Exec(string program, string args, bool waitForExit, bool emitOutput) + { + if (program == null) + throw new ArgumentException("program"); + + if (args == null) + throw new ArgumentException("args"); + + // Microsoft.VisualStudio.TestTools.UnitTesting + this.TestContext.WriteLine("running command: {0} {1}", program, args); + + string output; + int rc = Exec_NoContext(program, args, waitForExit, out output); + + if (rc != 0) + throw new Exception(String.Format("Non-zero RC {0}: {1}", program, output)); + + if (emitOutput) + this.TestContext.WriteLine("output: {0}", output); + else + this.TestContext.WriteLine("A-OK. (output suppressed)"); + + return output; + } + + internal static int Exec_NoContext(string program, string args, bool waitForExit, out string output) + { + System.Diagnostics.Process p = new System.Diagnostics.Process + { + StartInfo = + { + FileName = program, + CreateNoWindow = true, + Arguments = args, + WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, + UseShellExecute = false, + } + + }; + + if (waitForExit) + { + StringBuilder sb = new StringBuilder(); + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardError = true; + // must read at least one of the stderr or stdout asynchronously, + // to avoid deadlock + Action stdErrorRead = (o, e) => + { + if (!String.IsNullOrEmpty(e.Data)) + sb.Append(e.Data); + }; + + p.ErrorDataReceived += new System.Diagnostics.DataReceivedEventHandler(stdErrorRead); + p.Start(); + p.BeginErrorReadLine(); + output = p.StandardOutput.ReadToEnd(); + p.WaitForExit(); + if (sb.Length > 0) + output += sb.ToString(); + //output = CleanWzzipOut(output); // just in case + return p.ExitCode; + } + else + { + p.Start(); + } + output = ""; + return 0; + } + + #endregion + + + [TestMethod] + public void zlib_Compat_decompress_wi13446() + { + var zlibbedFile = GetContentFile("zlibbed.file"); + var streamCopy = new Action( (source,dest,bufferSize) => { + var temp = new byte[bufferSize]; + while (true) + { + var read = source.Read(temp, 0, temp.Length); + if (read <= 0) break; + dest.Write(temp, 0, read); + } + }); + + var unpack = new Action ((bufferSize) => { + using (var output = new MemoryStream()) + { + using (var input = File.OpenRead(zlibbedFile)) + { + using (var zinput = new ZlibStream(input, CompressionMode.Decompress)) + { + streamCopy(zinput, output, bufferSize); + } + } + } + }); + + unpack(1024); + unpack(16384); + } + + + [TestMethod] + public void Zlib_BasicDeflateAndInflate() + { + string TextToCompress = LoremIpsum; + + int rc; + int bufferSize = 40000; + byte[] compressedBytes = new byte[bufferSize]; + byte[] decompressedBytes = new byte[bufferSize]; + + ZlibCodec compressingStream = new ZlibCodec(); + + rc = compressingStream.InitializeDeflate(CompressionLevel.Default); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at InitializeDeflate() [{0}]", compressingStream.Message)); + + compressingStream.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + compressingStream.NextIn = 0; + + compressingStream.OutputBuffer = compressedBytes; + compressingStream.NextOut = 0; + + while (compressingStream.TotalBytesIn != TextToCompress.Length && compressingStream.TotalBytesOut < bufferSize) + { + compressingStream.AvailableBytesIn = compressingStream.AvailableBytesOut = 1; // force small buffers + rc = compressingStream.Deflate(FlushType.None); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at Deflate(1) [{0}]", compressingStream.Message)); + } + + while (true) + { + compressingStream.AvailableBytesOut = 1; + rc = compressingStream.Deflate(FlushType.Finish); + if (rc == ZlibConstants.Z_STREAM_END) + break; + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at Deflate(2) [{0}]", compressingStream.Message)); + } + + rc = compressingStream.EndDeflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndDeflate() [{0}]", compressingStream.Message)); + + ZlibCodec decompressingStream = new ZlibCodec(); + + decompressingStream.InputBuffer = compressedBytes; + decompressingStream.NextIn = 0; + decompressingStream.OutputBuffer = decompressedBytes; + decompressingStream.NextOut = 0; + + rc = decompressingStream.InitializeInflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at InitializeInflate() [{0}]", decompressingStream.Message)); + //CheckForError(decompressingStream, rc, "inflateInit"); + + while (decompressingStream.TotalBytesOut < decompressedBytes.Length && decompressingStream.TotalBytesIn < bufferSize) + { + decompressingStream.AvailableBytesIn = decompressingStream.AvailableBytesOut = 1; /* force small buffers */ + rc = decompressingStream.Inflate(FlushType.None); + if (rc == ZlibConstants.Z_STREAM_END) + break; + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at Inflate() [{0}]", decompressingStream.Message)); + //CheckForError(decompressingStream, rc, "inflate"); + } + + rc = decompressingStream.EndInflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndInflate() [{0}]", decompressingStream.Message)); + //CheckForError(decompressingStream, rc, "inflateEnd"); + + int j = 0; + for (; j < decompressedBytes.Length; j++) + if (decompressedBytes[j] == 0) + break; + + Assert.AreEqual(TextToCompress.Length, j, String.Format("Unequal lengths")); + + int i = 0; + for (i = 0; i < j; i++) + if (TextToCompress[i] != decompressedBytes[i]) + break; + + Assert.AreEqual(j, i, String.Format("Non-identical content")); + + var result = System.Text.ASCIIEncoding.ASCII.GetString(decompressedBytes, 0, j); + + TestContext.WriteLine("orig length: {0}", TextToCompress.Length); + TestContext.WriteLine("compressed length: {0}", compressingStream.TotalBytesOut); + TestContext.WriteLine("decompressed length: {0}", decompressingStream.TotalBytesOut); + TestContext.WriteLine("result length: {0}", result.Length); + TestContext.WriteLine("result of inflate:\n{0}", result); + return; + } + + + [TestMethod] + public void GZ_Utility() + { + var gzbin = GetTestDependentDir(CurrentDir, "Tools\\GZip\\bin\\Debug"); + var dnzGzipexe = Path.Combine(gzbin, "gzip.exe"); + Assert.IsTrue(File.Exists(dnzGzipexe), "Gzip.exe is missing {0}", + dnzGzipexe); + var unxGzipexe = "\\bin\\gzip.exe"; + Assert.IsTrue(File.Exists(unxGzipexe), "Gzip.exe is missing {0}", + unxGzipexe); + + foreach (var key in TestStrings.Keys) + { + int count = this.rnd.Next(81) + 40; + TestContext.WriteLine("Doing string {0}", key); + var s = TestStrings[key]; + var fname = String.Format("Pippo-{0}.txt", key); + using (var sw = new StreamWriter(File.Create(fname))) + { + for (int k=0; k < count; k++) + { + sw.WriteLine(s); + } + } + + int crcOriginal = DoCrc(fname); + + string args = fname + " -keep -v"; + TestContext.WriteLine("Exec: gzip {0}", args); + string gzout = this.Exec(dnzGzipexe, args); + + var gzfile = fname + ".gz"; + Assert.IsTrue(File.Exists(gzfile), "File is missing. {0}", + gzfile); + + File.Delete(fname); + Assert.IsTrue(!File.Exists(fname), "The delete failed. {0}", + fname); + + System.Threading.Thread.Sleep(1200); + + args = "-dfv "+ gzfile; + TestContext.WriteLine("Exec: gzip {0}", args); + gzout = this.Exec(unxGzipexe, args); + Assert.IsTrue(File.Exists(fname), "File is missing. {0}", + fname); + + int crcDecompressed = DoCrc(fname); + Assert.AreEqual(crcOriginal, crcDecompressed, + "CRC mismatch {0:X8}!={1:X8}", + crcOriginal, crcDecompressed); + } + } + + + + + + [TestMethod] + public void Zlib_BasicDictionaryDeflateInflate() + { + int rc; + int comprLen = 40000; + int uncomprLen = comprLen; + byte[] uncompr = new byte[uncomprLen]; + byte[] compr = new byte[comprLen]; + //long dictId; + + ZlibCodec compressor = new ZlibCodec(); + rc = compressor.InitializeDeflate(CompressionLevel.BestCompression); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at InitializeDeflate() [{0}]", compressor.Message)); + + string dictionaryWord = "hello "; + byte[] dictionary = System.Text.ASCIIEncoding.ASCII.GetBytes(dictionaryWord); + string TextToCompress = "hello, hello! How are you, Joe? I said hello. "; + byte[] BytesToCompress = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + + rc = compressor.SetDictionary(dictionary); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at SetDeflateDictionary() [{0}]", compressor.Message)); + + int dictId = compressor.Adler32; + + compressor.OutputBuffer = compr; + compressor.NextOut = 0; + compressor.AvailableBytesOut = comprLen; + + compressor.InputBuffer = BytesToCompress; + compressor.NextIn = 0; + compressor.AvailableBytesIn = BytesToCompress.Length; + + rc = compressor.Deflate(FlushType.Finish); + Assert.AreEqual(ZlibConstants.Z_STREAM_END, rc, String.Format("at Deflate() [{0}]", compressor.Message)); + + rc = compressor.EndDeflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndDeflate() [{0}]", compressor.Message)); + + + ZlibCodec decompressor = new ZlibCodec(); + + decompressor.InputBuffer = compr; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = comprLen; + + rc = decompressor.InitializeInflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at InitializeInflate() [{0}]", decompressor.Message)); + + decompressor.OutputBuffer = uncompr; + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = uncomprLen; + + while (true) + { + rc = decompressor.Inflate(FlushType.None); + if (rc == ZlibConstants.Z_STREAM_END) + { + break; + } + if (rc == ZlibConstants.Z_NEED_DICT) + { + Assert.AreEqual(dictId, decompressor.Adler32, "Unexpected Dictionary"); + rc = decompressor.SetDictionary(dictionary); + } + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at Inflate/SetInflateDictionary() [{0}]", decompressor.Message)); + } + + rc = decompressor.EndInflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndInflate() [{0}]", decompressor.Message)); + + int j = 0; + for (; j < uncompr.Length; j++) + if (uncompr[j] == 0) + break; + + Assert.AreEqual(TextToCompress.Length, j, String.Format("Unequal lengths")); + + int i = 0; + for (i = 0; i < j; i++) + if (TextToCompress[i] != uncompr[i]) + break; + + Assert.AreEqual(j, i, String.Format("Non-identical content")); + + var result = System.Text.ASCIIEncoding.ASCII.GetString(uncompr, 0, j); + + TestContext.WriteLine("orig length: {0}", TextToCompress.Length); + TestContext.WriteLine("compressed length: {0}", compressor.TotalBytesOut); + TestContext.WriteLine("uncompressed length: {0}", decompressor.TotalBytesOut); + TestContext.WriteLine("result length: {0}", result.Length); + TestContext.WriteLine("result of inflate:\n{0}", result); + } + + [TestMethod] + public void Zlib_TestFlushSync() + { + int rc; + int bufferSize = 40000; + byte[] CompressedBytes = new byte[bufferSize]; + byte[] DecompressedBytes = new byte[bufferSize]; + string TextToCompress = "This is the text that will be compressed."; + byte[] BytesToCompress = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + + ZlibCodec compressor = new ZlibCodec(CompressionMode.Compress); + + compressor.InputBuffer = BytesToCompress; + compressor.NextIn = 0; + compressor.AvailableBytesIn = 3; + + compressor.OutputBuffer = CompressedBytes; + compressor.NextOut = 0; + compressor.AvailableBytesOut = CompressedBytes.Length; + + rc = compressor.Deflate(FlushType.Full); + + CompressedBytes[3]++; // force an error in first compressed block // dinoch - ?? + compressor.AvailableBytesIn = TextToCompress.Length - 3; + + rc = compressor.Deflate(FlushType.Finish); + Assert.AreEqual(ZlibConstants.Z_STREAM_END, rc, String.Format("at Deflate() [{0}]", compressor.Message)); + + rc = compressor.EndDeflate(); + bufferSize = (int)(compressor.TotalBytesOut); + + ZlibCodec decompressor = new ZlibCodec(CompressionMode.Decompress); + + decompressor.InputBuffer = CompressedBytes; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = 2; + + decompressor.OutputBuffer = DecompressedBytes; + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = DecompressedBytes.Length; + + rc = decompressor.Inflate(FlushType.None); + decompressor.AvailableBytesIn = bufferSize - 2; + + rc = decompressor.SyncInflate(); + + bool gotException = false; + try + { + rc = decompressor.Inflate(FlushType.Finish); + } + catch (ZlibException ex1) + { + TestContext.WriteLine("Got Expected Exception: " + ex1); + gotException = true; + } + + Assert.IsTrue(gotException, "inflate should report DATA_ERROR"); + + rc = decompressor.EndInflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndInflate() [{0}]", decompressor.Message)); + + int j = 0; + for (; j < DecompressedBytes.Length; j++) + if (DecompressedBytes[j] == 0) + break; + + var result = System.Text.ASCIIEncoding.ASCII.GetString(DecompressedBytes, 0, j); + + Assert.AreEqual(TextToCompress.Length, result.Length + 3, "Strings are unequal lengths"); + + Console.WriteLine("orig length: {0}", TextToCompress.Length); + Console.WriteLine("compressed length: {0}", compressor.TotalBytesOut); + Console.WriteLine("uncompressed length: {0}", decompressor.TotalBytesOut); + Console.WriteLine("result length: {0}", result.Length); + Console.WriteLine("result of inflate:\n(Thi){0}", result); + } + + [TestMethod] + public void Zlib_Codec_TestLargeDeflateInflate() + { + int rc; + int j; + int bufferSize = 80000; + byte[] compressedBytes = new byte[bufferSize]; + byte[] workBuffer = new byte[bufferSize / 4]; + + ZlibCodec compressingStream = new ZlibCodec(); + + rc = compressingStream.InitializeDeflate(CompressionLevel.Level1); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at InitializeDeflate() [{0}]", compressingStream.Message)); + + compressingStream.OutputBuffer = compressedBytes; + compressingStream.AvailableBytesOut = compressedBytes.Length; + compressingStream.NextOut = 0; + System.Random rnd = new Random(); + + for (int k = 0; k < 4; k++) + { + switch (k) + { + case 0: + // At this point, workBuffer is all zeroes, so it should compress very well. + break; + + case 1: + // switch to no compression, keep same workBuffer (all zeroes): + compressingStream.SetDeflateParams(CompressionLevel.None, CompressionStrategy.Default); + break; + + case 2: + // Insert data into workBuffer, and switch back to compressing mode. + // we'll use lengths of the same random byte: + for (int i = 0; i < workBuffer.Length / 1000; i++) + { + byte b = (byte)rnd.Next(); + int n = 500 + rnd.Next(500); + for (j = 0; j < n; j++) + workBuffer[j + i] = b; + i += j - 1; + } + compressingStream.SetDeflateParams(CompressionLevel.BestCompression, CompressionStrategy.Filtered); + break; + + case 3: + // insert totally random data into the workBuffer + rnd.NextBytes(workBuffer); + break; + } + + compressingStream.InputBuffer = workBuffer; + compressingStream.NextIn = 0; + compressingStream.AvailableBytesIn = workBuffer.Length; + rc = compressingStream.Deflate(FlushType.None); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at Deflate({0}) [{1}]", k, compressingStream.Message)); + + if (k == 0) + Assert.AreEqual(0, compressingStream.AvailableBytesIn, "Deflate should be greedy."); + + TestContext.WriteLine("Stage {0}: uncompressed/compresssed bytes so far: ({1,6}/{2,6})", + k, compressingStream.TotalBytesIn, compressingStream.TotalBytesOut); + } + + rc = compressingStream.Deflate(FlushType.Finish); + Assert.AreEqual(ZlibConstants.Z_STREAM_END, rc, String.Format("at Deflate() [{0}]", compressingStream.Message)); + + rc = compressingStream.EndDeflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndDeflate() [{0}]", compressingStream.Message)); + + TestContext.WriteLine("Final: uncompressed/compressed bytes: ({0,6},{1,6})", + compressingStream.TotalBytesIn, compressingStream.TotalBytesOut); + + ZlibCodec decompressingStream = new ZlibCodec(CompressionMode.Decompress); + + decompressingStream.InputBuffer = compressedBytes; + decompressingStream.NextIn = 0; + decompressingStream.AvailableBytesIn = bufferSize; + + // upon inflating, we overwrite the decompressedBytes buffer repeatedly + int nCycles = 0; + while (true) + { + decompressingStream.OutputBuffer = workBuffer; + decompressingStream.NextOut = 0; + decompressingStream.AvailableBytesOut = workBuffer.Length; + rc = decompressingStream.Inflate(FlushType.None); + + nCycles++; + + if (rc == ZlibConstants.Z_STREAM_END) + break; + + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at Inflate() [{0}] TotalBytesOut={1}", + decompressingStream.Message, decompressingStream.TotalBytesOut)); + } + + rc = decompressingStream.EndInflate(); + Assert.AreEqual(ZlibConstants.Z_OK, rc, String.Format("at EndInflate() [{0}]", decompressingStream.Message)); + + Assert.AreEqual(4 * workBuffer.Length, (int)decompressingStream.TotalBytesOut); + + TestContext.WriteLine("compressed length: {0}", compressingStream.TotalBytesOut); + TestContext.WriteLine("decompressed length (expected): {0}", 4 * workBuffer.Length); + TestContext.WriteLine("decompressed length (actual) : {0}", decompressingStream.TotalBytesOut); + TestContext.WriteLine("decompression cycles: {0}", nCycles); + } + + + + [TestMethod] + public void Zlib_CompressString() + { + TestContext.WriteLine("Original.Length: {0}", GoPlacidly.Length); + byte[] compressed = ZlibStream.CompressString(GoPlacidly); + TestContext.WriteLine("compressed.Length: {0}", compressed.Length); + Assert.IsTrue(compressed.Length < GoPlacidly.Length); + + string uncompressed = ZlibStream.UncompressString(compressed); + Assert.AreEqual(GoPlacidly.Length, uncompressed.Length); + } + + [TestMethod] + public void GZip_CompressString() + { + TestContext.WriteLine("Original.Length: {0}", GoPlacidly.Length); + byte[] compressed = GZipStream.CompressString(GoPlacidly); + TestContext.WriteLine("compressed.Length: {0}", compressed.Length); + Assert.IsTrue(compressed.Length < GoPlacidly.Length); + + string uncompressed = GZipStream.UncompressString(compressed); + Assert.AreEqual(GoPlacidly.Length, uncompressed.Length); + } + + [TestMethod] + public void Deflate_CompressString() + { + TestContext.WriteLine("Original.Length: {0}", GoPlacidly.Length); + byte[] compressed = DeflateStream.CompressString(GoPlacidly); + TestContext.WriteLine("compressed.Length: {0}", compressed.Length); + Assert.IsTrue(compressed.Length < GoPlacidly.Length); + + string uncompressed = DeflateStream.UncompressString(compressed); + Assert.AreEqual(GoPlacidly.Length, uncompressed.Length); + } + + + + [TestMethod] + public void Zlib_ZlibStream_CompressWhileWriting() + { + System.IO.MemoryStream msSinkCompressed; + System.IO.MemoryStream msSinkDecompressed; + ZlibStream zOut; + + // first, compress: + msSinkCompressed = new System.IO.MemoryStream(); + zOut = new ZlibStream(msSinkCompressed, CompressionMode.Compress, CompressionLevel.BestCompression, true); + CopyStream(StringToMemoryStream(IhaveaDream), zOut); + zOut.Close(); + + // at this point, msSinkCompressed contains the compressed bytes + + // now, decompress: + msSinkDecompressed = new System.IO.MemoryStream(); + zOut = new ZlibStream(msSinkDecompressed, CompressionMode.Decompress); + msSinkCompressed.Position = 0; + CopyStream(msSinkCompressed, zOut); + + string result = MemoryStreamToString(msSinkDecompressed); + TestContext.WriteLine("decompressed: {0}", result); + Assert.AreEqual(IhaveaDream, result); + } + + + + [TestMethod] + public void Zlib_ZlibStream_CompressWhileReading_wi8557() + { + // workitem 8557 + System.IO.MemoryStream msSinkCompressed; + System.IO.MemoryStream msSinkDecompressed; + + // first, compress: + msSinkCompressed = new System.IO.MemoryStream(); + ZlibStream zIn= new ZlibStream(StringToMemoryStream(WhatWouldThingsHaveBeenLike), + CompressionMode.Compress, + CompressionLevel.BestCompression, + true); + CopyStream(zIn, msSinkCompressed); + + // At this point, msSinkCompressed contains the compressed bytes. + // Now, decompress: + msSinkDecompressed = new System.IO.MemoryStream(); + ZlibStream zOut = new ZlibStream(msSinkDecompressed, CompressionMode.Decompress); + msSinkCompressed.Position = 0; + CopyStream(msSinkCompressed, zOut); + + string result = MemoryStreamToString(msSinkDecompressed); + TestContext.WriteLine("decompressed: {0}", result); + Assert.AreEqual(WhatWouldThingsHaveBeenLike, result); + } + + + + [TestMethod] + public void Zlib_CodecTest() + { + int sz = this.rnd.Next(50000) + 50000; + string fileName = System.IO.Path.Combine(TopLevelDir, "Zlib_CodecTest.txt"); + CreateAndFillFileText(fileName, sz); + + byte[] UncompressedBytes = System.IO.File.ReadAllBytes(fileName); + + foreach (Ionic.Zlib.CompressionLevel level in Enum.GetValues(typeof(Ionic.Zlib.CompressionLevel))) + { + TestContext.WriteLine("\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + TestContext.WriteLine("trying compression level '{0}'", level.ToString()); + byte[] CompressedBytes = DeflateBuffer(UncompressedBytes, level); + byte[] DecompressedBytes = InflateBuffer(CompressedBytes, UncompressedBytes.Length); + CompareBuffers(UncompressedBytes, DecompressedBytes); + } + System.Threading.Thread.Sleep(2000); + } + + +#if UNNECESSARY + private byte[] ReadFile(string f) + { + System.IO.FileInfo fi = new System.IO.FileInfo(f); + byte[] buffer = new byte[fi.Length]; + + using (var readStream = System.IO.File.OpenRead(f)) + { + readStream.Read(buffer, 0, buffer.Length); + } + return buffer; + } +#endif + + + + private byte[] InflateBuffer(byte[] b, int length) + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec decompressor = new ZlibCodec(); + byte[] DecompressedBytes = new byte[length]; + TestContext.WriteLine("\n============================================"); + TestContext.WriteLine("Size of Buffer to Inflate: {0} bytes.", b.Length); + MemoryStream ms = new MemoryStream(DecompressedBytes); + + int rc = decompressor.InitializeInflate(); + + decompressor.InputBuffer = b; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = b.Length; + + decompressor.OutputBuffer = buffer; + + for (int pass = 0; pass < 2; pass++) + { + FlushType flush = (pass==0) + ? FlushType.None + : FlushType.Finish; + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(flush); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("inflating: " + decompressor.Message); + + if (buffer.Length - decompressor.AvailableBytesOut > 0) + ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + } + + decompressor.EndInflate(); + TestContext.WriteLine("TBO({0}).", decompressor.TotalBytesOut); + return DecompressedBytes; + } + + + + + private void CompareBuffers(byte[] a, byte[] b) + { + TestContext.WriteLine("\n============================================"); + TestContext.WriteLine("Comparing..."); + + if (a.Length != b.Length) + throw new Exception(String.Format("not equal size ({0}!={1})", a.Length, b.Length)); + + for (int i = 0; i < a.Length; i++) + { + if (a[i] != b[i]) + throw new Exception("not equal"); + } + } + + + + private byte[] DeflateBuffer(byte[] b, CompressionLevel level) + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec compressor = new ZlibCodec(); + + TestContext.WriteLine("\n============================================"); + TestContext.WriteLine("Size of Buffer to Deflate: {0} bytes.", b.Length); + MemoryStream ms = new MemoryStream(); + + int rc = compressor.InitializeDeflate(level); + + compressor.InputBuffer = b; + compressor.NextIn = 0; + compressor.AvailableBytesIn = b.Length; + + compressor.OutputBuffer = buffer; + + for (int pass = 0; pass < 2; pass++) + { + FlushType flush = (pass==0) + ? FlushType.None + : FlushType.Finish; + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(flush); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + } + + compressor.EndDeflate(); + Console.WriteLine("TBO({0}).", compressor.TotalBytesOut); + + ms.Seek(0, SeekOrigin.Begin); + byte[] c = new byte[compressor.TotalBytesOut]; + ms.Read(c, 0, c.Length); + return c; + } + + + [TestMethod] + public void Zlib_GZipStream_FileName_And_Comments() + { + // select the name of the zip file + string FileToCompress = System.IO.Path.Combine(TopLevelDir, "Zlib_GZipStream.dat"); + Assert.IsFalse(System.IO.File.Exists(FileToCompress), "The temporary zip file '{0}' already exists.", FileToCompress); + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n = -1; + + int sz = this.rnd.Next(21000) + 15000; + TestContext.WriteLine(" Creating file: {0} sz({1})", FileToCompress, sz); + CreateAndFillFileText(FileToCompress, sz); + + System.IO.FileInfo fi1 = new System.IO.FileInfo(FileToCompress); + int crc1 = DoCrc(FileToCompress); + + // four trials, all combos of FileName and Comment null or not null. + for (int k = 0; k < 4; k++) + { + string CompressedFile = String.Format("{0}-{1}.compressed", FileToCompress, k); + + using (Stream input = File.OpenRead(FileToCompress)) + { + using (FileStream raw = new FileStream(CompressedFile, FileMode.Create)) + { + using (GZipStream compressor = + new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + // FileName is optional metadata in the GZip bytestream + if (k % 2 == 1) + compressor.FileName = FileToCompress; + + // Comment is optional metadata in the GZip bytestream + if (k > 2) + compressor.Comment = "Compressing: " + FileToCompress; + + byte[] buffer = new byte[1024]; + n = -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + + n = input.Read(buffer, 0, buffer.Length); + } + } + } + } + + System.IO.FileInfo fi2 = new System.IO.FileInfo(CompressedFile); + + Assert.IsTrue(fi1.Length > fi2.Length, String.Format("Compressed File is not smaller, trial {0} ({1}!>{2})", k, fi1.Length, fi2.Length)); + + + // decompress twice: + // once with System.IO.Compression.GZipStream and once with Ionic.Zlib.GZipStream + for (int j = 0; j < 2; j++) + { + using (var input = System.IO.File.OpenRead(CompressedFile)) + { + + Stream decompressor = null; + try + { + switch (j) + { + case 0: + decompressor = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true); + break; + case 1: + decompressor = new System.IO.Compression.GZipStream(input, System.IO.Compression.CompressionMode.Decompress, true); + break; + } + + string DecompressedFile = + String.Format("{0}.{1}.decompressed", CompressedFile, (j == 0) ? "Ionic" : "BCL"); + + TestContext.WriteLine("........{0} ...", System.IO.Path.GetFileName(DecompressedFile)); + + using (var s2 = System.IO.File.Create(DecompressedFile)) + { + n = -1; + while (n != 0) + { + n = decompressor.Read(working, 0, working.Length); + if (n > 0) + s2.Write(working, 0, n); + } + } + + int crc2 = DoCrc(DecompressedFile); + Assert.AreEqual(crc1, crc2); + + } + finally + { + if (decompressor != null) + decompressor.Dispose(); + } + } + } + } + } + + + [TestMethod] + public void Zlib_GZipStream_ByteByByte_CheckCrc() + { + // select the name of the zip file + string FileToCompress = System.IO.Path.Combine(TopLevelDir, "Zlib_GZipStream_ByteByByte.dat"); + Assert.IsFalse(System.IO.File.Exists(FileToCompress), "The temporary zip file '{0}' already exists.", FileToCompress); + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n = -1; + + int sz = this.rnd.Next(21000) + 15000; + TestContext.WriteLine(" Creating file: {0} sz({1})", FileToCompress, sz); + CreateAndFillFileText(FileToCompress, sz); + + System.IO.FileInfo fi1 = new System.IO.FileInfo(FileToCompress); + int crc1 = DoCrc(FileToCompress); + + // four trials, all combos of FileName and Comment null or not null. + for (int k = 0; k < 4; k++) + { + string CompressedFile = String.Format("{0}-{1}.compressed", FileToCompress, k); + + using (Stream input = File.OpenRead(FileToCompress)) + { + using (FileStream raw = new FileStream(CompressedFile, FileMode.Create)) + { + using (GZipStream compressor = + new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + // FileName is optional metadata in the GZip bytestream + if (k % 2 == 1) + compressor.FileName = FileToCompress; + + // Comment is optional metadata in the GZip bytestream + if (k > 2) + compressor.Comment = "Compressing: " + FileToCompress; + + byte[] buffer = new byte[1024]; + n = -1; + while (n != 0) + { + if (n > 0) + { + for (int i=0; i < n; i++) + compressor.WriteByte(buffer[i]); + } + + n = input.Read(buffer, 0, buffer.Length); + } + } + } + } + + System.IO.FileInfo fi2 = new System.IO.FileInfo(CompressedFile); + + Assert.IsTrue(fi1.Length > fi2.Length, String.Format("Compressed File is not smaller, trial {0} ({1}!>{2})", k, fi1.Length, fi2.Length)); + + + // decompress twice: + // once with System.IO.Compression.GZipStream and once with Ionic.Zlib.GZipStream + for (int j = 0; j < 2; j++) + { + using (var input = System.IO.File.OpenRead(CompressedFile)) + { + + Stream decompressor = null; + try + { + switch (j) + { + case 0: + decompressor = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true); + break; + case 1: + decompressor = new System.IO.Compression.GZipStream(input, System.IO.Compression.CompressionMode.Decompress, true); + break; + } + + string DecompressedFile = + String.Format("{0}.{1}.decompressed", CompressedFile, (j == 0) ? "Ionic" : "BCL"); + + TestContext.WriteLine("........{0} ...", System.IO.Path.GetFileName(DecompressedFile)); + + using (var s2 = System.IO.File.Create(DecompressedFile)) + { + n = -1; + while (n != 0) + { + n = decompressor.Read(working, 0, working.Length); + if (n > 0) + s2.Write(working, 0, n); + } + } + + int crc2 = DoCrc(DecompressedFile); + Assert.AreEqual(crc1, crc2); + + } + finally + { + if (decompressor as Ionic.Zlib.GZipStream != null) + { + var gz = (Ionic.Zlib.GZipStream) decompressor; + gz.Close(); // sets the final CRC + Assert.AreEqual(gz.Crc32, crc1); + } + + if (decompressor != null) + decompressor.Dispose(); + } + } + } + } + } + + + [TestMethod] + public void Zlib_GZipStream_DecompressEmptyStream() + { + _DecompressEmptyStream(typeof(GZipStream)); + } + + + [TestMethod] + public void Zlib_ZlibStream_DecompressEmptyStream() + { + _DecompressEmptyStream(typeof(ZlibStream)); + } + + private void _DecompressEmptyStream(Type t) + { + byte[] working = new byte[WORKING_BUFFER_SIZE]; + + // once politely, and the 2nd time through, try to read after EOF + for (int m = 0; m < 2; m++) + { + using (MemoryStream ms1 = new MemoryStream()) + { + Object[] args = { ms1, CompressionMode.Decompress, false }; + using (Stream decompressor = (Stream) Activator.CreateInstance(t, args)) + { + using (MemoryStream ms2 = new MemoryStream()) + { + int n = -1; + while (n != 0) + { + n = decompressor.Read(working, 0, working.Length); + if (n > 0) + ms2.Write(working, 0, n); + } + + // we know there is no more data. Want to insure it does + // not throw. + if (m==1) + n = decompressor.Read(working, 0, working.Length); + + + Assert.AreEqual(ms2.Length, 0L); + } + } + } + } + } + + + [TestMethod] + public void Zlib_DeflateStream_InMemory() + { + String TextToCompress = UntilHeExtends; + + CompressionLevel[] levels = {CompressionLevel.Level0, + CompressionLevel.Level1, + CompressionLevel.Default, + CompressionLevel.Level7, + CompressionLevel.BestCompression}; + + // compress with various Ionic levels, and System.IO.Compression (default level) + for (int k= 0; k < levels.Length + 1; k++) + { + MemoryStream ms= new MemoryStream(); + + Stream compressor = null; + if (k == levels.Length) + + compressor = new System.IO.Compression.DeflateStream(ms, System.IO.Compression.CompressionMode.Compress, false); + else + { + compressor = new Ionic.Zlib.DeflateStream(ms, CompressionMode.Compress, levels[k], false); + TestContext.WriteLine("using level: {0}", levels[k].ToString()); + } + + TestContext.WriteLine("Text to compress is {0} bytes: '{1}'", + TextToCompress.Length, TextToCompress); + TestContext.WriteLine("using compressor: {0}", compressor.GetType().FullName); + + StreamWriter sw = new StreamWriter(compressor, Encoding.ASCII); + sw.Write(TextToCompress); + sw.Close(); + + var a = ms.ToArray(); + TestContext.WriteLine("Compressed stream is {0} bytes long", a.Length); + + // de-compress with both Ionic and System.IO.Compression + for (int j = 0; j < 2; j++) + { + var slow = new MySlowMemoryStream(a); // want to force EOF + Stream decompressor = null; + + switch (j) + { + case 0: + decompressor = new Ionic.Zlib.DeflateStream(slow, CompressionMode.Decompress, false); + break; + case 1: + decompressor = new System.IO.Compression.DeflateStream(slow, System.IO.Compression.CompressionMode.Decompress, false); + break; + } + + TestContext.WriteLine("using decompressor: {0}", decompressor.GetType().FullName); + + var sr = new StreamReader(decompressor, Encoding.ASCII); + string DecompressedText = sr.ReadToEnd(); + + TestContext.WriteLine("Read {0} characters: '{1}'", DecompressedText.Length, DecompressedText); + TestContext.WriteLine("\n"); + Assert.AreEqual(TextToCompress, DecompressedText); + } + } + } + + + + [TestMethod] + public void Zlib_CloseTwice() + { + string TextToCompress = LetMeDoItNow; + + for (int i = 0; i < 3; i++) + { + MemoryStream ms1= new MemoryStream(); + + Stream compressor = null; + switch (i) + { + case 0: + compressor= new DeflateStream(ms1, CompressionMode.Compress, CompressionLevel.BestCompression, false); + break; + case 1: + compressor = new GZipStream(ms1, CompressionMode.Compress, false); + break; + case 2: + compressor = new ZlibStream(ms1, CompressionMode.Compress, false); + break; + } + + TestContext.WriteLine("Text to compress is {0} bytes: '{1}'", + TextToCompress.Length, TextToCompress); + TestContext.WriteLine("using compressor: {0}", compressor.GetType().FullName); + + StreamWriter sw = new StreamWriter(compressor, Encoding.ASCII); + sw.Write(TextToCompress); + sw.Close(); // implicitly closes compressor + sw.Close();// implicitly closes compressor, again + + compressor.Close(); // explicitly closes compressor + var a = ms1.ToArray(); + TestContext.WriteLine("Compressed stream is {0} bytes long", a.Length); + + var ms2 = new MemoryStream(a); + Stream decompressor = null; + + switch (i) + { + case 0: + decompressor = new DeflateStream(ms2, CompressionMode.Decompress, false); + break; + case 1: + decompressor = new GZipStream(ms2, CompressionMode.Decompress, false); + break; + case 2: + decompressor = new ZlibStream(ms2, CompressionMode.Decompress, false); + break; + } + + TestContext.WriteLine("using decompressor: {0}", decompressor.GetType().FullName); + + var sr = new StreamReader(decompressor, Encoding.ASCII); + string DecompressedText = sr.ReadToEnd(); + + // verify that multiple calls to Close() do not throw + sr.Close(); + sr.Close(); + decompressor.Close(); + + TestContext.WriteLine("Read {0} characters: '{1}'", DecompressedText.Length, DecompressedText); + TestContext.WriteLine("\n"); + Assert.AreEqual(TextToCompress, DecompressedText); + } + } + + + [TestMethod] + [ExpectedException(typeof(System.ObjectDisposedException))] + public void Zlib_DisposedException_DeflateStream() + { + string TextToCompress = LetMeDoItNow; + + MemoryStream ms1= new MemoryStream(); + + Stream compressor= new DeflateStream(ms1, CompressionMode.Compress, false); + + TestContext.WriteLine("Text to compress is {0} bytes: '{1}'", + TextToCompress.Length, TextToCompress); + TestContext.WriteLine("using compressor: {0}", compressor.GetType().FullName); + + StreamWriter sw = new StreamWriter(compressor, Encoding.ASCII); + sw.Write(TextToCompress); + sw.Close(); // implicitly closes compressor + sw.Close(); // implicitly closes compressor, again + + compressor.Close(); // explicitly closes compressor + var a = ms1.ToArray(); + TestContext.WriteLine("Compressed stream is {0} bytes long", a.Length); + + var ms2 = new MemoryStream(a); + Stream decompressor = new DeflateStream(ms2, CompressionMode.Decompress, false); + + TestContext.WriteLine("using decompressor: {0}", decompressor.GetType().FullName); + + var sr = new StreamReader(decompressor, Encoding.ASCII); + string DecompressedText = sr.ReadToEnd(); + sr.Close(); + + TestContext.WriteLine("decompressor.CanRead = {0}",decompressor.CanRead); + + TestContext.WriteLine("Read {0} characters: '{1}'", DecompressedText.Length, DecompressedText); + TestContext.WriteLine("\n"); + Assert.AreEqual(TextToCompress, DecompressedText); + + } + + + [TestMethod] + [ExpectedException(typeof(System.ObjectDisposedException))] + public void Zlib_DisposedException_GZipStream() + { + string TextToCompress = IhaveaDream; + + MemoryStream ms1= new MemoryStream(); + + Stream compressor= new GZipStream(ms1, CompressionMode.Compress, false); + + TestContext.WriteLine("Text to compress is {0} bytes: '{1}'", + TextToCompress.Length, TextToCompress); + TestContext.WriteLine("using compressor: {0}", compressor.GetType().FullName); + + StreamWriter sw = new StreamWriter(compressor, Encoding.ASCII); + sw.Write(TextToCompress); + sw.Close(); // implicitly closes compressor + sw.Close(); // implicitly closes compressor, again + + compressor.Close(); // explicitly closes compressor + var a = ms1.ToArray(); + TestContext.WriteLine("Compressed stream is {0} bytes long", a.Length); + + var ms2 = new MemoryStream(a); + Stream decompressor = new GZipStream(ms2, CompressionMode.Decompress, false); + + TestContext.WriteLine("using decompressor: {0}", decompressor.GetType().FullName); + + var sr = new StreamReader(decompressor, Encoding.ASCII); + string DecompressedText = sr.ReadToEnd(); + sr.Close(); + + TestContext.WriteLine("decompressor.CanRead = {0}",decompressor.CanRead); + + TestContext.WriteLine("Read {0} characters: '{1}'", DecompressedText.Length, DecompressedText); + TestContext.WriteLine("\n"); + Assert.AreEqual(TextToCompress, DecompressedText); + } + + + [TestMethod] + [ExpectedException(typeof(System.ObjectDisposedException))] + public void Zlib_DisposedException_ZlibStream() + { + string TextToCompress = IhaveaDream; + + MemoryStream ms1= new MemoryStream(); + + Stream compressor= new ZlibStream(ms1, CompressionMode.Compress, false); + + TestContext.WriteLine("Text to compress is {0} bytes: '{1}'", + TextToCompress.Length, TextToCompress); + TestContext.WriteLine("using compressor: {0}", compressor.GetType().FullName); + + StreamWriter sw = new StreamWriter(compressor, Encoding.ASCII); + sw.Write(TextToCompress); + sw.Close(); // implicitly closes compressor + sw.Close(); // implicitly closes compressor, again + + compressor.Close(); // explicitly closes compressor + var a = ms1.ToArray(); + TestContext.WriteLine("Compressed stream is {0} bytes long", a.Length); + + var ms2 = new MemoryStream(a); + Stream decompressor = new ZlibStream(ms2, CompressionMode.Decompress, false); + + TestContext.WriteLine("using decompressor: {0}", decompressor.GetType().FullName); + + var sr = new StreamReader(decompressor, Encoding.ASCII); + string DecompressedText = sr.ReadToEnd(); + sr.Close(); + + TestContext.WriteLine("decompressor.CanRead = {0}",decompressor.CanRead); + + TestContext.WriteLine("Read {0} characters: '{1}'", DecompressedText.Length, DecompressedText); + TestContext.WriteLine("\n"); + Assert.AreEqual(TextToCompress, DecompressedText); + } + + + + + [TestMethod] + public void Zlib_Streams_VariousSizes() + { + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n = -1; + Int32[] Sizes = { 8000, 88000, 188000, 388000, 580000, 1580000 }; + + for (int p = 0; p < Sizes.Length; p++) + { + // both binary and text files + for (int m = 0; m < 2; m++) + { + int sz = this.rnd.Next(Sizes[p]) + Sizes[p]; + string FileToCompress = System.IO.Path.Combine(TopLevelDir, String.Format("Zlib_Streams.{0}.{1}", sz, (m == 0) ? "txt" : "bin")); + Assert.IsFalse(System.IO.File.Exists(FileToCompress), "The temporary file '{0}' already exists.", FileToCompress); + TestContext.WriteLine("Creating file {0} {1} bytes", FileToCompress, sz); + if (m == 0) + CreateAndFillFileText(FileToCompress, sz); + else + _CreateAndFillBinary(FileToCompress, sz, false); + + int crc1 = DoCrc(FileToCompress); + TestContext.WriteLine("Initial CRC: 0x{0:X8}", crc1); + + // try both GZipStream and DeflateStream + for (int k = 0; k < 2; k++) + { + // compress with Ionic and System.IO.Compression + for (int i = 0; i < 2; i++) + { + string CompressedFileRoot = String.Format("{0}.{1}.{2}.compressed", FileToCompress, + (k == 0) ? "GZIP" : "DEFLATE", + (i == 0) ? "Ionic" : "BCL"); + + int x = k + i * 2; + int z = (x == 0) ? 4 : 1; + // why 4 trials?? (only for GZIP and Ionic) + for (int h = 0; h < z; h++) + { + string CompressedFile = (x == 0) + ? CompressedFileRoot + ".trial" + h + : CompressedFileRoot; + + using (var input = System.IO.File.OpenRead(FileToCompress)) + { + using (var raw = System.IO.File.Create(CompressedFile)) + { + Stream compressor = null; + try + { + switch (x) + { + case 0: // k == 0, i == 0 + compressor = new Ionic.Zlib.GZipStream(raw, CompressionMode.Compress, true); + break; + case 1: // k == 1, i == 0 + compressor = new Ionic.Zlib.DeflateStream(raw, CompressionMode.Compress, true); + break; + case 2: // k == 0, i == 1 + compressor = new System.IO.Compression.GZipStream(raw, System.IO.Compression.CompressionMode.Compress, true); + break; + case 3: // k == 1, i == 1 + compressor = new System.IO.Compression.DeflateStream(raw, System.IO.Compression.CompressionMode.Compress, true); + break; + } + //TestContext.WriteLine("Compress with: {0} ..", compressor.GetType().FullName); + + TestContext.WriteLine("........{0} ...", System.IO.Path.GetFileName(CompressedFile)); + + if (x == 0) + { + if (h != 0) + { + Ionic.Zlib.GZipStream gzip = compressor as Ionic.Zlib.GZipStream; + + if (h % 2 == 1) + gzip.FileName = FileToCompress; + + if (h > 2) + gzip.Comment = "Compressing: " + FileToCompress; + + } + } + + n = -1; + while ((n = input.Read(working, 0, working.Length)) != 0) + { + compressor.Write(working, 0, n); + } + + } + finally + { + if (compressor != null) + compressor.Dispose(); + } + } + } + + // now, decompress with Ionic and System.IO.Compression + // for (int j = 0; j < 2; j++) + for (int j = 1; j >= 0; j--) + { + using (var input = System.IO.File.OpenRead(CompressedFile)) + { + Stream decompressor = null; + try + { + int w = k + j * 2; + switch (w) + { + case 0: // k == 0, j == 0 + decompressor = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true); + break; + case 1: // k == 1, j == 0 + decompressor = new Ionic.Zlib.DeflateStream(input, CompressionMode.Decompress, true); + break; + case 2: // k == 0, j == 1 + decompressor = new System.IO.Compression.GZipStream(input, System.IO.Compression.CompressionMode.Decompress, true); + break; + case 3: // k == 1, j == 1 + decompressor = new System.IO.Compression.DeflateStream(input, System.IO.Compression.CompressionMode.Decompress, true); + break; + } + + //TestContext.WriteLine("Decompress: {0} ...", decompressor.GetType().FullName); + string DecompressedFile = + String.Format("{0}.{1}.decompressed", CompressedFile, (j == 0) ? "Ionic" : "BCL"); + + TestContext.WriteLine("........{0} ...", System.IO.Path.GetFileName(DecompressedFile)); + + using (var s2 = System.IO.File.Create(DecompressedFile)) + { + n = -1; + while (n != 0) + { + n = decompressor.Read(working, 0, working.Length); + if (n > 0) + s2.Write(working, 0, n); + } + } + + int crc2 = DoCrc(DecompressedFile); + Assert.AreEqual((UInt32)crc1, (UInt32)crc2); + + } + finally + { + if (decompressor != null) + decompressor.Dispose(); + } + } + } + } + } + } + } + } + TestContext.WriteLine("Done."); + } + + + + + private void PerformTrialWi8870(byte[] buffer) + { + TestContext.WriteLine("Original"); + + byte[] compressedBytes = null; + using (MemoryStream ms1 = new MemoryStream()) + { + using (DeflateStream compressor = new DeflateStream(ms1, CompressionMode.Compress, false)) + { + compressor.Write(buffer, 0, buffer.Length); + } + compressedBytes = ms1.ToArray(); + } + + TestContext.WriteLine("Compressed {0} bytes into {1} bytes", + buffer.Length, compressedBytes.Length); + + byte[] decompressed= null; + using (MemoryStream ms2 = new MemoryStream()) + { + using (var deflateStream = new DeflateStream(ms2, CompressionMode.Decompress, false)) + { + deflateStream.Write(compressedBytes, 0, compressedBytes.Length); + } + decompressed = ms2.ToArray(); + } + + TestContext.WriteLine("Decompressed"); + + + bool check = true; + if (buffer.Length != decompressed.Length) + { + TestContext.WriteLine("Different lengths."); + check = false; + } + else + { + for (int i=0; i < buffer.Length; i++) + { + if (buffer[i] != decompressed[i]) + { + TestContext.WriteLine("byte {0} differs", i); + check = false; + break; + } + } + } + + Assert.IsTrue(check,"Data check failed."); + } + + + + + private byte[] RandomizeBuffer(int length) + { + byte[] buffer = new byte[length]; + int mod1 = 86 + this.rnd.Next(46)/2 + 1; + int mod2 = 50 + this.rnd.Next(72)/2 + 1; + for (int i=0; i < length; i++) + { + if (i > 200) + buffer[i] = (byte)(i % mod1); + else if (i > 100) + buffer[i] = (byte)(i % mod2); + else if (i > 42) + buffer[i] = (byte)(i % 33); + else buffer[i]= (byte)i; + } + return buffer; + } + + + + [TestMethod] + public void Zlib_DeflateStream_wi8870() + { + for (int j = 0; j < 1000; j++) + { + byte[] buffer = RandomizeBuffer(117+(this.rnd.Next(3)*100)); + PerformTrialWi8870(buffer); + } + } + + + + + [TestMethod] + public void Zlib_ParallelDeflateStream() + { + var sw = new System.Diagnostics.Stopwatch(); + sw.Start(); + TestContext.WriteLine("{0}: Zlib_ParallelDeflateStream Start", sw.Elapsed); + + int sz = 256*1024 + this.rnd.Next(120000); + string FileToCompress = System.IO.Path.Combine(TopLevelDir, String.Format("Zlib_ParallelDeflateStream.{0}.txt", sz)); + + CreateAndFillFileText( FileToCompress, sz); + + TestContext.WriteLine("{0}: Created file: {1}", sw.Elapsed, FileToCompress ); + + byte[] original = File.ReadAllBytes(FileToCompress); + + int crc1 = DoCrc(FileToCompress); + + TestContext.WriteLine("{0}: Original CRC: {1:X8}", sw.Elapsed, crc1 ); + + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n = -1; + long originalLength; + MemoryStream ms1 = new MemoryStream(); + { + using (FileStream fs1 = File.OpenRead(FileToCompress)) + { + originalLength = fs1.Length; + using (var compressor = new Ionic.Zlib.ParallelDeflateOutputStream(ms1, true)) + { + while ((n = fs1.Read(working, 0, working.Length)) != 0) + { + compressor.Write(working, 0, n); + } + } + } + ms1.Seek(0, SeekOrigin.Begin); + } + + TestContext.WriteLine("{0}: Compressed {1} bytes into {2} bytes", sw.Elapsed, + originalLength, ms1.Length); + + var crc = new Ionic.Crc.CRC32(); + int crc2= 0; + byte[] decompressedBytes= null; + using (MemoryStream ms2 = new MemoryStream()) + { + using (var decompressor = new DeflateStream(ms1, CompressionMode.Decompress, false)) + { + while ((n = decompressor.Read(working, 0, working.Length)) != 0) + { + ms2.Write(working, 0, n); + } + } + TestContext.WriteLine("{0}: Decompressed", sw.Elapsed); + TestContext.WriteLine("{0}: Decompressed length: {1}", sw.Elapsed, ms2.Length); + ms2.Seek(0, SeekOrigin.Begin); + crc2 = crc.GetCrc32(ms2); + decompressedBytes = ms2.ToArray(); + TestContext.WriteLine("{0}: Decompressed CRC: {1:X8}", sw.Elapsed, crc2 ); + } + + + TestContext.WriteLine("{0}: Checking...", sw.Elapsed ); + + bool check = true; + if (originalLength != decompressedBytes.Length) + { + TestContext.WriteLine("Different lengths."); + check = false; + } + else + { + for (int i = 0; i < decompressedBytes.Length; i++) + { + if (original[i] != decompressedBytes[i]) + { + TestContext.WriteLine("byte {0} differs", i); + check = false; + break; + } + } + } + + Assert.IsTrue(check,"Data check failed"); + TestContext.WriteLine("{0}: Done...", sw.Elapsed ); + } + + + + + + + private int DoCrc(string filename) + { + using (Stream a = File.OpenRead(filename)) + using (var crc = new Ionic.Crc.CrcCalculatorStream(a)) + { + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n = -1; + while (n != 0) + n = crc.Read(working, 0, working.Length); + return crc.Crc; + } + } + + + + private static void _CreateAndFillBinary(string Filename, Int64 size, bool zeroes) + { + Int64 bytesRemaining = size; + System.Random rnd = new System.Random(); + // fill with binary data + byte[] Buffer = new byte[20000]; + using (System.IO.Stream fileStream = new System.IO.FileStream(Filename, System.IO.FileMode.Create, System.IO.FileAccess.Write)) + { + while (bytesRemaining > 0) + { + int sizeOfChunkToWrite = (bytesRemaining > Buffer.Length) ? Buffer.Length : (int)bytesRemaining; + if (!zeroes) rnd.NextBytes(Buffer); + fileStream.Write(Buffer, 0, sizeOfChunkToWrite); + bytesRemaining -= sizeOfChunkToWrite; + } + fileStream.Close(); + } + } + + + internal static void CreateAndFillFileText(string Filename, Int64 size) + { + Int64 bytesRemaining = size; + System.Random rnd = new System.Random(); + // fill the file with text data + using (System.IO.StreamWriter sw = System.IO.File.CreateText(Filename)) + { + do + { + // pick a word at random + string selectedWord = LoremIpsumWords[rnd.Next(LoremIpsumWords.Length)]; + if (bytesRemaining < selectedWord.Length + 1) + { + sw.Write(selectedWord.Substring(0, (int)bytesRemaining)); + bytesRemaining = 0; + } + else + { + sw.Write(selectedWord); + sw.Write(" "); + bytesRemaining -= (selectedWord.Length + 1); + } + } while (bytesRemaining > 0); + sw.Close(); + } + } + + [TestMethod] + public void TestAdler32() + { + // create a buffer full of 0xff's + var buffer = new byte[2048 * 4]; + for (var i = 0; i < buffer.Length; i++) + { + buffer[i] = 255; + }; + + uint goal = 4104380882; + var testAdler = new Action( chunk => { + var index = 0; + var adler = Adler.Adler32(0, null, 0, 0); + while (index < buffer.Length) + { + var length = Math.Min(buffer.Length - index, chunk); + adler = Adler.Adler32(adler, buffer, index, length); + index = index + chunk; + } + Assert.AreEqual(adler, goal); + }); + + testAdler(3979); + testAdler(3980); + testAdler(3999); + } + + + + internal static string LetMeDoItNow = "I expect to pass through the world but once. Any good therefore that I can do, or any kindness I can show to any creature, let me do it now. Let me not defer it, for I shall not pass this way again. -- Anonymous, although some have attributed it to Stephen Grellet"; + + internal static string UntilHeExtends = "Until he extends the circle of his compassion to all living things, man will not himself find peace. - Albert Schweitzer, early 20th-century German Nobel Peace Prize-winning mission doctor and theologian."; + + internal static string WhatWouldThingsHaveBeenLike = "'What would things have been like [in Russia] if during periods of mass arrests people had not simply sat there, paling with terror at every bang on the downstairs door and at every step on the staircase, but understood they had nothing to lose and had boldly set up in the downstairs hall an ambush of half a dozen people?' -- Alexander Solzhenitsyn"; + + internal static string GoPlacidly = + @"Go placidly amid the noise and haste, and remember what peace there may be in silence. + +As far as possible, without surrender, be on good terms with all persons. Speak your truth quietly and clearly; and listen to others, even to the dull and the ignorant, they too have their story. Avoid loud and aggressive persons, they are vexations to the spirit. + +If you compare yourself with others, you may become vain and bitter; for always there will be greater and lesser persons than yourself. Enjoy your achievements as well as your plans. Keep interested in your own career, however humble; it is a real possession in the changing fortunes of time. + +Exercise caution in your business affairs, for the world is full of trickery. But let this not blind you to what virtue there is; many persons strive for high ideals, and everywhere life is full of heroism. Be yourself. Especially, do not feign affection. Neither be cynical about love, for in the face of all aridity and disenchantment it is perennial as the grass. + +Take kindly to the counsel of the years, gracefully surrendering the things of youth. Nurture strength of spirit to shield you in sudden misfortune. But do not distress yourself with imaginings. Many fears are born of fatigue and loneliness. + +Beyond a wholesome discipline, be gentle with yourself. You are a child of the universe, no less than the trees and the stars; you have a right to be here. And whether or not it is clear to you, no doubt the universe is unfolding as it should. + +Therefore be at peace with God, whatever you conceive Him to be, and whatever your labors and aspirations, in the noisy confusion of life, keep peace in your soul. + +With all its sham, drudgery and broken dreams, it is still a beautiful world. + +Be cheerful. Strive to be happy. + +Max Ehrmann c.1920 +"; + + + internal static string IhaveaDream = @"Let us not wallow in the valley of despair, I say to you today, my friends. + +And so even though we face the difficulties of today and tomorrow, I still have a dream. It is a dream deeply rooted in the American dream. + +I have a dream that one day this nation will rise up and live out the true meaning of its creed: 'We hold these truths to be self-evident, that all men are created equal.' + +I have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood. + +I have a dream that one day even the state of Mississippi, a state sweltering with the heat of injustice, sweltering with the heat of oppression, will be transformed into an oasis of freedom and justice. + +I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by the content of their character. + +I have a dream today! + +I have a dream that one day, down in Alabama, with its vicious racists, with its governor having his lips dripping with the words of 'interposition' and 'nullification' -- one day right there in Alabama little black boys and black girls will be able to join hands with little white boys and white girls as sisters and brothers. + +I have a dream today! + +I have a dream that one day every valley shall be exalted, and every hill and mountain shall be made low, the rough places will be made plain, and the crooked places will be made straight; 'and the glory of the Lord shall be revealed and all flesh shall see it together.'2 +"; + + internal static string LoremIpsum = +"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer " + +"vulputate, nibh non rhoncus euismod, erat odio pellentesque lacus, sit " + +"amet convallis mi augue et odio. Phasellus cursus urna facilisis " + +"quam. Suspendisse nec metus et sapien scelerisque euismod. Nullam " + +"molestie sem quis nisl. Fusce pellentesque, ante sed semper egestas, sem " + +"nulla vestibulum nulla, quis sollicitudin leo lorem elementum " + +"wisi. Aliquam vestibulum nonummy orci. Sed in dolor sed enim ullamcorper " + +"accumsan. Duis vel nibh. Class aptent taciti sociosqu ad litora torquent " + +"per conubia nostra, per inceptos hymenaeos. Sed faucibus, enim sit amet " + +"venenatis laoreet, nisl elit posuere est, ut sollicitudin tortor velit " + +"ut ipsum. Aliquam erat volutpat. Phasellus tincidunt vehicula " + +"eros. Curabitur vitae erat. " + +"\n " + +"Quisque pharetra lacus quis sapien. Duis id est non wisi sagittis " + +"adipiscing. Nulla facilisi. Etiam quam erat, lobortis eu, facilisis nec, " + +"blandit hendrerit, metus. Fusce hendrerit. Nunc magna libero, " + +"sollicitudin non, vulputate non, ornare id, nulla. Suspendisse " + +"potenti. Nullam in mauris. Curabitur et nisl vel purus vehicula " + +"sodales. Class aptent taciti sociosqu ad litora torquent per conubia " + +"nostra, per inceptos hymenaeos. Cum sociis natoque penatibus et magnis " + +"dis parturient montes, nascetur ridiculus mus. Donec semper, arcu nec " + +"dignissim porta, eros odio tempus pede, et laoreet nibh arcu et " + +"nisl. Morbi pellentesque eleifend ante. Morbi dictum lorem non " + +"ante. Nullam et augue sit amet sapien varius mollis. " + +"\n " + +"Nulla erat lorem, fringilla eget, ultrices nec, dictum sed, " + +"sapien. Aliquam libero ligula, porttitor scelerisque, lobortis nec, " + +"dignissim eu, elit. Etiam feugiat, dui vitae laoreet faucibus, tellus " + +"urna molestie purus, sit amet pretium lorem pede in erat. Ut non libero " + +"et sapien porttitor eleifend. Vestibulum ante ipsum primis in faucibus " + +"orci luctus et ultrices posuere cubilia Curae; In at lorem et lacus " + +"feugiat iaculis. Nunc tempus eros nec arcu tristique egestas. Quisque " + +"metus arcu, pretium in, suscipit dictum, bibendum sit amet, " + +"mauris. Aliquam non urna. Suspendisse eget diam. Aliquam erat " + +"volutpat. In euismod aliquam lorem. Mauris dolor nisl, consectetuer sit " + +"amet, suscipit sodales, rutrum in, lorem. Nunc nec nisl. Nulla ante " + +"libero, aliquam porttitor, aliquet at, imperdiet sed, diam. Pellentesque " + +"tincidunt nisl et ipsum. Suspendisse purus urna, semper quis, laoreet " + +"in, vestibulum vel, arcu. Nunc elementum eros nec mauris. " + +"\n " + +"Vivamus congue pede at quam. Aliquam aliquam leo vel turpis. Ut " + +"commodo. Integer tincidunt sem a risus. Cras aliquam libero quis " + +"arcu. Integer posuere. Nulla malesuada, wisi ac elementum sollicitudin, " + +"libero libero molestie velit, eu faucibus est ante eu libero. Sed " + +"vestibulum, dolor ac ultricies consectetuer, tellus risus interdum diam, " + +"a imperdiet nibh eros eget mauris. Donec faucibus volutpat " + +"augue. Phasellus vitae arcu quis ipsum ultrices fermentum. Vivamus " + +"ultricies porta ligula. Nullam malesuada. Ut feugiat urna non " + +"turpis. Vivamus ipsum. Vivamus eleifend condimentum risus. Curabitur " + +"pede. Maecenas suscipit pretium tortor. Integer pellentesque. " + +"\n " + +"Mauris est. Aenean accumsan purus vitae ligula. Lorem ipsum dolor sit " + +"amet, consectetuer adipiscing elit. Nullam at mauris id turpis placerat " + +"accumsan. Sed pharetra metus ut ante. Aenean vel urna sit amet ante " + +"pretium dapibus. Sed nulla. Sed nonummy, lacus a suscipit semper, erat " + +"wisi convallis mi, et accumsan magna elit laoreet sem. Nam leo est, " + +"cursus ut, molestie ac, laoreet id, mauris. Suspendisse auctor nibh. " + +"\n"; + + static string[] LoremIpsumWords; + + private const int WORKING_BUFFER_SIZE = 0x4000; + + } + + + public class MySlowMemoryStream : MemoryStream + { + // ctor + public MySlowMemoryStream(byte[] bytes) : base(bytes, false) {} + + public override int Read(byte[] buffer, int offset, int count) + { + if (count < 0) + throw new ArgumentOutOfRangeException(); + + if (count == 0) + return 0; + + // force stream to read just one byte at a time + int NextByte = base.ReadByte(); + if (NextByte == -1) + return 0; + + buffer[offset] = (byte) NextByte; + return 1; + } + } + + + +} diff --git a/dotNetZip/Zlib/Deflate.cs b/dotNetZip/Zlib/Deflate.cs new file mode 100644 index 0000000..9672250 --- /dev/null +++ b/dotNetZip/Zlib/Deflate.cs @@ -0,0 +1,1879 @@ +// Deflate.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-03 19:52:15> +// +// ------------------------------------------------------------------ +// +// This module defines logic for handling the Deflate or compression. +// +// This code is based on multiple sources: +// - the original zlib v1.2.3 source, which is Copyright (C) 1995-2005 Jean-loup Gailly. +// - the original jzlib, which is Copyright (c) 2000-2003 ymnk, JCraft,Inc. +// +// However, this code is significantly different from both. +// The object model is not the same, and many of the behaviors are different. +// +// In keeping with the license for these other works, the copyrights for +// jzlib and zlib are here. +// +// ----------------------------------------------------------------------- +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; + +namespace Ionic.Zlib +{ + + internal enum BlockState + { + NeedMore = 0, // block not completed, need more input or more output + BlockDone, // block flush performed + FinishStarted, // finish started, need only more output at next deflate + FinishDone // finish done, accept no more input or output + } + + internal enum DeflateFlavor + { + Store, + Fast, + Slow + } + + internal sealed class DeflateManager + { + private static readonly int MEM_LEVEL_MAX = 9; + private static readonly int MEM_LEVEL_DEFAULT = 8; + + internal delegate BlockState CompressFunc(FlushType flush); + + internal class Config + { + // Use a faster search when the previous match is longer than this + internal int GoodLength; // reduce lazy search above this match length + + // Attempt to find a better match only when the current match is + // strictly smaller than this value. This mechanism is used only for + // compression levels >= 4. For levels 1,2,3: MaxLazy is actually + // MaxInsertLength. (See DeflateFast) + + internal int MaxLazy; // do not perform lazy search above this match length + + internal int NiceLength; // quit search above this match length + + // To speed up deflation, hash chains are never searched beyond this + // length. A higher limit improves compression ratio but degrades the speed. + + internal int MaxChainLength; + + internal DeflateFlavor Flavor; + + private Config(int goodLength, int maxLazy, int niceLength, int maxChainLength, DeflateFlavor flavor) + { + this.GoodLength = goodLength; + this.MaxLazy = maxLazy; + this.NiceLength = niceLength; + this.MaxChainLength = maxChainLength; + this.Flavor = flavor; + } + + public static Config Lookup(CompressionLevel level) + { + return Table[(int)level]; + } + + + static Config() + { + Table = new Config[] { + new Config(0, 0, 0, 0, DeflateFlavor.Store), + new Config(4, 4, 8, 4, DeflateFlavor.Fast), + new Config(4, 5, 16, 8, DeflateFlavor.Fast), + new Config(4, 6, 32, 32, DeflateFlavor.Fast), + + new Config(4, 4, 16, 16, DeflateFlavor.Slow), + new Config(8, 16, 32, 32, DeflateFlavor.Slow), + new Config(8, 16, 128, 128, DeflateFlavor.Slow), + new Config(8, 32, 128, 256, DeflateFlavor.Slow), + new Config(32, 128, 258, 1024, DeflateFlavor.Slow), + new Config(32, 258, 258, 4096, DeflateFlavor.Slow), + }; + } + + private static readonly Config[] Table; + } + + + private CompressFunc DeflateFunction; + + private static readonly System.String[] _ErrorMessage = new System.String[] + { + "need dictionary", + "stream end", + "", + "file error", + "stream error", + "data error", + "insufficient memory", + "buffer error", + "incompatible version", + "" + }; + + // preset dictionary flag in zlib header + private static readonly int PRESET_DICT = 0x20; + + private static readonly int INIT_STATE = 42; + private static readonly int BUSY_STATE = 113; + private static readonly int FINISH_STATE = 666; + + // The deflate compression method + private static readonly int Z_DEFLATED = 8; + + private static readonly int STORED_BLOCK = 0; + private static readonly int STATIC_TREES = 1; + private static readonly int DYN_TREES = 2; + + // The three kinds of block type + private static readonly int Z_BINARY = 0; + private static readonly int Z_ASCII = 1; + private static readonly int Z_UNKNOWN = 2; + + private static readonly int Buf_size = 8 * 2; + + private static readonly int MIN_MATCH = 3; + private static readonly int MAX_MATCH = 258; + + private static readonly int MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + + private static readonly int HEAP_SIZE = (2 * InternalConstants.L_CODES + 1); + + private static readonly int END_BLOCK = 256; + + internal ZlibCodec _codec; // the zlib encoder/decoder + internal int status; // as the name implies + internal byte[] pending; // output still pending - waiting to be compressed + internal int nextPending; // index of next pending byte to output to the stream + internal int pendingCount; // number of bytes in the pending buffer + + internal sbyte data_type; // UNKNOWN, BINARY or ASCII + internal int last_flush; // value of flush param for previous deflate call + + internal int w_size; // LZ77 window size (32K by default) + internal int w_bits; // log2(w_size) (8..16) + internal int w_mask; // w_size - 1 + + //internal byte[] dictionary; + internal byte[] window; + + // Sliding window. Input bytes are read into the second half of the window, + // and move to the first half later to keep a dictionary of at least wSize + // bytes. With this organization, matches are limited to a distance of + // wSize-MAX_MATCH bytes, but this ensures that IO is always + // performed with a length multiple of the block size. + // + // To do: use the user input buffer as sliding window. + + internal int window_size; + // Actual size of window: 2*wSize, except when the user input buffer + // is directly used as sliding window. + + internal short[] prev; + // Link to older string with same hash index. To limit the size of this + // array to 64K, this link is maintained only for the last 32K strings. + // An index in this array is thus a window index modulo 32K. + + internal short[] head; // Heads of the hash chains or NIL. + + internal int ins_h; // hash index of string to be inserted + internal int hash_size; // number of elements in hash table + internal int hash_bits; // log2(hash_size) + internal int hash_mask; // hash_size-1 + + // Number of bits by which ins_h must be shifted at each input + // step. It must be such that after MIN_MATCH steps, the oldest + // byte no longer takes part in the hash key, that is: + // hash_shift * MIN_MATCH >= hash_bits + internal int hash_shift; + + // Window position at the beginning of the current output block. Gets + // negative when the window is moved backwards. + + internal int block_start; + + Config config; + internal int match_length; // length of best match + internal int prev_match; // previous match + internal int match_available; // set if previous match exists + internal int strstart; // start of string to insert into.....???? + internal int match_start; // start of matching string + internal int lookahead; // number of valid bytes ahead in window + + // Length of the best match at previous step. Matches not greater than this + // are discarded. This is used in the lazy match evaluation. + internal int prev_length; + + // Insert new strings in the hash table only if the match length is not + // greater than this length. This saves time but degrades compression. + // max_insert_length is used only for compression levels <= 3. + + internal CompressionLevel compressionLevel; // compression level (1..9) + internal CompressionStrategy compressionStrategy; // favor or force Huffman coding + + + internal short[] dyn_ltree; // literal and length tree + internal short[] dyn_dtree; // distance tree + internal short[] bl_tree; // Huffman tree for bit lengths + + internal Tree treeLiterals = new Tree(); // desc for literal tree + internal Tree treeDistances = new Tree(); // desc for distance tree + internal Tree treeBitLengths = new Tree(); // desc for bit length tree + + // number of codes at each bit length for an optimal tree + internal short[] bl_count = new short[InternalConstants.MAX_BITS + 1]; + + // heap used to build the Huffman trees + internal int[] heap = new int[2 * InternalConstants.L_CODES + 1]; + + internal int heap_len; // number of elements in the heap + internal int heap_max; // element of largest frequency + + // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + // The same heap array is used to build all trees. + + // Depth of each subtree used as tie breaker for trees of equal frequency + internal sbyte[] depth = new sbyte[2 * InternalConstants.L_CODES + 1]; + + internal int _lengthOffset; // index for literals or lengths + + + // Size of match buffer for literals/lengths. There are 4 reasons for + // limiting lit_bufsize to 64K: + // - frequencies can be kept in 16 bit counters + // - if compression is not successful for the first block, all input + // data is still in the window so we can still emit a stored block even + // when input comes from standard input. (This can also be done for + // all blocks if lit_bufsize is not greater than 32K.) + // - if compression is not successful for a file smaller than 64K, we can + // even emit a stored file instead of a stored block (saving 5 bytes). + // This is applicable only for zip (not gzip or zlib). + // - creating new Huffman trees less frequently may not provide fast + // adaptation to changes in the input data statistics. (Take for + // example a binary file with poorly compressible code followed by + // a highly compressible string table.) Smaller buffer sizes give + // fast adaptation but have of course the overhead of transmitting + // trees more frequently. + + internal int lit_bufsize; + + internal int last_lit; // running index in l_buf + + // Buffer for distances. To simplify the code, d_buf and l_buf have + // the same number of elements. To use different lengths, an extra flag + // array would be necessary. + + internal int _distanceOffset; // index into pending; points to distance data?? + + internal int opt_len; // bit length of current block with optimal trees + internal int static_len; // bit length of current block with static trees + internal int matches; // number of string matches in current block + internal int last_eob_len; // bit length of EOB code for last block + + // Output buffer. bits are inserted starting at the bottom (least + // significant bits). + internal short bi_buf; + + // Number of valid bits in bi_buf. All bits above the last valid bit + // are always zero. + internal int bi_valid; + + + internal DeflateManager() + { + dyn_ltree = new short[HEAP_SIZE * 2]; + dyn_dtree = new short[(2 * InternalConstants.D_CODES + 1) * 2]; // distance tree + bl_tree = new short[(2 * InternalConstants.BL_CODES + 1) * 2]; // Huffman tree for bit lengths + } + + + // lm_init + private void _InitializeLazyMatch() + { + window_size = 2 * w_size; + + // clear the hash - workitem 9063 + Array.Clear(head, 0, hash_size); + //for (int i = 0; i < hash_size; i++) head[i] = 0; + + config = Config.Lookup(compressionLevel); + SetDeflater(); + + strstart = 0; + block_start = 0; + lookahead = 0; + match_length = prev_length = MIN_MATCH - 1; + match_available = 0; + ins_h = 0; + } + + // Initialize the tree data structures for a new zlib stream. + private void _InitializeTreeData() + { + treeLiterals.dyn_tree = dyn_ltree; + treeLiterals.staticTree = StaticTree.Literals; + + treeDistances.dyn_tree = dyn_dtree; + treeDistances.staticTree = StaticTree.Distances; + + treeBitLengths.dyn_tree = bl_tree; + treeBitLengths.staticTree = StaticTree.BitLengths; + + bi_buf = 0; + bi_valid = 0; + last_eob_len = 8; // enough lookahead for inflate + + // Initialize the first block of the first file: + _InitializeBlocks(); + } + + internal void _InitializeBlocks() + { + // Initialize the trees. + for (int i = 0; i < InternalConstants.L_CODES; i++) + dyn_ltree[i * 2] = 0; + for (int i = 0; i < InternalConstants.D_CODES; i++) + dyn_dtree[i * 2] = 0; + for (int i = 0; i < InternalConstants.BL_CODES; i++) + bl_tree[i * 2] = 0; + + dyn_ltree[END_BLOCK * 2] = 1; + opt_len = static_len = 0; + last_lit = matches = 0; + } + + // Restore the heap property by moving down the tree starting at node k, + // exchanging a node with the smallest of its two sons if necessary, stopping + // when the heap property is re-established (each father smaller than its + // two sons). + internal void pqdownheap(short[] tree, int k) + { + int v = heap[k]; + int j = k << 1; // left son of k + while (j <= heap_len) + { + // Set j to the smallest of the two sons: + if (j < heap_len && _IsSmaller(tree, heap[j + 1], heap[j], depth)) + { + j++; + } + // Exit if v is smaller than both sons + if (_IsSmaller(tree, v, heap[j], depth)) + break; + + // Exchange v with the smallest son + heap[k] = heap[j]; k = j; + // And continue down the tree, setting j to the left son of k + j <<= 1; + } + heap[k] = v; + } + + internal static bool _IsSmaller(short[] tree, int n, int m, sbyte[] depth) + { + short tn2 = tree[n * 2]; + short tm2 = tree[m * 2]; + return (tn2 < tm2 || (tn2 == tm2 && depth[n] <= depth[m])); + } + + + // Scan a literal or distance tree to determine the frequencies of the codes + // in the bit length tree. + internal void scan_tree(short[] tree, int max_code) + { + int n; // iterates over all tree elements + int prevlen = -1; // last emitted length + int curlen; // length of current code + int nextlen = (int)tree[0 * 2 + 1]; // length of next code + int count = 0; // repeat count of the current code + int max_count = 7; // max repeat count + int min_count = 4; // min repeat count + + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + tree[(max_code + 1) * 2 + 1] = (short)0x7fff; // guard //?? + + for (n = 0; n <= max_code; n++) + { + curlen = nextlen; nextlen = (int)tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen == nextlen) + { + continue; + } + else if (count < min_count) + { + bl_tree[curlen * 2] = (short)(bl_tree[curlen * 2] + count); + } + else if (curlen != 0) + { + if (curlen != prevlen) + bl_tree[curlen * 2]++; + bl_tree[InternalConstants.REP_3_6 * 2]++; + } + else if (count <= 10) + { + bl_tree[InternalConstants.REPZ_3_10 * 2]++; + } + else + { + bl_tree[InternalConstants.REPZ_11_138 * 2]++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + else if (curlen == nextlen) + { + max_count = 6; min_count = 3; + } + else + { + max_count = 7; min_count = 4; + } + } + } + + // Construct the Huffman tree for the bit lengths and return the index in + // bl_order of the last bit length code to send. + internal int build_bl_tree() + { + int max_blindex; // index of last bit length code of non zero freq + + // Determine the bit length frequencies for literal and distance trees + scan_tree(dyn_ltree, treeLiterals.max_code); + scan_tree(dyn_dtree, treeDistances.max_code); + + // Build the bit length tree: + treeBitLengths.build_tree(this); + // opt_len now includes the length of the tree representations, except + // the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + + // Determine the number of bit length codes to send. The pkzip format + // requires that at least 4 bit length codes be sent. (appnote.txt says + // 3 but the actual value used is 4.) + for (max_blindex = InternalConstants.BL_CODES - 1; max_blindex >= 3; max_blindex--) + { + if (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] != 0) + break; + } + // Update opt_len to include the bit length tree and counts + opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + + return max_blindex; + } + + + // Send the header for a block using dynamic Huffman trees: the counts, the + // lengths of the bit length codes, the literal tree and the distance tree. + // IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + internal void send_all_trees(int lcodes, int dcodes, int blcodes) + { + int rank; // index in bl_order + + send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt + send_bits(dcodes - 1, 5); + send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt + for (rank = 0; rank < blcodes; rank++) + { + send_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3); + } + send_tree(dyn_ltree, lcodes - 1); // literal tree + send_tree(dyn_dtree, dcodes - 1); // distance tree + } + + // Send a literal or distance tree in compressed form, using the codes in + // bl_tree. + internal void send_tree(short[] tree, int max_code) + { + int n; // iterates over all tree elements + int prevlen = -1; // last emitted length + int curlen; // length of current code + int nextlen = tree[0 * 2 + 1]; // length of next code + int count = 0; // repeat count of the current code + int max_count = 7; // max repeat count + int min_count = 4; // min repeat count + + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + + for (n = 0; n <= max_code; n++) + { + curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen == nextlen) + { + continue; + } + else if (count < min_count) + { + do + { + send_code(curlen, bl_tree); + } + while (--count != 0); + } + else if (curlen != 0) + { + if (curlen != prevlen) + { + send_code(curlen, bl_tree); count--; + } + send_code(InternalConstants.REP_3_6, bl_tree); + send_bits(count - 3, 2); + } + else if (count <= 10) + { + send_code(InternalConstants.REPZ_3_10, bl_tree); + send_bits(count - 3, 3); + } + else + { + send_code(InternalConstants.REPZ_11_138, bl_tree); + send_bits(count - 11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + else if (curlen == nextlen) + { + max_count = 6; min_count = 3; + } + else + { + max_count = 7; min_count = 4; + } + } + } + + // Output a block of bytes on the stream. + // IN assertion: there is enough room in pending_buf. + private void put_bytes(byte[] p, int start, int len) + { + Array.Copy(p, start, pending, pendingCount, len); + pendingCount += len; + } + +#if NOTNEEDED + private void put_byte(byte c) + { + pending[pendingCount++] = c; + } + internal void put_short(int b) + { + unchecked + { + pending[pendingCount++] = (byte)b; + pending[pendingCount++] = (byte)(b >> 8); + } + } + internal void putShortMSB(int b) + { + unchecked + { + pending[pendingCount++] = (byte)(b >> 8); + pending[pendingCount++] = (byte)b; + } + } +#endif + + internal void send_code(int c, short[] tree) + { + int c2 = c * 2; + send_bits((tree[c2] & 0xffff), (tree[c2 + 1] & 0xffff)); + } + + internal void send_bits(int value, int length) + { + int len = length; + unchecked + { + if (bi_valid > (int)Buf_size - len) + { + //int val = value; + // bi_buf |= (val << bi_valid); + + bi_buf |= (short)((value << bi_valid) & 0xffff); + //put_short(bi_buf); + pending[pendingCount++] = (byte)bi_buf; + pending[pendingCount++] = (byte)(bi_buf >> 8); + + + bi_buf = (short)((uint)value >> (Buf_size - bi_valid)); + bi_valid += len - Buf_size; + } + else + { + // bi_buf |= (value) << bi_valid; + bi_buf |= (short)((value << bi_valid) & 0xffff); + bi_valid += len; + } + } + } + + // Send one empty static block to give enough lookahead for inflate. + // This takes 10 bits, of which 7 may remain in the bit buffer. + // The current inflate code requires 9 bits of lookahead. If the + // last two codes for the previous block (real code plus EOB) were coded + // on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode + // the last real code. In this case we send two empty static blocks instead + // of one. (There are no problems if the previous block is stored or fixed.) + // To simplify the code, we assume the worst case of last real code encoded + // on one bit only. + internal void _tr_align() + { + send_bits(STATIC_TREES << 1, 3); + send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes); + + bi_flush(); + + // Of the 10 bits for the empty block, we have already sent + // (10 - bi_valid) bits. The lookahead for the last real code (before + // the EOB of the previous block) was thus at least one plus the length + // of the EOB plus what we have just sent of the empty static block. + if (1 + last_eob_len + 10 - bi_valid < 9) + { + send_bits(STATIC_TREES << 1, 3); + send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes); + bi_flush(); + } + last_eob_len = 7; + } + + + // Save the match info and tally the frequency counts. Return true if + // the current block must be flushed. + internal bool _tr_tally(int dist, int lc) + { + pending[_distanceOffset + last_lit * 2] = unchecked((byte) ( (uint)dist >> 8 ) ); + pending[_distanceOffset + last_lit * 2 + 1] = unchecked((byte)dist); + pending[_lengthOffset + last_lit] = unchecked((byte)lc); + last_lit++; + + if (dist == 0) + { + // lc is the unmatched char + dyn_ltree[lc * 2]++; + } + else + { + matches++; + // Here, lc is the match length - MIN_MATCH + dist--; // dist = match distance - 1 + dyn_ltree[(Tree.LengthCode[lc] + InternalConstants.LITERALS + 1) * 2]++; + dyn_dtree[Tree.DistanceCode(dist) * 2]++; + } + + if ((last_lit & 0x1fff) == 0 && (int)compressionLevel > 2) + { + // Compute an upper bound for the compressed length + int out_length = last_lit << 3; + int in_length = strstart - block_start; + int dcode; + for (dcode = 0; dcode < InternalConstants.D_CODES; dcode++) + { + out_length = (int)(out_length + (int)dyn_dtree[dcode * 2] * (5L + Tree.ExtraDistanceBits[dcode])); + } + out_length >>= 3; + if ((matches < (last_lit / 2)) && out_length < in_length / 2) + return true; + } + + return (last_lit == lit_bufsize - 1) || (last_lit == lit_bufsize); + // dinoch - wraparound? + // We avoid equality with lit_bufsize because of wraparound at 64K + // on 16 bit machines and because stored blocks are restricted to + // 64K-1 bytes. + } + + + + // Send the block data compressed using the given Huffman trees + internal void send_compressed_block(short[] ltree, short[] dtree) + { + int distance; // distance of matched string + int lc; // match length or unmatched char (if dist == 0) + int lx = 0; // running index in l_buf + int code; // the code to send + int extra; // number of extra bits to send + + if (last_lit != 0) + { + do + { + int ix = _distanceOffset + lx * 2; + distance = ((pending[ix] << 8) & 0xff00) | + (pending[ix + 1] & 0xff); + lc = (pending[_lengthOffset + lx]) & 0xff; + lx++; + + if (distance == 0) + { + send_code(lc, ltree); // send a literal byte + } + else + { + // literal or match pair + // Here, lc is the match length - MIN_MATCH + code = Tree.LengthCode[lc]; + + // send the length code + send_code(code + InternalConstants.LITERALS + 1, ltree); + extra = Tree.ExtraLengthBits[code]; + if (extra != 0) + { + // send the extra length bits + lc -= Tree.LengthBase[code]; + send_bits(lc, extra); + } + distance--; // dist is now the match distance - 1 + code = Tree.DistanceCode(distance); + + // send the distance code + send_code(code, dtree); + + extra = Tree.ExtraDistanceBits[code]; + if (extra != 0) + { + // send the extra distance bits + distance -= Tree.DistanceBase[code]; + send_bits(distance, extra); + } + } + + // Check that the overlay between pending and d_buf+l_buf is ok: + } + while (lx < last_lit); + } + + send_code(END_BLOCK, ltree); + last_eob_len = ltree[END_BLOCK * 2 + 1]; + } + + + + // Set the data type to ASCII or BINARY, using a crude approximation: + // binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. + // IN assertion: the fields freq of dyn_ltree are set and the total of all + // frequencies does not exceed 64K (to fit in an int on 16 bit machines). + internal void set_data_type() + { + int n = 0; + int ascii_freq = 0; + int bin_freq = 0; + while (n < 7) + { + bin_freq += dyn_ltree[n * 2]; n++; + } + while (n < 128) + { + ascii_freq += dyn_ltree[n * 2]; n++; + } + while (n < InternalConstants.LITERALS) + { + bin_freq += dyn_ltree[n * 2]; n++; + } + data_type = (sbyte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + } + + + + // Flush the bit buffer, keeping at most 7 bits in it. + internal void bi_flush() + { + if (bi_valid == 16) + { + pending[pendingCount++] = (byte)bi_buf; + pending[pendingCount++] = (byte)(bi_buf >> 8); + bi_buf = 0; + bi_valid = 0; + } + else if (bi_valid >= 8) + { + //put_byte((byte)bi_buf); + pending[pendingCount++] = (byte)bi_buf; + bi_buf >>= 8; + bi_valid -= 8; + } + } + + // Flush the bit buffer and align the output on a byte boundary + internal void bi_windup() + { + if (bi_valid > 8) + { + pending[pendingCount++] = (byte)bi_buf; + pending[pendingCount++] = (byte)(bi_buf >> 8); + } + else if (bi_valid > 0) + { + //put_byte((byte)bi_buf); + pending[pendingCount++] = (byte)bi_buf; + } + bi_buf = 0; + bi_valid = 0; + } + + // Copy a stored block, storing first the length and its + // one's complement if requested. + internal void copy_block(int buf, int len, bool header) + { + bi_windup(); // align on byte boundary + last_eob_len = 8; // enough lookahead for inflate + + if (header) + unchecked + { + //put_short((short)len); + pending[pendingCount++] = (byte)len; + pending[pendingCount++] = (byte)(len >> 8); + //put_short((short)~len); + pending[pendingCount++] = (byte)~len; + pending[pendingCount++] = (byte)(~len >> 8); + } + + put_bytes(window, buf, len); + } + + internal void flush_block_only(bool eof) + { + _tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof); + block_start = strstart; + _codec.flush_pending(); + } + + // Copy without compression as much as possible from the input stream, return + // the current block state. + // This function does not insert new strings in the dictionary since + // uncompressible data is probably not useful. This function is used + // only for the level=0 compression option. + // NOTE: this function should be optimized to avoid extra copying from + // window to pending_buf. + internal BlockState DeflateNone(FlushType flush) + { + // Stored blocks are limited to 0xffff bytes, pending is limited + // to pending_buf_size, and each stored block has a 5 byte header: + + int max_block_size = 0xffff; + int max_start; + + if (max_block_size > pending.Length - 5) + { + max_block_size = pending.Length - 5; + } + + // Copy as much as possible from input to output: + while (true) + { + // Fill the window as much as possible: + if (lookahead <= 1) + { + _fillWindow(); + if (lookahead == 0 && flush == FlushType.None) + return BlockState.NeedMore; + if (lookahead == 0) + break; // flush the current block + } + + strstart += lookahead; + lookahead = 0; + + // Emit a stored block if pending will be full: + max_start = block_start + max_block_size; + if (strstart == 0 || strstart >= max_start) + { + // strstart == 0 is possible when wraparound on 16-bit machine + lookahead = (int)(strstart - max_start); + strstart = (int)max_start; + + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + + // Flush if we may have to slide, otherwise block_start may become + // negative and the data will be gone: + if (strstart - block_start >= w_size - MIN_LOOKAHEAD) + { + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + } + + flush_block_only(flush == FlushType.Finish); + if (_codec.AvailableBytesOut == 0) + return (flush == FlushType.Finish) ? BlockState.FinishStarted : BlockState.NeedMore; + + return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; + } + + + // Send a stored block + internal void _tr_stored_block(int buf, int stored_len, bool eof) + { + send_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type + copy_block(buf, stored_len, true); // with header + } + + // Determine the best encoding for the current block: dynamic trees, static + // trees or store, and output the encoded block to the zip file. + internal void _tr_flush_block(int buf, int stored_len, bool eof) + { + int opt_lenb, static_lenb; // opt_len and static_len in bytes + int max_blindex = 0; // index of last bit length code of non zero freq + + // Build the Huffman trees unless a stored block is forced + if (compressionLevel > 0) + { + // Check if the file is ascii or binary + if (data_type == Z_UNKNOWN) + set_data_type(); + + // Construct the literal and distance trees + treeLiterals.build_tree(this); + + treeDistances.build_tree(this); + + // At this point, opt_len and static_len are the total bit lengths of + // the compressed block data, excluding the tree representations. + + // Build the bit length tree for the above two trees, and get the index + // in bl_order of the last bit length code to send. + max_blindex = build_bl_tree(); + + // Determine the best encoding. Compute first the block length in bytes + opt_lenb = (opt_len + 3 + 7) >> 3; + static_lenb = (static_len + 3 + 7) >> 3; + + if (static_lenb <= opt_lenb) + opt_lenb = static_lenb; + } + else + { + opt_lenb = static_lenb = stored_len + 5; // force a stored block + } + + if (stored_len + 4 <= opt_lenb && buf != -1) + { + // 4: two words for the lengths + // The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + // Otherwise we can't have processed more than WSIZE input bytes since + // the last block flush, because compression would have been + // successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + // transform a block into a stored block. + _tr_stored_block(buf, stored_len, eof); + } + else if (static_lenb == opt_lenb) + { + send_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3); + send_compressed_block(StaticTree.lengthAndLiteralsTreeCodes, StaticTree.distTreeCodes); + } + else + { + send_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3); + send_all_trees(treeLiterals.max_code + 1, treeDistances.max_code + 1, max_blindex + 1); + send_compressed_block(dyn_ltree, dyn_dtree); + } + + // The above check is made mod 2^32, for files larger than 512 MB + // and uLong implemented on 32 bits. + + _InitializeBlocks(); + + if (eof) + { + bi_windup(); + } + } + + // Fill the window when the lookahead becomes insufficient. + // Updates strstart and lookahead. + // + // IN assertion: lookahead < MIN_LOOKAHEAD + // OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + // At least one byte has been read, or avail_in == 0; reads are + // performed for at least two bytes (required for the zip translate_eol + // option -- not supported here). + private void _fillWindow() + { + int n, m; + int p; + int more; // Amount of free space at the end of the window. + + do + { + more = (window_size - lookahead - strstart); + + // Deal with !@#$% 64K limit: + if (more == 0 && strstart == 0 && lookahead == 0) + { + more = w_size; + } + else if (more == -1) + { + // Very unlikely, but possible on 16 bit machine if strstart == 0 + // and lookahead == 1 (input done one byte at time) + more--; + + // If the window is almost full and there is insufficient lookahead, + // move the upper half to the lower one to make room in the upper half. + } + else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) + { + Array.Copy(window, w_size, window, 0, w_size); + match_start -= w_size; + strstart -= w_size; // we now have strstart >= MAX_DIST + block_start -= w_size; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). We slide even when level == 0 + // to keep the hash table consistent if we switch back to level > 0 + // later. (Using level 0 permanently is not an optimal usage of + // zlib, so we don't care about this pathological case.) + + n = hash_size; + p = n; + do + { + m = (head[--p] & 0xffff); + head[p] = (short)((m >= w_size) ? (m - w_size) : 0); + } + while (--n != 0); + + n = w_size; + p = n; + do + { + m = (prev[--p] & 0xffff); + prev[p] = (short)((m >= w_size) ? (m - w_size) : 0); + // If n is not on any hash chain, prev[n] is garbage but + // its value will never be used. + } + while (--n != 0); + more += w_size; + } + + if (_codec.AvailableBytesIn == 0) + return; + + // If there was no sliding: + // strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + // more == window_size - lookahead - strstart + // => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + // => more >= window_size - 2*WSIZE + 2 + // In the BIG_MEM or MMAP case (not yet supported), + // window_size == input_size + MIN_LOOKAHEAD && + // strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + // Otherwise, window_size == 2*WSIZE so more >= 2. + // If there was sliding, more >= WSIZE. So in all cases, more >= 2. + + n = _codec.read_buf(window, strstart + lookahead, more); + lookahead += n; + + // Initialize the hash value now that we have some input: + if (lookahead >= MIN_MATCH) + { + ins_h = window[strstart] & 0xff; + ins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; + } + // If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + // but this is not important since only literal bytes will be emitted. + } + while (lookahead < MIN_LOOKAHEAD && _codec.AvailableBytesIn != 0); + } + + // Compress as much as possible from the input stream, return the current + // block state. + // This function does not perform lazy evaluation of matches and inserts + // new strings in the dictionary only for unmatched strings or for short + // matches. It is used only for the fast compression options. + internal BlockState DeflateFast(FlushType flush) + { + // short hash_head = 0; // head of the hash chain + int hash_head = 0; // head of the hash chain + bool bflush; // set if current block must be flushed + + while (true) + { + // Make sure that we always have enough lookahead, except + // at the end of the input file. We need MAX_MATCH bytes + // for the next match, plus MIN_MATCH bytes to insert the + // string following the next match. + if (lookahead < MIN_LOOKAHEAD) + { + _fillWindow(); + if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None) + { + return BlockState.NeedMore; + } + if (lookahead == 0) + break; // flush the current block + } + + // Insert the string window[strstart .. strstart+2] in the + // dictionary, and set hash_head to the head of the hash chain: + if (lookahead >= MIN_MATCH) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + + // prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + } + + // Find the longest match, discarding those <= prev_length. + // At this point we have always match_length < MIN_MATCH + + if (hash_head != 0L && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) + { + // To simplify the code, we prevent matches with the string + // of window index 0 (in particular we have to avoid a match + // of the string with itself at the start of the input file). + if (compressionStrategy != CompressionStrategy.HuffmanOnly) + { + match_length = longest_match(hash_head); + } + // longest_match() sets match_start + } + if (match_length >= MIN_MATCH) + { + // check_match(strstart, match_start, match_length); + + bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH); + + lookahead -= match_length; + + // Insert new strings in the hash table only if the match length + // is not too large. This saves time but degrades compression. + if (match_length <= config.MaxLazy && lookahead >= MIN_MATCH) + { + match_length--; // string at strstart already in hash table + do + { + strstart++; + + ins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + // prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + + // strstart never exceeds WSIZE-MAX_MATCH, so there are + // always MIN_MATCH bytes ahead. + } + while (--match_length != 0); + strstart++; + } + else + { + strstart += match_length; + match_length = 0; + ins_h = window[strstart] & 0xff; + + ins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; + // If lookahead < MIN_MATCH, ins_h is garbage, but it does not + // matter since it will be recomputed at next deflate call. + } + } + else + { + // No match, output a literal byte + + bflush = _tr_tally(0, window[strstart] & 0xff); + lookahead--; + strstart++; + } + if (bflush) + { + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + } + + flush_block_only(flush == FlushType.Finish); + if (_codec.AvailableBytesOut == 0) + { + if (flush == FlushType.Finish) + return BlockState.FinishStarted; + else + return BlockState.NeedMore; + } + return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; + } + + // Same as above, but achieves better compression. We use a lazy + // evaluation for matches: a match is finally adopted only if there is + // no better match at the next window position. + internal BlockState DeflateSlow(FlushType flush) + { + // short hash_head = 0; // head of hash chain + int hash_head = 0; // head of hash chain + bool bflush; // set if current block must be flushed + + // Process the input block. + while (true) + { + // Make sure that we always have enough lookahead, except + // at the end of the input file. We need MAX_MATCH bytes + // for the next match, plus MIN_MATCH bytes to insert the + // string following the next match. + + if (lookahead < MIN_LOOKAHEAD) + { + _fillWindow(); + if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None) + return BlockState.NeedMore; + + if (lookahead == 0) + break; // flush the current block + } + + // Insert the string window[strstart .. strstart+2] in the + // dictionary, and set hash_head to the head of the hash chain: + + if (lookahead >= MIN_MATCH) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + // prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + } + + // Find the longest match, discarding those <= prev_length. + prev_length = match_length; + prev_match = match_start; + match_length = MIN_MATCH - 1; + + if (hash_head != 0 && prev_length < config.MaxLazy && + ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) + { + // To simplify the code, we prevent matches with the string + // of window index 0 (in particular we have to avoid a match + // of the string with itself at the start of the input file). + + if (compressionStrategy != CompressionStrategy.HuffmanOnly) + { + match_length = longest_match(hash_head); + } + // longest_match() sets match_start + + if (match_length <= 5 && (compressionStrategy == CompressionStrategy.Filtered || + (match_length == MIN_MATCH && strstart - match_start > 4096))) + { + + // If prev_match is also MIN_MATCH, match_start is garbage + // but we will ignore the current match anyway. + match_length = MIN_MATCH - 1; + } + } + + // If there was a match at the previous step and the current + // match is not better, output the previous match: + if (prev_length >= MIN_MATCH && match_length <= prev_length) + { + int max_insert = strstart + lookahead - MIN_MATCH; + // Do not insert strings in hash table beyond this. + + // check_match(strstart-1, prev_match, prev_length); + + bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); + + // Insert in hash table all strings up to the end of the match. + // strstart-1 and strstart are already inserted. If there is not + // enough lookahead, the last two strings are not inserted in + // the hash table. + lookahead -= (prev_length - 1); + prev_length -= 2; + do + { + if (++strstart <= max_insert) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + //prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + } + } + while (--prev_length != 0); + match_available = 0; + match_length = MIN_MATCH - 1; + strstart++; + + if (bflush) + { + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + } + else if (match_available != 0) + { + + // If there was no match at the previous position, output a + // single literal. If there was a match but the current match + // is longer, truncate the previous match to a single literal. + + bflush = _tr_tally(0, window[strstart - 1] & 0xff); + + if (bflush) + { + flush_block_only(false); + } + strstart++; + lookahead--; + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + else + { + // There is no previous match to compare with, wait for + // the next step to decide. + + match_available = 1; + strstart++; + lookahead--; + } + } + + if (match_available != 0) + { + bflush = _tr_tally(0, window[strstart - 1] & 0xff); + match_available = 0; + } + flush_block_only(flush == FlushType.Finish); + + if (_codec.AvailableBytesOut == 0) + { + if (flush == FlushType.Finish) + return BlockState.FinishStarted; + else + return BlockState.NeedMore; + } + + return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; + } + + + internal int longest_match(int cur_match) + { + int chain_length = config.MaxChainLength; // max hash chain length + int scan = strstart; // current string + int match; // matched string + int len; // length of current match + int best_len = prev_length; // best match length so far + int limit = strstart > (w_size - MIN_LOOKAHEAD) ? strstart - (w_size - MIN_LOOKAHEAD) : 0; + + int niceLength = config.NiceLength; + + // Stop when cur_match becomes <= limit. To simplify the code, + // we prevent matches with the string of window index 0. + + int wmask = w_mask; + + int strend = strstart + MAX_MATCH; + byte scan_end1 = window[scan + best_len - 1]; + byte scan_end = window[scan + best_len]; + + // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + // It is easy to get rid of this optimization if necessary. + + // Do not waste too much time if we already have a good match: + if (prev_length >= config.GoodLength) + { + chain_length >>= 2; + } + + // Do not look for matches beyond the end of the input. This is necessary + // to make deflate deterministic. + if (niceLength > lookahead) + niceLength = lookahead; + + do + { + match = cur_match; + + // Skip to next match if the match length cannot increase + // or if the match length is less than 2: + if (window[match + best_len] != scan_end || + window[match + best_len - 1] != scan_end1 || + window[match] != window[scan] || + window[++match] != window[scan + 1]) + continue; + + // The check at best_len-1 can be removed because it will be made + // again later. (This heuristic is not always a win.) + // It is not necessary to compare scan[2] and match[2] since they + // are always equal when the other bytes match, given that + // the hash keys are equal and that HASH_BITS >= 8. + scan += 2; match++; + + // We check for insufficient lookahead only every 8th comparison; + // the 256th check will be made at strstart+258. + do + { + } + while (window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && scan < strend); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) + { + match_start = cur_match; + best_len = len; + if (len >= niceLength) + break; + scan_end1 = window[scan + best_len - 1]; + scan_end = window[scan + best_len]; + } + } + while ((cur_match = (prev[cur_match & wmask] & 0xffff)) > limit && --chain_length != 0); + + if (best_len <= lookahead) + return best_len; + return lookahead; + } + + + private bool Rfc1950BytesEmitted = false; + private bool _WantRfc1950HeaderBytes = true; + internal bool WantRfc1950HeaderBytes + { + get { return _WantRfc1950HeaderBytes; } + set { _WantRfc1950HeaderBytes = value; } + } + + + internal int Initialize(ZlibCodec codec, CompressionLevel level) + { + return Initialize(codec, level, ZlibConstants.WindowBitsMax); + } + + internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits) + { + return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, CompressionStrategy.Default); + } + + internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits, CompressionStrategy compressionStrategy) + { + return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, compressionStrategy); + } + + internal int Initialize(ZlibCodec codec, CompressionLevel level, int windowBits, int memLevel, CompressionStrategy strategy) + { + _codec = codec; + _codec.Message = null; + + // validation + if (windowBits < 9 || windowBits > 15) + throw new ZlibException("windowBits must be in the range 9..15."); + + if (memLevel < 1 || memLevel > MEM_LEVEL_MAX) + throw new ZlibException(String.Format("memLevel must be in the range 1.. {0}", MEM_LEVEL_MAX)); + + _codec.dstate = this; + + w_bits = windowBits; + w_size = 1 << w_bits; + w_mask = w_size - 1; + + hash_bits = memLevel + 7; + hash_size = 1 << hash_bits; + hash_mask = hash_size - 1; + hash_shift = ((hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + window = new byte[w_size * 2]; + prev = new short[w_size]; + head = new short[hash_size]; + + // for memLevel==8, this will be 16384, 16k + lit_bufsize = 1 << (memLevel + 6); + + // Use a single array as the buffer for data pending compression, + // the output distance codes, and the output length codes (aka tree). + // orig comment: This works just fine since the average + // output size for (length,distance) codes is <= 24 bits. + pending = new byte[lit_bufsize * 4]; + _distanceOffset = lit_bufsize; + _lengthOffset = (1 + 2) * lit_bufsize; + + // So, for memLevel 8, the length of the pending buffer is 65536. 64k. + // The first 16k are pending bytes. + // The middle slice, of 32k, is used for distance codes. + // The final 16k are length codes. + + this.compressionLevel = level; + this.compressionStrategy = strategy; + + Reset(); + return ZlibConstants.Z_OK; + } + + + internal void Reset() + { + _codec.TotalBytesIn = _codec.TotalBytesOut = 0; + _codec.Message = null; + //strm.data_type = Z_UNKNOWN; + + pendingCount = 0; + nextPending = 0; + + Rfc1950BytesEmitted = false; + + status = (WantRfc1950HeaderBytes) ? INIT_STATE : BUSY_STATE; + _codec._Adler32 = Adler.Adler32(0, null, 0, 0); + + last_flush = (int)FlushType.None; + + _InitializeTreeData(); + _InitializeLazyMatch(); + } + + + internal int End() + { + if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) + { + return ZlibConstants.Z_STREAM_ERROR; + } + // Deallocate in reverse order of allocations: + pending = null; + head = null; + prev = null; + window = null; + // free + // dstate=null; + return status == BUSY_STATE ? ZlibConstants.Z_DATA_ERROR : ZlibConstants.Z_OK; + } + + + private void SetDeflater() + { + switch (config.Flavor) + { + case DeflateFlavor.Store: + DeflateFunction = DeflateNone; + break; + case DeflateFlavor.Fast: + DeflateFunction = DeflateFast; + break; + case DeflateFlavor.Slow: + DeflateFunction = DeflateSlow; + break; + } + } + + + internal int SetParams(CompressionLevel level, CompressionStrategy strategy) + { + int result = ZlibConstants.Z_OK; + + if (compressionLevel != level) + { + Config newConfig = Config.Lookup(level); + + // change in the deflate flavor (Fast vs slow vs none)? + if (newConfig.Flavor != config.Flavor && _codec.TotalBytesIn != 0) + { + // Flush the last buffer: + result = _codec.Deflate(FlushType.Partial); + } + + compressionLevel = level; + config = newConfig; + SetDeflater(); + } + + // no need to flush with change in strategy? Really? + compressionStrategy = strategy; + + return result; + } + + + internal int SetDictionary(byte[] dictionary) + { + int length = dictionary.Length; + int index = 0; + + if (dictionary == null || status != INIT_STATE) + throw new ZlibException("Stream error."); + + _codec._Adler32 = Adler.Adler32(_codec._Adler32, dictionary, 0, dictionary.Length); + + if (length < MIN_MATCH) + return ZlibConstants.Z_OK; + if (length > w_size - MIN_LOOKAHEAD) + { + length = w_size - MIN_LOOKAHEAD; + index = dictionary.Length - length; // use the tail of the dictionary + } + Array.Copy(dictionary, index, window, 0, length); + strstart = length; + block_start = length; + + // Insert all strings in the hash table (except for the last two bytes). + // s->lookahead stays null, so s->ins_h will be recomputed at the next + // call of fill_window. + + ins_h = window[0] & 0xff; + ins_h = (((ins_h) << hash_shift) ^ (window[1] & 0xff)) & hash_mask; + + for (int n = 0; n <= length - MIN_MATCH; n++) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(n) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + prev[n & w_mask] = head[ins_h]; + head[ins_h] = (short)n; + } + return ZlibConstants.Z_OK; + } + + + + internal int Deflate(FlushType flush) + { + int old_flush; + + if (_codec.OutputBuffer == null || + (_codec.InputBuffer == null && _codec.AvailableBytesIn != 0) || + (status == FINISH_STATE && flush != FlushType.Finish)) + { + _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_STREAM_ERROR)]; + throw new ZlibException(String.Format("Something is fishy. [{0}]", _codec.Message)); + } + if (_codec.AvailableBytesOut == 0) + { + _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; + throw new ZlibException("OutputBuffer is full (AvailableBytesOut == 0)"); + } + + old_flush = last_flush; + last_flush = (int)flush; + + // Write the zlib (rfc1950) header bytes + if (status == INIT_STATE) + { + int header = (Z_DEFLATED + ((w_bits - 8) << 4)) << 8; + int level_flags = (((int)compressionLevel - 1) & 0xff) >> 1; + + if (level_flags > 3) + level_flags = 3; + header |= (level_flags << 6); + if (strstart != 0) + header |= PRESET_DICT; + header += 31 - (header % 31); + + status = BUSY_STATE; + //putShortMSB(header); + unchecked + { + pending[pendingCount++] = (byte)(header >> 8); + pending[pendingCount++] = (byte)header; + } + // Save the adler32 of the preset dictionary: + if (strstart != 0) + { + pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000) >> 24); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x00FF0000) >> 16); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x0000FF00) >> 8); + pending[pendingCount++] = (byte)(_codec._Adler32 & 0x000000FF); + } + _codec._Adler32 = Adler.Adler32(0, null, 0, 0); + } + + // Flush as much pending output as possible + if (pendingCount != 0) + { + _codec.flush_pending(); + if (_codec.AvailableBytesOut == 0) + { + //System.out.println(" avail_out==0"); + // Since avail_out is 0, deflate will be called again with + // more output space, but possibly with both pending and + // avail_in equal to zero. There won't be anything to do, + // but this is not an error situation so make sure we + // return OK instead of BUF_ERROR at next call of deflate: + last_flush = -1; + return ZlibConstants.Z_OK; + } + + // Make sure there is something to do and avoid duplicate consecutive + // flushes. For repeated and useless calls with Z_FINISH, we keep + // returning Z_STREAM_END instead of Z_BUFF_ERROR. + } + else if (_codec.AvailableBytesIn == 0 && + (int)flush <= old_flush && + flush != FlushType.Finish) + { + // workitem 8557 + // + // Not sure why this needs to be an error. pendingCount == 0, which + // means there's nothing to deflate. And the caller has not asked + // for a FlushType.Finish, but... that seems very non-fatal. We + // can just say "OK" and do nothing. + + // _codec.Message = z_errmsg[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; + // throw new ZlibException("AvailableBytesIn == 0 && flush<=old_flush && flush != FlushType.Finish"); + + return ZlibConstants.Z_OK; + } + + // User must not provide more input after the first FINISH: + if (status == FINISH_STATE && _codec.AvailableBytesIn != 0) + { + _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; + throw new ZlibException("status == FINISH_STATE && _codec.AvailableBytesIn != 0"); + } + + // Start a new block or continue the current one. + if (_codec.AvailableBytesIn != 0 || lookahead != 0 || (flush != FlushType.None && status != FINISH_STATE)) + { + BlockState bstate = DeflateFunction(flush); + + if (bstate == BlockState.FinishStarted || bstate == BlockState.FinishDone) + { + status = FINISH_STATE; + } + if (bstate == BlockState.NeedMore || bstate == BlockState.FinishStarted) + { + if (_codec.AvailableBytesOut == 0) + { + last_flush = -1; // avoid BUF_ERROR next call, see above + } + return ZlibConstants.Z_OK; + // If flush != Z_NO_FLUSH && avail_out == 0, the next call + // of deflate should use the same flush parameter to make sure + // that the flush is complete. So we don't have to output an + // empty block here, this will be done at next call. This also + // ensures that for a very small output buffer, we emit at most + // one empty block. + } + + if (bstate == BlockState.BlockDone) + { + if (flush == FlushType.Partial) + { + _tr_align(); + } + else + { + // FlushType.Full or FlushType.Sync + _tr_stored_block(0, 0, false); + // For a full flush, this empty block will be recognized + // as a special marker by inflate_sync(). + if (flush == FlushType.Full) + { + // clear hash (forget the history) + for (int i = 0; i < hash_size; i++) + head[i] = 0; + } + } + _codec.flush_pending(); + if (_codec.AvailableBytesOut == 0) + { + last_flush = -1; // avoid BUF_ERROR at next call, see above + return ZlibConstants.Z_OK; + } + } + } + + if (flush != FlushType.Finish) + return ZlibConstants.Z_OK; + + if (!WantRfc1950HeaderBytes || Rfc1950BytesEmitted) + return ZlibConstants.Z_STREAM_END; + + // Write the zlib trailer (adler32) + pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000) >> 24); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x00FF0000) >> 16); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x0000FF00) >> 8); + pending[pendingCount++] = (byte)(_codec._Adler32 & 0x000000FF); + //putShortMSB((int)(SharedUtils.URShift(_codec._Adler32, 16))); + //putShortMSB((int)(_codec._Adler32 & 0xffff)); + + _codec.flush_pending(); + + // If avail_out is zero, the application will call deflate again + // to flush the rest. + + Rfc1950BytesEmitted = true; // write the trailer only once! + + return pendingCount != 0 ? ZlibConstants.Z_OK : ZlibConstants.Z_STREAM_END; + } + + } +} \ No newline at end of file diff --git a/dotNetZip/Zlib/DeflateStream.cs b/dotNetZip/Zlib/DeflateStream.cs new file mode 100644 index 0000000..05362d4 --- /dev/null +++ b/dotNetZip/Zlib/DeflateStream.cs @@ -0,0 +1,740 @@ +// DeflateStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2010 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-31 14:48:11> +// +// ------------------------------------------------------------------ +// +// This module defines the DeflateStream class, which can be used as a replacement for +// the System.IO.Compression.DeflateStream class in the .NET BCL. +// +// ------------------------------------------------------------------ + + +using System; + +namespace Ionic.Zlib +{ + /// + /// A class for compressing and decompressing streams using the Deflate algorithm. + /// + /// + /// + /// + /// + /// The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any + /// stream. + /// + /// + /// + /// Using this stream, applications can compress or decompress data via stream + /// Read and Write operations. Either compresssion or decompression + /// can occur through either reading or writing. The compression format used is + /// DEFLATE, which is documented in IETF RFC 1951, "DEFLATE + /// Compressed Data Format Specification version 1.3.". + /// + /// + /// + /// This class is similar to , except that + /// ZlibStream adds the RFC + /// 1950 - ZLIB framing bytes to a compressed stream when compressing, or + /// expects the RFC1950 framing bytes when decompressing. The DeflateStream + /// does not. + /// + /// + /// + /// + /// + /// + public class DeflateStream : System.IO.Stream + { + internal ZlibBaseStream _baseStream; + internal System.IO.Stream _innerStream; + bool _disposed; + + /// + /// Create a DeflateStream using the specified CompressionMode. + /// + /// + /// + /// When mode is CompressionMode.Compress, the DeflateStream will use + /// the default compression level. The "captive" stream will be closed when + /// the DeflateStream is closed. + /// + /// + /// + /// This example uses a DeflateStream to compress data from a file, and writes + /// the compressed data to another file. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".deflated") + /// Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the DeflateStream will compress or decompress. + public DeflateStream(System.IO.Stream stream, CompressionMode mode) + : this(stream, mode, CompressionLevel.Default, false) + { + } + + /// + /// Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is + /// ignored. The "captive" stream will be closed when the DeflateStream is + /// closed. + /// + /// + /// + /// + /// + /// + /// This example uses a DeflateStream to compress data from a file, and writes + /// the compressed data to another file. + /// + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (Stream compressor = new DeflateStream(raw, + /// CompressionMode.Compress, + /// CompressionLevel.BestCompression)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// while (n != 0) + /// { + /// if (n > 0) + /// compressor.Write(buffer, 0, n); + /// n= input.Read(buffer, 0, buffer.Length); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".deflated") + /// Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream to be read or written while deflating or inflating. + /// Indicates whether the DeflateStream will compress or decompress. + /// A tuning knob to trade speed for effectiveness. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level) + : this(stream, mode, level, false) + { + } + + /// + /// Create a DeflateStream using the specified + /// CompressionMode, and explicitly specify whether the + /// stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// memory stream that will be re-read after compression. Specify true for + /// the parameter to leave the stream open. + /// + /// + /// + /// The DeflateStream will use the default compression level. + /// + /// + /// + /// See the other overloads of this constructor for example code. + /// + /// + /// + /// + /// The stream which will be read or written. This is called the + /// "captive" stream in other places in this documentation. + /// + /// + /// + /// Indicates whether the DeflateStream will compress or decompress. + /// + /// + /// true if the application would like the stream to + /// remain open after inflation/deflation. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, bool leaveOpen) + : this(stream, mode, CompressionLevel.Default, leaveOpen) + { + } + + /// + /// Create a DeflateStream using the specified CompressionMode + /// and the specified CompressionLevel, and explicitly specify whether + /// the stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is ignored. + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// that will be re-read after + /// compression. Specify true for the parameter + /// to leave the stream open. + /// + /// + /// + /// + /// + /// + /// This example shows how to use a DeflateStream to compress data from + /// a file, and store the compressed data into another file. + /// + /// + /// using (var output = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// while (n != 0) + /// { + /// if (n > 0) + /// compressor.Write(buffer, 0, n); + /// n= input.Read(buffer, 0, buffer.Length); + /// } + /// } + /// } + /// // can write additional data to the output stream here + /// } + /// + /// + /// + /// Using output As FileStream = File.Create(fileToCompress & ".deflated") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// ' can write additional data to the output stream here. + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the DeflateStream will compress or decompress. + /// true if the application would like the stream to remain open after inflation/deflation. + /// A tuning knob to trade speed for effectiveness. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) + { + _innerStream = stream; + _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.DEFLATE, leaveOpen); + } + + #region Zlib properties + + /// + /// This property sets the flush behavior on the stream. + /// + /// See the ZLIB documentation for the meaning of the flush behavior. + /// + virtual public FlushType FlushMode + { + get { return (this._baseStream._flushMode); } + set + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + this._baseStream._flushMode = value; + } + } + + /// + /// The size of the working buffer for the compression codec. + /// + /// + /// + /// + /// The working buffer is used for all stream operations. The default size is + /// 1024 bytes. The minimum size is 128 bytes. You may get better performance + /// with a larger buffer. Then again, you might not. You would have to test + /// it. + /// + /// + /// + /// Set this before the first call to Read() or Write() on the + /// stream. If you try to set it afterwards, it will throw. + /// + /// + public int BufferSize + { + get + { + return this._baseStream._bufferSize; + } + set + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + if (this._baseStream._workingBuffer != null) + throw new ZlibException("The working buffer is already set."); + if (value < ZlibConstants.WorkingBufferSizeMin) + throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); + this._baseStream._bufferSize = value; + } + } + + /// + /// The ZLIB strategy to be used during compression. + /// + /// + /// + /// By tweaking this parameter, you may be able to optimize the compression for + /// data with particular characteristics. + /// + public CompressionStrategy Strategy + { + get + { + return this._baseStream.Strategy; + } + set + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + this._baseStream.Strategy = value; + } + } + + /// Returns the total number of bytes input so far. + virtual public long TotalIn + { + get + { + return this._baseStream._z.TotalBytesIn; + } + } + + /// Returns the total number of bytes output so far. + virtual public long TotalOut + { + get + { + return this._baseStream._z.TotalBytesOut; + } + } + + #endregion + + #region System.IO.Stream methods + /// + /// Dispose the stream. + /// + /// + /// + /// This may or may not result in a Close() call on the captive + /// stream. See the constructors that have a leaveOpen parameter + /// for more information. + /// + /// + /// Application code won't call this code directly. This method may be + /// invoked in two distinct scenarios. If disposing == true, the method + /// has been called directly or indirectly by a user's code, for example + /// via the public Dispose() method. In this case, both managed and + /// unmanaged resources can be referenced and disposed. If disposing == + /// false, the method has been called by the runtime from inside the + /// object finalizer and this method should not reference other objects; + /// in that case only unmanaged resources must be referenced or + /// disposed. + /// + /// + /// + /// true if the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this._baseStream != null)) + this._baseStream.Close(); + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value depends on whether the captive stream supports reading. + /// + public override bool CanRead + { + get + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + return _baseStream._stream.CanRead; + } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + return _baseStream._stream.CanWrite; + } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + _baseStream.Flush(); + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the total bytes + /// written out, if used in writing, or the total bytes read in, if used in + /// reading. The count may refer to compressed bytes or uncompressed bytes, + /// depending on how you've used the stream. + /// + public override long Position + { + get + { + if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Writer) + return this._baseStream._z.TotalBytesOut; + if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Reader) + return this._baseStream._z.TotalBytesIn; + return 0; + } + set { throw new NotImplementedException(); } + } + + /// + /// Read data from the stream. + /// + /// + /// + /// + /// If you wish to use the DeflateStream to compress data while + /// reading, you can create a DeflateStream with + /// CompressionMode.Compress, providing an uncompressed data stream. + /// Then call Read() on that DeflateStream, and the data read will be + /// compressed as you read. If you wish to use the DeflateStream to + /// decompress data while reading, you can create a DeflateStream with + /// CompressionMode.Decompress, providing a readable compressed data + /// stream. Then call Read() on that DeflateStream, and the data read + /// will be decompressed as you read. + /// + /// + /// + /// A DeflateStream can be used for Read() or Write(), but not both. + /// + /// + /// + /// The buffer into which the read data should be placed. + /// the offset within that data array to put the first byte read. + /// the number of bytes to read. + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + return _baseStream.Read(buffer, offset, count); + } + + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + /// this is irrelevant, since it will always throw! + /// irrelevant! + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// If you wish to use the DeflateStream to compress data while + /// writing, you can create a DeflateStream with + /// CompressionMode.Compress, and a writable output stream. Then call + /// Write() on that DeflateStream, providing uncompressed data + /// as input. The data sent to the output stream will be the compressed form + /// of the data written. If you wish to use the DeflateStream to + /// decompress data while writing, you can create a DeflateStream with + /// CompressionMode.Decompress, and a writable output stream. Then + /// call Write() on that stream, providing previously compressed + /// data. The data sent to the output stream will be the decompressed form of + /// the data written. + /// + /// + /// + /// A DeflateStream can be used for Read() or Write(), + /// but not both. + /// + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + _baseStream.Write(buffer, offset, count); + } + #endregion + + + + + /// + /// Compress a string into a byte array using DEFLATE (RFC 1951). + /// + /// + /// + /// Uncompress it with . + /// + /// + /// DeflateStream.UncompressString(byte[]) + /// DeflateStream.CompressBuffer(byte[]) + /// GZipStream.CompressString(string) + /// ZlibStream.CompressString(string) + /// + /// + /// A string to compress. The string will first be encoded + /// using UTF8, then compressed. + /// + /// + /// The string in compressed form + public static byte[] CompressString(String s) + { + using (var ms = new System.IO.MemoryStream()) + { + System.IO.Stream compressor = + new DeflateStream(ms, CompressionMode.Compress, CompressionLevel.BestCompression); + ZlibBaseStream.CompressString(s, compressor); + return ms.ToArray(); + } + } + + + /// + /// Compress a byte array into a new byte array using DEFLATE. + /// + /// + /// + /// Uncompress it with . + /// + /// + /// DeflateStream.CompressString(string) + /// DeflateStream.UncompressBuffer(byte[]) + /// GZipStream.CompressBuffer(byte[]) + /// ZlibStream.CompressBuffer(byte[]) + /// + /// + /// A buffer to compress. + /// + /// + /// The data in compressed form + public static byte[] CompressBuffer(byte[] b) + { + using (var ms = new System.IO.MemoryStream()) + { + System.IO.Stream compressor = + new DeflateStream( ms, CompressionMode.Compress, CompressionLevel.BestCompression ); + + ZlibBaseStream.CompressBuffer(b, compressor); + return ms.ToArray(); + } + } + + + /// + /// Uncompress a DEFLATE'd byte array into a single string. + /// + /// + /// DeflateStream.CompressString(String) + /// DeflateStream.UncompressBuffer(byte[]) + /// GZipStream.UncompressString(byte[]) + /// ZlibStream.UncompressString(byte[]) + /// + /// + /// A buffer containing DEFLATE-compressed data. + /// + /// + /// The uncompressed string + public static String UncompressString(byte[] compressed) + { + using (var input = new System.IO.MemoryStream(compressed)) + { + System.IO.Stream decompressor = + new DeflateStream(input, CompressionMode.Decompress); + + return ZlibBaseStream.UncompressString(compressed, decompressor); + } + } + + + /// + /// Uncompress a DEFLATE'd byte array into a byte array. + /// + /// + /// DeflateStream.CompressBuffer(byte[]) + /// DeflateStream.UncompressString(byte[]) + /// GZipStream.UncompressBuffer(byte[]) + /// ZlibStream.UncompressBuffer(byte[]) + /// + /// + /// A buffer containing data that has been compressed with DEFLATE. + /// + /// + /// The data in uncompressed form + public static byte[] UncompressBuffer(byte[] compressed) + { + using (var input = new System.IO.MemoryStream(compressed)) + { + System.IO.Stream decompressor = + new DeflateStream( input, CompressionMode.Decompress ); + + return ZlibBaseStream.UncompressBuffer(compressed, decompressor); + } + } + + } + +} + diff --git a/dotNetZip/Zlib/GZipStream.cs b/dotNetZip/Zlib/GZipStream.cs new file mode 100644 index 0000000..745e096 --- /dev/null +++ b/dotNetZip/Zlib/GZipStream.cs @@ -0,0 +1,1033 @@ +// GZipStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-08 18:14:39> +// +// ------------------------------------------------------------------ +// +// This module defines the GZipStream class, which can be used as a replacement for +// the System.IO.Compression.GZipStream class in the .NET BCL. NB: The design is not +// completely OO clean: there is some intelligence in the ZlibBaseStream that reads the +// GZip header. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; + +namespace Ionic.Zlib +{ + /// + /// A class for compressing and decompressing GZIP streams. + /// + /// + /// + /// + /// The GZipStream is a Decorator on a + /// . It adds GZIP compression or decompression to any + /// stream. + /// + /// + /// + /// Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the + /// Ionic.Zlib.GZipStream can compress while writing, or decompress while + /// reading, but not vice versa. The compression method used is GZIP, which is + /// documented in IETF RFC + /// 1952, "GZIP file format specification version 4.3". + /// + /// + /// A GZipStream can be used to decompress data (through Read()) or + /// to compress data (through Write()), but not both. + /// + /// + /// + /// If you wish to use the GZipStream to compress data, you must wrap it + /// around a write-able stream. As you call Write() on the GZipStream, the + /// data will be compressed into the GZIP format. If you want to decompress data, + /// you must wrap the GZipStream around a readable stream that contains an + /// IETF RFC 1952-compliant stream. The data will be decompressed as you call + /// Read() on the GZipStream. + /// + /// + /// + /// Though the GZIP format allows data from multiple files to be concatenated + /// together, this stream handles only a single segment of GZIP format, typically + /// representing a single file. + /// + /// + /// + /// This class is similar to and . + /// ZlibStream handles RFC1950-compliant streams. + /// handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. + /// + /// + /// + /// + /// + /// + public class GZipStream : System.IO.Stream + { + // GZip format + // source: http://tools.ietf.org/html/rfc1952 + // + // header id: 2 bytes 1F 8B + // compress method 1 byte 8= DEFLATE (none other supported) + // flag 1 byte bitfield (See below) + // mtime 4 bytes time_t (seconds since jan 1, 1970 UTC of the file. + // xflg 1 byte 2 = max compress used , 4 = max speed (can be ignored) + // OS 1 byte OS for originating archive. set to 0xFF in compression. + // extra field length 2 bytes optional - only if FEXTRA is set. + // extra field varies + // filename varies optional - if FNAME is set. zero terminated. ISO-8859-1. + // file comment varies optional - if FCOMMENT is set. zero terminated. ISO-8859-1. + // crc16 1 byte optional - present only if FHCRC bit is set + // compressed data varies + // CRC32 4 bytes + // isize 4 bytes data size modulo 2^32 + // + // FLG (FLaGs) + // bit 0 FTEXT - indicates file is ASCII text (can be safely ignored) + // bit 1 FHCRC - there is a CRC16 for the header immediately following the header + // bit 2 FEXTRA - extra fields are present + // bit 3 FNAME - the zero-terminated filename is present. encoding; ISO-8859-1. + // bit 4 FCOMMENT - a zero-terminated file comment is present. encoding: ISO-8859-1 + // bit 5 reserved + // bit 6 reserved + // bit 7 reserved + // + // On consumption: + // Extra field is a bunch of nonsense and can be safely ignored. + // Header CRC and OS, likewise. + // + // on generation: + // all optional fields get 0, except for the OS, which gets 255. + // + + + + /// + /// The comment on the GZIP stream. + /// + /// + /// + /// + /// The GZIP format allows for each file to optionally have an associated + /// comment stored with the file. The comment is encoded with the ISO-8859-1 + /// code page. To include a comment in a GZIP stream you create, set this + /// property before calling Write() for the first time on the + /// GZipStream. + /// + /// + /// + /// When using GZipStream to decompress, you can retrieve this property + /// after the first call to Read(). If no comment has been set in the + /// GZIP bytestream, the Comment property will return null + /// (Nothing in VB). + /// + /// + public String Comment + { + get + { + return _Comment; + } + set + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + _Comment = value; + } + } + + /// + /// The FileName for the GZIP stream. + /// + /// + /// + /// + /// + /// The GZIP format optionally allows each file to have an associated + /// filename. When compressing data (through Write()), set this + /// FileName before calling Write() the first time on the GZipStream. + /// The actual filename is encoded into the GZIP bytestream with the + /// ISO-8859-1 code page, according to RFC 1952. It is the application's + /// responsibility to insure that the FileName can be encoded and decoded + /// correctly with this code page. + /// + /// + /// + /// When decompressing (through Read()), you can retrieve this value + /// any time after the first Read(). In the case where there was no filename + /// encoded into the GZIP bytestream, the property will return null (Nothing + /// in VB). + /// + /// + public String FileName + { + get { return _FileName; } + set + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + _FileName = value; + if (_FileName == null) return; + if (_FileName.IndexOf("/") != -1) + { + _FileName = _FileName.Replace("/", "\\"); + } + if (_FileName.EndsWith("\\")) + throw new Exception("Illegal filename"); + if (_FileName.IndexOf("\\") != -1) + { + // trim any leading path + _FileName = Path.GetFileName(_FileName); + } + } + } + + /// + /// The last modified time for the GZIP stream. + /// + /// + /// + /// GZIP allows the storage of a last modified time with each GZIP entry. + /// When compressing data, you can set this before the first call to + /// Write(). When decompressing, you can retrieve this value any time + /// after the first call to Read(). + /// + public DateTime? LastModified; + + /// + /// The CRC on the GZIP stream. + /// + /// + /// This is used for internal error checking. You probably don't need to look at this property. + /// + public int Crc32 { get { return _Crc32; } } + + private int _headerByteCount; + internal ZlibBaseStream _baseStream; + bool _disposed; + bool _firstReadDone; + string _FileName; + string _Comment; + int _Crc32; + + + /// + /// Create a GZipStream using the specified CompressionMode. + /// + /// + /// + /// + /// When mode is CompressionMode.Compress, the GZipStream will use the + /// default compression level. + /// + /// + /// + /// As noted in the class documentation, the CompressionMode (Compress + /// or Decompress) also establishes the "direction" of the stream. A + /// GZipStream with CompressionMode.Compress works only through + /// Write(). A GZipStream with + /// CompressionMode.Decompress works only through Read(). + /// + /// + /// + /// + /// + /// This example shows how to use a GZipStream to compress data. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(outputFile)) + /// { + /// using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Dim outputFile As String = (fileToCompress & ".compressed") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(outputFile) + /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// + /// + /// This example shows how to use a GZipStream to uncompress a file. + /// + /// private void GunZipFile(string filename) + /// { + /// if (!filename.EndsWith(".gz)) + /// throw new ArgumentException("filename"); + /// var DecompressedFile = filename.Substring(0,filename.Length-3); + /// byte[] working = new byte[WORKING_BUFFER_SIZE]; + /// int n= 1; + /// using (System.IO.Stream input = System.IO.File.OpenRead(filename)) + /// { + /// using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + /// { + /// using (var output = System.IO.File.Create(DecompressedFile)) + /// { + /// while (n !=0) + /// { + /// n= decompressor.Read(working, 0, working.Length); + /// if (n > 0) + /// { + /// output.Write(working, 0, n); + /// } + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Private Sub GunZipFile(ByVal filename as String) + /// If Not (filename.EndsWith(".gz)) Then + /// Throw New ArgumentException("filename") + /// End If + /// Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) + /// Dim working(WORKING_BUFFER_SIZE) as Byte + /// Dim n As Integer = 1 + /// Using input As Stream = File.OpenRead(filename) + /// Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) + /// Using output As Stream = File.Create(UncompressedFile) + /// Do + /// n= decompressor.Read(working, 0, working.Length) + /// If n > 0 Then + /// output.Write(working, 0, n) + /// End IF + /// Loop While (n > 0) + /// End Using + /// End Using + /// End Using + /// End Sub + /// + /// + /// + /// The stream which will be read or written. + /// Indicates whether the GZipStream will compress or decompress. + public GZipStream(Stream stream, CompressionMode mode) + : this(stream, mode, CompressionLevel.Default, false) + { + } + + /// + /// Create a GZipStream using the specified CompressionMode and + /// the specified CompressionLevel. + /// + /// + /// + /// + /// The CompressionMode (Compress or Decompress) also establishes the + /// "direction" of the stream. A GZipStream with + /// CompressionMode.Compress works only through Write(). A + /// GZipStream with CompressionMode.Decompress works only + /// through Read(). + /// + /// + /// + /// + /// + /// + /// This example shows how to use a GZipStream to compress a file into a .gz file. + /// + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".gz")) + /// { + /// using (Stream compressor = new GZipStream(raw, + /// CompressionMode.Compress, + /// CompressionLevel.BestCompression)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".gz") + /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream to be read or written while deflating or inflating. + /// Indicates whether the GZipStream will compress or decompress. + /// A tuning knob to trade speed for effectiveness. + public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level) + : this(stream, mode, level, false) + { + } + + /// + /// Create a GZipStream using the specified CompressionMode, and + /// explicitly specify whether the stream should be left open after Deflation + /// or Inflation. + /// + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// memory stream that will be re-read after compressed data has been written + /// to it. Specify true for the parameter to leave + /// the stream open. + /// + /// + /// + /// The (Compress or Decompress) also + /// establishes the "direction" of the stream. A GZipStream with + /// CompressionMode.Compress works only through Write(). A GZipStream + /// with CompressionMode.Decompress works only through Read(). + /// + /// + /// + /// The GZipStream will use the default compression level. If you want + /// to specify the compression level, see . + /// + /// + /// + /// See the other overloads of this constructor for example code. + /// + /// + /// + /// + /// + /// The stream which will be read or written. This is called the "captive" + /// stream in other places in this documentation. + /// + /// + /// Indicates whether the GZipStream will compress or decompress. + /// + /// + /// + /// true if the application would like the base stream to remain open after + /// inflation/deflation. + /// + public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen) + : this(stream, mode, CompressionLevel.Default, leaveOpen) + { + } + + /// + /// Create a GZipStream using the specified CompressionMode and the + /// specified CompressionLevel, and explicitly specify whether the + /// stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// memory stream that will be re-read after compressed data has been written + /// to it. Specify true for the parameter to + /// leave the stream open. + /// + /// + /// + /// As noted in the class documentation, the CompressionMode (Compress + /// or Decompress) also establishes the "direction" of the stream. A + /// GZipStream with CompressionMode.Compress works only through + /// Write(). A GZipStream with CompressionMode.Decompress works only + /// through Read(). + /// + /// + /// + /// + /// + /// This example shows how to use a GZipStream to compress data. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(outputFile)) + /// { + /// using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Dim outputFile As String = (fileToCompress & ".compressed") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(outputFile) + /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the GZipStream will compress or decompress. + /// true if the application would like the stream to remain open after inflation/deflation. + /// A tuning knob to trade speed for effectiveness. + public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) + { + _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.GZIP, leaveOpen); + } + + #region Zlib properties + + /// + /// This property sets the flush behavior on the stream. + /// + virtual public FlushType FlushMode + { + get { return (this._baseStream._flushMode); } + set { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + this._baseStream._flushMode = value; + } + } + + /// + /// The size of the working buffer for the compression codec. + /// + /// + /// + /// + /// The working buffer is used for all stream operations. The default size is + /// 1024 bytes. The minimum size is 128 bytes. You may get better performance + /// with a larger buffer. Then again, you might not. You would have to test + /// it. + /// + /// + /// + /// Set this before the first call to Read() or Write() on the + /// stream. If you try to set it afterwards, it will throw. + /// + /// + public int BufferSize + { + get + { + return this._baseStream._bufferSize; + } + set + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + if (this._baseStream._workingBuffer != null) + throw new ZlibException("The working buffer is already set."); + if (value < ZlibConstants.WorkingBufferSizeMin) + throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); + this._baseStream._bufferSize = value; + } + } + + + /// Returns the total number of bytes input so far. + virtual public long TotalIn + { + get + { + return this._baseStream._z.TotalBytesIn; + } + } + + /// Returns the total number of bytes output so far. + virtual public long TotalOut + { + get + { + return this._baseStream._z.TotalBytesOut; + } + } + + #endregion + + #region Stream methods + + /// + /// Dispose the stream. + /// + /// + /// + /// This may or may not result in a Close() call on the captive + /// stream. See the constructors that have a leaveOpen parameter + /// for more information. + /// + /// + /// This method may be invoked in two distinct scenarios. If disposing + /// == true, the method has been called directly or indirectly by a + /// user's code, for example via the public Dispose() method. In this + /// case, both managed and unmanaged resources can be referenced and + /// disposed. If disposing == false, the method has been called by the + /// runtime from inside the object finalizer and this method should not + /// reference other objects; in that case only unmanaged resources must + /// be referenced or disposed. + /// + /// + /// + /// indicates whether the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this._baseStream != null)) + { + this._baseStream.Close(); + this._Crc32 = _baseStream.Crc32; + } + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value depends on whether the captive stream supports reading. + /// + public override bool CanRead + { + get + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + return _baseStream._stream.CanRead; + } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + return _baseStream._stream.CanWrite; + } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + _baseStream.Flush(); + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the total bytes + /// written out, if used in writing, or the total bytes read in, if used in + /// reading. The count may refer to compressed bytes or uncompressed bytes, + /// depending on how you've used the stream. + /// + public override long Position + { + get + { + if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Writer) + return this._baseStream._z.TotalBytesOut + _headerByteCount; + if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Reader) + return this._baseStream._z.TotalBytesIn + this._baseStream._gzipHeaderByteCount; + return 0; + } + + set { throw new NotImplementedException(); } + } + + /// + /// Read and decompress data from the source stream. + /// + /// + /// + /// With a GZipStream, decompression is done through reading. + /// + /// + /// + /// + /// byte[] working = new byte[WORKING_BUFFER_SIZE]; + /// using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) + /// { + /// using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + /// { + /// using (var output = System.IO.File.Create(_DecompressedFile)) + /// { + /// int n; + /// while ((n= decompressor.Read(working, 0, working.Length)) !=0) + /// { + /// output.Write(working, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// The buffer into which the decompressed data should be placed. + /// the offset within that data array to put the first byte read. + /// the number of bytes to read. + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + int n = _baseStream.Read(buffer, offset, count); + + // Console.WriteLine("GZipStream::Read(buffer, off({0}), c({1}) = {2}", offset, count, n); + // Console.WriteLine( Util.FormatByteArray(buffer, offset, n) ); + + if (!_firstReadDone) + { + _firstReadDone = true; + FileName = _baseStream._GzipFileName; + Comment = _baseStream._GzipComment; + } + return n; + } + + + + /// + /// Calling this method always throws a . + /// + /// irrelevant; it will always throw! + /// irrelevant; it will always throw! + /// irrelevant! + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// irrelevant; this method will always throw! + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// If you wish to use the GZipStream to compress data while writing, + /// you can create a GZipStream with CompressionMode.Compress, and a + /// writable output stream. Then call Write() on that GZipStream, + /// providing uncompressed data as input. The data sent to the output stream + /// will be the compressed form of the data written. + /// + /// + /// + /// A GZipStream can be used for Read() or Write(), but not + /// both. Writing implies compression. Reading implies decompression. + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + if (_baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Undefined) + { + //Console.WriteLine("GZipStream: First write"); + if (_baseStream._wantCompress) + { + // first write in compression, therefore, emit the GZIP header + _headerByteCount = EmitHeader(); + } + else + { + throw new InvalidOperationException(); + } + } + + _baseStream.Write(buffer, offset, count); + } + #endregion + + + internal static readonly System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); +#if SILVERLIGHT || NETCF + internal static readonly System.Text.Encoding iso8859dash1 = new Ionic.Encoding.Iso8859Dash1Encoding(); +#else + internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding("iso-8859-1"); +#endif + + + private int EmitHeader() + { + byte[] commentBytes = (Comment == null) ? null : iso8859dash1.GetBytes(Comment); + byte[] filenameBytes = (FileName == null) ? null : iso8859dash1.GetBytes(FileName); + + int cbLength = (Comment == null) ? 0 : commentBytes.Length + 1; + int fnLength = (FileName == null) ? 0 : filenameBytes.Length + 1; + + int bufferLength = 10 + cbLength + fnLength; + byte[] header = new byte[bufferLength]; + int i = 0; + // ID + header[i++] = 0x1F; + header[i++] = 0x8B; + + // compression method + header[i++] = 8; + byte flag = 0; + if (Comment != null) + flag ^= 0x10; + if (FileName != null) + flag ^= 0x8; + + // flag + header[i++] = flag; + + // mtime + if (!LastModified.HasValue) LastModified = DateTime.Now; + System.TimeSpan delta = LastModified.Value - _unixEpoch; + Int32 timet = (Int32)delta.TotalSeconds; + Array.Copy(BitConverter.GetBytes(timet), 0, header, i, 4); + i += 4; + + // xflg + header[i++] = 0; // this field is totally useless + // OS + header[i++] = 0xFF; // 0xFF == unspecified + + // extra field length - only if FEXTRA is set, which it is not. + //header[i++]= 0; + //header[i++]= 0; + + // filename + if (fnLength != 0) + { + Array.Copy(filenameBytes, 0, header, i, fnLength - 1); + i += fnLength - 1; + header[i++] = 0; // terminate + } + + // comment + if (cbLength != 0) + { + Array.Copy(commentBytes, 0, header, i, cbLength - 1); + i += cbLength - 1; + header[i++] = 0; // terminate + } + + _baseStream._stream.Write(header, 0, header.Length); + + return header.Length; // bytes written + } + + + + /// + /// Compress a string into a byte array using GZip. + /// + /// + /// + /// Uncompress it with . + /// + /// + /// + /// + /// + /// + /// A string to compress. The string will first be encoded + /// using UTF8, then compressed. + /// + /// + /// The string in compressed form + public static byte[] CompressString(String s) + { + using (var ms = new MemoryStream()) + { + System.IO.Stream compressor = + new GZipStream(ms, CompressionMode.Compress, CompressionLevel.BestCompression); + ZlibBaseStream.CompressString(s, compressor); + return ms.ToArray(); + } + } + + + /// + /// Compress a byte array into a new byte array using GZip. + /// + /// + /// + /// Uncompress it with . + /// + /// + /// + /// + /// + /// + /// A buffer to compress. + /// + /// + /// The data in compressed form + public static byte[] CompressBuffer(byte[] b) + { + using (var ms = new MemoryStream()) + { + System.IO.Stream compressor = + new GZipStream( ms, CompressionMode.Compress, CompressionLevel.BestCompression ); + + ZlibBaseStream.CompressBuffer(b, compressor); + return ms.ToArray(); + } + } + + + /// + /// Uncompress a GZip'ed byte array into a single string. + /// + /// + /// + /// + /// + /// + /// A buffer containing GZIP-compressed data. + /// + /// + /// The uncompressed string + public static String UncompressString(byte[] compressed) + { + using (var input = new MemoryStream(compressed)) + { + Stream decompressor = new GZipStream(input, CompressionMode.Decompress); + return ZlibBaseStream.UncompressString(compressed, decompressor); + } + } + + + /// + /// Uncompress a GZip'ed byte array into a byte array. + /// + /// + /// + /// + /// + /// + /// A buffer containing data that has been compressed with GZip. + /// + /// + /// The data in uncompressed form + public static byte[] UncompressBuffer(byte[] compressed) + { + using (var input = new System.IO.MemoryStream(compressed)) + { + System.IO.Stream decompressor = + new GZipStream( input, CompressionMode.Decompress ); + + return ZlibBaseStream.UncompressBuffer(compressed, decompressor); + } + } + + + } +} diff --git a/dotNetZip/Zlib/InfTree.cs b/dotNetZip/Zlib/InfTree.cs new file mode 100644 index 0000000..416b143 --- /dev/null +++ b/dotNetZip/Zlib/InfTree.cs @@ -0,0 +1,436 @@ +// Inftree.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-October-28 12:43:54> +// +// ------------------------------------------------------------------ +// +// This module defines classes used in decompression. This code is derived +// from the jzlib implementation of zlib. In keeping with the license for jzlib, +// the copyright to that code is below. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + + +using System; +namespace Ionic.Zlib +{ + + sealed class InfTree + { + + private const int MANY = 1440; + + private const int Z_OK = 0; + private const int Z_STREAM_END = 1; + private const int Z_NEED_DICT = 2; + private const int Z_ERRNO = - 1; + private const int Z_STREAM_ERROR = - 2; + private const int Z_DATA_ERROR = - 3; + private const int Z_MEM_ERROR = - 4; + private const int Z_BUF_ERROR = - 5; + private const int Z_VERSION_ERROR = - 6; + + internal const int fixed_bl = 9; + internal const int fixed_bd = 5; + + //UPGRADE_NOTE: Final was removed from the declaration of 'fixed_tl'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] fixed_tl = new int[]{96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, + 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, + 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255}; + //UPGRADE_NOTE: Final was removed from the declaration of 'fixed_td'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] fixed_td = new int[]{80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577}; + + // Tables for deflate from PKZIP's appnote.txt. + //UPGRADE_NOTE: Final was removed from the declaration of 'cplens'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cplens = new int[]{3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + + // see note #13 above about 258 + //UPGRADE_NOTE: Final was removed from the declaration of 'cplext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cplext = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; + + //UPGRADE_NOTE: Final was removed from the declaration of 'cpdist'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cpdist = new int[]{1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; + + //UPGRADE_NOTE: Final was removed from the declaration of 'cpdext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cpdext = new int[]{0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; + + // If BMAX needs to be larger than 16, then h and x[] should be uLong. + internal const int BMAX = 15; // maximum bit length of any code + + internal int[] hn = null; // hufts used in space + internal int[] v = null; // work area for huft_build + internal int[] c = null; // bit length count table + internal int[] r = null; // table entry for structure assignment + internal int[] u = null; // table stack + internal int[] x = null; // bit offsets, then code stack + + private int huft_build(int[] b, int bindex, int n, int s, int[] d, int[] e, int[] t, int[] m, int[] hp, int[] hn, int[] v) + { + // Given a list of code lengths and a maximum table size, make a set of + // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + // if the given code set is incomplete (the tables are still built in this + // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of + // lengths), or Z_MEM_ERROR if not enough memory. + + int a; // counter for codes of length k + int f; // i repeats in table every f entries + int g; // maximum code length + int h; // table level + int i; // counter, current code + int j; // counter + int k; // number of bits in current code + int l; // bits per table (returned in m) + int mask; // (1 << w) - 1, to avoid cc -O bug on HP + int p; // pointer into c[], b[], or v[] + int q; // points to current table + int w; // bits before this table == (l * h) + int xp; // pointer into x + int y; // number of dummy codes added + int z; // number of entries in current table + + // Generate counts for each bit length + + p = 0; i = n; + do + { + c[b[bindex + p]]++; p++; i--; // assume all entries <= BMAX + } + while (i != 0); + + if (c[0] == n) + { + // null input--all zero length codes + t[0] = - 1; + m[0] = 0; + return Z_OK; + } + + // Find minimum and maximum length, bound *m by those + l = m[0]; + for (j = 1; j <= BMAX; j++) + if (c[j] != 0) + break; + k = j; // minimum code length + if (l < j) + { + l = j; + } + for (i = BMAX; i != 0; i--) + { + if (c[i] != 0) + break; + } + g = i; // maximum code length + if (l > i) + { + l = i; + } + m[0] = l; + + // Adjust last length count to fill out codes, if needed + for (y = 1 << j; j < i; j++, y <<= 1) + { + if ((y -= c[j]) < 0) + { + return Z_DATA_ERROR; + } + } + if ((y -= c[i]) < 0) + { + return Z_DATA_ERROR; + } + c[i] += y; + + // Generate starting offsets into the value table for each length + x[1] = j = 0; + p = 1; xp = 2; + while (--i != 0) + { + // note that i == g from above + x[xp] = (j += c[p]); + xp++; + p++; + } + + // Make a table of values in order of bit lengths + i = 0; p = 0; + do + { + if ((j = b[bindex + p]) != 0) + { + v[x[j]++] = i; + } + p++; + } + while (++i < n); + n = x[g]; // set n to length of v + + // Generate the Huffman codes and for each, make the table entries + x[0] = i = 0; // first Huffman code is zero + p = 0; // grab values in bit order + h = - 1; // no tables yet--level -1 + w = - l; // bits decoded == (l * h) + u[0] = 0; // just to keep compilers happy + q = 0; // ditto + z = 0; // ditto + + // go through the bit lengths (k already is bits in shortest code) + for (; k <= g; k++) + { + a = c[k]; + while (a-- != 0) + { + // here i is the Huffman code of length k bits for value *p + // make tables up to required level + while (k > w + l) + { + h++; + w += l; // previous table always l bits + // compute minimum size table less than or equal to l bits + z = g - w; + z = (z > l)?l:z; // table size upper limit + if ((f = 1 << (j = k - w)) > a + 1) + { + // try a k-w bit table + // too few codes for k-w bit table + f -= (a + 1); // deduct codes from patterns left + xp = k; + if (j < z) + { + while (++j < z) + { + // try smaller tables up to z bits + if ((f <<= 1) <= c[++xp]) + break; // enough codes to use up j bits + f -= c[xp]; // else deduct codes from patterns + } + } + } + z = 1 << j; // table entries for j-bit table + + // allocate new table + if (hn[0] + z > MANY) + { + // (note: doesn't matter for fixed) + return Z_DATA_ERROR; // overflow of MANY + } + u[h] = q = hn[0]; // DEBUG + hn[0] += z; + + // connect to last table, if there is one + if (h != 0) + { + x[h] = i; // save pattern for backing up + r[0] = (sbyte) j; // bits in this table + r[1] = (sbyte) l; // bits to dump before this table + j = SharedUtils.URShift(i, (w - l)); + r[2] = (int) (q - u[h - 1] - j); // offset to this table + Array.Copy(r, 0, hp, (u[h - 1] + j) * 3, 3); // connect to last table + } + else + { + t[0] = q; // first table is returned result + } + } + + // set up table entry in r + r[1] = (sbyte) (k - w); + if (p >= n) + { + r[0] = 128 + 64; // out of values--invalid code + } + else if (v[p] < s) + { + r[0] = (sbyte) (v[p] < 256?0:32 + 64); // 256 is end-of-block + r[2] = v[p++]; // simple code is just the value + } + else + { + r[0] = (sbyte) (e[v[p] - s] + 16 + 64); // non-simple--look up in lists + r[2] = d[v[p++] - s]; + } + + // fill code-like entries with r + f = 1 << (k - w); + for (j = SharedUtils.URShift(i, w); j < z; j += f) + { + Array.Copy(r, 0, hp, (q + j) * 3, 3); + } + + // backwards increment the k-bit code i + for (j = 1 << (k - 1); (i & j) != 0; j = SharedUtils.URShift(j, 1)) + { + i ^= j; + } + i ^= j; + + // backup over finished tables + mask = (1 << w) - 1; // needed on HP, cc -O bug + while ((i & mask) != x[h]) + { + h--; // don't need to update q + w -= l; + mask = (1 << w) - 1; + } + } + } + // Return Z_BUF_ERROR if we were given an incomplete table + return y != 0 && g != 1?Z_BUF_ERROR:Z_OK; + } + + internal int inflate_trees_bits(int[] c, int[] bb, int[] tb, int[] hp, ZlibCodec z) + { + int result; + initWorkArea(19); + hn[0] = 0; + result = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v); + + if (result == Z_DATA_ERROR) + { + z.Message = "oversubscribed dynamic bit lengths tree"; + } + else if (result == Z_BUF_ERROR || bb[0] == 0) + { + z.Message = "incomplete dynamic bit lengths tree"; + result = Z_DATA_ERROR; + } + return result; + } + + internal int inflate_trees_dynamic(int nl, int nd, int[] c, int[] bl, int[] bd, int[] tl, int[] td, int[] hp, ZlibCodec z) + { + int result; + + // build literal/length tree + initWorkArea(288); + hn[0] = 0; + result = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v); + if (result != Z_OK || bl[0] == 0) + { + if (result == Z_DATA_ERROR) + { + z.Message = "oversubscribed literal/length tree"; + } + else if (result != Z_MEM_ERROR) + { + z.Message = "incomplete literal/length tree"; + result = Z_DATA_ERROR; + } + return result; + } + + // build distance tree + initWorkArea(288); + result = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v); + + if (result != Z_OK || (bd[0] == 0 && nl > 257)) + { + if (result == Z_DATA_ERROR) + { + z.Message = "oversubscribed distance tree"; + } + else if (result == Z_BUF_ERROR) + { + z.Message = "incomplete distance tree"; + result = Z_DATA_ERROR; + } + else if (result != Z_MEM_ERROR) + { + z.Message = "empty distance tree with lengths"; + result = Z_DATA_ERROR; + } + return result; + } + + return Z_OK; + } + + internal static int inflate_trees_fixed(int[] bl, int[] bd, int[][] tl, int[][] td, ZlibCodec z) + { + bl[0] = fixed_bl; + bd[0] = fixed_bd; + tl[0] = fixed_tl; + td[0] = fixed_td; + return Z_OK; + } + + private void initWorkArea(int vsize) + { + if (hn == null) + { + hn = new int[1]; + v = new int[vsize]; + c = new int[BMAX + 1]; + r = new int[3]; + u = new int[BMAX]; + x = new int[BMAX + 1]; + } + else + { + if (v.Length < vsize) + { + v = new int[vsize]; + } + Array.Clear(v,0,vsize); + Array.Clear(c,0,BMAX+1); + r[0]=0; r[1]=0; r[2]=0; + // for(int i=0; i +// +// ------------------------------------------------------------------ +// +// This module defines classes for decompression. This code is derived +// from the jzlib implementation of zlib, but significantly modified. +// The object model is not the same, and many of the behaviors are +// different. Nonetheless, in keeping with the license for jzlib, I am +// reproducing the copyright to that code here. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; +namespace Ionic.Zlib +{ + sealed class InflateBlocks + { + private const int MANY = 1440; + + // Table for deflate from PKZIP's appnote.txt. + internal static readonly int[] border = new int[] + { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + + private enum InflateBlockMode + { + TYPE = 0, // get type bits (3, including end bit) + LENS = 1, // get lengths for stored + STORED = 2, // processing stored block + TABLE = 3, // get table lengths + BTREE = 4, // get bit lengths tree for a dynamic block + DTREE = 5, // get length, distance trees for a dynamic block + CODES = 6, // processing fixed or dynamic block + DRY = 7, // output remaining window bytes + DONE = 8, // finished last block, done + BAD = 9, // ot a data error--stuck here + } + + private InflateBlockMode mode; // current inflate_block mode + + internal int left; // if STORED, bytes left to copy + + internal int table; // table lengths (14 bits) + internal int index; // index into blens (or border) + internal int[] blens; // bit lengths of codes + internal int[] bb = new int[1]; // bit length tree depth + internal int[] tb = new int[1]; // bit length decoding tree + + internal InflateCodes codes = new InflateCodes(); // if CODES, current state + + internal int last; // true if this block is the last block + + internal ZlibCodec _codec; // pointer back to this zlib stream + + // mode independent information + internal int bitk; // bits in bit buffer + internal int bitb; // bit buffer + internal int[] hufts; // single malloc for tree space + internal byte[] window; // sliding window + internal int end; // one byte after sliding window + internal int readAt; // window read pointer + internal int writeAt; // window write pointer + internal System.Object checkfn; // check function + internal uint check; // check on output + + internal InfTree inftree = new InfTree(); + + internal InflateBlocks(ZlibCodec codec, System.Object checkfn, int w) + { + _codec = codec; + hufts = new int[MANY * 3]; + window = new byte[w]; + end = w; + this.checkfn = checkfn; + mode = InflateBlockMode.TYPE; + Reset(); + } + + internal uint Reset() + { + uint oldCheck = check; + mode = InflateBlockMode.TYPE; + bitk = 0; + bitb = 0; + readAt = writeAt = 0; + + if (checkfn != null) + _codec._Adler32 = check = Adler.Adler32(0, null, 0, 0); + return oldCheck; + } + + + internal int Process(int r) + { + int t; // temporary storage + int b; // bit buffer + int k; // bits in bit buffer + int p; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + + // copy input/output information to locals (UPDATE macro restores) + + p = _codec.NextIn; + n = _codec.AvailableBytesIn; + b = bitb; + k = bitk; + + q = writeAt; + m = (int)(q < readAt ? readAt - q - 1 : end - q); + + + // process input based on current state + while (true) + { + switch (mode) + { + case InflateBlockMode.TYPE: + + while (k < (3)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + t = (int)(b & 7); + last = t & 1; + + switch ((uint)t >> 1) + { + case 0: // stored + b >>= 3; k -= (3); + t = k & 7; // go to byte boundary + b >>= t; k -= t; + mode = InflateBlockMode.LENS; // get length of stored block + break; + + case 1: // fixed + int[] bl = new int[1]; + int[] bd = new int[1]; + int[][] tl = new int[1][]; + int[][] td = new int[1][]; + InfTree.inflate_trees_fixed(bl, bd, tl, td, _codec); + codes.Init(bl[0], bd[0], tl[0], 0, td[0], 0); + b >>= 3; k -= 3; + mode = InflateBlockMode.CODES; + break; + + case 2: // dynamic + b >>= 3; k -= 3; + mode = InflateBlockMode.TABLE; + break; + + case 3: // illegal + b >>= 3; k -= 3; + mode = InflateBlockMode.BAD; + _codec.Message = "invalid block type"; + r = ZlibConstants.Z_DATA_ERROR; + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + break; + + case InflateBlockMode.LENS: + + while (k < (32)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + ; + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + if ( ( ((~b)>>16) & 0xffff) != (b & 0xffff)) + { + mode = InflateBlockMode.BAD; + _codec.Message = "invalid stored block lengths"; + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + left = (b & 0xffff); + b = k = 0; // dump bits + mode = left != 0 ? InflateBlockMode.STORED : (last != 0 ? InflateBlockMode.DRY : InflateBlockMode.TYPE); + break; + + case InflateBlockMode.STORED: + if (n == 0) + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + if (m == 0) + { + if (q == end && readAt != 0) + { + q = 0; m = (int)(q < readAt ? readAt - q - 1 : end - q); + } + if (m == 0) + { + writeAt = q; + r = Flush(r); + q = writeAt; m = (int)(q < readAt ? readAt - q - 1 : end - q); + if (q == end && readAt != 0) + { + q = 0; m = (int)(q < readAt ? readAt - q - 1 : end - q); + } + if (m == 0) + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + } + } + r = ZlibConstants.Z_OK; + + t = left; + if (t > n) + t = n; + if (t > m) + t = m; + Array.Copy(_codec.InputBuffer, p, window, q, t); + p += t; n -= t; + q += t; m -= t; + if ((left -= t) != 0) + break; + mode = last != 0 ? InflateBlockMode.DRY : InflateBlockMode.TYPE; + break; + + case InflateBlockMode.TABLE: + + while (k < (14)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + table = t = (b & 0x3fff); + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + mode = InflateBlockMode.BAD; + _codec.Message = "too many length or distance symbols"; + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if (blens == null || blens.Length < t) + { + blens = new int[t]; + } + else + { + Array.Clear(blens, 0, t); + // for (int i = 0; i < t; i++) + // { + // blens[i] = 0; + // } + } + + b >>= 14; + k -= 14; + + + index = 0; + mode = InflateBlockMode.BTREE; + goto case InflateBlockMode.BTREE; + + case InflateBlockMode.BTREE: + while (index < 4 + (table >> 10)) + { + while (k < (3)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + blens[border[index++]] = b & 7; + + b >>= 3; k -= 3; + } + + while (index < 19) + { + blens[border[index++]] = 0; + } + + bb[0] = 7; + t = inftree.inflate_trees_bits(blens, bb, tb, hufts, _codec); + if (t != ZlibConstants.Z_OK) + { + r = t; + if (r == ZlibConstants.Z_DATA_ERROR) + { + blens = null; + mode = InflateBlockMode.BAD; + } + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + index = 0; + mode = InflateBlockMode.DTREE; + goto case InflateBlockMode.DTREE; + + case InflateBlockMode.DTREE: + while (true) + { + t = table; + if (!(index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))) + { + break; + } + + int i, j, c; + + t = bb[0]; + + while (k < t) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + t = hufts[(tb[0] + (b & InternalInflateConstants.InflateMask[t])) * 3 + 1]; + c = hufts[(tb[0] + (b & InternalInflateConstants.InflateMask[t])) * 3 + 2]; + + if (c < 16) + { + b >>= t; k -= t; + blens[index++] = c; + } + else + { + // c == 16..18 + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + + while (k < (t + i)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + b >>= t; k -= t; + + j += (b & InternalInflateConstants.InflateMask[i]); + + b >>= i; k -= i; + + i = index; + t = table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) + { + blens = null; + mode = InflateBlockMode.BAD; + _codec.Message = "invalid bit length repeat"; + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + c = (c == 16) ? blens[i-1] : 0; + do + { + blens[i++] = c; + } + while (--j != 0); + index = i; + } + } + + tb[0] = -1; + { + int[] bl = new int[] { 9 }; // must be <= 9 for lookahead assumptions + int[] bd = new int[] { 6 }; // must be <= 9 for lookahead assumptions + int[] tl = new int[1]; + int[] td = new int[1]; + + t = table; + t = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl, bd, tl, td, hufts, _codec); + + if (t != ZlibConstants.Z_OK) + { + if (t == ZlibConstants.Z_DATA_ERROR) + { + blens = null; + mode = InflateBlockMode.BAD; + } + r = t; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + codes.Init(bl[0], bd[0], hufts, tl[0], hufts, td[0]); + } + mode = InflateBlockMode.CODES; + goto case InflateBlockMode.CODES; + + case InflateBlockMode.CODES: + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + + r = codes.Process(this, r); + if (r != ZlibConstants.Z_STREAM_END) + { + return Flush(r); + } + + r = ZlibConstants.Z_OK; + p = _codec.NextIn; + n = _codec.AvailableBytesIn; + b = bitb; + k = bitk; + q = writeAt; + m = (int)(q < readAt ? readAt - q - 1 : end - q); + + if (last == 0) + { + mode = InflateBlockMode.TYPE; + break; + } + mode = InflateBlockMode.DRY; + goto case InflateBlockMode.DRY; + + case InflateBlockMode.DRY: + writeAt = q; + r = Flush(r); + q = writeAt; m = (int)(q < readAt ? readAt - q - 1 : end - q); + if (readAt != writeAt) + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + mode = InflateBlockMode.DONE; + goto case InflateBlockMode.DONE; + + case InflateBlockMode.DONE: + r = ZlibConstants.Z_STREAM_END; + bitb = b; + bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + + case InflateBlockMode.BAD: + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + + + default: + r = ZlibConstants.Z_STREAM_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + } + } + + + internal void Free() + { + Reset(); + window = null; + hufts = null; + } + + internal void SetDictionary(byte[] d, int start, int n) + { + Array.Copy(d, start, window, 0, n); + readAt = writeAt = n; + } + + // Returns true if inflate is currently at the end of a block generated + // by Z_SYNC_FLUSH or Z_FULL_FLUSH. + internal int SyncPoint() + { + return mode == InflateBlockMode.LENS ? 1 : 0; + } + + // copy as much as possible from the sliding window to the output area + internal int Flush(int r) + { + int nBytes; + + for (int pass=0; pass < 2; pass++) + { + if (pass==0) + { + // compute number of bytes to copy as far as end of window + nBytes = (int)((readAt <= writeAt ? writeAt : end) - readAt); + } + else + { + // compute bytes to copy + nBytes = writeAt - readAt; + } + + // workitem 8870 + if (nBytes == 0) + { + if (r == ZlibConstants.Z_BUF_ERROR) + r = ZlibConstants.Z_OK; + return r; + } + + if (nBytes > _codec.AvailableBytesOut) + nBytes = _codec.AvailableBytesOut; + + if (nBytes != 0 && r == ZlibConstants.Z_BUF_ERROR) + r = ZlibConstants.Z_OK; + + // update counters + _codec.AvailableBytesOut -= nBytes; + _codec.TotalBytesOut += nBytes; + + // update check information + if (checkfn != null) + _codec._Adler32 = check = Adler.Adler32(check, window, readAt, nBytes); + + // copy as far as end of window + Array.Copy(window, readAt, _codec.OutputBuffer, _codec.NextOut, nBytes); + _codec.NextOut += nBytes; + readAt += nBytes; + + // see if more to copy at beginning of window + if (readAt == end && pass == 0) + { + // wrap pointers + readAt = 0; + if (writeAt == end) + writeAt = 0; + } + else pass++; + } + + // done + return r; + } + } + + + internal static class InternalInflateConstants + { + // And'ing with mask[n] masks the lower n bits + internal static readonly int[] InflateMask = new int[] { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, + 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, + 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, + 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff }; + } + + + sealed class InflateCodes + { + // waiting for "i:"=input, + // "o:"=output, + // "x:"=nothing + private const int START = 0; // x: set up for LEN + private const int LEN = 1; // i: get length/literal/eob next + private const int LENEXT = 2; // i: getting length extra (have base) + private const int DIST = 3; // i: get distance next + private const int DISTEXT = 4; // i: getting distance extra + private const int COPY = 5; // o: copying bytes in window, waiting for space + private const int LIT = 6; // o: got literal, waiting for output space + private const int WASH = 7; // o: got eob, possibly still output waiting + private const int END = 8; // x: got eob and all data flushed + private const int BADCODE = 9; // x: got error + + internal int mode; // current inflate_codes mode + + // mode dependent information + internal int len; + + internal int[] tree; // pointer into tree + internal int tree_index = 0; + internal int need; // bits needed + + internal int lit; + + // if EXT or COPY, where and how much + internal int bitsToGet; // bits to get for extra + internal int dist; // distance back to copy from + + internal byte lbits; // ltree bits decoded per branch + internal byte dbits; // dtree bits decoder per branch + internal int[] ltree; // literal/length/eob tree + internal int ltree_index; // literal/length/eob tree + internal int[] dtree; // distance tree + internal int dtree_index; // distance tree + + internal InflateCodes() + { + } + + internal void Init(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index) + { + mode = START; + lbits = (byte)bl; + dbits = (byte)bd; + ltree = tl; + ltree_index = tl_index; + dtree = td; + dtree_index = td_index; + tree = null; + } + + internal int Process(InflateBlocks blocks, int r) + { + int j; // temporary storage + int tindex; // temporary pointer + int e; // extra bits or operation + int b = 0; // bit buffer + int k = 0; // bits in bit buffer + int p = 0; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + int f; // pointer to copy strings from + + ZlibCodec z = blocks._codec; + + // copy input/output information to locals (UPDATE macro restores) + p = z.NextIn; + n = z.AvailableBytesIn; + b = blocks.bitb; + k = blocks.bitk; + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + // process input and output based on current state + while (true) + { + switch (mode) + { + // waiting for "i:"=input, "o:"=output, "x:"=nothing + case START: // x: set up for LEN + if (m >= 258 && n >= 10) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + r = InflateFast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, blocks, z); + + p = z.NextIn; + n = z.AvailableBytesIn; + b = blocks.bitb; + k = blocks.bitk; + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (r != ZlibConstants.Z_OK) + { + mode = (r == ZlibConstants.Z_STREAM_END) ? WASH : BADCODE; + break; + } + } + need = lbits; + tree = ltree; + tree_index = ltree_index; + + mode = LEN; + goto case LEN; + + case LEN: // i: get length/literal/eob next + j = need; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + tindex = (tree_index + (b & InternalInflateConstants.InflateMask[j])) * 3; + + b >>= (tree[tindex + 1]); + k -= (tree[tindex + 1]); + + e = tree[tindex]; + + if (e == 0) + { + // literal + lit = tree[tindex + 2]; + mode = LIT; + break; + } + if ((e & 16) != 0) + { + // length + bitsToGet = e & 15; + len = tree[tindex + 2]; + mode = LENEXT; + break; + } + if ((e & 64) == 0) + { + // next table + need = e; + tree_index = tindex / 3 + tree[tindex + 2]; + break; + } + if ((e & 32) != 0) + { + // end of block + mode = WASH; + break; + } + mode = BADCODE; // invalid code + z.Message = "invalid literal/length code"; + r = ZlibConstants.Z_DATA_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + + case LENEXT: // i: getting length extra (have base) + j = bitsToGet; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + len += (b & InternalInflateConstants.InflateMask[j]); + + b >>= j; + k -= j; + + need = dbits; + tree = dtree; + tree_index = dtree_index; + mode = DIST; + goto case DIST; + + case DIST: // i: get distance next + j = need; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + tindex = (tree_index + (b & InternalInflateConstants.InflateMask[j])) * 3; + + b >>= tree[tindex + 1]; + k -= tree[tindex + 1]; + + e = (tree[tindex]); + if ((e & 0x10) != 0) + { + // distance + bitsToGet = e & 15; + dist = tree[tindex + 2]; + mode = DISTEXT; + break; + } + if ((e & 64) == 0) + { + // next table + need = e; + tree_index = tindex / 3 + tree[tindex + 2]; + break; + } + mode = BADCODE; // invalid code + z.Message = "invalid distance code"; + r = ZlibConstants.Z_DATA_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + + case DISTEXT: // i: getting distance extra + j = bitsToGet; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + dist += (b & InternalInflateConstants.InflateMask[j]); + + b >>= j; + k -= j; + + mode = COPY; + goto case COPY; + + case COPY: // o: copying bytes in window, waiting for space + f = q - dist; + while (f < 0) + { + // modulo window size-"while" instead + f += blocks.end; // of "if" handles invalid distances + } + while (len != 0) + { + if (m == 0) + { + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + if (m == 0) + { + blocks.writeAt = q; r = blocks.Flush(r); + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + + if (m == 0) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + } + } + + blocks.window[q++] = blocks.window[f++]; m--; + + if (f == blocks.end) + f = 0; + len--; + } + mode = START; + break; + + case LIT: // o: got literal, waiting for output space + if (m == 0) + { + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + if (m == 0) + { + blocks.writeAt = q; r = blocks.Flush(r); + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + if (m == 0) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + } + } + r = ZlibConstants.Z_OK; + + blocks.window[q++] = (byte)lit; m--; + + mode = START; + break; + + case WASH: // o: got eob, possibly more output + if (k > 7) + { + // return unused byte, if any + k -= 8; + n++; + p--; // can always return one + } + + blocks.writeAt = q; r = blocks.Flush(r); + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (blocks.readAt != blocks.writeAt) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + mode = END; + goto case END; + + case END: + r = ZlibConstants.Z_STREAM_END; + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + case BADCODE: // x: got error + + r = ZlibConstants.Z_DATA_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + default: + r = ZlibConstants.Z_STREAM_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + } + } + + + // Called with number of bytes left to write in window at least 258 + // (the maximum string length) and number of input bytes available + // at least ten. The ten bytes are six bytes for the longest length/ + // distance pair plus four bytes for overloading the bit buffer. + + internal int InflateFast(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, InflateBlocks s, ZlibCodec z) + { + int t; // temporary pointer + int[] tp; // temporary pointer + int tp_index; // temporary pointer + int e; // extra bits or operation + int b; // bit buffer + int k; // bits in bit buffer + int p; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + int ml; // mask for literal/length tree + int md; // mask for distance tree + int c; // bytes to copy + int d; // distance back to copy from + int r; // copy source pointer + + int tp_index_t_3; // (tp_index+t)*3 + + // load input, output, bit values + p = z.NextIn; n = z.AvailableBytesIn; b = s.bitb; k = s.bitk; + q = s.writeAt; m = q < s.readAt ? s.readAt - q - 1 : s.end - q; + + // initialize masks + ml = InternalInflateConstants.InflateMask[bl]; + md = InternalInflateConstants.InflateMask[bd]; + + // do until not enough input or output space for fast loop + do + { + // assume called with m >= 258 && n >= 10 + // get literal/length code + while (k < (20)) + { + // max bits for literal/length code + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; + } + + t = b & ml; + tp = tl; + tp_index = tl_index; + tp_index_t_3 = (tp_index + t) * 3; + if ((e = tp[tp_index_t_3]) == 0) + { + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + + s.window[q++] = (byte)tp[tp_index_t_3 + 2]; + m--; + continue; + } + do + { + + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + + if ((e & 16) != 0) + { + e &= 15; + c = tp[tp_index_t_3 + 2] + ((int)b & InternalInflateConstants.InflateMask[e]); + + b >>= e; k -= e; + + // decode distance base of block to copy + while (k < 15) + { + // max bits for distance code + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; + } + + t = b & md; + tp = td; + tp_index = td_index; + tp_index_t_3 = (tp_index + t) * 3; + e = tp[tp_index_t_3]; + + do + { + + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + + if ((e & 16) != 0) + { + // get extra bits to add to distance base + e &= 15; + while (k < e) + { + // get extra bits (up to 13) + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; + } + + d = tp[tp_index_t_3 + 2] + (b & InternalInflateConstants.InflateMask[e]); + + b >>= e; k -= e; + + // do the copy + m -= c; + if (q >= d) + { + // offset before dest + // just copy + r = q - d; + if (q - r > 0 && 2 > (q - r)) + { + s.window[q++] = s.window[r++]; // minimum count is three, + s.window[q++] = s.window[r++]; // so unroll loop a little + c -= 2; + } + else + { + Array.Copy(s.window, r, s.window, q, 2); + q += 2; r += 2; c -= 2; + } + } + else + { + // else offset after destination + r = q - d; + do + { + r += s.end; // force pointer in window + } + while (r < 0); // covers invalid distances + e = s.end - r; + if (c > e) + { + // if source crosses, + c -= e; // wrapped copy + if (q - r > 0 && e > (q - r)) + { + do + { + s.window[q++] = s.window[r++]; + } + while (--e != 0); + } + else + { + Array.Copy(s.window, r, s.window, q, e); + q += e; r += e; e = 0; + } + r = 0; // copy rest from start of window + } + } + + // copy all or what's left + if (q - r > 0 && c > (q - r)) + { + do + { + s.window[q++] = s.window[r++]; + } + while (--c != 0); + } + else + { + Array.Copy(s.window, r, s.window, q, c); + q += c; r += c; c = 0; + } + break; + } + else if ((e & 64) == 0) + { + t += tp[tp_index_t_3 + 2]; + t += (b & InternalInflateConstants.InflateMask[e]); + tp_index_t_3 = (tp_index + t) * 3; + e = tp[tp_index_t_3]; + } + else + { + z.Message = "invalid distance code"; + + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_DATA_ERROR; + } + } + while (true); + break; + } + + if ((e & 64) == 0) + { + t += tp[tp_index_t_3 + 2]; + t += (b & InternalInflateConstants.InflateMask[e]); + tp_index_t_3 = (tp_index + t) * 3; + if ((e = tp[tp_index_t_3]) == 0) + { + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + s.window[q++] = (byte)tp[tp_index_t_3 + 2]; + m--; + break; + } + } + else if ((e & 32) != 0) + { + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_STREAM_END; + } + else + { + z.Message = "invalid literal/length code"; + + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_DATA_ERROR; + } + } + while (true); + } + while (m >= 258 && n >= 10); + + // not enough input or output--restore pointers and return + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_OK; + } + } + + + internal sealed class InflateManager + { + // preset dictionary flag in zlib header + private const int PRESET_DICT = 0x20; + + private const int Z_DEFLATED = 8; + + private enum InflateManagerMode + { + METHOD = 0, // waiting for method byte + FLAG = 1, // waiting for flag byte + DICT4 = 2, // four dictionary check bytes to go + DICT3 = 3, // three dictionary check bytes to go + DICT2 = 4, // two dictionary check bytes to go + DICT1 = 5, // one dictionary check byte to go + DICT0 = 6, // waiting for inflateSetDictionary + BLOCKS = 7, // decompressing blocks + CHECK4 = 8, // four check bytes to go + CHECK3 = 9, // three check bytes to go + CHECK2 = 10, // two check bytes to go + CHECK1 = 11, // one check byte to go + DONE = 12, // finished check, done + BAD = 13, // got an error--stay here + } + + private InflateManagerMode mode; // current inflate mode + internal ZlibCodec _codec; // pointer back to this zlib stream + + // mode dependent information + internal int method; // if FLAGS, method byte + + // if CHECK, check values to compare + internal uint computedCheck; // computed check value + internal uint expectedCheck; // stream check value + + // if BAD, inflateSync's marker bytes count + internal int marker; + + // mode independent information + //internal int nowrap; // flag for no wrapper + private bool _handleRfc1950HeaderBytes = true; + internal bool HandleRfc1950HeaderBytes + { + get { return _handleRfc1950HeaderBytes; } + set { _handleRfc1950HeaderBytes = value; } + } + internal int wbits; // log2(window size) (8..15, defaults to 15) + + internal InflateBlocks blocks; // current inflate_blocks state + + public InflateManager() { } + + public InflateManager(bool expectRfc1950HeaderBytes) + { + _handleRfc1950HeaderBytes = expectRfc1950HeaderBytes; + } + + internal int Reset() + { + _codec.TotalBytesIn = _codec.TotalBytesOut = 0; + _codec.Message = null; + mode = HandleRfc1950HeaderBytes ? InflateManagerMode.METHOD : InflateManagerMode.BLOCKS; + blocks.Reset(); + return ZlibConstants.Z_OK; + } + + internal int End() + { + if (blocks != null) + blocks.Free(); + blocks = null; + return ZlibConstants.Z_OK; + } + + internal int Initialize(ZlibCodec codec, int w) + { + _codec = codec; + _codec.Message = null; + blocks = null; + + // handle undocumented nowrap option (no zlib header or check) + //nowrap = 0; + //if (w < 0) + //{ + // w = - w; + // nowrap = 1; + //} + + // set window size + if (w < 8 || w > 15) + { + End(); + throw new ZlibException("Bad window size."); + + //return ZlibConstants.Z_STREAM_ERROR; + } + wbits = w; + + blocks = new InflateBlocks(codec, + HandleRfc1950HeaderBytes ? this : null, + 1 << w); + + // reset state + Reset(); + return ZlibConstants.Z_OK; + } + + + internal int Inflate(FlushType flush) + { + int b; + + if (_codec.InputBuffer == null) + throw new ZlibException("InputBuffer is null. "); + +// int f = (flush == FlushType.Finish) +// ? ZlibConstants.Z_BUF_ERROR +// : ZlibConstants.Z_OK; + + // workitem 8870 + int f = ZlibConstants.Z_OK; + int r = ZlibConstants.Z_BUF_ERROR; + + while (true) + { + switch (mode) + { + case InflateManagerMode.METHOD: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + if (((method = _codec.InputBuffer[_codec.NextIn++]) & 0xf) != Z_DEFLATED) + { + mode = InflateManagerMode.BAD; + _codec.Message = String.Format("unknown compression method (0x{0:X2})", method); + marker = 5; // can't try inflateSync + break; + } + if ((method >> 4) + 8 > wbits) + { + mode = InflateManagerMode.BAD; + _codec.Message = String.Format("invalid window size ({0})", (method >> 4) + 8); + marker = 5; // can't try inflateSync + break; + } + mode = InflateManagerMode.FLAG; + break; + + + case InflateManagerMode.FLAG: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + b = (_codec.InputBuffer[_codec.NextIn++]) & 0xff; + + if ((((method << 8) + b) % 31) != 0) + { + mode = InflateManagerMode.BAD; + _codec.Message = "incorrect header check"; + marker = 5; // can't try inflateSync + break; + } + + mode = ((b & PRESET_DICT) == 0) + ? InflateManagerMode.BLOCKS + : InflateManagerMode.DICT4; + break; + + case InflateManagerMode.DICT4: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck = (uint)((_codec.InputBuffer[_codec.NextIn++] << 24) & 0xff000000); + mode = InflateManagerMode.DICT3; + break; + + case InflateManagerMode.DICT3: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 16) & 0x00ff0000); + mode = InflateManagerMode.DICT2; + break; + + case InflateManagerMode.DICT2: + + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 8) & 0x0000ff00); + mode = InflateManagerMode.DICT1; + break; + + + case InflateManagerMode.DICT1: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; _codec.TotalBytesIn++; + expectedCheck += (uint)(_codec.InputBuffer[_codec.NextIn++] & 0x000000ff); + _codec._Adler32 = expectedCheck; + mode = InflateManagerMode.DICT0; + return ZlibConstants.Z_NEED_DICT; + + + case InflateManagerMode.DICT0: + mode = InflateManagerMode.BAD; + _codec.Message = "need dictionary"; + marker = 0; // can try inflateSync + return ZlibConstants.Z_STREAM_ERROR; + + + case InflateManagerMode.BLOCKS: + r = blocks.Process(r); + if (r == ZlibConstants.Z_DATA_ERROR) + { + mode = InflateManagerMode.BAD; + marker = 0; // can try inflateSync + break; + } + + if (r == ZlibConstants.Z_OK) r = f; + + if (r != ZlibConstants.Z_STREAM_END) + return r; + + r = f; + computedCheck = blocks.Reset(); + if (!HandleRfc1950HeaderBytes) + { + mode = InflateManagerMode.DONE; + return ZlibConstants.Z_STREAM_END; + } + mode = InflateManagerMode.CHECK4; + break; + + case InflateManagerMode.CHECK4: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck = (uint)((_codec.InputBuffer[_codec.NextIn++] << 24) & 0xff000000); + mode = InflateManagerMode.CHECK3; + break; + + case InflateManagerMode.CHECK3: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 16) & 0x00ff0000); + mode = InflateManagerMode.CHECK2; + break; + + case InflateManagerMode.CHECK2: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 8) & 0x0000ff00); + mode = InflateManagerMode.CHECK1; + break; + + case InflateManagerMode.CHECK1: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; _codec.TotalBytesIn++; + expectedCheck += (uint)(_codec.InputBuffer[_codec.NextIn++] & 0x000000ff); + if (computedCheck != expectedCheck) + { + mode = InflateManagerMode.BAD; + _codec.Message = "incorrect data check"; + marker = 5; // can't try inflateSync + break; + } + mode = InflateManagerMode.DONE; + return ZlibConstants.Z_STREAM_END; + + case InflateManagerMode.DONE: + return ZlibConstants.Z_STREAM_END; + + case InflateManagerMode.BAD: + throw new ZlibException(String.Format("Bad state ({0})", _codec.Message)); + + default: + throw new ZlibException("Stream error."); + + } + } + } + + + + internal int SetDictionary(byte[] dictionary) + { + int index = 0; + int length = dictionary.Length; + if (mode != InflateManagerMode.DICT0) + throw new ZlibException("Stream error."); + + if (Adler.Adler32(1, dictionary, 0, dictionary.Length) != _codec._Adler32) + { + return ZlibConstants.Z_DATA_ERROR; + } + + _codec._Adler32 = Adler.Adler32(0, null, 0, 0); + + if (length >= (1 << wbits)) + { + length = (1 << wbits) - 1; + index = dictionary.Length - length; + } + blocks.SetDictionary(dictionary, index, length); + mode = InflateManagerMode.BLOCKS; + return ZlibConstants.Z_OK; + } + + + private static readonly byte[] mark = new byte[] { 0, 0, 0xff, 0xff }; + + internal int Sync() + { + int n; // number of bytes to look at + int p; // pointer to bytes + int m; // number of marker bytes found in a row + long r, w; // temporaries to save total_in and total_out + + // set up + if (mode != InflateManagerMode.BAD) + { + mode = InflateManagerMode.BAD; + marker = 0; + } + if ((n = _codec.AvailableBytesIn) == 0) + return ZlibConstants.Z_BUF_ERROR; + p = _codec.NextIn; + m = marker; + + // search + while (n != 0 && m < 4) + { + if (_codec.InputBuffer[p] == mark[m]) + { + m++; + } + else if (_codec.InputBuffer[p] != 0) + { + m = 0; + } + else + { + m = 4 - m; + } + p++; n--; + } + + // restore + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + _codec.AvailableBytesIn = n; + marker = m; + + // return no joy or set up to restart on a new block + if (m != 4) + { + return ZlibConstants.Z_DATA_ERROR; + } + r = _codec.TotalBytesIn; + w = _codec.TotalBytesOut; + Reset(); + _codec.TotalBytesIn = r; + _codec.TotalBytesOut = w; + mode = InflateManagerMode.BLOCKS; + return ZlibConstants.Z_OK; + } + + + // Returns true if inflate is currently at the end of a block generated + // by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + // implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH + // but removes the length bytes of the resulting empty stored block. When + // decompressing, PPP checks that at the end of input packet, inflate is + // waiting for these length bytes. + internal int SyncPoint(ZlibCodec z) + { + return blocks.SyncPoint(); + } + } +} \ No newline at end of file diff --git a/dotNetZip/Zlib/LICENSE.jzlib.txt b/dotNetZip/Zlib/LICENSE.jzlib.txt new file mode 100644 index 0000000..19414a2 --- /dev/null +++ b/dotNetZip/Zlib/LICENSE.jzlib.txt @@ -0,0 +1,32 @@ +The ZLIB library, available as Ionic.Zlib.dll or as part of DotNetZip, +is a ported-then-modified version of jzlib. The following applies to jzlib: + +JZlib 0.0.* were released under the GNU LGPL license. Later, we have switched +over to a BSD-style license. + +------------------------------------------------------------------------------ +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dotNetZip/Zlib/License.zlib.txt b/dotNetZip/Zlib/License.zlib.txt new file mode 100644 index 0000000..de6d57a --- /dev/null +++ b/dotNetZip/Zlib/License.zlib.txt @@ -0,0 +1,31 @@ +The ZLIB library, available as Ionic.Zlib.dll or as part of DotNetZip, +is a ported-then-modified version of jzlib, which itself is based on +zlib-1.1.3, the well-known C-language compression library. + +The following notice applies to zlib: + +----------------------------------------------------------------------- + +Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler + + The ZLIB software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly jloup@gzip.org + Mark Adler madler@alumni.caltech.edu + + +----------------------------------------------------------------------- diff --git a/dotNetZip/Zlib/LocalTestRun.testrunconfig b/dotNetZip/Zlib/LocalTestRun.testrunconfig new file mode 100644 index 0000000..09d5c0b --- /dev/null +++ b/dotNetZip/Zlib/LocalTestRun.testrunconfig @@ -0,0 +1,5 @@ + + + This is a default test run configuration for a local test run. + + \ No newline at end of file diff --git a/dotNetZip/Zlib/ParallelDeflateOutputStream.cs b/dotNetZip/Zlib/ParallelDeflateOutputStream.cs new file mode 100644 index 0000000..f751415 --- /dev/null +++ b/dotNetZip/Zlib/ParallelDeflateOutputStream.cs @@ -0,0 +1,1386 @@ +//#define Trace + +// ParallelDeflateOutputStream.cs +// ------------------------------------------------------------------ +// +// A DeflateStream that does compression only, it uses a +// divide-and-conquer approach with multiple threads to exploit multiple +// CPUs for the DEFLATE computation. +// +// last saved: <2011-July-31 14:49:40> +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 by Dino Chiesa +// All rights reserved! +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Threading; +using Ionic.Zlib; +using System.IO; + + +namespace Ionic.Zlib +{ + internal class WorkItem + { + public byte[] buffer; + public byte[] compressed; + public int crc; + public int index; + public int ordinal; + public int inputBytesAvailable; + public int compressedBytesAvailable; + public ZlibCodec compressor; + + public WorkItem(int size, + Ionic.Zlib.CompressionLevel compressLevel, + CompressionStrategy strategy, + int ix) + { + this.buffer= new byte[size]; + // alloc 5 bytes overhead for every block (margin of safety= 2) + int n = size + ((size / 32768)+1) * 5 * 2; + this.compressed = new byte[n]; + this.compressor = new ZlibCodec(); + this.compressor.InitializeDeflate(compressLevel, false); + this.compressor.OutputBuffer = this.compressed; + this.compressor.InputBuffer = this.buffer; + this.index = ix; + } + } + + /// + /// A class for compressing streams using the + /// Deflate algorithm with multiple threads. + /// + /// + /// + /// + /// This class performs DEFLATE compression through writing. For + /// more information on the Deflate algorithm, see IETF RFC 1951, + /// "DEFLATE Compressed Data Format Specification version 1.3." + /// + /// + /// + /// This class is similar to , except + /// that this class is for compression only, and this implementation uses an + /// approach that employs multiple worker threads to perform the DEFLATE. On + /// a multi-cpu or multi-core computer, the performance of this class can be + /// significantly higher than the single-threaded DeflateStream, particularly + /// for larger streams. How large? Anything over 10mb is a good candidate + /// for parallel compression. + /// + /// + /// + /// The tradeoff is that this class uses more memory and more CPU than the + /// vanilla DeflateStream, and also is less efficient as a compressor. For + /// large files the size of the compressed data stream can be less than 1% + /// larger than the size of a compressed data stream from the vanialla + /// DeflateStream. For smaller files the difference can be larger. The + /// difference will also be larger if you set the BufferSize to be lower than + /// the default value. Your mileage may vary. Finally, for small files, the + /// ParallelDeflateOutputStream can be much slower than the vanilla + /// DeflateStream, because of the overhead associated to using the thread + /// pool. + /// + /// + /// + /// + public class ParallelDeflateOutputStream : System.IO.Stream + { + + private static readonly int IO_BUFFER_SIZE_DEFAULT = 64 * 1024; // 128k + private static readonly int BufferPairsPerCore = 4; + + private System.Collections.Generic.List _pool; + private bool _leaveOpen; + private bool emitting; + private System.IO.Stream _outStream; + private int _maxBufferPairs; + private int _bufferSize = IO_BUFFER_SIZE_DEFAULT; + private AutoResetEvent _newlyCompressedBlob; + //private ManualResetEvent _writingDone; + //private ManualResetEvent _sessionReset; + private object _outputLock = new object(); + private bool _isClosed; + private bool _firstWriteDone; + private int _currentlyFilling; + private int _lastFilled; + private int _lastWritten; + private int _latestCompressed; + private int _Crc32; + private Ionic.Crc.CRC32 _runningCrc; + private object _latestLock = new object(); + private System.Collections.Generic.Queue _toWrite; + private System.Collections.Generic.Queue _toFill; + private Int64 _totalBytesProcessed; + private Ionic.Zlib.CompressionLevel _compressLevel; + private volatile Exception _pendingException; + private bool _handlingException; + private object _eLock = new Object(); // protects _pendingException + + // This bitfield is used only when Trace is defined. + //private TraceBits _DesiredTrace = TraceBits.Write | TraceBits.WriteBegin | + //TraceBits.WriteDone | TraceBits.Lifecycle | TraceBits.Fill | TraceBits.Flush | + //TraceBits.Session; + + //private TraceBits _DesiredTrace = TraceBits.WriteBegin | TraceBits.WriteDone | TraceBits.Synch | TraceBits.Lifecycle | TraceBits.Session ; + + private TraceBits _DesiredTrace = + TraceBits.Session | + TraceBits.Compress | + TraceBits.WriteTake | + TraceBits.WriteEnter | + TraceBits.EmitEnter | + TraceBits.EmitDone | + TraceBits.EmitLock | + TraceBits.EmitSkip | + TraceBits.EmitBegin; + + /// + /// Create a ParallelDeflateOutputStream. + /// + /// + /// + /// + /// This stream compresses data written into it via the DEFLATE + /// algorithm (see RFC 1951), and writes out the compressed byte stream. + /// + /// + /// + /// The instance will use the default compression level, the default + /// buffer sizes and the default number of threads and buffers per + /// thread. + /// + /// + /// + /// This class is similar to , + /// except that this implementation uses an approach that employs + /// multiple worker threads to perform the DEFLATE. On a multi-cpu or + /// multi-core computer, the performance of this class can be + /// significantly higher than the single-threaded DeflateStream, + /// particularly for larger streams. How large? Anything over 10mb is + /// a good candidate for parallel compression. + /// + /// + /// + /// + /// + /// + /// This example shows how to use a ParallelDeflateOutputStream to compress + /// data. It reads a file, compresses it, and writes the compressed data to + /// a second, output file. + /// + /// + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// String outputFile = fileToCompress + ".compressed"; + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(outputFile)) + /// { + /// using (Stream compressor = new ParallelDeflateOutputStream(raw)) + /// { + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Dim outputFile As String = (fileToCompress & ".compressed") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(outputFile) + /// Using compressor As Stream = New ParallelDeflateOutputStream(raw) + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream to which compressed data will be written. + public ParallelDeflateOutputStream(System.IO.Stream stream) + : this(stream, CompressionLevel.Default, CompressionStrategy.Default, false) + { + } + + /// + /// Create a ParallelDeflateOutputStream using the specified CompressionLevel. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// A tuning knob to trade speed for effectiveness. + public ParallelDeflateOutputStream(System.IO.Stream stream, CompressionLevel level) + : this(stream, level, CompressionStrategy.Default, false) + { + } + + /// + /// Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + /// when the ParallelDeflateOutputStream is closed. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// + /// true if the application would like the stream to remain open after inflation/deflation. + /// + public ParallelDeflateOutputStream(System.IO.Stream stream, bool leaveOpen) + : this(stream, CompressionLevel.Default, CompressionStrategy.Default, leaveOpen) + { + } + + /// + /// Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + /// when the ParallelDeflateOutputStream is closed. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// A tuning knob to trade speed for effectiveness. + /// + /// true if the application would like the stream to remain open after inflation/deflation. + /// + public ParallelDeflateOutputStream(System.IO.Stream stream, CompressionLevel level, bool leaveOpen) + : this(stream, CompressionLevel.Default, CompressionStrategy.Default, leaveOpen) + { + } + + /// + /// Create a ParallelDeflateOutputStream using the specified + /// CompressionLevel and CompressionStrategy, and specifying whether to + /// leave the captive stream open when the ParallelDeflateOutputStream is + /// closed. + /// + /// + /// See the + /// constructor for example code. + /// + /// The stream to which compressed data will be written. + /// A tuning knob to trade speed for effectiveness. + /// + /// By tweaking this parameter, you may be able to optimize the compression for + /// data with particular characteristics. + /// + /// + /// true if the application would like the stream to remain open after inflation/deflation. + /// + public ParallelDeflateOutputStream(System.IO.Stream stream, + CompressionLevel level, + CompressionStrategy strategy, + bool leaveOpen) + { + TraceOutput(TraceBits.Lifecycle | TraceBits.Session, "-------------------------------------------------------"); + TraceOutput(TraceBits.Lifecycle | TraceBits.Session, "Create {0:X8}", this.GetHashCode()); + _outStream = stream; + _compressLevel= level; + Strategy = strategy; + _leaveOpen = leaveOpen; + this.MaxBufferPairs = 16; // default + } + + + /// + /// The ZLIB strategy to be used during compression. + /// + /// + public CompressionStrategy Strategy + { + get; + private set; + } + + /// + /// The maximum number of buffer pairs to use. + /// + /// + /// + /// + /// This property sets an upper limit on the number of memory buffer + /// pairs to create. The implementation of this stream allocates + /// multiple buffers to facilitate parallel compression. As each buffer + /// fills up, this stream uses + /// ThreadPool.QueueUserWorkItem() + /// to compress those buffers in a background threadpool thread. After a + /// buffer is compressed, it is re-ordered and written to the output + /// stream. + /// + /// + /// + /// A higher number of buffer pairs enables a higher degree of + /// parallelism, which tends to increase the speed of compression on + /// multi-cpu computers. On the other hand, a higher number of buffer + /// pairs also implies a larger memory consumption, more active worker + /// threads, and a higher cpu utilization for any compression. This + /// property enables the application to limit its memory consumption and + /// CPU utilization behavior depending on requirements. + /// + /// + /// + /// For each compression "task" that occurs in parallel, there are 2 + /// buffers allocated: one for input and one for output. This property + /// sets a limit for the number of pairs. The total amount of storage + /// space allocated for buffering will then be (N*S*2), where N is the + /// number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + /// pairs per CPU core, so if your machine has 4 cores, and you retain + /// the default buffer size of 128k, then the + /// ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + /// memory in total, or 4mb, in blocks of 128kb. If you then set this + /// property to 8, then the number will be 8 * 2 * 128kb of buffer + /// memory, or 2mb. + /// + /// + /// + /// CPU utilization will also go up with additional buffers, because a + /// larger number of buffer pairs allows a larger number of background + /// threads to compress in parallel. If you find that parallel + /// compression is consuming too much memory or CPU, you can adjust this + /// value downward. + /// + /// + /// + /// The default value is 16. Different values may deliver better or + /// worse results, depending on your priorities and the dynamic + /// performance characteristics of your storage and compute resources. + /// + /// + /// + /// This property is not the number of buffer pairs to use; it is an + /// upper limit. An illustration: Suppose you have an application that + /// uses the default value of this property (which is 16), and it runs + /// on a machine with 2 CPU cores. In that case, DotNetZip will allocate + /// 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + /// limit specified by this property has no effect. + /// + /// + /// + /// The application can set this value at any time, but it is effective + /// only before the first call to Write(), which is when the buffers are + /// allocated. + /// + /// + public int MaxBufferPairs + { + get + { + return _maxBufferPairs; + } + set + { + if (value < 4) + throw new ArgumentException("MaxBufferPairs", + "Value must be 4 or greater."); + _maxBufferPairs = value; + } + } + + /// + /// The size of the buffers used by the compressor threads. + /// + /// + /// + /// + /// The default buffer size is 128k. The application can set this value + /// at any time, but it is effective only before the first Write(). + /// + /// + /// + /// Larger buffer sizes implies larger memory consumption but allows + /// more efficient compression. Using smaller buffer sizes consumes less + /// memory but may result in less effective compression. For example, + /// using the default buffer size of 128k, the compression delivered is + /// within 1% of the compression delivered by the single-threaded . On the other hand, using a + /// BufferSize of 8k can result in a compressed data stream that is 5% + /// larger than that delivered by the single-threaded + /// DeflateStream. Excessively small buffer sizes can also cause + /// the speed of the ParallelDeflateOutputStream to drop, because of + /// larger thread scheduling overhead dealing with many many small + /// buffers. + /// + /// + /// + /// The total amount of storage space allocated for buffering will be + /// (N*S*2), where N is the number of buffer pairs, and S is the size of + /// each buffer (this property). There are 2 buffers used by the + /// compressor, one for input and one for output. By default, DotNetZip + /// allocates 4 buffer pairs per CPU core, so if your machine has 4 + /// cores, then the number of buffer pairs used will be 16. If you + /// accept the default value of this property, 128k, then the + /// ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory + /// in total, or 4mb, in blocks of 128kb. If you set this property to + /// 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or + /// 2mb. + /// + /// + /// + public int BufferSize + { + get { return _bufferSize;} + set + { + if (value < 1024) + throw new ArgumentOutOfRangeException("BufferSize", + "BufferSize must be greater than 1024 bytes"); + _bufferSize = value; + } + } + + /// + /// The CRC32 for the data that was written out, prior to compression. + /// + /// + /// This value is meaningful only after a call to Close(). + /// + public int Crc32 { get { return _Crc32; } } + + + /// + /// The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. + /// + /// + /// This value is meaningful only after a call to Close(). + /// + public Int64 BytesProcessed { get { return _totalBytesProcessed; } } + + + private void _InitializePoolOfWorkItems() + { + _toWrite = new Queue(); + _toFill = new Queue(); + _pool = new System.Collections.Generic.List(); + int nTasks = BufferPairsPerCore * Environment.ProcessorCount; + nTasks = Math.Min(nTasks, _maxBufferPairs); + for(int i=0; i < nTasks; i++) + { + _pool.Add(new WorkItem(_bufferSize, _compressLevel, Strategy, i)); + _toFill.Enqueue(i); + } + + _newlyCompressedBlob = new AutoResetEvent(false); + _runningCrc = new Ionic.Crc.CRC32(); + _currentlyFilling = -1; + _lastFilled = -1; + _lastWritten = -1; + _latestCompressed = -1; + } + + + + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// + /// To use the ParallelDeflateOutputStream to compress data, create a + /// ParallelDeflateOutputStream with CompressionMode.Compress, passing a + /// writable output stream. Then call Write() on that + /// ParallelDeflateOutputStream, providing uncompressed data as input. The + /// data sent to the output stream will be the compressed form of the data + /// written. + /// + /// + /// + /// To decompress data, use the class. + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + bool mustWait = false; + + // This method does this: + // 0. handles any pending exceptions + // 1. write any buffers that are ready to be written, + // 2. fills a work buffer; when full, flip state to 'Filled', + // 3. if more data to be written, goto step 1 + + if (_isClosed) + throw new InvalidOperationException(); + + // dispense any exceptions that occurred on the BG threads + if (_pendingException != null) + { + _handlingException = true; + var pe = _pendingException; + _pendingException = null; + throw pe; + } + + if (count == 0) return; + + if (!_firstWriteDone) + { + // Want to do this on first Write, first session, and not in the + // constructor. We want to allow MaxBufferPairs to + // change after construction, but before first Write. + _InitializePoolOfWorkItems(); + _firstWriteDone = true; + } + + + do + { + // may need to make buffers available + EmitPendingBuffers(false, mustWait); + + mustWait = false; + // use current buffer, or get a new buffer to fill + int ix = -1; + if (_currentlyFilling >= 0) + { + ix = _currentlyFilling; + TraceOutput(TraceBits.WriteTake, + "Write notake wi({0}) lf({1})", + ix, + _lastFilled); + } + else + { + TraceOutput(TraceBits.WriteTake, "Write take?"); + if (_toFill.Count == 0) + { + // no available buffers, so... need to emit + // compressed buffers. + mustWait = true; + continue; + } + + ix = _toFill.Dequeue(); + TraceOutput(TraceBits.WriteTake, + "Write take wi({0}) lf({1})", + ix, + _lastFilled); + ++_lastFilled; // TODO: consider rollover? + } + + WorkItem workitem = _pool[ix]; + + int limit = ((workitem.buffer.Length - workitem.inputBytesAvailable) > count) + ? count + : (workitem.buffer.Length - workitem.inputBytesAvailable); + + workitem.ordinal = _lastFilled; + + TraceOutput(TraceBits.Write, + "Write lock wi({0}) ord({1}) iba({2})", + workitem.index, + workitem.ordinal, + workitem.inputBytesAvailable + ); + + // copy from the provided buffer to our workitem, starting at + // the tail end of whatever data we might have in there currently. + Buffer.BlockCopy(buffer, + offset, + workitem.buffer, + workitem.inputBytesAvailable, + limit); + + count -= limit; + offset += limit; + workitem.inputBytesAvailable += limit; + if (workitem.inputBytesAvailable == workitem.buffer.Length) + { + // No need for interlocked.increment: the Write() + // method is documented as not multi-thread safe, so + // we can assume Write() calls come in from only one + // thread. + TraceOutput(TraceBits.Write, + "Write QUWI wi({0}) ord({1}) iba({2}) nf({3})", + workitem.index, + workitem.ordinal, + workitem.inputBytesAvailable ); + + if (!ThreadPool.QueueUserWorkItem( _DeflateOne, workitem )) + throw new Exception("Cannot enqueue workitem"); + + _currentlyFilling = -1; // will get a new buffer next time + } + else + _currentlyFilling = ix; + + if (count > 0) + TraceOutput(TraceBits.WriteEnter, "Write more"); + } + while (count > 0); // until no more to write + + TraceOutput(TraceBits.WriteEnter, "Write exit"); + return; + } + + + + private void _FlushFinish() + { + // After writing a series of compressed buffers, each one closed + // with Flush.Sync, we now write the final one as Flush.Finish, + // and then stop. + byte[] buffer = new byte[128]; + var compressor = new ZlibCodec(); + int rc = compressor.InitializeDeflate(_compressLevel, false); + compressor.InputBuffer = null; + compressor.NextIn = 0; + compressor.AvailableBytesIn = 0; + compressor.OutputBuffer = buffer; + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + { + TraceOutput(TraceBits.EmitBegin, + "Emit begin flush bytes({0})", + buffer.Length - compressor.AvailableBytesOut); + + _outStream.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + + TraceOutput(TraceBits.EmitDone, + "Emit done flush"); + } + + compressor.EndDeflate(); + + _Crc32 = _runningCrc.Crc32Result; + } + + + private void _Flush(bool lastInput) + { + if (_isClosed) + throw new InvalidOperationException(); + + if (emitting) return; + + // compress any partial buffer + if (_currentlyFilling >= 0) + { + WorkItem workitem = _pool[_currentlyFilling]; + _DeflateOne(workitem); + _currentlyFilling = -1; // get a new buffer next Write() + } + + if (lastInput) + { + EmitPendingBuffers(true, false); + _FlushFinish(); + } + else + { + EmitPendingBuffers(false, false); + } + } + + + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_pendingException != null) + { + _handlingException = true; + var pe = _pendingException; + _pendingException = null; + throw pe; + } + if (_handlingException) + return; + + _Flush(false); + } + + + /// + /// Close the stream. + /// + /// + /// You must call Close on the stream to guarantee that all of the data written in has + /// been compressed, and the compressed data has been written out. + /// + public override void Close() + { + TraceOutput(TraceBits.Session, "Close {0:X8}", this.GetHashCode()); + + if (_pendingException != null) + { + _handlingException = true; + var pe = _pendingException; + _pendingException = null; + throw pe; + } + + if (_handlingException) + return; + + if (_isClosed) return; + + _Flush(true); + + if (!_leaveOpen) + _outStream.Close(); + + _isClosed= true; + } + + + + // workitem 10030 - implement a new Dispose method + + /// Dispose the object + /// + /// + /// Because ParallelDeflateOutputStream is IDisposable, the + /// application must call this method when finished using the instance. + /// + /// + /// This method is generally called implicitly upon exit from + /// a using scope in C# (Using in VB). + /// + /// + new public void Dispose() + { + TraceOutput(TraceBits.Lifecycle, "Dispose {0:X8}", this.GetHashCode()); + Close(); + _pool = null; + Dispose(true); + } + + + + /// The Dispose method + /// + /// indicates whether the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + } + + + /// + /// Resets the stream for use with another stream. + /// + /// + /// Because the ParallelDeflateOutputStream is expensive to create, it + /// has been designed so that it can be recycled and re-used. You have + /// to call Close() on the stream first, then you can call Reset() on + /// it, to use it again on another stream. + /// + /// + /// + /// The new output stream for this era. + /// + /// + /// + /// + /// ParallelDeflateOutputStream deflater = null; + /// foreach (var inputFile in listOfFiles) + /// { + /// string outputFile = inputFile + ".compressed"; + /// using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) + /// { + /// using (var outStream = System.IO.File.Create(outputFile)) + /// { + /// if (deflater == null) + /// deflater = new ParallelDeflateOutputStream(outStream, + /// CompressionLevel.Best, + /// CompressionStrategy.Default, + /// true); + /// deflater.Reset(outStream); + /// + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// deflater.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + public void Reset(Stream stream) + { + TraceOutput(TraceBits.Session, "-------------------------------------------------------"); + TraceOutput(TraceBits.Session, "Reset {0:X8} firstDone({1})", this.GetHashCode(), _firstWriteDone); + + if (!_firstWriteDone) return; + + // reset all status + _toWrite.Clear(); + _toFill.Clear(); + foreach (var workitem in _pool) + { + _toFill.Enqueue(workitem.index); + workitem.ordinal = -1; + } + + _firstWriteDone = false; + _totalBytesProcessed = 0L; + _runningCrc = new Ionic.Crc.CRC32(); + _isClosed= false; + _currentlyFilling = -1; + _lastFilled = -1; + _lastWritten = -1; + _latestCompressed = -1; + _outStream = stream; + } + + + + + private void EmitPendingBuffers(bool doAll, bool mustWait) + { + // When combining parallel deflation with a ZipSegmentedStream, it's + // possible for the ZSS to throw from within this method. In that + // case, Close/Dispose will be called on this stream, if this stream + // is employed within a using or try/finally pair as required. But + // this stream is unaware of the pending exception, so the Close() + // method invokes this method AGAIN. This can lead to a deadlock. + // Therefore, failfast if re-entering. + + if (emitting) return; + emitting = true; + if (doAll || mustWait) + _newlyCompressedBlob.WaitOne(); + + do + { + int firstSkip = -1; + int millisecondsToWait = doAll ? 200 : (mustWait ? -1 : 0); + int nextToWrite = -1; + + do + { + if (Monitor.TryEnter(_toWrite, millisecondsToWait)) + { + nextToWrite = -1; + try + { + if (_toWrite.Count > 0) + nextToWrite = _toWrite.Dequeue(); + } + finally + { + Monitor.Exit(_toWrite); + } + + if (nextToWrite >= 0) + { + WorkItem workitem = _pool[nextToWrite]; + if (workitem.ordinal != _lastWritten + 1) + { + // out of order. requeue and try again. + TraceOutput(TraceBits.EmitSkip, + "Emit skip wi({0}) ord({1}) lw({2}) fs({3})", + workitem.index, + workitem.ordinal, + _lastWritten, + firstSkip); + + lock(_toWrite) + { + _toWrite.Enqueue(nextToWrite); + } + + if (firstSkip == nextToWrite) + { + // We went around the list once. + // None of the items in the list is the one we want. + // Now wait for a compressor to signal again. + _newlyCompressedBlob.WaitOne(); + firstSkip = -1; + } + else if (firstSkip == -1) + firstSkip = nextToWrite; + + continue; + } + + firstSkip = -1; + + TraceOutput(TraceBits.EmitBegin, + "Emit begin wi({0}) ord({1}) cba({2})", + workitem.index, + workitem.ordinal, + workitem.compressedBytesAvailable); + + _outStream.Write(workitem.compressed, 0, workitem.compressedBytesAvailable); + _runningCrc.Combine(workitem.crc, workitem.inputBytesAvailable); + _totalBytesProcessed += workitem.inputBytesAvailable; + workitem.inputBytesAvailable = 0; + + TraceOutput(TraceBits.EmitDone, + "Emit done wi({0}) ord({1}) cba({2}) mtw({3})", + workitem.index, + workitem.ordinal, + workitem.compressedBytesAvailable, + millisecondsToWait); + + _lastWritten = workitem.ordinal; + _toFill.Enqueue(workitem.index); + + // don't wait next time through + if (millisecondsToWait == -1) millisecondsToWait = 0; + } + } + else + nextToWrite = -1; + + } while (nextToWrite >= 0); + + } while (doAll && (_lastWritten != _latestCompressed)); + + emitting = false; + } + + + +#if OLD + private void _PerpetualWriterMethod(object state) + { + TraceOutput(TraceBits.WriterThread, "_PerpetualWriterMethod START"); + + try + { + do + { + // wait for the next session + TraceOutput(TraceBits.Synch | TraceBits.WriterThread, "Synch _sessionReset.WaitOne(begin) PWM"); + _sessionReset.WaitOne(); + TraceOutput(TraceBits.Synch | TraceBits.WriterThread, "Synch _sessionReset.WaitOne(done) PWM"); + + if (_isDisposed) break; + + TraceOutput(TraceBits.Synch | TraceBits.WriterThread, "Synch _sessionReset.Reset() PWM"); + _sessionReset.Reset(); + + // repeatedly write buffers as they become ready + WorkItem workitem = null; + Ionic.Zlib.CRC32 c= new Ionic.Zlib.CRC32(); + do + { + workitem = _pool[_nextToWrite % _pc]; + lock(workitem) + { + if (_noMoreInputForThisSegment) + TraceOutput(TraceBits.Write, + "Write drain wi({0}) stat({1}) canuse({2}) cba({3})", + workitem.index, + workitem.status, + (workitem.status == (int)WorkItem.Status.Compressed), + workitem.compressedBytesAvailable); + + do + { + if (workitem.status == (int)WorkItem.Status.Compressed) + { + TraceOutput(TraceBits.WriteBegin, + "Write begin wi({0}) stat({1}) cba({2})", + workitem.index, + workitem.status, + workitem.compressedBytesAvailable); + + workitem.status = (int)WorkItem.Status.Writing; + _outStream.Write(workitem.compressed, 0, workitem.compressedBytesAvailable); + c.Combine(workitem.crc, workitem.inputBytesAvailable); + _totalBytesProcessed += workitem.inputBytesAvailable; + _nextToWrite++; + workitem.inputBytesAvailable= 0; + workitem.status = (int)WorkItem.Status.Done; + + TraceOutput(TraceBits.WriteDone, + "Write done wi({0}) stat({1}) cba({2})", + workitem.index, + workitem.status, + workitem.compressedBytesAvailable); + + + Monitor.Pulse(workitem); + break; + } + else + { + int wcycles = 0; + // I've locked a workitem I cannot use. + // Therefore, wake someone else up, and then release the lock. + while (workitem.status != (int)WorkItem.Status.Compressed) + { + TraceOutput(TraceBits.WriteWait, + "Write waiting wi({0}) stat({1}) nw({2}) nf({3}) nomore({4})", + workitem.index, + workitem.status, + _nextToWrite, _nextToFill, + _noMoreInputForThisSegment ); + + if (_noMoreInputForThisSegment && _nextToWrite == _nextToFill) + break; + + wcycles++; + + // wake up someone else + Monitor.Pulse(workitem); + // release and wait + Monitor.Wait(workitem); + + if (workitem.status == (int)WorkItem.Status.Compressed) + TraceOutput(TraceBits.WriteWait, + "Write A-OK wi({0}) stat({1}) iba({2}) cba({3}) cyc({4})", + workitem.index, + workitem.status, + workitem.inputBytesAvailable, + workitem.compressedBytesAvailable, + wcycles); + } + + if (_noMoreInputForThisSegment && _nextToWrite == _nextToFill) + break; + + } + } + while (true); + } + + if (_noMoreInputForThisSegment) + TraceOutput(TraceBits.Write, + "Write nomore nw({0}) nf({1}) break({2})", + _nextToWrite, _nextToFill, (_nextToWrite == _nextToFill)); + + if (_noMoreInputForThisSegment && _nextToWrite == _nextToFill) + break; + + } while (true); + + + // Finish: + // After writing a series of buffers, closing each one with + // Flush.Sync, we now write the final one as Flush.Finish, and + // then stop. + byte[] buffer = new byte[128]; + ZlibCodec compressor = new ZlibCodec(); + int rc = compressor.InitializeDeflate(_compressLevel, false); + compressor.InputBuffer = null; + compressor.NextIn = 0; + compressor.AvailableBytesIn = 0; + compressor.OutputBuffer = buffer; + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + { + TraceOutput(TraceBits.WriteBegin, + "Write begin flush bytes({0})", + buffer.Length - compressor.AvailableBytesOut); + + _outStream.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + + TraceOutput(TraceBits.WriteBegin, + "Write done flush"); + } + + compressor.EndDeflate(); + + _Crc32 = c.Crc32Result; + + // signal that writing is complete: + TraceOutput(TraceBits.Synch, "Synch _writingDone.Set() PWM"); + _writingDone.Set(); + } + while (true); + } + catch (System.Exception exc1) + { + lock(_eLock) + { + // expose the exception to the main thread + if (_pendingException!=null) + _pendingException = exc1; + } + } + + TraceOutput(TraceBits.WriterThread, "_PerpetualWriterMethod FINIS"); + } +#endif + + + + + private void _DeflateOne(Object wi) + { + // compress one buffer + WorkItem workitem = (WorkItem) wi; + try + { + int myItem = workitem.index; + Ionic.Crc.CRC32 crc = new Ionic.Crc.CRC32(); + + // calc CRC on the buffer + crc.SlurpBlock(workitem.buffer, 0, workitem.inputBytesAvailable); + + // deflate it + DeflateOneSegment(workitem); + + // update status + workitem.crc = crc.Crc32Result; + TraceOutput(TraceBits.Compress, + "Compress wi({0}) ord({1}) len({2})", + workitem.index, + workitem.ordinal, + workitem.compressedBytesAvailable + ); + + lock(_latestLock) + { + if (workitem.ordinal > _latestCompressed) + _latestCompressed = workitem.ordinal; + } + lock (_toWrite) + { + _toWrite.Enqueue(workitem.index); + } + _newlyCompressedBlob.Set(); + } + catch (System.Exception exc1) + { + lock(_eLock) + { + // expose the exception to the main thread + if (_pendingException!=null) + _pendingException = exc1; + } + } + } + + + + + private bool DeflateOneSegment(WorkItem workitem) + { + ZlibCodec compressor = workitem.compressor; + int rc= 0; + compressor.ResetDeflate(); + compressor.NextIn = 0; + + compressor.AvailableBytesIn = workitem.inputBytesAvailable; + + // step 1: deflate the buffer + compressor.NextOut = 0; + compressor.AvailableBytesOut = workitem.compressed.Length; + do + { + compressor.Deflate(FlushType.None); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + // step 2: flush (sync) + rc = compressor.Deflate(FlushType.Sync); + + workitem.compressedBytesAvailable= (int) compressor.TotalBytesOut; + return true; + } + + + [System.Diagnostics.ConditionalAttribute("Trace")] + private void TraceOutput(TraceBits bits, string format, params object[] varParams) + { + if ((bits & _DesiredTrace) != 0) + { + lock(_outputLock) + { + int tid = Thread.CurrentThread.GetHashCode(); +#if !SILVERLIGHT + Console.ForegroundColor = (ConsoleColor) (tid % 8 + 8); +#endif + Console.Write("{0:000} PDOS ", tid); + Console.WriteLine(format, varParams); +#if !SILVERLIGHT + Console.ResetColor(); +#endif + } + } + } + + + // used only when Trace is defined + [Flags] + enum TraceBits : uint + { + None = 0, + NotUsed1 = 1, + EmitLock = 2, + EmitEnter = 4, // enter _EmitPending + EmitBegin = 8, // begin to write out + EmitDone = 16, // done writing out + EmitSkip = 32, // writer skipping a workitem + EmitAll = 58, // All Emit flags + Flush = 64, + Lifecycle = 128, // constructor/disposer + Session = 256, // Close/Reset + Synch = 512, // thread synchronization + Instance = 1024, // instance settings + Compress = 2048, // compress task + Write = 4096, // filling buffers, when caller invokes Write() + WriteEnter = 8192, // upon entry to Write() + WriteTake = 16384, // on _toFill.Take() + All = 0xffffffff, + } + + + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream supports Read operations. + /// + /// + /// Always returns false. + /// + public override bool CanRead + { + get {return false;} + } + + /// + /// Indicates whether the stream supports Write operations. + /// + /// + /// Returns true if the provided stream is writable. + /// + public override bool CanWrite + { + get { return _outStream.CanWrite; } + } + + /// + /// Reading this property always throws a NotSupportedException. + /// + public override long Length + { + get { throw new NotSupportedException(); } + } + + /// + /// Returns the current position of the output stream. + /// + /// + /// + /// Because the output gets written by a background thread, + /// the value may change asynchronously. Setting this + /// property always throws a NotSupportedException. + /// + /// + public override long Position + { + get { return _outStream.Position; } + set { throw new NotSupportedException(); } + } + + /// + /// This method always throws a NotSupportedException. + /// + /// + /// The buffer into which data would be read, IF THIS METHOD + /// ACTUALLY DID ANYTHING. + /// + /// + /// The offset within that data array at which to insert the + /// data that is read, IF THIS METHOD ACTUALLY DID + /// ANYTHING. + /// + /// + /// The number of bytes to write, IF THIS METHOD ACTUALLY DID + /// ANYTHING. + /// + /// nothing. + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotSupportedException(); + } + + /// + /// This method always throws a NotSupportedException. + /// + /// + /// The offset to seek to.... + /// IF THIS METHOD ACTUALLY DID ANYTHING. + /// + /// + /// The reference specifying how to apply the offset.... IF + /// THIS METHOD ACTUALLY DID ANYTHING. + /// + /// nothing. It always throws. + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + /// + /// This method always throws a NotSupportedException. + /// + /// + /// The new value for the stream length.... IF + /// THIS METHOD ACTUALLY DID ANYTHING. + /// + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + } + +} + + diff --git a/dotNetZip/Zlib/Tree.cs b/dotNetZip/Zlib/Tree.cs new file mode 100644 index 0000000..1db8c4f --- /dev/null +++ b/dotNetZip/Zlib/Tree.cs @@ -0,0 +1,423 @@ +// Tree.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-October-28 13:29:50> +// +// ------------------------------------------------------------------ +// +// This module defines classes for zlib compression and +// decompression. This code is derived from the jzlib implementation of +// zlib. In keeping with the license for jzlib, the copyright to that +// code is below. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; + +namespace Ionic.Zlib +{ + sealed class Tree + { + private static readonly int HEAP_SIZE = (2 * InternalConstants.L_CODES + 1); + + // extra bits for each length code + internal static readonly int[] ExtraLengthBits = new int[] + { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 + }; + + // extra bits for each distance code + internal static readonly int[] ExtraDistanceBits = new int[] + { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 + }; + + // extra bits for each bit length code + internal static readonly int[] extra_blbits = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7}; + + internal static readonly sbyte[] bl_order = new sbyte[]{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit + // length codes. + + internal const int Buf_size = 8 * 2; + + // see definition of array dist_code below + //internal const int DIST_CODE_LEN = 512; + + private static readonly sbyte[] _dist_code = new sbyte[] + { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 + }; + + internal static readonly sbyte[] LengthCode = new sbyte[] + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, + 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 + }; + + + internal static readonly int[] LengthBase = new int[] + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, + 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0 + }; + + + internal static readonly int[] DistanceBase = new int[] + { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, + 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 + }; + + + /// + /// Map from a distance to a distance code. + /// + /// + /// No side effects. _dist_code[256] and _dist_code[257] are never used. + /// + internal static int DistanceCode(int dist) + { + return (dist < 256) + ? _dist_code[dist] + : _dist_code[256 + SharedUtils.URShift(dist, 7)]; + } + + internal short[] dyn_tree; // the dynamic tree + internal int max_code; // largest code with non zero frequency + internal StaticTree staticTree; // the corresponding static tree + + // Compute the optimal bit lengths for a tree and update the total bit length + // for the current block. + // IN assertion: the fields freq and dad are set, heap[heap_max] and + // above are the tree nodes sorted by increasing frequency. + // OUT assertions: the field len is set to the optimal bit length, the + // array bl_count contains the frequencies for each bit length. + // The length opt_len is updated; static_len is also updated if stree is + // not null. + internal void gen_bitlen(DeflateManager s) + { + short[] tree = dyn_tree; + short[] stree = staticTree.treeCodes; + int[] extra = staticTree.extraBits; + int base_Renamed = staticTree.extraBase; + int max_length = staticTree.maxLength; + int h; // heap index + int n, m; // iterate over the tree elements + int bits; // bit length + int xbits; // extra bits + short f; // frequency + int overflow = 0; // number of elements with bit length too large + + for (bits = 0; bits <= InternalConstants.MAX_BITS; bits++) + s.bl_count[bits] = 0; + + // In a first pass, compute the optimal bit lengths (which may + // overflow in the case of the bit length tree). + tree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) + { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; + if (bits > max_length) + { + bits = max_length; overflow++; + } + tree[n * 2 + 1] = (short) bits; + // We overwrite tree[n*2+1] which is no longer needed + + if (n > max_code) + continue; // not a leaf node + + s.bl_count[bits]++; + xbits = 0; + if (n >= base_Renamed) + xbits = extra[n - base_Renamed]; + f = tree[n * 2]; + s.opt_len += f * (bits + xbits); + if (stree != null) + s.static_len += f * (stree[n * 2 + 1] + xbits); + } + if (overflow == 0) + return ; + + // This happens for example on obj2 and pic of the Calgary corpus + // Find the first bit length which could increase: + do + { + bits = max_length - 1; + while (s.bl_count[bits] == 0) + bits--; + s.bl_count[bits]--; // move one leaf down the tree + s.bl_count[bits + 1] = (short) (s.bl_count[bits + 1] + 2); // move one overflow item as its brother + s.bl_count[max_length]--; + // The brother of the overflow item also moves one step up, + // but this does not affect bl_count[max_length] + overflow -= 2; + } + while (overflow > 0); + + for (bits = max_length; bits != 0; bits--) + { + n = s.bl_count[bits]; + while (n != 0) + { + m = s.heap[--h]; + if (m > max_code) + continue; + if (tree[m * 2 + 1] != bits) + { + s.opt_len = (int) (s.opt_len + ((long) bits - (long) tree[m * 2 + 1]) * (long) tree[m * 2]); + tree[m * 2 + 1] = (short) bits; + } + n--; + } + } + } + + // Construct one Huffman tree and assigns the code bit strings and lengths. + // Update the total bit length for the current block. + // IN assertion: the field freq is set for all tree elements. + // OUT assertions: the fields len and code are set to the optimal bit length + // and corresponding code. The length opt_len is updated; static_len is + // also updated if stree is not null. The field max_code is set. + internal void build_tree(DeflateManager s) + { + short[] tree = dyn_tree; + short[] stree = staticTree.treeCodes; + int elems = staticTree.elems; + int n, m; // iterate over heap elements + int max_code = -1; // largest code with non zero frequency + int node; // new node being created + + // Construct the initial heap, with least frequent element in + // heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + // heap[0] is not used. + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) + { + if (tree[n * 2] != 0) + { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + } + else + { + tree[n * 2 + 1] = 0; + } + } + + // The pkzip format requires that at least one distance code exists, + // and that at least one bit should be sent even if there is only one + // possible code. So to avoid special checks later on we force at least + // two codes of non zero frequency. + while (s.heap_len < 2) + { + node = s.heap[++s.heap_len] = (max_code < 2?++max_code:0); + tree[node * 2] = 1; + s.depth[node] = 0; + s.opt_len--; + if (stree != null) + s.static_len -= stree[node * 2 + 1]; + // node is 0 or 1 so it does not have extra bits + } + this.max_code = max_code; + + // The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + // establish sub-heaps of increasing lengths: + + for (n = s.heap_len / 2; n >= 1; n--) + s.pqdownheap(tree, n); + + // Construct the Huffman tree by repeatedly combining the least two + // frequent nodes. + + node = elems; // next internal node of the tree + do + { + // n = node of least frequency + n = s.heap[1]; + s.heap[1] = s.heap[s.heap_len--]; + s.pqdownheap(tree, 1); + m = s.heap[1]; // m = node of next least frequency + + s.heap[--s.heap_max] = n; // keep the nodes sorted by frequency + s.heap[--s.heap_max] = m; + + // Create a new node father of n and m + tree[node * 2] = unchecked((short) (tree[n * 2] + tree[m * 2])); + s.depth[node] = (sbyte) (System.Math.Max((byte) s.depth[n], (byte) s.depth[m]) + 1); + tree[n * 2 + 1] = tree[m * 2 + 1] = (short) node; + + // and insert the new node in the heap + s.heap[1] = node++; + s.pqdownheap(tree, 1); + } + while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1]; + + // At this point, the fields freq and dad are set. We can now + // generate the bit lengths. + + gen_bitlen(s); + + // The field len is now set, we can generate the bit codes + gen_codes(tree, max_code, s.bl_count); + } + + // Generate the codes for a given tree and bit counts (which need not be + // optimal). + // IN assertion: the array bl_count contains the bit length statistics for + // the given tree and the field len is set for all tree elements. + // OUT assertion: the field code is set for all tree elements of non + // zero code length. + internal static void gen_codes(short[] tree, int max_code, short[] bl_count) + { + short[] next_code = new short[InternalConstants.MAX_BITS + 1]; // next code value for each bit length + short code = 0; // running code value + int bits; // bit index + int n; // code index + + // The distribution counts are first used to generate the code values + // without bit reversal. + for (bits = 1; bits <= InternalConstants.MAX_BITS; bits++) + unchecked { + next_code[bits] = code = (short) ((code + bl_count[bits - 1]) << 1); + } + + // Check that the bit counts in bl_count are consistent. The last code + // must be all ones. + //Assert (code + bl_count[MAX_BITS]-1 == (1<>= 1; //SharedUtils.URShift(code, 1); + res <<= 1; + } + while (--len > 0); + return res >> 1; + } + } +} \ No newline at end of file diff --git a/dotNetZip/Zlib/Zlib DLL.csproj b/dotNetZip/Zlib/Zlib DLL.csproj new file mode 100644 index 0000000..043cae4 --- /dev/null +++ b/dotNetZip/Zlib/Zlib DLL.csproj @@ -0,0 +1,186 @@ + + + + Local + 2.0 + Debug + AnyCPU + + + + + Ionic.Zlib + ..\Ionic.snk + JScript + Grid + IE50 + false + Library + Ionic.Zlib + false + OnBuildSuccess + + + + + 3.5 + + + {9816BA86-9250-4C00-A912-25F07F8677D1} + false + true + SAK + SAK + SAK + SAK + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + bin\Debug\ + false + 285212672 + false + + + + + bin\Debug\Ionic.Zlib.XML + true + 4096 + false + + + false + false + false + 4 + full + prompt + AllRules.ruleset + + + bin\Release\ + false + 285212672 + false + + + + + + + true + 4096 + false + + + false + false + false + 4 + full + prompt + AllRules.ruleset + + + + mscorlib + + + System + + + System.Data + + + System.Design + + + System.Drawing + + + System.Management + + + System.Windows.Forms + + + System.Xml + + + + + + + + + + + + + + + + + + + CRC32.cs + + + Properties\SolutionInfo.cs + + + + + Ionic.snk + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + + + + + + \ No newline at end of file diff --git a/dotNetZip/Zlib/Zlib.cs b/dotNetZip/Zlib/Zlib.cs new file mode 100644 index 0000000..dcfe725 --- /dev/null +++ b/dotNetZip/Zlib/Zlib.cs @@ -0,0 +1,546 @@ +// Zlib.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-03 19:52:28> +// +// ------------------------------------------------------------------ +// +// This module defines classes for ZLIB compression and +// decompression. This code is derived from the jzlib implementation of +// zlib, but significantly modified. The object model is not the same, +// and many of the behaviors are new or different. Nonetheless, in +// keeping with the license for jzlib, the copyright to that code is +// included below. +// +// ------------------------------------------------------------------ +// +// The following notice applies to jzlib: +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// jzlib is based on zlib-1.1.3. +// +// The following notice applies to zlib: +// +// ----------------------------------------------------------------------- +// +// Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler +// +// The ZLIB software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// +// Jean-loup Gailly jloup@gzip.org +// Mark Adler madler@alumni.caltech.edu +// +// ----------------------------------------------------------------------- + + + +using System; +using Interop=System.Runtime.InteropServices; + +namespace Ionic.Zlib +{ + + /// + /// Describes how to flush the current deflate operation. + /// + /// + /// The different FlushType values are useful when using a Deflate in a streaming application. + /// + public enum FlushType + { + /// No flush at all. + None = 0, + + /// Closes the current block, but doesn't flush it to + /// the output. Used internally only in hypothetical + /// scenarios. This was supposed to be removed by Zlib, but it is + /// still in use in some edge cases. + /// + Partial, + + /// + /// Use this during compression to specify that all pending output should be + /// flushed to the output buffer and the output should be aligned on a byte + /// boundary. You might use this in a streaming communication scenario, so that + /// the decompressor can get all input data available so far. When using this + /// with a ZlibCodec, AvailableBytesIn will be zero after the call if + /// enough output space has been provided before the call. Flushing will + /// degrade compression and so it should be used only when necessary. + /// + Sync, + + /// + /// Use this during compression to specify that all output should be flushed, as + /// with FlushType.Sync, but also, the compression state should be reset + /// so that decompression can restart from this point if previous compressed + /// data has been damaged or if random access is desired. Using + /// FlushType.Full too often can significantly degrade the compression. + /// + Full, + + /// Signals the end of the compression/decompression stream. + Finish, + } + + + /// + /// The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. + /// + public enum CompressionLevel + { + /// + /// None means that the data will be simply stored, with no change at all. + /// If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None + /// cannot be opened with the default zip reader. Use a different CompressionLevel. + /// + None= 0, + /// + /// Same as None. + /// + Level0 = 0, + + /// + /// The fastest but least effective compression. + /// + BestSpeed = 1, + + /// + /// A synonym for BestSpeed. + /// + Level1 = 1, + + /// + /// A little slower, but better, than level 1. + /// + Level2 = 2, + + /// + /// A little slower, but better, than level 2. + /// + Level3 = 3, + + /// + /// A little slower, but better, than level 3. + /// + Level4 = 4, + + /// + /// A little slower than level 4, but with better compression. + /// + Level5 = 5, + + /// + /// The default compression level, with a good balance of speed and compression efficiency. + /// + Default = 6, + /// + /// A synonym for Default. + /// + Level6 = 6, + + /// + /// Pretty good compression! + /// + Level7 = 7, + + /// + /// Better compression than Level7! + /// + Level8 = 8, + + /// + /// The "best" compression, where best means greatest reduction in size of the input data stream. + /// This is also the slowest compression. + /// + BestCompression = 9, + + /// + /// A synonym for BestCompression. + /// + Level9 = 9, + } + + /// + /// Describes options for how the compression algorithm is executed. Different strategies + /// work better on different sorts of data. The strategy parameter can affect the compression + /// ratio and the speed of compression but not the correctness of the compresssion. + /// + public enum CompressionStrategy + { + /// + /// The default strategy is probably the best for normal data. + /// + Default = 0, + + /// + /// The Filtered strategy is intended to be used most effectively with data produced by a + /// filter or predictor. By this definition, filtered data consists mostly of small + /// values with a somewhat random distribution. In this case, the compression algorithm + /// is tuned to compress them better. The effect of Filtered is to force more Huffman + /// coding and less string matching; it is a half-step between Default and HuffmanOnly. + /// + Filtered = 1, + + /// + /// Using HuffmanOnly will force the compressor to do Huffman encoding only, with no + /// string matching. + /// + HuffmanOnly = 2, + } + + + /// + /// An enum to specify the direction of transcoding - whether to compress or decompress. + /// + public enum CompressionMode + { + /// + /// Used to specify that the stream should compress the data. + /// + Compress= 0, + /// + /// Used to specify that the stream should decompress the data. + /// + Decompress = 1, + } + + + /// + /// A general purpose exception class for exceptions in the Zlib library. + /// + [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000E")] + public class ZlibException : System.Exception + { + /// + /// The ZlibException class captures exception information generated + /// by the Zlib library. + /// + public ZlibException() + : base() + { + } + + /// + /// This ctor collects a message attached to the exception. + /// + /// the message for the exception. + public ZlibException(System.String s) + : base(s) + { + } + } + + + internal class SharedUtils + { + /// + /// Performs an unsigned bitwise right shift with the specified number + /// + /// Number to operate on + /// Ammount of bits to shift + /// The resulting number from the shift operation + public static int URShift(int number, int bits) + { + return (int)((uint)number >> bits); + } + +#if NOT + /// + /// Performs an unsigned bitwise right shift with the specified number + /// + /// Number to operate on + /// Ammount of bits to shift + /// The resulting number from the shift operation + public static long URShift(long number, int bits) + { + return (long) ((UInt64)number >> bits); + } +#endif + + /// + /// Reads a number of characters from the current source TextReader and writes + /// the data to the target array at the specified index. + /// + /// + /// The source TextReader to read from + /// Contains the array of characteres read from the source TextReader. + /// The starting index of the target array. + /// The maximum number of characters to read from the source TextReader. + /// + /// + /// The number of characters read. The number will be less than or equal to + /// count depending on the data available in the source TextReader. Returns -1 + /// if the end of the stream is reached. + /// + public static System.Int32 ReadInput(System.IO.TextReader sourceTextReader, byte[] target, int start, int count) + { + // Returns 0 bytes if not enough space in target + if (target.Length == 0) return 0; + + char[] charArray = new char[target.Length]; + int bytesRead = sourceTextReader.Read(charArray, start, count); + + // Returns -1 if EOF + if (bytesRead == 0) return -1; + + for (int index = start; index < start + bytesRead; index++) + target[index] = (byte)charArray[index]; + + return bytesRead; + } + + + internal static byte[] ToByteArray(System.String sourceString) + { + return System.Text.UTF8Encoding.UTF8.GetBytes(sourceString); + } + + + internal static char[] ToCharArray(byte[] byteArray) + { + return System.Text.UTF8Encoding.UTF8.GetChars(byteArray); + } + } + + internal static class InternalConstants + { + internal static readonly int MAX_BITS = 15; + internal static readonly int BL_CODES = 19; + internal static readonly int D_CODES = 30; + internal static readonly int LITERALS = 256; + internal static readonly int LENGTH_CODES = 29; + internal static readonly int L_CODES = (LITERALS + 1 + LENGTH_CODES); + + // Bit length codes must not exceed MAX_BL_BITS bits + internal static readonly int MAX_BL_BITS = 7; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + internal static readonly int REP_3_6 = 16; + + // repeat a zero length 3-10 times (3 bits of repeat count) + internal static readonly int REPZ_3_10 = 17; + + // repeat a zero length 11-138 times (7 bits of repeat count) + internal static readonly int REPZ_11_138 = 18; + + } + + internal sealed class StaticTree + { + internal static readonly short[] lengthAndLiteralsTreeCodes = new short[] { + 12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, + 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, + 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, + 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, + 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, + 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, + 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, + 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, + 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, + 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, + 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, + 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, + 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, + 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, + 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, + 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, + 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, + 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, + 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, + 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, + 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, + 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, + 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, + 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, + 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, + 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, + 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, + 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, + 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, + 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, + 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, + 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, + 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, + 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, + 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, + 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8 + }; + + internal static readonly short[] distTreeCodes = new short[] { + 0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, + 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, + 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, + 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5 }; + + internal static readonly StaticTree Literals; + internal static readonly StaticTree Distances; + internal static readonly StaticTree BitLengths; + + internal short[] treeCodes; // static tree or null + internal int[] extraBits; // extra bits for each code or null + internal int extraBase; // base index for extra_bits + internal int elems; // max number of elements in the tree + internal int maxLength; // max bit length for the codes + + private StaticTree(short[] treeCodes, int[] extraBits, int extraBase, int elems, int maxLength) + { + this.treeCodes = treeCodes; + this.extraBits = extraBits; + this.extraBase = extraBase; + this.elems = elems; + this.maxLength = maxLength; + } + static StaticTree() + { + Literals = new StaticTree(lengthAndLiteralsTreeCodes, Tree.ExtraLengthBits, InternalConstants.LITERALS + 1, InternalConstants.L_CODES, InternalConstants.MAX_BITS); + Distances = new StaticTree(distTreeCodes, Tree.ExtraDistanceBits, 0, InternalConstants.D_CODES, InternalConstants.MAX_BITS); + BitLengths = new StaticTree(null, Tree.extra_blbits, 0, InternalConstants.BL_CODES, InternalConstants.MAX_BL_BITS); + } + } + + + + /// + /// Computes an Adler-32 checksum. + /// + /// + /// The Adler checksum is similar to a CRC checksum, but faster to compute, though less + /// reliable. It is used in producing RFC1950 compressed streams. The Adler checksum + /// is a required part of the "ZLIB" standard. Applications will almost never need to + /// use this class directly. + /// + /// + /// + public sealed class Adler + { + // largest prime smaller than 65536 + private static readonly uint BASE = 65521; + // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 + private static readonly int NMAX = 5552; + + +#pragma warning disable 3001 +#pragma warning disable 3002 + + /// + /// Calculates the Adler32 checksum. + /// + /// + /// + /// This is used within ZLIB. You probably don't need to use this directly. + /// + /// + /// + /// To compute an Adler32 checksum on a byte array: + /// + /// var adler = Adler.Adler32(0, null, 0, 0); + /// adler = Adler.Adler32(adler, buffer, index, length); + /// + /// + public static uint Adler32(uint adler, byte[] buf, int index, int len) + { + if (buf == null) + return 1; + + uint s1 = (uint) (adler & 0xffff); + uint s2 = (uint) ((adler >> 16) & 0xffff); + + while (len > 0) + { + int k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) + { + //s1 += (buf[index++] & 0xff); s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + k -= 16; + } + if (k != 0) + { + do + { + s1 += buf[index++]; + s2 += s1; + } + while (--k != 0); + } + s1 %= BASE; + s2 %= BASE; + } + return (uint)((s2 << 16) | s1); + } +#pragma warning restore 3001 +#pragma warning restore 3002 + + } + +} \ No newline at end of file diff --git a/dotNetZip/Zlib/ZlibBaseStream.cs b/dotNetZip/Zlib/ZlibBaseStream.cs new file mode 100644 index 0000000..700ab7b --- /dev/null +++ b/dotNetZip/Zlib/ZlibBaseStream.cs @@ -0,0 +1,627 @@ +// ZlibBaseStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 21:22:38> +// +// ------------------------------------------------------------------ +// +// This module defines the ZlibBaseStream class, which is an intnernal +// base class for DeflateStream, ZlibStream and GZipStream. +// +// ------------------------------------------------------------------ + +using System; +using System.IO; + +namespace Ionic.Zlib +{ + + internal enum ZlibStreamFlavor { ZLIB = 1950, DEFLATE = 1951, GZIP = 1952 } + + internal class ZlibBaseStream : System.IO.Stream + { + protected internal ZlibCodec _z = null; // deferred init... new ZlibCodec(); + + protected internal StreamMode _streamMode = StreamMode.Undefined; + protected internal FlushType _flushMode; + protected internal ZlibStreamFlavor _flavor; + protected internal CompressionMode _compressionMode; + protected internal CompressionLevel _level; + protected internal bool _leaveOpen; + protected internal byte[] _workingBuffer; + protected internal int _bufferSize = ZlibConstants.WorkingBufferSizeDefault; + protected internal byte[] _buf1 = new byte[1]; + + protected internal System.IO.Stream _stream; + protected internal CompressionStrategy Strategy = CompressionStrategy.Default; + + // workitem 7159 + Ionic.Crc.CRC32 crc; + protected internal string _GzipFileName; + protected internal string _GzipComment; + protected internal DateTime _GzipMtime; + protected internal int _gzipHeaderByteCount; + + internal int Crc32 { get { if (crc == null) return 0; return crc.Crc32Result; } } + + public ZlibBaseStream(System.IO.Stream stream, + CompressionMode compressionMode, + CompressionLevel level, + ZlibStreamFlavor flavor, + bool leaveOpen) + : base() + { + this._flushMode = FlushType.None; + //this._workingBuffer = new byte[WORKING_BUFFER_SIZE_DEFAULT]; + this._stream = stream; + this._leaveOpen = leaveOpen; + this._compressionMode = compressionMode; + this._flavor = flavor; + this._level = level; + // workitem 7159 + if (flavor == ZlibStreamFlavor.GZIP) + { + this.crc = new Ionic.Crc.CRC32(); + } + } + + + protected internal bool _wantCompress + { + get + { + return (this._compressionMode == CompressionMode.Compress); + } + } + + private ZlibCodec z + { + get + { + if (_z == null) + { + bool wantRfc1950Header = (this._flavor == ZlibStreamFlavor.ZLIB); + _z = new ZlibCodec(); + if (this._compressionMode == CompressionMode.Decompress) + { + _z.InitializeInflate(wantRfc1950Header); + } + else + { + _z.Strategy = Strategy; + _z.InitializeDeflate(this._level, wantRfc1950Header); + } + } + return _z; + } + } + + + + private byte[] workingBuffer + { + get + { + if (_workingBuffer == null) + _workingBuffer = new byte[_bufferSize]; + return _workingBuffer; + } + } + + + + public override void Write(System.Byte[] buffer, int offset, int count) + { + // workitem 7159 + // calculate the CRC on the unccompressed data (before writing) + if (crc != null) + crc.SlurpBlock(buffer, offset, count); + + if (_streamMode == StreamMode.Undefined) + _streamMode = StreamMode.Writer; + else if (_streamMode != StreamMode.Writer) + throw new ZlibException("Cannot Write after Reading."); + + if (count == 0) + return; + + // first reference of z property will initialize the private var _z + z.InputBuffer = buffer; + _z.NextIn = offset; + _z.AvailableBytesIn = count; + bool done = false; + do + { + _z.OutputBuffer = workingBuffer; + _z.NextOut = 0; + _z.AvailableBytesOut = _workingBuffer.Length; + int rc = (_wantCompress) + ? _z.Deflate(_flushMode) + : _z.Inflate(_flushMode); + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new ZlibException((_wantCompress ? "de" : "in") + "flating: " + _z.Message); + + //if (_workingBuffer.Length - _z.AvailableBytesOut > 0) + _stream.Write(_workingBuffer, 0, _workingBuffer.Length - _z.AvailableBytesOut); + + done = _z.AvailableBytesIn == 0 && _z.AvailableBytesOut != 0; + + // If GZIP and de-compress, we're done when 8 bytes remain. + if (_flavor == ZlibStreamFlavor.GZIP && !_wantCompress) + done = (_z.AvailableBytesIn == 8 && _z.AvailableBytesOut != 0); + + } + while (!done); + } + + + + private void finish() + { + if (_z == null) return; + + if (_streamMode == StreamMode.Writer) + { + bool done = false; + do + { + _z.OutputBuffer = workingBuffer; + _z.NextOut = 0; + _z.AvailableBytesOut = _workingBuffer.Length; + int rc = (_wantCompress) + ? _z.Deflate(FlushType.Finish) + : _z.Inflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + { + string verb = (_wantCompress ? "de" : "in") + "flating"; + if (_z.Message == null) + throw new ZlibException(String.Format("{0}: (rc = {1})", verb, rc)); + else + throw new ZlibException(verb + ": " + _z.Message); + } + + if (_workingBuffer.Length - _z.AvailableBytesOut > 0) + { + _stream.Write(_workingBuffer, 0, _workingBuffer.Length - _z.AvailableBytesOut); + } + + done = _z.AvailableBytesIn == 0 && _z.AvailableBytesOut != 0; + // If GZIP and de-compress, we're done when 8 bytes remain. + if (_flavor == ZlibStreamFlavor.GZIP && !_wantCompress) + done = (_z.AvailableBytesIn == 8 && _z.AvailableBytesOut != 0); + + } + while (!done); + + Flush(); + + // workitem 7159 + if (_flavor == ZlibStreamFlavor.GZIP) + { + if (_wantCompress) + { + // Emit the GZIP trailer: CRC32 and size mod 2^32 + int c1 = crc.Crc32Result; + _stream.Write(BitConverter.GetBytes(c1), 0, 4); + int c2 = (Int32)(crc.TotalBytesRead & 0x00000000FFFFFFFF); + _stream.Write(BitConverter.GetBytes(c2), 0, 4); + } + else + { + throw new ZlibException("Writing with decompression is not supported."); + } + } + } + // workitem 7159 + else if (_streamMode == StreamMode.Reader) + { + if (_flavor == ZlibStreamFlavor.GZIP) + { + if (!_wantCompress) + { + // workitem 8501: handle edge case (decompress empty stream) + if (_z.TotalBytesOut == 0L) + return; + + // Read and potentially verify the GZIP trailer: + // CRC32 and size mod 2^32 + byte[] trailer = new byte[8]; + + // workitems 8679 & 12554 + if (_z.AvailableBytesIn < 8) + { + // Make sure we have read to the end of the stream + Array.Copy(_z.InputBuffer, _z.NextIn, trailer, 0, _z.AvailableBytesIn); + int bytesNeeded = 8 - _z.AvailableBytesIn; + int bytesRead = _stream.Read(trailer, + _z.AvailableBytesIn, + bytesNeeded); + if (bytesNeeded != bytesRead) + { + throw new ZlibException(String.Format("Missing or incomplete GZIP trailer. Expected 8 bytes, got {0}.", + _z.AvailableBytesIn + bytesRead)); + } + } + else + { + Array.Copy(_z.InputBuffer, _z.NextIn, trailer, 0, trailer.Length); + } + + Int32 crc32_expected = BitConverter.ToInt32(trailer, 0); + Int32 crc32_actual = crc.Crc32Result; + Int32 isize_expected = BitConverter.ToInt32(trailer, 4); + Int32 isize_actual = (Int32)(_z.TotalBytesOut & 0x00000000FFFFFFFF); + + if (crc32_actual != crc32_expected) + throw new ZlibException(String.Format("Bad CRC32 in GZIP trailer. (actual({0:X8})!=expected({1:X8}))", crc32_actual, crc32_expected)); + + if (isize_actual != isize_expected) + throw new ZlibException(String.Format("Bad size in GZIP trailer. (actual({0})!=expected({1}))", isize_actual, isize_expected)); + + } + else + { + throw new ZlibException("Reading with compression is not supported."); + } + } + } + } + + + private void end() + { + if (z == null) + return; + if (_wantCompress) + { + _z.EndDeflate(); + } + else + { + _z.EndInflate(); + } + _z = null; + } + + + public override void Close() + { + if (_stream == null) return; + try + { + finish(); + } + finally + { + end(); + if (!_leaveOpen) _stream.Close(); + _stream = null; + } + } + + public override void Flush() + { + _stream.Flush(); + } + + public override System.Int64 Seek(System.Int64 offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + //_outStream.Seek(offset, origin); + } + public override void SetLength(System.Int64 value) + { + _stream.SetLength(value); + } + + +#if NOT + public int Read() + { + if (Read(_buf1, 0, 1) == 0) + return 0; + // calculate CRC after reading + if (crc!=null) + crc.SlurpBlock(_buf1,0,1); + return (_buf1[0] & 0xFF); + } +#endif + + private bool nomoreinput = false; + + + + private string ReadZeroTerminatedString() + { + var list = new System.Collections.Generic.List(); + bool done = false; + do + { + // workitem 7740 + int n = _stream.Read(_buf1, 0, 1); + if (n != 1) + throw new ZlibException("Unexpected EOF reading GZIP header."); + else + { + if (_buf1[0] == 0) + done = true; + else + list.Add(_buf1[0]); + } + } while (!done); + byte[] a = list.ToArray(); + return GZipStream.iso8859dash1.GetString(a, 0, a.Length); + } + + + private int _ReadAndValidateGzipHeader() + { + int totalBytesRead = 0; + // read the header on the first read + byte[] header = new byte[10]; + int n = _stream.Read(header, 0, header.Length); + + // workitem 8501: handle edge case (decompress empty stream) + if (n == 0) + return 0; + + if (n != 10) + throw new ZlibException("Not a valid GZIP stream."); + + if (header[0] != 0x1F || header[1] != 0x8B || header[2] != 8) + throw new ZlibException("Bad GZIP header."); + + Int32 timet = BitConverter.ToInt32(header, 4); + _GzipMtime = GZipStream._unixEpoch.AddSeconds(timet); + totalBytesRead += n; + if ((header[3] & 0x04) == 0x04) + { + // read and discard extra field + n = _stream.Read(header, 0, 2); // 2-byte length field + totalBytesRead += n; + + Int16 extraLength = (Int16)(header[0] + header[1] * 256); + byte[] extra = new byte[extraLength]; + n = _stream.Read(extra, 0, extra.Length); + if (n != extraLength) + throw new ZlibException("Unexpected end-of-file reading GZIP header."); + totalBytesRead += n; + } + if ((header[3] & 0x08) == 0x08) + _GzipFileName = ReadZeroTerminatedString(); + if ((header[3] & 0x10) == 0x010) + _GzipComment = ReadZeroTerminatedString(); + if ((header[3] & 0x02) == 0x02) + Read(_buf1, 0, 1); // CRC16, ignore + + return totalBytesRead; + } + + + + public override System.Int32 Read(System.Byte[] buffer, System.Int32 offset, System.Int32 count) + { + // According to MS documentation, any implementation of the IO.Stream.Read function must: + // (a) throw an exception if offset & count reference an invalid part of the buffer, + // or if count < 0, or if buffer is null + // (b) return 0 only upon EOF, or if count = 0 + // (c) if not EOF, then return at least 1 byte, up to bytes + + if (_streamMode == StreamMode.Undefined) + { + if (!this._stream.CanRead) throw new ZlibException("The stream is not readable."); + // for the first read, set up some controls. + _streamMode = StreamMode.Reader; + // (The first reference to _z goes through the private accessor which + // may initialize it.) + z.AvailableBytesIn = 0; + if (_flavor == ZlibStreamFlavor.GZIP) + { + _gzipHeaderByteCount = _ReadAndValidateGzipHeader(); + // workitem 8501: handle edge case (decompress empty stream) + if (_gzipHeaderByteCount == 0) + return 0; + } + } + + if (_streamMode != StreamMode.Reader) + throw new ZlibException("Cannot Read after Writing."); + + if (count == 0) return 0; + if (nomoreinput && _wantCompress) return 0; // workitem 8557 + if (buffer == null) throw new ArgumentNullException("buffer"); + if (count < 0) throw new ArgumentOutOfRangeException("count"); + if (offset < buffer.GetLowerBound(0)) throw new ArgumentOutOfRangeException("offset"); + if ((offset + count) > buffer.GetLength(0)) throw new ArgumentOutOfRangeException("count"); + + int rc = 0; + + // set up the output of the deflate/inflate codec: + _z.OutputBuffer = buffer; + _z.NextOut = offset; + _z.AvailableBytesOut = count; + + // This is necessary in case _workingBuffer has been resized. (new byte[]) + // (The first reference to _workingBuffer goes through the private accessor which + // may initialize it.) + _z.InputBuffer = workingBuffer; + + do + { + // need data in _workingBuffer in order to deflate/inflate. Here, we check if we have any. + if ((_z.AvailableBytesIn == 0) && (!nomoreinput)) + { + // No data available, so try to Read data from the captive stream. + _z.NextIn = 0; + _z.AvailableBytesIn = _stream.Read(_workingBuffer, 0, _workingBuffer.Length); + if (_z.AvailableBytesIn == 0) + nomoreinput = true; + + } + // we have data in InputBuffer; now compress or decompress as appropriate + rc = (_wantCompress) + ? _z.Deflate(_flushMode) + : _z.Inflate(_flushMode); + + if (nomoreinput && (rc == ZlibConstants.Z_BUF_ERROR)) + return 0; + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new ZlibException(String.Format("{0}flating: rc={1} msg={2}", (_wantCompress ? "de" : "in"), rc, _z.Message)); + + if ((nomoreinput || rc == ZlibConstants.Z_STREAM_END) && (_z.AvailableBytesOut == count)) + break; // nothing more to read + } + //while (_z.AvailableBytesOut == count && rc == ZlibConstants.Z_OK); + while (_z.AvailableBytesOut > 0 && !nomoreinput && rc == ZlibConstants.Z_OK); + + + // workitem 8557 + // is there more room in output? + if (_z.AvailableBytesOut > 0) + { + if (rc == ZlibConstants.Z_OK && _z.AvailableBytesIn == 0) + { + // deferred + } + + // are we completely done reading? + if (nomoreinput) + { + // and in compression? + if (_wantCompress) + { + // no more input data available; therefore we flush to + // try to complete the read + rc = _z.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new ZlibException(String.Format("Deflating: rc={0} msg={1}", rc, _z.Message)); + } + } + } + + + rc = (count - _z.AvailableBytesOut); + + // calculate CRC after reading + if (crc != null) + crc.SlurpBlock(buffer, offset, rc); + + return rc; + } + + + + public override System.Boolean CanRead + { + get { return this._stream.CanRead; } + } + + public override System.Boolean CanSeek + { + get { return this._stream.CanSeek; } + } + + public override System.Boolean CanWrite + { + get { return this._stream.CanWrite; } + } + + public override System.Int64 Length + { + get { return _stream.Length; } + } + + public override long Position + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + internal enum StreamMode + { + Writer, + Reader, + Undefined, + } + + + public static void CompressString(String s, Stream compressor) + { + byte[] uncompressed = System.Text.Encoding.UTF8.GetBytes(s); + using (compressor) + { + compressor.Write(uncompressed, 0, uncompressed.Length); + } + } + + public static void CompressBuffer(byte[] b, Stream compressor) + { + // workitem 8460 + using (compressor) + { + compressor.Write(b, 0, b.Length); + } + } + + public static String UncompressString(byte[] compressed, Stream decompressor) + { + // workitem 8460 + byte[] working = new byte[1024]; + var encoding = System.Text.Encoding.UTF8; + using (var output = new MemoryStream()) + { + using (decompressor) + { + int n; + while ((n = decompressor.Read(working, 0, working.Length)) != 0) + { + output.Write(working, 0, n); + } + } + + // reset to allow read from start + output.Seek(0, SeekOrigin.Begin); + var sr = new StreamReader(output, encoding); + return sr.ReadToEnd(); + } + } + + public static byte[] UncompressBuffer(byte[] compressed, Stream decompressor) + { + // workitem 8460 + byte[] working = new byte[1024]; + using (var output = new MemoryStream()) + { + using (decompressor) + { + int n; + while ((n = decompressor.Read(working, 0, working.Length)) != 0) + { + output.Write(working, 0, n); + } + } + return output.ToArray(); + } + } + + } + + +} diff --git a/dotNetZip/Zlib/ZlibCodec.cs b/dotNetZip/Zlib/ZlibCodec.cs new file mode 100644 index 0000000..ab0abcf --- /dev/null +++ b/dotNetZip/Zlib/ZlibCodec.cs @@ -0,0 +1,717 @@ +// ZlibCodec.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-November-03 15:40:51> +// +// ------------------------------------------------------------------ +// +// This module defines a Codec for ZLIB compression and +// decompression. This code extends code that was based the jzlib +// implementation of zlib, but this code is completely novel. The codec +// class is new, and encapsulates some behaviors that are new, and some +// that were present in other classes in the jzlib code base. In +// keeping with the license for jzlib, the copyright to the jzlib code +// is included below. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; +using Interop=System.Runtime.InteropServices; + +namespace Ionic.Zlib +{ + /// + /// Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). + /// + /// + /// + /// This class compresses and decompresses data according to the Deflate algorithm + /// and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. + /// + [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000D")] + [Interop.ComVisible(true)] +#if !NETCF + [Interop.ClassInterface(Interop.ClassInterfaceType.AutoDispatch)] +#endif + sealed public class ZlibCodec + { + /// + /// The buffer from which data is taken. + /// + public byte[] InputBuffer; + + /// + /// An index into the InputBuffer array, indicating where to start reading. + /// + public int NextIn; + + /// + /// The number of bytes available in the InputBuffer, starting at NextIn. + /// + /// + /// Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. + /// The class will update this number as calls to Inflate/Deflate are made. + /// + public int AvailableBytesIn; + + /// + /// Total number of bytes read so far, through all calls to Inflate()/Deflate(). + /// + public long TotalBytesIn; + + /// + /// Buffer to store output data. + /// + public byte[] OutputBuffer; + + /// + /// An index into the OutputBuffer array, indicating where to start writing. + /// + public int NextOut; + + /// + /// The number of bytes available in the OutputBuffer, starting at NextOut. + /// + /// + /// Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. + /// The class will update this number as calls to Inflate/Deflate are made. + /// + public int AvailableBytesOut; + + /// + /// Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). + /// + public long TotalBytesOut; + + /// + /// used for diagnostics, when something goes wrong! + /// + public System.String Message; + + internal DeflateManager dstate; + internal InflateManager istate; + + internal uint _Adler32; + + /// + /// The compression level to use in this codec. Useful only in compression mode. + /// + public CompressionLevel CompressLevel = CompressionLevel.Default; + + /// + /// The number of Window Bits to use. + /// + /// + /// This gauges the size of the sliding window, and hence the + /// compression effectiveness as well as memory consumption. It's best to just leave this + /// setting alone if you don't know what it is. The maximum value is 15 bits, which implies + /// a 32k window. + /// + public int WindowBits = ZlibConstants.WindowBitsDefault; + + /// + /// The compression strategy to use. + /// + /// + /// This is only effective in compression. The theory offered by ZLIB is that different + /// strategies could potentially produce significant differences in compression behavior + /// for different data sets. Unfortunately I don't have any good recommendations for how + /// to set it differently. When I tested changing the strategy I got minimally different + /// compression performance. It's best to leave this property alone if you don't have a + /// good feel for it. Or, you may want to produce a test harness that runs through the + /// different strategy options and evaluates them on different file types. If you do that, + /// let me know your results. + /// + public CompressionStrategy Strategy = CompressionStrategy.Default; + + + /// + /// The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. + /// + public int Adler32 { get { return (int)_Adler32; } } + + + /// + /// Create a ZlibCodec. + /// + /// + /// If you use this default constructor, you will later have to explicitly call + /// InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress + /// or decompress. + /// + public ZlibCodec() { } + + /// + /// Create a ZlibCodec that either compresses or decompresses. + /// + /// + /// Indicates whether the codec should compress (deflate) or decompress (inflate). + /// + public ZlibCodec(CompressionMode mode) + { + if (mode == CompressionMode.Compress) + { + int rc = InitializeDeflate(); + if (rc != ZlibConstants.Z_OK) throw new ZlibException("Cannot initialize for deflate."); + } + else if (mode == CompressionMode.Decompress) + { + int rc = InitializeInflate(); + if (rc != ZlibConstants.Z_OK) throw new ZlibException("Cannot initialize for inflate."); + } + else throw new ZlibException("Invalid ZlibStreamFlavor."); + } + + /// + /// Initialize the inflation state. + /// + /// + /// It is not necessary to call this before using the ZlibCodec to inflate data; + /// It is implicitly called when you call the constructor. + /// + /// Z_OK if everything goes well. + public int InitializeInflate() + { + return InitializeInflate(this.WindowBits); + } + + /// + /// Initialize the inflation state with an explicit flag to + /// govern the handling of RFC1950 header bytes. + /// + /// + /// + /// By default, the ZLIB header defined in RFC 1950 is expected. If + /// you want to read a zlib stream you should specify true for + /// expectRfc1950Header. If you have a deflate stream, you will want to specify + /// false. It is only necessary to invoke this initializer explicitly if you + /// want to specify false. + /// + /// + /// whether to expect an RFC1950 header byte + /// pair when reading the stream of data to be inflated. + /// + /// Z_OK if everything goes well. + public int InitializeInflate(bool expectRfc1950Header) + { + return InitializeInflate(this.WindowBits, expectRfc1950Header); + } + + /// + /// Initialize the ZlibCodec for inflation, with the specified number of window bits. + /// + /// The number of window bits to use. If you need to ask what that is, + /// then you shouldn't be calling this initializer. + /// Z_OK if all goes well. + public int InitializeInflate(int windowBits) + { + this.WindowBits = windowBits; + return InitializeInflate(windowBits, true); + } + + /// + /// Initialize the inflation state with an explicit flag to govern the handling of + /// RFC1950 header bytes. + /// + /// + /// + /// If you want to read a zlib stream you should specify true for + /// expectRfc1950Header. In this case, the library will expect to find a ZLIB + /// header, as defined in RFC + /// 1950, in the compressed stream. If you will be reading a DEFLATE or + /// GZIP stream, which does not have such a header, you will want to specify + /// false. + /// + /// + /// whether to expect an RFC1950 header byte pair when reading + /// the stream of data to be inflated. + /// The number of window bits to use. If you need to ask what that is, + /// then you shouldn't be calling this initializer. + /// Z_OK if everything goes well. + public int InitializeInflate(int windowBits, bool expectRfc1950Header) + { + this.WindowBits = windowBits; + if (dstate != null) throw new ZlibException("You may not call InitializeInflate() after calling InitializeDeflate()."); + istate = new InflateManager(expectRfc1950Header); + return istate.Initialize(this, windowBits); + } + + /// + /// Inflate the data in the InputBuffer, placing the result in the OutputBuffer. + /// + /// + /// You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and + /// AvailableBytesOut before calling this method. + /// + /// + /// + /// private void InflateBuffer() + /// { + /// int bufferSize = 1024; + /// byte[] buffer = new byte[bufferSize]; + /// ZlibCodec decompressor = new ZlibCodec(); + /// + /// Console.WriteLine("\n============================================"); + /// Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); + /// MemoryStream ms = new MemoryStream(DecompressedBytes); + /// + /// int rc = decompressor.InitializeInflate(); + /// + /// decompressor.InputBuffer = CompressedBytes; + /// decompressor.NextIn = 0; + /// decompressor.AvailableBytesIn = CompressedBytes.Length; + /// + /// decompressor.OutputBuffer = buffer; + /// + /// // pass 1: inflate + /// do + /// { + /// decompressor.NextOut = 0; + /// decompressor.AvailableBytesOut = buffer.Length; + /// rc = decompressor.Inflate(FlushType.None); + /// + /// if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + /// throw new Exception("inflating: " + decompressor.Message); + /// + /// ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); + /// } + /// while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + /// + /// // pass 2: finish and flush + /// do + /// { + /// decompressor.NextOut = 0; + /// decompressor.AvailableBytesOut = buffer.Length; + /// rc = decompressor.Inflate(FlushType.Finish); + /// + /// if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + /// throw new Exception("inflating: " + decompressor.Message); + /// + /// if (buffer.Length - decompressor.AvailableBytesOut > 0) + /// ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); + /// } + /// while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + /// + /// decompressor.EndInflate(); + /// } + /// + /// + /// + /// The flush to use when inflating. + /// Z_OK if everything goes well. + public int Inflate(FlushType flush) + { + if (istate == null) + throw new ZlibException("No Inflate State!"); + return istate.Inflate(flush); + } + + + /// + /// Ends an inflation session. + /// + /// + /// Call this after successively calling Inflate(). This will cause all buffers to be flushed. + /// After calling this you cannot call Inflate() without a intervening call to one of the + /// InitializeInflate() overloads. + /// + /// Z_OK if everything goes well. + public int EndInflate() + { + if (istate == null) + throw new ZlibException("No Inflate State!"); + int ret = istate.End(); + istate = null; + return ret; + } + + /// + /// I don't know what this does! + /// + /// Z_OK if everything goes well. + public int SyncInflate() + { + if (istate == null) + throw new ZlibException("No Inflate State!"); + return istate.Sync(); + } + + /// + /// Initialize the ZlibCodec for deflation operation. + /// + /// + /// The codec will use the MAX window bits and the default level of compression. + /// + /// + /// + /// int bufferSize = 40000; + /// byte[] CompressedBytes = new byte[bufferSize]; + /// byte[] DecompressedBytes = new byte[bufferSize]; + /// + /// ZlibCodec compressor = new ZlibCodec(); + /// + /// compressor.InitializeDeflate(CompressionLevel.Default); + /// + /// compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + /// compressor.NextIn = 0; + /// compressor.AvailableBytesIn = compressor.InputBuffer.Length; + /// + /// compressor.OutputBuffer = CompressedBytes; + /// compressor.NextOut = 0; + /// compressor.AvailableBytesOut = CompressedBytes.Length; + /// + /// while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) + /// { + /// compressor.Deflate(FlushType.None); + /// } + /// + /// while (true) + /// { + /// int rc= compressor.Deflate(FlushType.Finish); + /// if (rc == ZlibConstants.Z_STREAM_END) break; + /// } + /// + /// compressor.EndDeflate(); + /// + /// + /// + /// Z_OK if all goes well. You generally don't need to check the return code. + public int InitializeDeflate() + { + return _InternalInitializeDeflate(true); + } + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. + /// + /// + /// The codec will use the maximum window bits (15) and the specified + /// CompressionLevel. It will emit a ZLIB stream as it compresses. + /// + /// The compression level for the codec. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level) + { + this.CompressLevel = level; + return _InternalInitializeDeflate(true); + } + + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + /// and the explicit flag governing whether to emit an RFC1950 header byte pair. + /// + /// + /// The codec will use the maximum window bits (15) and the specified CompressionLevel. + /// If you want to generate a zlib stream, you should specify true for + /// wantRfc1950Header. In this case, the library will emit a ZLIB + /// header, as defined in RFC + /// 1950, in the compressed stream. + /// + /// The compression level for the codec. + /// whether to emit an initial RFC1950 byte pair in the compressed stream. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level, bool wantRfc1950Header) + { + this.CompressLevel = level; + return _InternalInitializeDeflate(wantRfc1950Header); + } + + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + /// and the specified number of window bits. + /// + /// + /// The codec will use the specified number of window bits and the specified CompressionLevel. + /// + /// The compression level for the codec. + /// the number of window bits to use. If you don't know what this means, don't use this method. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level, int bits) + { + this.CompressLevel = level; + this.WindowBits = bits; + return _InternalInitializeDeflate(true); + } + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified + /// CompressionLevel, the specified number of window bits, and the explicit flag + /// governing whether to emit an RFC1950 header byte pair. + /// + /// + /// The compression level for the codec. + /// whether to emit an initial RFC1950 byte pair in the compressed stream. + /// the number of window bits to use. If you don't know what this means, don't use this method. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level, int bits, bool wantRfc1950Header) + { + this.CompressLevel = level; + this.WindowBits = bits; + return _InternalInitializeDeflate(wantRfc1950Header); + } + + private int _InternalInitializeDeflate(bool wantRfc1950Header) + { + if (istate != null) throw new ZlibException("You may not call InitializeDeflate() after calling InitializeInflate()."); + dstate = new DeflateManager(); + dstate.WantRfc1950HeaderBytes = wantRfc1950Header; + + return dstate.Initialize(this, this.CompressLevel, this.WindowBits, this.Strategy); + } + + /// + /// Deflate one batch of data. + /// + /// + /// You must have set InputBuffer and OutputBuffer before calling this method. + /// + /// + /// + /// private void DeflateBuffer(CompressionLevel level) + /// { + /// int bufferSize = 1024; + /// byte[] buffer = new byte[bufferSize]; + /// ZlibCodec compressor = new ZlibCodec(); + /// + /// Console.WriteLine("\n============================================"); + /// Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); + /// MemoryStream ms = new MemoryStream(); + /// + /// int rc = compressor.InitializeDeflate(level); + /// + /// compressor.InputBuffer = UncompressedBytes; + /// compressor.NextIn = 0; + /// compressor.AvailableBytesIn = UncompressedBytes.Length; + /// + /// compressor.OutputBuffer = buffer; + /// + /// // pass 1: deflate + /// do + /// { + /// compressor.NextOut = 0; + /// compressor.AvailableBytesOut = buffer.Length; + /// rc = compressor.Deflate(FlushType.None); + /// + /// if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + /// throw new Exception("deflating: " + compressor.Message); + /// + /// ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); + /// } + /// while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + /// + /// // pass 2: finish and flush + /// do + /// { + /// compressor.NextOut = 0; + /// compressor.AvailableBytesOut = buffer.Length; + /// rc = compressor.Deflate(FlushType.Finish); + /// + /// if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + /// throw new Exception("deflating: " + compressor.Message); + /// + /// if (buffer.Length - compressor.AvailableBytesOut > 0) + /// ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + /// } + /// while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + /// + /// compressor.EndDeflate(); + /// + /// ms.Seek(0, SeekOrigin.Begin); + /// CompressedBytes = new byte[compressor.TotalBytesOut]; + /// ms.Read(CompressedBytes, 0, CompressedBytes.Length); + /// } + /// + /// + /// whether to flush all data as you deflate. Generally you will want to + /// use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to + /// flush everything. + /// + /// Z_OK if all goes well. + public int Deflate(FlushType flush) + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + return dstate.Deflate(flush); + } + + /// + /// End a deflation session. + /// + /// + /// Call this after making a series of one or more calls to Deflate(). All buffers are flushed. + /// + /// Z_OK if all goes well. + public int EndDeflate() + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + // TODO: dinoch Tue, 03 Nov 2009 15:39 (test this) + //int ret = dstate.End(); + dstate = null; + return ZlibConstants.Z_OK; //ret; + } + + /// + /// Reset a codec for another deflation session. + /// + /// + /// Call this to reset the deflation state. For example if a thread is deflating + /// non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first + /// block and before the next Deflate(None) of the second block. + /// + /// Z_OK if all goes well. + public void ResetDeflate() + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + dstate.Reset(); + } + + + /// + /// Set the CompressionStrategy and CompressionLevel for a deflation session. + /// + /// the level of compression to use. + /// the strategy to use for compression. + /// Z_OK if all goes well. + public int SetDeflateParams(CompressionLevel level, CompressionStrategy strategy) + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + return dstate.SetParams(level, strategy); + } + + + /// + /// Set the dictionary to be used for either Inflation or Deflation. + /// + /// The dictionary bytes to use. + /// Z_OK if all goes well. + public int SetDictionary(byte[] dictionary) + { + if (istate != null) + return istate.SetDictionary(dictionary); + + if (dstate != null) + return dstate.SetDictionary(dictionary); + + throw new ZlibException("No Inflate or Deflate state!"); + } + + // Flush as much pending output as possible. All deflate() output goes + // through this function so some applications may wish to modify it + // to avoid allocating a large strm->next_out buffer and copying into it. + // (See also read_buf()). + internal void flush_pending() + { + int len = dstate.pendingCount; + + if (len > AvailableBytesOut) + len = AvailableBytesOut; + if (len == 0) + return; + + if (dstate.pending.Length <= dstate.nextPending || + OutputBuffer.Length <= NextOut || + dstate.pending.Length < (dstate.nextPending + len) || + OutputBuffer.Length < (NextOut + len)) + { + throw new ZlibException(String.Format("Invalid State. (pending.Length={0}, pendingCount={1})", + dstate.pending.Length, dstate.pendingCount)); + } + + Array.Copy(dstate.pending, dstate.nextPending, OutputBuffer, NextOut, len); + + NextOut += len; + dstate.nextPending += len; + TotalBytesOut += len; + AvailableBytesOut -= len; + dstate.pendingCount -= len; + if (dstate.pendingCount == 0) + { + dstate.nextPending = 0; + } + } + + // Read a new buffer from the current input stream, update the adler32 + // and total number of bytes read. All deflate() input goes through + // this function so some applications may wish to modify it to avoid + // allocating a large strm->next_in buffer and copying from it. + // (See also flush_pending()). + internal int read_buf(byte[] buf, int start, int size) + { + int len = AvailableBytesIn; + + if (len > size) + len = size; + if (len == 0) + return 0; + + AvailableBytesIn -= len; + + if (dstate.WantRfc1950HeaderBytes) + { + _Adler32 = Adler.Adler32(_Adler32, InputBuffer, NextIn, len); + } + Array.Copy(InputBuffer, NextIn, buf, start, len); + NextIn += len; + TotalBytesIn += len; + return len; + } + + } +} \ No newline at end of file diff --git a/dotNetZip/Zlib/ZlibConstants.cs b/dotNetZip/Zlib/ZlibConstants.cs new file mode 100644 index 0000000..59ae730 --- /dev/null +++ b/dotNetZip/Zlib/ZlibConstants.cs @@ -0,0 +1,128 @@ +// ZlibConstants.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-November-03 18:50:19> +// +// ------------------------------------------------------------------ +// +// This module defines constants used by the zlib class library. This +// code is derived from the jzlib implementation of zlib, but +// significantly modified. In keeping with the license for jzlib, the +// copyright to that code is included here. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; + +namespace Ionic.Zlib +{ + /// + /// A bunch of constants used in the Zlib interface. + /// + public static class ZlibConstants + { + /// + /// The maximum number of window bits for the Deflate algorithm. + /// + public const int WindowBitsMax = 15; // 32K LZ77 window + + /// + /// The default number of window bits for the Deflate algorithm. + /// + public const int WindowBitsDefault = WindowBitsMax; + + /// + /// indicates everything is A-OK + /// + public const int Z_OK = 0; + + /// + /// Indicates that the last operation reached the end of the stream. + /// + public const int Z_STREAM_END = 1; + + /// + /// The operation ended in need of a dictionary. + /// + public const int Z_NEED_DICT = 2; + + /// + /// There was an error with the stream - not enough data, not open and readable, etc. + /// + public const int Z_STREAM_ERROR = -2; + + /// + /// There was an error with the data - not enough data, bad data, etc. + /// + public const int Z_DATA_ERROR = -3; + + /// + /// There was an error with the working buffer. + /// + public const int Z_BUF_ERROR = -5; + + /// + /// The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. + /// +#if NETCF + public const int WorkingBufferSizeDefault = 8192; +#else + public const int WorkingBufferSizeDefault = 16384; +#endif + /// + /// The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. + /// + public const int WorkingBufferSizeMin = 1024; + } + +} + diff --git a/dotNetZip/Zlib/ZlibStream.cs b/dotNetZip/Zlib/ZlibStream.cs new file mode 100644 index 0000000..88ddca9 --- /dev/null +++ b/dotNetZip/Zlib/ZlibStream.cs @@ -0,0 +1,725 @@ +// ZlibStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-31 14:53:33> +// +// ------------------------------------------------------------------ +// +// This module defines the ZlibStream class, which is similar in idea to +// the System.IO.Compression.DeflateStream and +// System.IO.Compression.GZipStream classes in the .NET BCL. +// +// ------------------------------------------------------------------ + +using System; +using System.IO; + +namespace Ionic.Zlib +{ + + /// + /// Represents a Zlib stream for compression or decompression. + /// + /// + /// + /// + /// The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any + /// stream. + /// + /// + /// Using this stream, applications can compress or decompress data via + /// stream Read() and Write() operations. Either compresssion or + /// decompression can occur through either reading or writing. The compression + /// format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed + /// Data Format Specification version 3.3". This implementation of ZLIB always uses + /// DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE + /// Compressed Data Format Specification version 1.3.") + /// + /// + /// The ZLIB format allows for varying compression methods, window sizes, and dictionaries. + /// This implementation always uses the DEFLATE compression method, a preset dictionary, + /// and 15 window bits by default. + /// + /// + /// + /// This class is similar to , except that it adds the + /// RFC1950 header and trailer bytes to a compressed stream when compressing, or expects + /// the RFC1950 header and trailer bytes when decompressing. It is also similar to the + /// . + /// + /// + /// + /// + public class ZlibStream : System.IO.Stream + { + internal ZlibBaseStream _baseStream; + bool _disposed; + + /// + /// Create a ZlibStream using the specified CompressionMode. + /// + /// + /// + /// + /// When mode is CompressionMode.Compress, the ZlibStream + /// will use the default compression level. The "captive" stream will be + /// closed when the ZlibStream is closed. + /// + /// + /// + /// + /// + /// This example uses a ZlibStream to compress a file, and writes the + /// compressed data to another file. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + /// { + /// using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".zlib") + /// Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// + /// The stream which will be read or written. + /// Indicates whether the ZlibStream will compress or decompress. + public ZlibStream(System.IO.Stream stream, CompressionMode mode) + : this(stream, mode, CompressionLevel.Default, false) + { + } + + /// + /// Create a ZlibStream using the specified CompressionMode and + /// the specified CompressionLevel. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is ignored. + /// The "captive" stream will be closed when the ZlibStream is closed. + /// + /// + /// + /// + /// + /// This example uses a ZlibStream to compress data from a file, and writes the + /// compressed data to another file. + /// + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + /// { + /// using (Stream compressor = new ZlibStream(raw, + /// CompressionMode.Compress, + /// CompressionLevel.BestCompression)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".zlib") + /// Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// + /// The stream to be read or written while deflating or inflating. + /// Indicates whether the ZlibStream will compress or decompress. + /// A tuning knob to trade speed for effectiveness. + public ZlibStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level) + : this(stream, mode, level, false) + { + } + + /// + /// Create a ZlibStream using the specified CompressionMode, and + /// explicitly specify whether the captive stream should be left open after + /// Deflation or Inflation. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Compress, the ZlibStream will use + /// the default compression level. + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// that will be re-read after + /// compression. Specify true for the parameter to leave the stream + /// open. + /// + /// + /// + /// See the other overloads of this constructor for example code. + /// + /// + /// + /// + /// The stream which will be read or written. This is called the + /// "captive" stream in other places in this documentation. + /// Indicates whether the ZlibStream will compress or decompress. + /// true if the application would like the stream to remain + /// open after inflation/deflation. + public ZlibStream(System.IO.Stream stream, CompressionMode mode, bool leaveOpen) + : this(stream, mode, CompressionLevel.Default, leaveOpen) + { + } + + /// + /// Create a ZlibStream using the specified CompressionMode + /// and the specified CompressionLevel, and explicitly specify + /// whether the stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// This constructor allows the application to request that the captive + /// stream remain open after the deflation or inflation occurs. By + /// default, after Close() is called on the stream, the captive + /// stream is also closed. In some cases this is not desired, for example + /// if the stream is a that will be + /// re-read after compression. Specify true for the parameter to leave the stream open. + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is + /// ignored. + /// + /// + /// + /// + /// + /// + /// This example shows how to use a ZlibStream to compress the data from a file, + /// and store the result into another file. The filestream remains open to allow + /// additional data to be written to it. + /// + /// + /// using (var output = System.IO.File.Create(fileToCompress + ".zlib")) + /// { + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// // can write additional data to the output stream here + /// } + /// + /// + /// Using output As FileStream = File.Create(fileToCompress & ".zlib") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// ' can write additional data to the output stream here. + /// End Using + /// + /// + /// + /// The stream which will be read or written. + /// + /// Indicates whether the ZlibStream will compress or decompress. + /// + /// + /// true if the application would like the stream to remain open after + /// inflation/deflation. + /// + /// + /// + /// A tuning knob to trade speed for effectiveness. This parameter is + /// effective only when mode is CompressionMode.Compress. + /// + public ZlibStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) + { + _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.ZLIB, leaveOpen); + } + + #region Zlib properties + + /// + /// This property sets the flush behavior on the stream. + /// Sorry, though, not sure exactly how to describe all the various settings. + /// + virtual public FlushType FlushMode + { + get { return (this._baseStream._flushMode); } + set + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + this._baseStream._flushMode = value; + } + } + + /// + /// The size of the working buffer for the compression codec. + /// + /// + /// + /// + /// The working buffer is used for all stream operations. The default size is + /// 1024 bytes. The minimum size is 128 bytes. You may get better performance + /// with a larger buffer. Then again, you might not. You would have to test + /// it. + /// + /// + /// + /// Set this before the first call to Read() or Write() on the + /// stream. If you try to set it afterwards, it will throw. + /// + /// + public int BufferSize + { + get + { + return this._baseStream._bufferSize; + } + set + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + if (this._baseStream._workingBuffer != null) + throw new ZlibException("The working buffer is already set."); + if (value < ZlibConstants.WorkingBufferSizeMin) + throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); + this._baseStream._bufferSize = value; + } + } + + /// Returns the total number of bytes input so far. + virtual public long TotalIn + { + get { return this._baseStream._z.TotalBytesIn; } + } + + /// Returns the total number of bytes output so far. + virtual public long TotalOut + { + get { return this._baseStream._z.TotalBytesOut; } + } + + #endregion + + #region System.IO.Stream methods + + /// + /// Dispose the stream. + /// + /// + /// + /// This may or may not result in a Close() call on the captive + /// stream. See the constructors that have a leaveOpen parameter + /// for more information. + /// + /// + /// This method may be invoked in two distinct scenarios. If disposing + /// == true, the method has been called directly or indirectly by a + /// user's code, for example via the public Dispose() method. In this + /// case, both managed and unmanaged resources can be referenced and + /// disposed. If disposing == false, the method has been called by the + /// runtime from inside the object finalizer and this method should not + /// reference other objects; in that case only unmanaged resources must + /// be referenced or disposed. + /// + /// + /// + /// indicates whether the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this._baseStream != null)) + this._baseStream.Close(); + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value depends on whether the captive stream supports reading. + /// + public override bool CanRead + { + get + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + return _baseStream._stream.CanRead; + } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + return _baseStream._stream.CanWrite; + } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + _baseStream.Flush(); + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotSupportedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the total bytes + /// written out, if used in writing, or the total bytes read in, if used in + /// reading. The count may refer to compressed bytes or uncompressed bytes, + /// depending on how you've used the stream. + /// + public override long Position + { + get + { + if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Writer) + return this._baseStream._z.TotalBytesOut; + if (this._baseStream._streamMode == Ionic.Zlib.ZlibBaseStream.StreamMode.Reader) + return this._baseStream._z.TotalBytesIn; + return 0; + } + + set { throw new NotSupportedException(); } + } + + /// + /// Read data from the stream. + /// + /// + /// + /// + /// + /// If you wish to use the ZlibStream to compress data while reading, + /// you can create a ZlibStream with CompressionMode.Compress, + /// providing an uncompressed data stream. Then call Read() on that + /// ZlibStream, and the data read will be compressed. If you wish to + /// use the ZlibStream to decompress data while reading, you can create + /// a ZlibStream with CompressionMode.Decompress, providing a + /// readable compressed data stream. Then call Read() on that + /// ZlibStream, and the data will be decompressed as it is read. + /// + /// + /// + /// A ZlibStream can be used for Read() or Write(), but + /// not both. + /// + /// + /// + /// + /// + /// The buffer into which the read data should be placed. + /// + /// + /// the offset within that data array to put the first byte read. + /// + /// the number of bytes to read. + /// + /// the number of bytes read + public override int Read(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + return _baseStream.Read(buffer, offset, count); + } + + /// + /// Calling this method always throws a . + /// + /// + /// The offset to seek to.... + /// IF THIS METHOD ACTUALLY DID ANYTHING. + /// + /// + /// The reference specifying how to apply the offset.... IF + /// THIS METHOD ACTUALLY DID ANYTHING. + /// + /// + /// nothing. This method always throws. + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + /// + /// Calling this method always throws a . + /// + /// + /// The new value for the stream length.... IF + /// THIS METHOD ACTUALLY DID ANYTHING. + /// + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// + /// If you wish to use the ZlibStream to compress data while writing, + /// you can create a ZlibStream with CompressionMode.Compress, + /// and a writable output stream. Then call Write() on that + /// ZlibStream, providing uncompressed data as input. The data sent to + /// the output stream will be the compressed form of the data written. If you + /// wish to use the ZlibStream to decompress data while writing, you + /// can create a ZlibStream with CompressionMode.Decompress, and a + /// writable output stream. Then call Write() on that stream, + /// providing previously compressed data. The data sent to the output stream + /// will be the decompressed form of the data written. + /// + /// + /// + /// A ZlibStream can be used for Read() or Write(), but not both. + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("ZlibStream"); + _baseStream.Write(buffer, offset, count); + } + #endregion + + + /// + /// Compress a string into a byte array using ZLIB. + /// + /// + /// + /// Uncompress it with . + /// + /// + /// + /// + /// + /// + /// + /// A string to compress. The string will first be encoded + /// using UTF8, then compressed. + /// + /// + /// The string in compressed form + public static byte[] CompressString(String s) + { + using (var ms = new MemoryStream()) + { + Stream compressor = + new ZlibStream(ms, CompressionMode.Compress, CompressionLevel.BestCompression); + ZlibBaseStream.CompressString(s, compressor); + return ms.ToArray(); + } + } + + + /// + /// Compress a byte array into a new byte array using ZLIB. + /// + /// + /// + /// Uncompress it with . + /// + /// + /// + /// + /// + /// + /// A buffer to compress. + /// + /// + /// The data in compressed form + public static byte[] CompressBuffer(byte[] b) + { + using (var ms = new MemoryStream()) + { + Stream compressor = + new ZlibStream( ms, CompressionMode.Compress, CompressionLevel.BestCompression ); + + ZlibBaseStream.CompressBuffer(b, compressor); + return ms.ToArray(); + } + } + + + /// + /// Uncompress a ZLIB-compressed byte array into a single string. + /// + /// + /// + /// + /// + /// + /// A buffer containing ZLIB-compressed data. + /// + /// + /// The uncompressed string + public static String UncompressString(byte[] compressed) + { + using (var input = new MemoryStream(compressed)) + { + Stream decompressor = + new ZlibStream(input, CompressionMode.Decompress); + + return ZlibBaseStream.UncompressString(compressed, decompressor); + } + } + + + /// + /// Uncompress a ZLIB-compressed byte array into a byte array. + /// + /// + /// + /// + /// + /// + /// A buffer containing ZLIB-compressed data. + /// + /// + /// The data in uncompressed form + public static byte[] UncompressBuffer(byte[] compressed) + { + using (var input = new MemoryStream(compressed)) + { + Stream decompressor = + new ZlibStream( input, CompressionMode.Decompress ); + + return ZlibBaseStream.UncompressBuffer(compressed, decompressor); + } + } + + } + + +} \ No newline at end of file diff --git a/dotNetZip/Zlib/properties/AssemblyInfo.cs b/dotNetZip/Zlib/properties/AssemblyInfo.cs new file mode 100644 index 0000000..72b263c Binary files /dev/null and b/dotNetZip/Zlib/properties/AssemblyInfo.cs differ diff --git a/dotNetZip/Zlib/zlib-10.vsmdi b/dotNetZip/Zlib/zlib-10.vsmdi new file mode 100644 index 0000000..8aa6a31 --- /dev/null +++ b/dotNetZip/Zlib/zlib-10.vsmdi @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dotNetZip/clean.ps1 b/dotNetZip/clean.ps1 new file mode 100644 index 0000000..b4db52d --- /dev/null +++ b/dotNetZip/clean.ps1 @@ -0,0 +1,80 @@ +# ------------------------------------------------------- +# clean.ps1 +# +# Cleans the various project outputs. To be used prior to zipping +# up the source tree. +# +# This script is part of DotNetZip. +# DotNetZip is Copyright 2008-2011 Dino Chiesa. +# +# DotNetZip is licensed under the MS-PL. See the accompanying +# License.txt file. +# +# Last Updated: <2011-July-30 15:54:25> +# +# ------------------------------------------------------- + +$msbuild = "c:\.net4.0\msbuild.exe" +$dirsToClean = @("Zip", + "Zip Reduced", + "Zip CF", + "Zip SL", + "Zip Tests", + "Zlib", + "Zlib CF", + "Zlib SL DLL", + "Zlib Tests", + "BZip2", + "BZip2 CF", + "BZip2 SL DLL", + "BZip2 Tests", + "Examples\C#\CreateZip", + "Examples\C#\ReadZip", + "Examples\C#\WinForms-QuickZip", + "Examples\C#\ZipDir", + "Examples\C#\ZipTreeView", + "Examples\VB\Quick-Unzip", + "Examples\VB\WinForms-DotNetZip", + "Examples\VB\WinForms-TreeViewZip", + "Tools\Unzip", + "Tools\BZip2", + "Tools\GZip", + "Tools\Zipit", + "Tools\ConvertZipToSfx", + "Tools\WinFormsApp" + ) + + +get-childitem -filter *.csproj~ -recurse | remove-item + + +$saveloc = get-location + +Write-Host "" +Write-Host "Running MSBuild /t:Clean ..." + +foreach ($dir in $dirsToClean) { + Write-Host (' {0}' -f $dir) + set-location $dir + $expr = $msbuild + " /nologo /noconsolelogger /t:Clean /p:Configuration=Release" + Invoke-Expression $expr + $expr = $msbuild + " /nologo /noconsolelogger /t:Clean /p:Configuration=Debug" + Invoke-Expression $expr + set-location $saveloc +} + +Write-Host "" +Write-Host "Removing bin and obj directories ..." + +foreach ($dir in $dirsToClean) { + Write-Host (' {0}' -f $dir) + set-location $dir + foreach ($subdir in @("bin", "obj")) { + if (Test-Path $subdir) { + remove-item $subdir -recurse + } + } + set-location $saveloc +} + + diff --git a/ePubReader/BuildProcessTemplates/DefaultTemplate.11.1.xaml b/ePubReader/BuildProcessTemplates/DefaultTemplate.11.1.xaml new file mode 100644 index 0000000..bf54edf --- /dev/null +++ b/ePubReader/BuildProcessTemplates/DefaultTemplate.11.1.xaml @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings()] + [False] + [New Microsoft.TeamFoundation.Build.Workflow.Activities.TestSpecList(New Microsoft.TeamFoundation.Build.Workflow.Activities.AgileTestPlatformSpec("**\*test*.dll"))] + ["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"] + [False] + [True] + [True] + [Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All] + + + + [Microsoft.TeamFoundation.Build.Workflow.Activities.CodeAnalysisOption.AsConfigured] + [True] + [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] + [True] + [New Microsoft.TeamFoundation.Build.Workflow.Activities.SourceAndSymbolServerSettings(True, Nothing)] + [True] + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] + [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] + + + + + + + All + 11.0 + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ePubReader/BuildProcessTemplates/LabDefaultTemplate.11.xaml b/ePubReader/BuildProcessTemplates/LabDefaultTemplate.11.xaml new file mode 100644 index 0000000..9e1fb0b --- /dev/null +++ b/ePubReader/BuildProcessTemplates/LabDefaultTemplate.11.xaml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + 11.0 + + + + + + 920,3702 + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + True + + + + + + + [LabWorkflowParameters.BuildDetails.BuildUri] + + + [ChildBuildDetail.Uri] + + + + + + + + + + + + [BuildLocation] + + + [If(LabWorkflowParameters.BuildDetails.Configuration Is Nothing, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsEmpty Or (SelectedBuildDetail.Information.GetNodesByType(Microsoft.TeamFoundation.Build.Common.InformationTypes.ConfigurationSummary, True)).Count = 1, BuildLocation, If(LabWorkflowParameters.BuildDetails.Configuration.IsPlatformEmptyOrAnyCpu, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration, BuildLocation + "\" + LabWorkflowParameters.BuildDetails.Configuration.Platform + "\" + LabWorkflowParameters.BuildDetails.Configuration.Configuration)))] + + + + + + + + + + + + [LabEnvironmentUri] + + + [LabWorkflowParameters.EnvironmentDetails.LabEnvironmentUri.ToString()] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [PostDeploymentSnapshotName] + + + [If(LabWorkflowParameters.BuildDetails.IsTeamSystemBuild = True,String.Format("{0}_{1}_{2}", LabWorkflowParameters.DeploymentDetails.PostDeploymentSnapshotName, BuildNumber,BuildDetail.BuildNumber),String.Format("{0}_{1}", LabWorkflowParameters.DeploymentDetails.PostDeploymentSnapshotName, BuildDetail.BuildNumber))] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [BuildStatus] + + + [Microsoft.TeamFoundation.Build.Client.BuildStatus.PartiallySucceeded] + + + + + + + [BuildStatus] + + + [Microsoft.TeamFoundation.Build.Client.BuildStatus.Failed] + + + + + + + + + + + + \ No newline at end of file diff --git a/ePubReader/BuildProcessTemplates/UpgradeTemplate.xaml b/ePubReader/BuildProcessTemplates/UpgradeTemplate.xaml new file mode 100644 index 0000000..b3ee07f --- /dev/null +++ b/ePubReader/BuildProcessTemplates/UpgradeTemplate.xaml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + [New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly }] + + + + [Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto] + [False] + [False] + + + + + + + + + + [Microsoft.TeamFoundation.VersionControl.Client.RecursionType.OneLevel] + [Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal] + + + + All + Assembly references and imported namespaces serialized as XML namespaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ePubReader/ExampleWebSite/Default.aspx b/ePubReader/ExampleWebSite/Default.aspx new file mode 100644 index 0000000..aeb68d7 --- /dev/null +++ b/ePubReader/ExampleWebSite/Default.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> + + + + + + + + +
+
+ +
+
+ + diff --git a/ePubReader/ExampleWebSite/Default.aspx.cs b/ePubReader/ExampleWebSite/Default.aspx.cs new file mode 100644 index 0000000..c975306 --- /dev/null +++ b/ePubReader/ExampleWebSite/Default.aspx.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using eBdb.EpubReader; + +public partial class _Default : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + Epub epub = new Epub(ConfigurationManager.AppSettings["EpubFilesPath"] + "LoLasartan.epub"); + Response.Clear(); + Response.Write(epub.GetContentAsHtml()); + Response.End(); + } +} \ No newline at end of file diff --git a/ePubReader/ExampleWebSite/web.config b/ePubReader/ExampleWebSite/web.config new file mode 100644 index 0000000..0e701d4 --- /dev/null +++ b/ePubReader/ExampleWebSite/web.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ePubReader/Tester/Program.cs b/ePubReader/Tester/Program.cs new file mode 100644 index 0000000..a1087b8 --- /dev/null +++ b/ePubReader/Tester/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using eBdb.EpubReader; + +namespace Tester { + class Program { + static void Main(string[] args) { + string[] files = Directory.GetFiles(@"c:\Inetpub\ePubReader\temp\load tests\"); + Console.WriteLine("Started"); + foreach (var file in files) { + try { + Epub epub = new Epub(file); + } catch (Exception e) { + Console.WriteLine("FileName: " + file + ", Exception: " + e.Message); + } + } + Console.WriteLine("Finished"); + Console.ReadLine(); + } + } +} diff --git a/ePubReader/Tester/Properties/AssemblyInfo.cs b/ePubReader/Tester/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..cc84be5 --- /dev/null +++ b/ePubReader/Tester/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tester")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tester")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ba3a1310-fea5-44a2-8618-e05645702d88")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ePubReader/Tester/Tester.csproj b/ePubReader/Tester/Tester.csproj new file mode 100644 index 0000000..ca6596b --- /dev/null +++ b/ePubReader/Tester/Tester.csproj @@ -0,0 +1,82 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {5C57C5F8-15C8-436C-B711-672953301313} + Exe + Properties + Tester + Tester + v4.0 + + + 512 + SAK + SAK + SAK + SAK + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB} + ePubReader + + + + + + + + + + + + + \ No newline at end of file diff --git a/ePubReader/Tester/app.config b/ePubReader/Tester/app.config new file mode 100644 index 0000000..e365603 --- /dev/null +++ b/ePubReader/Tester/app.config @@ -0,0 +1,3 @@ + + + diff --git a/ePubReader/Tiny ePub/App.xaml b/ePubReader/Tiny ePub/App.xaml new file mode 100644 index 0000000..3e1655b --- /dev/null +++ b/ePubReader/Tiny ePub/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/ePubReader/Tiny ePub/App.xaml.cs b/ePubReader/Tiny ePub/App.xaml.cs new file mode 100644 index 0000000..2703768 --- /dev/null +++ b/ePubReader/Tiny ePub/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace Tiny_ePub +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/ePubReader/Tiny ePub/BookInfoTemplate.txt b/ePubReader/Tiny ePub/BookInfoTemplate.txt new file mode 100644 index 0000000..d0e19b8 --- /dev/null +++ b/ePubReader/Tiny ePub/BookInfoTemplate.txt @@ -0,0 +1,10 @@ + + +

{title}

+

+Author(s): {authors}
+Publisher: {publisher} +

+{about} + + \ No newline at end of file diff --git a/ePubReader/Tiny ePub/MainWindow.xaml b/ePubReader/Tiny ePub/MainWindow.xaml new file mode 100644 index 0000000..d027d44 --- /dev/null +++ b/ePubReader/Tiny ePub/MainWindow.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ePubReader/Tiny ePub/MainWindow.xaml.cs b/ePubReader/Tiny ePub/MainWindow.xaml.cs new file mode 100644 index 0000000..af8376e --- /dev/null +++ b/ePubReader/Tiny ePub/MainWindow.xaml.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.IO; +using eBdb.EpubReader; + +namespace Tiny_ePub +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + Epub _epub = null; + + public MainWindow() + { + InitializeComponent(); + } + + private void MenuFileOpen_Click(object sender, RoutedEventArgs e) + { + try + { + Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog(); + ofd.DefaultExt = "epub"; + ofd.Filter = "EPub (*.epub)|*.epub|All Files (*.*)|*.*"; + Nullable results = ofd.ShowDialog(); + + if (results == true) + { + //instantiate epub + _epub = new Epub(ofd.FileName); + + //retrieve document + BookDocBrowser.NavigateToString(_epub.GetContentAsHtml()); + + //build info page + BuildInfoPage(_epub); + + //build table of contents + foreach (var i in _epub.TOC) + { + foreach (var u in i.Children) + { + Console.WriteLine(u.Title); + } + } + + BookDocBrowser.Visibility = System.Windows.Visibility.Visible; + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + private void BuildInfoPage(Epub pub) + { + try + { + var reader = new StreamReader("BookInfoTemplate.txt"); + var template = reader.ReadToEnd(); + var title = string.Empty; + var authors = string.Empty; + var publisher = string.Empty; + var about = string.Empty; + + //get title + + if ((pub.Title.Count > 0) && (!string.IsNullOrEmpty(pub.Title[0]))) + { + title = pub.Title[0]; + } + else + { + title = "No title provided"; + } + + //get authors + if (pub.Creator.Count > 0) + { + foreach (var a in pub.Creator) + { + authors = a + ", "; + } + + //remove last ", " + if (!string.IsNullOrEmpty(authors)) + { + authors = authors.Substring(0, authors.Length - 3); + } + } + else + { + authors = "No authors listed"; + } + + //get publisher + if ((pub.Publisher.Count > 0) && (!string.IsNullOrEmpty(pub.Publisher[0]))) + { + publisher = pub.Publisher[0]; + } + else + { + publisher = "No publisher listed"; + } + + //get about + if ((pub.Description.Count > 0) && (!string.IsNullOrEmpty(pub.Description[0].ToString()))) + { + about = pub.Description[0]; + if (!about.Contains("

")) + { + about = "

About:
" + about + "

"; + } + else + { + about = about.Insert(about.IndexOf("

") + 3, "About:
"); + } + about = about.Replace("\\u", " "); + } + else + { + about = "No description provided"; + } + + //update template + template = template.Replace("{title}", title); + template = template.Replace("{authors}", authors); + template = template.Replace("{publisher}", publisher); + template = template.Replace("{about}", about); + + InfoDocBrowser.NavigateToString(template); + + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + private void MenuFileExit_Click(object sender, RoutedEventArgs e) + { + Close(); + } + + private void MenuViewBoookInfo_Click(object sender, RoutedEventArgs e) + { + BookDocBrowser.Visibility = System.Windows.Visibility.Collapsed; + InfoDocBrowser.Visibility = System.Windows.Visibility.Visible; + } + + private void MenuViewContent_Click(object sender, RoutedEventArgs e) + { + MessageBox.Show("not implemented"); + } + + private void MenuViewBook_Click(object sender, RoutedEventArgs e) + { + InfoDocBrowser.Visibility = System.Windows.Visibility.Collapsed; + BookDocBrowser.Visibility = System.Windows.Visibility.Visible; + } + } +} diff --git a/ePubReader/Tiny ePub/Properties/AssemblyInfo.cs b/ePubReader/Tiny ePub/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8245e77 --- /dev/null +++ b/ePubReader/Tiny ePub/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tiny ePub")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tiny ePub")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.2")] +[assembly: AssemblyFileVersion("1.0.0.2")] diff --git a/ePubReader/Tiny ePub/Properties/Resources.Designer.cs b/ePubReader/Tiny ePub/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ea3a8b2 --- /dev/null +++ b/ePubReader/Tiny ePub/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tiny_ePub.Properties { + using System; + + + ///

+ /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tiny_ePub.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/ePubReader/Tiny ePub/Properties/Resources.resx b/ePubReader/Tiny ePub/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ePubReader/Tiny ePub/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ePubReader/Tiny ePub/Properties/Settings.Designer.cs b/ePubReader/Tiny ePub/Properties/Settings.Designer.cs new file mode 100644 index 0000000..1670ecd --- /dev/null +++ b/ePubReader/Tiny ePub/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tiny_ePub.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/ePubReader/Tiny ePub/Properties/Settings.settings b/ePubReader/Tiny ePub/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/ePubReader/Tiny ePub/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ePubReader/Tiny ePub/Tiny ePub.csproj b/ePubReader/Tiny ePub/Tiny ePub.csproj new file mode 100644 index 0000000..75eb3ea --- /dev/null +++ b/ePubReader/Tiny ePub/Tiny ePub.csproj @@ -0,0 +1,120 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4} + WinExe + Properties + Tiny_ePub + Tiny ePub + v4.0 + + + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + SAK + SAK + SAK + SAK + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB} + ePubReader + + + + + Always + + + + + \ No newline at end of file diff --git a/ePubReader/Tiny ePub/app.config b/ePubReader/Tiny ePub/app.config new file mode 100644 index 0000000..e365603 --- /dev/null +++ b/ePubReader/Tiny ePub/app.config @@ -0,0 +1,3 @@ + + + diff --git a/ePubReader/UnitTests/Epub_Tests.cs b/ePubReader/UnitTests/Epub_Tests.cs new file mode 100644 index 0000000..401930b --- /dev/null +++ b/ePubReader/UnitTests/Epub_Tests.cs @@ -0,0 +1,312 @@ +using System.IO; +using eBdb.EpubReader; +using NUnit.Framework; + +namespace UnitTests { + [TestFixture] + public class Epub_Tests { + private Epub _FitzgeraldBook; + private Epub _LehovBook; + private Epub _LoLeSartanBooks; + + [TestFixtureSetUp] + public void SetupBooks() { + _FitzgeraldBook = new Epub(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fitzgerald-curious-case-of-benjamin-button.epub"); + _LehovBook = new Epub(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\LeholLhitpalelLehov_nadav.epub"); + _LoLeSartanBooks = new Epub(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\LoLasartan.epub"); + } + + [Test] + public void Test_UUID() { + Assert.AreEqual("urn:uuid:CBC56AFC-6C29-1014-8672-92A1DF1F0AF1", _FitzgeraldBook.UUID); + Assert.AreEqual("urn:uuid:9c8b24d6-a653-f975-e70c-4ad8962f888e", _LehovBook.UUID); + Assert.AreEqual("urn:uuid:eb653363-ebc6-236c-c20b-ba3fc1cfa513", _LoLeSartanBooks.UUID); + } + + [Test] + public void Test_ID() { + Assert.AreEqual(1, _FitzgeraldBook.ID.Count); + Assert.AreEqual("urn:uuid:CBC56AFC-6C29-1014-8672-92A1DF1F0AF1", _FitzgeraldBook.ID[0]); + + Assert.AreEqual(1, _LehovBook.ID.Count); + Assert.AreEqual("urn:uuid:9c8b24d6-a653-f975-e70c-4ad8962f888e", _LehovBook.ID[0]); + + Assert.AreEqual(1, _LoLeSartanBooks.ID.Count); + Assert.AreEqual("urn:uuid:eb653363-ebc6-236c-c20b-ba3fc1cfa513", _LoLeSartanBooks.ID[0]); + } + + [Test] + public void Test_Title() { + Assert.AreEqual(1, _FitzgeraldBook.Title.Count); + Assert.AreEqual("The Curious Case of Benjamin Button", _FitzgeraldBook.Title[0]); + + Assert.AreEqual(1, _LehovBook.Title.Count); + Assert.AreEqual("לאכול להתפלל לאהוב", _LehovBook.Title[0]); + + Assert.AreEqual(0, _LoLeSartanBooks.Title.Count); + } + + [Test] + public void Test_Language() { + Assert.AreEqual(1, _FitzgeraldBook.Language.Count); + Assert.AreEqual("en-gb", _FitzgeraldBook.Language[0]); + + Assert.AreEqual(1, _LehovBook.Language.Count); + Assert.AreEqual("he", _LehovBook.Language[0]); + + Assert.AreEqual(1, _LoLeSartanBooks.Language.Count); + Assert.AreEqual("en", _LoLeSartanBooks.Language[0]); + } + + [Test] + public void Test_Creator() { + Assert.AreEqual(1, _FitzgeraldBook.Creator.Count); + Assert.AreEqual("F. Scott Fitzgerald", _FitzgeraldBook.Creator[0]); + + Assert.AreEqual(1, _LehovBook.Creator.Count); + Assert.AreEqual("אליזבת גילברט", _LehovBook.Creator[0]); + + Assert.AreEqual(0, _LoLeSartanBooks.Creator.Count); + } + + [Test] + public void Test_Description() { + Assert.AreEqual(0, _FitzgeraldBook.Description.Count); + + Assert.AreEqual(0, _LehovBook.Description.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Description.Count); + } + + [Test] + public void Test_Date() { + Assert.AreEqual(2, _FitzgeraldBook.Date.Count); + Assert.AreEqual("original-publication", _FitzgeraldBook.Date[0].Type); + Assert.AreEqual("1922", _FitzgeraldBook.Date[0].Date); + Assert.AreEqual("epub-publication", _FitzgeraldBook.Date[1].Type); + Assert.AreEqual("2011-06-15", _FitzgeraldBook.Date[1].Date); + + Assert.AreEqual(0, _LehovBook.Date.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Date.Count); + } + + [Test] + public void Test_Publisher() { + Assert.AreEqual(1, _FitzgeraldBook.Publisher.Count); + Assert.AreEqual("epubBooks (www.epubbooks.com)", _FitzgeraldBook.Publisher[0]); + + Assert.AreEqual(0, _LehovBook.Publisher.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Publisher.Count); + } + + [Test] + public void Test_Contributer() { + Assert.AreEqual(0, _FitzgeraldBook.Contributer.Count); + + Assert.AreEqual(0, _LehovBook.Contributer.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Contributer.Count); + } + + [Test] + public void Test_Type() { + Assert.AreEqual(0, _FitzgeraldBook.Type.Count); + + Assert.AreEqual(0, _LehovBook.Type.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Type.Count); + } + + [Test] + public void Test_Format() { + Assert.AreEqual(0, _FitzgeraldBook.Format.Count); + + Assert.AreEqual(0, _LehovBook.Format.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Format.Count); + } + + [Test] + public void Test_Subject() { + Assert.AreEqual(1, _FitzgeraldBook.Subject.Count); + Assert.AreEqual("Short Stories", _FitzgeraldBook.Subject[0]); + + Assert.AreEqual(0, _LehovBook.Subject.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Subject.Count); + } + + [Test] + public void Test_Source() { + Assert.AreEqual(1, _FitzgeraldBook.Source.Count); + Assert.AreEqual("Project Gutenberg", _FitzgeraldBook.Source[0]); + + Assert.AreEqual(0, _LehovBook.Source.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Source.Count); + } + + [Test] + public void Test_Relation() { + Assert.AreEqual(0, _FitzgeraldBook.Relation.Count); + + Assert.AreEqual(0, _LehovBook.Relation.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Relation.Count); + } + + [Test] + public void Test_Coverage() { + Assert.AreEqual(0, _FitzgeraldBook.Coverage.Count); + + Assert.AreEqual(0, _LehovBook.Coverage.Count); + + Assert.AreEqual(0, _LoLeSartanBooks.Coverage.Count); + } + + [Test] + public void Test_Rights() { + Assert.AreEqual(1, _FitzgeraldBook.Rights.Count); + Assert.IsTrue(_FitzgeraldBook.Rights[0].Trim().StartsWith("Provided for free by epubBooks.com. Not for commercial use.")); + + Assert.AreEqual(1, _LehovBook.Rights.Count); + Assert.AreEqual("כנרת זמורה-ביתן", _LehovBook.Rights[0]); + + Assert.AreEqual(0, _LoLeSartanBooks.Rights.Count); + } + + [Test] + public void Test_Content() { + Assert.AreEqual(13, _FitzgeraldBook.Content.Count); + + Assert.AreEqual("title.html", ((ContentData)_FitzgeraldBook.Content[0]).FileName); + Assert.AreEqual("epubbooksinfo.html", ((ContentData)_FitzgeraldBook.Content[1]).FileName); + Assert.AreEqual("chapter-001.html", ((ContentData)_FitzgeraldBook.Content[2]).FileName); + Assert.AreEqual("chapter-002.html", ((ContentData)_FitzgeraldBook.Content[3]).FileName); + Assert.AreEqual("chapter-003.html", ((ContentData)_FitzgeraldBook.Content[4]).FileName); + Assert.AreEqual("chapter-004.html", ((ContentData)_FitzgeraldBook.Content[5]).FileName); + Assert.AreEqual("chapter-005.html", ((ContentData)_FitzgeraldBook.Content[6]).FileName); + Assert.AreEqual("chapter-006.html", ((ContentData)_FitzgeraldBook.Content[7]).FileName); + Assert.AreEqual("chapter-007.html", ((ContentData)_FitzgeraldBook.Content[8]).FileName); + Assert.AreEqual("chapter-008.html", ((ContentData)_FitzgeraldBook.Content[9]).FileName); + Assert.AreEqual("chapter-009.html", ((ContentData)_FitzgeraldBook.Content[10]).FileName); + Assert.AreEqual("chapter-010.html", ((ContentData)_FitzgeraldBook.Content[11]).FileName); + Assert.AreEqual("chapter-011.html", ((ContentData)_FitzgeraldBook.Content[12]).FileName); + + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\title.html"), ((ContentData)_FitzgeraldBook.Content[0]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\epubbooksinfo.html"), ((ContentData)_FitzgeraldBook.Content[1]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-001.html"), ((ContentData)_FitzgeraldBook.Content[2]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-002.html"), ((ContentData)_FitzgeraldBook.Content[3]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-003.html"), ((ContentData)_FitzgeraldBook.Content[4]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-004.html"), ((ContentData)_FitzgeraldBook.Content[5]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-005.html"), ((ContentData)_FitzgeraldBook.Content[6]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-006.html"), ((ContentData)_FitzgeraldBook.Content[7]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-007.html"), ((ContentData)_FitzgeraldBook.Content[8]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-008.html"), ((ContentData)_FitzgeraldBook.Content[9]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-009.html"), ((ContentData)_FitzgeraldBook.Content[10]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-010.html"), ((ContentData)_FitzgeraldBook.Content[11]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\chapter-011.html"), ((ContentData)_FitzgeraldBook.Content[12]).Content); + + Assert.AreEqual(117, _LehovBook.Content.Count); + Assert.AreEqual("LeholLhitpalelLehov-3.xhtml", ((ContentData)_LehovBook.Content[0]).FileName); + Assert.AreEqual("LeholLhitpalelLehov-4.xhtml", ((ContentData)_LehovBook.Content[1]).FileName); + Assert.AreEqual("LeholLhitpalelLehov-5.xhtml", ((ContentData)_LehovBook.Content[2]).FileName); + Assert.AreEqual("LeholLhitpalelLehov-117.xhtml", ((ContentData)_LehovBook.Content[114]).FileName); + Assert.AreEqual("LeholLhitpalelLehov-118.xhtml", ((ContentData)_LehovBook.Content[115]).FileName); + Assert.AreEqual("LeholLhitpalelLehov-119.xhtml", ((ContentData)_LehovBook.Content[116]).FileName); + + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-3.xhtml"), ((ContentData)_LehovBook.Content[0]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-4.xhtml"), ((ContentData)_LehovBook.Content[1]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-5.xhtml"), ((ContentData)_LehovBook.Content[2]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-117.xhtml"), ((ContentData)_LehovBook.Content[114]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-118.xhtml"), ((ContentData)_LehovBook.Content[115]).Content); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-119.xhtml"), ((ContentData)_LehovBook.Content[116]).Content); + + Assert.AreEqual(1, _LoLeSartanBooks.Content.Count); + Assert.AreEqual("LoLasartan1.xhtml", ((ContentData)_LoLeSartanBooks.Content[0]).FileName); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lolesartan\OEBPS\LoLasartan1.xhtml"), ((ContentData)_LoLeSartanBooks.Content[0]).Content); + } + + [Test] + public void Test_ExtendedData() { + Assert.AreEqual(4, _FitzgeraldBook.ExtendedData.Count); + Assert.AreEqual("css/titlepage.css", ((ExtendedData)_FitzgeraldBook.ExtendedData[0]).FileName); + Assert.AreEqual("text/css", ((ExtendedData)_FitzgeraldBook.ExtendedData[0]).MimeType); + Assert.IsTrue(((ExtendedData)_FitzgeraldBook.ExtendedData[0]).IsText); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\css\titlepage.css"), ((ExtendedData)_FitzgeraldBook.ExtendedData[0]).Content); + + Assert.AreEqual("images/epubbooks-logo.png", ((ExtendedData)_FitzgeraldBook.ExtendedData[2]).FileName); + Assert.AreEqual("image/png", ((ExtendedData)_FitzgeraldBook.ExtendedData[2]).MimeType); + Assert.IsFalse(((ExtendedData)_FitzgeraldBook.ExtendedData[2]).IsText); + + Assert.AreEqual(23, _LehovBook.ExtendedData.Count); + Assert.AreEqual("images/460878-5_fmt.jpeg", ((ExtendedData)_LehovBook.ExtendedData[1]).FileName); + Assert.AreEqual("image/jpeg", ((ExtendedData)_LehovBook.ExtendedData[1]).MimeType); + Assert.IsFalse(((ExtendedData)_LehovBook.ExtendedData[1]).IsText); + + Assert.AreEqual(25, _LoLeSartanBooks.ExtendedData.Count); + Assert.AreEqual("images/figure 19_fmt.jpeg", ((ExtendedData)_LoLeSartanBooks.ExtendedData[23]).FileName); + Assert.AreEqual("image/jpeg", ((ExtendedData)_LoLeSartanBooks.ExtendedData[23]).MimeType); + Assert.IsFalse(((ExtendedData)_LoLeSartanBooks.ExtendedData[23]).IsText); + + Assert.AreEqual("toc.ncx", ((ExtendedData)_LoLeSartanBooks.ExtendedData[0]).FileName); + Assert.AreEqual("application/x-dtbncx+xml", ((ExtendedData)_LoLeSartanBooks.ExtendedData[0]).MimeType); + Assert.IsTrue(((ExtendedData)_LoLeSartanBooks.ExtendedData[0]).IsText); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lolesartan\OEBPS\toc.ncx"), ((ExtendedData)_LoLeSartanBooks.ExtendedData[0]).Content); + } + + [Test] + public void Test_TOC() { + Assert.AreEqual(13, _FitzgeraldBook.TOC.Count); + Assert.AreEqual(0, _FitzgeraldBook.TOC[0].Children.Count); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\fritz\OPS\title.html"), _FitzgeraldBook.TOC[0].ContentData.Content); + Assert.AreEqual("navpoint-1", _FitzgeraldBook.TOC[0].ID); + Assert.AreEqual(1, _FitzgeraldBook.TOC[0].Order); + Assert.AreEqual("title.html", _FitzgeraldBook.TOC[0].Source); + Assert.AreEqual("Title Page", _FitzgeraldBook.TOC[0].Title); + + Assert.AreEqual("navpoint-2", _FitzgeraldBook.TOC[1].ID); + Assert.AreEqual("navpoint-3", _FitzgeraldBook.TOC[2].ID); + Assert.AreEqual("navpoint-4", _FitzgeraldBook.TOC[3].ID); + Assert.AreEqual("navpoint-5", _FitzgeraldBook.TOC[4].ID); + Assert.AreEqual("navpoint-6", _FitzgeraldBook.TOC[5].ID); + Assert.AreEqual("navpoint-7", _FitzgeraldBook.TOC[6].ID); + Assert.AreEqual("navpoint-8", _FitzgeraldBook.TOC[7].ID); + Assert.AreEqual("navpoint-9", _FitzgeraldBook.TOC[8].ID); + Assert.AreEqual("navpoint-10", _FitzgeraldBook.TOC[9].ID); + Assert.AreEqual("navpoint-11", _FitzgeraldBook.TOC[10].ID); + Assert.AreEqual("navpoint-12", _FitzgeraldBook.TOC[11].ID); + Assert.AreEqual("navpoint-13", _FitzgeraldBook.TOC[12].ID); + + Assert.AreEqual(11, _LehovBook.TOC.Count); + Assert.AreEqual(35, _LehovBook.TOC[6].Children.Count); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-9.xhtml"), _LehovBook.TOC[6].ContentData.Content); + Assert.AreEqual("navpoint-7", _LehovBook.TOC[6].ID); + Assert.AreEqual(8, _LehovBook.TOC[6].Order); + Assert.AreEqual("LeholLhitpalelLehov-9.xhtml", _LehovBook.TOC[6].Source); + Assert.AreEqual("ספר ראשון - איטליה", _LehovBook.TOC[6].Title); + + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lehov\OEBPS\LeholLhitpalelLehov-10.xhtml"), _LehovBook.TOC[6].Children[0].ContentData.Content); + Assert.AreEqual("navpoint-8", _LehovBook.TOC[6].Children[0].ID); + Assert.AreEqual(9, _LehovBook.TOC[6].Children[0].Order); + Assert.AreEqual("LeholLhitpalelLehov-10.xhtml", _LehovBook.TOC[6].Children[0].Source); + Assert.AreEqual("1", _LehovBook.TOC[6].Children[0].Title); + + Assert.AreEqual(1, _LoLeSartanBooks.TOC.Count); + Assert.AreEqual(16, _LoLeSartanBooks.TOC[0].Children.Count); + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lolesartan\OEBPS\LoLasartan1.xhtml"), _LoLeSartanBooks.TOC[0].Children[0].ContentData.Content); + Assert.AreEqual("navpoint-1", _LoLeSartanBooks.TOC[0].Children[0].ID); + Assert.AreEqual(2, _LoLeSartanBooks.TOC[0].Children[0].Order); + Assert.AreEqual("LoLasartan1.xhtml#toc-anchor", _LoLeSartanBooks.TOC[0].Children[0].Source); + Assert.AreEqual("מבוא", _LoLeSartanBooks.TOC[0].Children[0].Title); + + Assert.AreEqual(File.ReadAllText(@"c:\Inetpub\ePubReader\UnitTests\UnitTestsBooks\lolesartan\OEBPS\LoLasartan1.xhtml"), _LoLeSartanBooks.TOC[0].Children[15].ContentData.Content); + Assert.AreEqual("navpoint-16", _LoLeSartanBooks.TOC[0].Children[15].ID); + Assert.AreEqual(17, _LoLeSartanBooks.TOC[0].Children[15].Order); + Assert.AreEqual("LoLasartan1.xhtml#toc-anchor-15", _LoLeSartanBooks.TOC[0].Children[15].Source); + Assert.AreEqual("חלק ראשון - הרפואה התזונתית החדשה", _LoLeSartanBooks.TOC[0].Children[15].Title); + } + } +} diff --git a/ePubReader/UnitTests/Properties/AssemblyInfo.cs b/ePubReader/UnitTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5ed22fc --- /dev/null +++ b/ePubReader/UnitTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("UnitTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UnitTests")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0ba16577-e03f-487c-acc7-e5f0f77671b6")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ePubReader/UnitTests/UnitTests.csproj b/ePubReader/UnitTests/UnitTests.csproj new file mode 100644 index 0000000..e2a346f --- /dev/null +++ b/ePubReader/UnitTests/UnitTests.csproj @@ -0,0 +1,80 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB} + Library + Properties + UnitTests + UnitTests + v4.0 + 512 + SAK + SAK + SAK + SAK + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\Program Files (x86)\NUnit 2.5.10\bin\net-2.0\framework\nunit.framework.dll + + + + + + + + + + + + + + + + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB} + ePubReader + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ePubReader/ePubReader.sln b/ePubReader/ePubReader.sln new file mode 100644 index 0000000..4071e5a --- /dev/null +++ b/ePubReader/ePubReader.sln @@ -0,0 +1,125 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ePubReader", "ePubReader\ePubReader.csproj", "{B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}" +EndProject +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "ExampleWebSite", "ExampleWebSite", "{A4D2021D-D544-4C4C-854C-0827018B1CCB}" + ProjectSection(WebsiteProperties) = preProject + SccProjectName = "SAK" + SccAuxPath = "SAK" + SccLocalPath = "SAK" + SccProvider = "SAK" + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" + ProjectReferences = "{B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}|ePubReader.dll;" + Debug.AspNetCompiler.VirtualPath = "/ExampleWebSite" + Debug.AspNetCompiler.PhysicalPath = "ExampleWebSite\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\ExampleWebSite\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/ExampleWebSite" + Release.AspNetCompiler.PhysicalPath = "ExampleWebSite\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\ExampleWebSite\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + VWDPort = "50676" + DefaultWebSiteLanguage = "Visual C#" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{5C57C5F8-15C8-436C-B711-672953301313}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiny ePub", "Tiny ePub\Tiny ePub.csproj", "{AC3A0521-3436-4ED5-AB10-EA40C13B91F4}" +EndProject +Global + GlobalSection(TeamFoundationVersionControl) = preSolution + SccNumberOfProjects = 6 + SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} + SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs14 + SccLocalPath0 = . + SccProjectUniqueName1 = ePubReader\\ePubReader.csproj + SccProjectName1 = ePubReader + SccLocalPath1 = ePubReader + SccWebProject2 = true + SccProjectUniqueName2 = ExampleWebSite + SccProjectName2 = ExampleWebSite + SccLocalPath2 = ExampleWebSite + SccProjectEnlistmentChoice2 = 2 + SccProjectUniqueName3 = Tester\\Tester.csproj + SccProjectName3 = Tester + SccLocalPath3 = Tester + SccProjectUniqueName4 = UnitTests\\UnitTests.csproj + SccProjectName4 = UnitTests + SccLocalPath4 = UnitTests + SccProjectUniqueName5 = Tiny\u0020ePub\\Tiny\u0020ePub.csproj + SccProjectName5 = Tiny\u0020ePub + SccLocalPath5 = Tiny\u0020ePub + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|Any CPU.Build.0 = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB}.Release|x86.ActiveCfg = Release|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Debug|x86.ActiveCfg = Debug|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Release|Any CPU.Build.0 = Release|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {48EF02EE-9F9F-4AC3-AEAD-05F1788A0ABB}.Release|x86.ActiveCfg = Release|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Debug|x86.ActiveCfg = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Release|Any CPU.Build.0 = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Release|Mixed Platforms.Build.0 = Debug|Any CPU + {A4D2021D-D544-4C4C-854C-0827018B1CCB}.Release|x86.ActiveCfg = Debug|Any CPU + {5C57C5F8-15C8-436C-B711-672953301313}.Debug|Any CPU.ActiveCfg = Debug|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Debug|x86.ActiveCfg = Debug|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Debug|x86.Build.0 = Debug|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Release|Any CPU.ActiveCfg = Release|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Release|Mixed Platforms.Build.0 = Release|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Release|x86.ActiveCfg = Release|x86 + {5C57C5F8-15C8-436C-B711-672953301313}.Release|x86.Build.0 = Release|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Debug|Any CPU.ActiveCfg = Debug|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Debug|x86.ActiveCfg = Debug|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Debug|x86.Build.0 = Debug|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Release|Any CPU.ActiveCfg = Release|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Release|Mixed Platforms.Build.0 = Release|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Release|x86.ActiveCfg = Release|x86 + {AC3A0521-3436-4ED5-AB10-EA40C13B91F4}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ePubReader/ePubReader/ContentData.cs b/ePubReader/ePubReader/ContentData.cs new file mode 100644 index 0000000..9e5b7ca --- /dev/null +++ b/ePubReader/ePubReader/ContentData.cs @@ -0,0 +1,30 @@ +using System.IO; +using System.Text.RegularExpressions; +using Ionic.Zip; + +namespace eBdb.EpubReader { + public class ContentData { + private readonly ZipEntry _ZipEntry; + public string FileName { get; private set; } + public string Content { + get { + using (MemoryStream memoryStream = new MemoryStream()) { + _ZipEntry.Extract(memoryStream); + memoryStream.Position = 0; + + using (StreamReader reader = new StreamReader(memoryStream)) return reader.ReadToEnd(); + } + } + } + + public ContentData(string fileName, ZipEntry zipEntry) { + FileName = fileName; + _ZipEntry = zipEntry; + } + + public string GetContentAsPlainText() { + Match m = Regex.Match(Content, @"]*>.+", Utils.REO_csi); + return m.Success ? Utils.ClearText(m.Value) : ""; + } + } +} diff --git a/ePubReader/ePubReader/Date.cs b/ePubReader/ePubReader/Date.cs new file mode 100644 index 0000000..f08359e --- /dev/null +++ b/ePubReader/ePubReader/Date.cs @@ -0,0 +1,11 @@ +namespace eBdb.EpubReader { + public class DateData { + public string Type { get; private set; } + public string Date { get; private set; } + + public DateData(string type, string date) { + Type = type; + Date = date; + } + } +} diff --git a/ePubReader/ePubReader/Epub.cs b/ePubReader/ePubReader/Epub.cs new file mode 100644 index 0000000..0a3db4d --- /dev/null +++ b/ePubReader/ePubReader/Epub.cs @@ -0,0 +1,480 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Web; +using System.Xml.Linq; +using Ionic.Zip; +using eBdb.EpubReader.Properties; + +namespace eBdb.EpubReader { + public class Epub { + + #region Properties + //Note: Mandatory fields defined by OPF standard + public string UUID { get; private set; } + public List ID { get; private set; } + public List Title { get; private set; } + public List Language { get; private set; } + + //Note: Not mandatory fields by OPF standard + public List Creator { get; private set; } + public List Description { get; private set; } + public List Date { get; private set; } + public List Publisher { get; private set; } + public List Contributer { get; private set; } + public List Type { get; private set; } + public List Format { get; private set; } + public List Subject { get; private set; } + public List Source { get; private set; } + public List Relation { get; private set; } + public List Coverage { get; private set; } + public List Rights { get; private set; } + + public OrderedDictionary Content { get; private set; } + public OrderedDictionary ExtendedData { get; private set; } + public List TOC { get; private set; } + + private readonly ZipFile _EpubFile; + private readonly string _ContentOpfPath; + private string _TocFileName; + private readonly Hashtable _LinksMapping = new Hashtable(StringComparer.InvariantCultureIgnoreCase); + private string _CurrentFileName; + private static Regex _RefsRegex = new Regex(@"(?<\w+[^>]*?href\s*=\s*(""|'))(?[^""']*)(?(""|')[^>]*>)", Utils.REO_ci); + private static Regex _ExternalLinksRegex = new Regex(@"^\s*(http(s)?://|mailto:|ftp(s)?://)", Utils.REO_ci); + #endregion + + #region Constructor + public Epub(string ePubPath) { + ID = new List(); + Title = new List(); + Language = new List(); + + Creator = new List(); + Description = new List(); + Date = new List(); + Publisher = new List(); + Contributer = new List(); + Type = new List(); + Format = new List(); + Subject = new List(); + Source = new List(); + Relation = new List(); + Coverage = new List(); + Rights = new List(); + + Content = new OrderedDictionary(); + ExtendedData = new OrderedDictionary(); + TOC = new List(); + + if (File.Exists(ePubPath)) _EpubFile = ZipFile.Read(ePubPath); + else throw new FileNotFoundException(); + + string opfFilePath = GetOpfFilePath(_EpubFile); + if (string.IsNullOrEmpty(opfFilePath)) throw new Exception("Invalid epub file."); + + Match m = Regex.Match(opfFilePath, @"^.*/", Utils.REO_c); + _ContentOpfPath = m.Success ? m.Value : ""; + + LoadEpubMetaDataFromOpfFile(opfFilePath); + if (_TocFileName != null) LoadTableOfContents(); + } + + public Epub(Stream ePubStream, bool loadTOC = false) + { + ID = new List(); + Title = new List(); + Language = new List(); + + Creator = new List(); + Description = new List(); + Date = new List(); + Publisher = new List(); + Contributer = new List(); + Type = new List(); + Format = new List(); + Subject = new List(); + Source = new List(); + Relation = new List(); + Coverage = new List(); + Rights = new List(); + + Content = new OrderedDictionary(); + ExtendedData = new OrderedDictionary(); + TOC = new List(); + + if (ePubStream != null && ePubStream.CanRead) _EpubFile = ZipFile.Read(ePubStream); + else throw new FileNotFoundException(); + + string opfFilePath = GetOpfFilePath(_EpubFile); + if (string.IsNullOrEmpty(opfFilePath)) throw new Exception("Invalid epub file."); + + Match m = Regex.Match(opfFilePath, @"^.*/", Utils.REO_c); + _ContentOpfPath = m.Success ? m.Value : ""; + + LoadEpubMetaDataFromOpfFile(opfFilePath); + if (_TocFileName != null && loadTOC) LoadTableOfContents(); + } + #endregion + + #region Public Functions + public string GetContentAsPlainText() { + StringBuilder builder = new StringBuilder(); + for (int i = 0, y = Content.Count; i < y; ++i) builder.Append(((ContentData)Content[i]).GetContentAsPlainText()); + return builder.ToString(); + } + + public string GetContentAsHtml() { + StringBuilder body = new StringBuilder(); + body.AppendFormat("

Table of Contents

{0}", GetTocHtml(TOC)); + + //Note: run through all content items and collect collection of replacement links (solves problem with client id value replacement) + for (int i = 0, y = Content.Count; i < y; ++i) { + var contentData = (ContentData)Content[i]; + CollectReplacementLinks(_LinksMapping, GetTrimmedFileName(contentData.FileName, false), contentData.Content); + } + + for (int i = 0, y = Content.Count; i < y; ++i) { + var contentData = (ContentData)Content[i]; + Match m = Regex.Match(contentData.Content, @"]*>(?.+)", Utils.REO_csi); + if (m.Success) { + //Note: add link to top of page so they can be found by the table of contents + //then update links within body + _CurrentFileName = GetTrimmedFileName(contentData.FileName, false); + string fullContentHtml = NormalizeRefs("" + m.Groups["body"].Value); + + //embed base64 images & append + fullContentHtml = EmbedImages(fullContentHtml); + body.Append(fullContentHtml); + _CurrentFileName = null; + } + } + + string headPart = ""; + Match match = Regex.Match(((ContentData)Content[Content.Count - 1]).Content, @"]*>(?.+?)", Utils.REO_csi); + if (match.Success) headPart = Regex.Replace(match.Groups["head"].Value, @"]*>.+?", "", Utils.REO_csi); + + if (!Regex.IsMatch(headPart, @"]*?http-equiv\s*=\s*(""|')Content-Type(""|')", Utils.REO_csi)) + headPart += ""; + + headPart = EmbedCssData(headPart); + + string bodyTag = ""; + match = Regex.Match(((ContentData)Content[Content.Count - 1]).Content, @"]*>", Utils.REO_ci); + if (match.Success) bodyTag = match.Value; + + + if (Language.Count > 0 && CultureInfo.CreateSpecificCulture(Language[0]).TextInfo.IsRightToLeft) + body = body.Insert(body.Length - 2, " dir=\"rtl\""); + + return string.Format(_HtmlTemplate, string.Join(", ", Creator) + " - " + Title[0], headPart.Trim(), bodyTag, body); + } + + + #endregion + + #region Private Functions + private string EmbedImages(string html) { + return Regex.Replace(html, @"(?<\w+[^>]*?src\s*=\s*(""|'))(?[^""']+)(?(""|')[^>]*>)", SrcEvaluator, Utils.REO_ci); + } + + private string SrcEvaluator(Match match) { + var extendedData = ExtendedData[GetTrimmedFileName(match.Groups["src"].Value, true)] as ExtendedData; + return extendedData != null + ? match.Groups["prefix"].Value + "data:" + extendedData.MimeType + ";base64," + extendedData.Content + + match.Groups["suffix"].Value : match.Value; + } + + // + //Developer: Brian Kenney + //Date: 7/29/2012 + //Change: remove namespace prefix + //Details: + //some opf files come with the namespace prefix of odfc, so remvoe the prefix before processing + // + private static string GetOpfFilePath(ZipFile epubFile) + { + string tmpXMLStream; + ZipEntry zipEntry = epubFile.Entries.FirstOrDefault(e => e.FileName.Equals(@"meta-inf/container.xml", StringComparison.InvariantCultureIgnoreCase)); + if (zipEntry != null) { + XElement containerXml; + using (MemoryStream memoryStream = new MemoryStream()) { + zipEntry.Extract(memoryStream); + memoryStream.Position = 0; + + containerXml = XElement.Load(memoryStream); + + //get stream just in case we have a namespace prefix + memoryStream.Position = 0; + var sr = new System.IO.StreamReader(memoryStream); + tmpXMLStream = sr.ReadToEnd(); + } + + XNamespace xNamespace = containerXml.Attribute("xmlns") != null ? containerXml.Attribute("xmlns").Value : XNamespace.None; + if (xNamespace != XNamespace.None) + { + return containerXml.Descendants(xNamespace + "rootfile").FirstOrDefault(p => p.Attribute("media-type") != null && p.Attribute("media-type").Value.Equals("application/oebps-package+xml", StringComparison.InvariantCultureIgnoreCase)).Attribute("full-path").Value; + } + else + { + //remove odfc namespace prefix and process + XDocument xDocument = XDocument.Parse(tmpXMLStream); + xDocument.Root.Add(new XAttribute("xmlns", "urn:oasis:names:tc:opendocument:xmlns:container")); + xDocument.Root.Attributes(XNamespace.Xmlns + "odfc").Remove(); + containerXml = XElement.Parse(xDocument.ToString()); + xNamespace = containerXml.Attribute("xmlns") != null ? containerXml.Attribute("xmlns").Value : XNamespace.None; + if (xNamespace != XNamespace.None) + { + return containerXml.Descendants(xNamespace + "rootfile").FirstOrDefault(p => p.Attribute("media-type") != null && p.Attribute("media-type").Value.Equals("application/oebps-package+xml", StringComparison.InvariantCultureIgnoreCase)).Attribute("full-path").Value; + } + } + } + return null; + } + + private void LoadEpubMetaDataFromOpfFile(string opfFilePath) { + ZipEntry zipEntry = _EpubFile.Entries.FirstOrDefault(e => e.FileName.Equals(opfFilePath, StringComparison.InvariantCultureIgnoreCase)); + if (zipEntry == null) throw new Exception("Invalid epub file."); + + XElement contentOpf; + using (MemoryStream memoryStream = new MemoryStream()) + { + zipEntry.Extract(memoryStream); + // Fix buggy " + // See http://stackoverflow.com/questions/912440/xdocument-cant-load-xml-with-version-1-1-in-c-sharp-linq + byte[] b = memoryStream.ToArray(); + for (int i = 0; i < 50; i++) + { + // Check for version="1.1" and replace if found + if (b[i] == 0x76 && b[i + 1] == 0x65 && b[i + 2] == 0x72 && b[i + 3] == 0x73 && b[i + 4] == 0x69 && b[i + 5] == 0x6F && b[i + 6] == 0x6E + && b[i + 7] == 0x3D && b[i + 8] == 0x22 && b[i + 9] == 0x31 && b[i + 10] == 0x2E && b[i + 11] == 0x31) + { + b[i + 11] = 0x30; + } + } + using (MemoryStream fixedStream = new MemoryStream(b)) + { + contentOpf = XElement.Load(fixedStream); + } + b = null; + } + + XNamespace xNamespace = contentOpf.Attribute("xmlns") != null ? contentOpf.Attribute("xmlns").Value : XNamespace.None; + + string uniqueIdentifier = contentOpf.Attribute("unique-identifier").Value; + try { UUID = contentOpf.Elements(xNamespace + "metadata").Elements().FirstOrDefault(e => e.Name.LocalName == "identifier" && e.Attributes("id").FirstOrDefault() != null && e.Attribute("id").Value == uniqueIdentifier).Value; } + catch { } + foreach (var metadataElement in contentOpf.Elements(xNamespace + "metadata").Elements().Where(e => e.Value.Trim() != string.Empty)) { + switch (metadataElement.Name.LocalName) { + case "title": Title.Add(metadataElement.Value); break; + case "creator": Creator.Add(metadataElement.Value); break; + case "date": + var attribute = metadataElement.Attributes().FirstOrDefault(a => a.Name.LocalName == "event"); + if (attribute != null) Date.Add(new DateData(attribute.Value, metadataElement.Value)); + break; + case "publisher": Publisher.Add(metadataElement.Value); break; + case "subject": Subject.Add(metadataElement.Value); break; + case "source": Source.Add(metadataElement.Value); break; + case "rights": Rights.Add(metadataElement.Value); break; + case "description": Description.Add(metadataElement.Value); break; + case "contributor": Contributer.Add(metadataElement.Value); break; + case "type": Type.Add(metadataElement.Value); break; + case "format": Format.Add(metadataElement.Value); break; + case "identifier": ID.Add(metadataElement.Value); break; + case "language": Language.Add(metadataElement.Value); break; + case "relation": Relation.Add(metadataElement.Value); break; + case "coverage": Coverage.Add(metadataElement.Value); break; + } + } + + LoadManifestSectionFromOpfFile(contentOpf, xNamespace); + } + + private void LoadManifestSectionFromOpfFile(XElement contentOpf, XNamespace xNamespace) { + //NOTE: with the content.opf file + //NOTE: grab the idref from the spine element and + //NOTE: find a match corresponding to the elements listed under the manifest section + HashSet alreadyProcessedFiles = new HashSet(StringComparer.InvariantCultureIgnoreCase); + foreach (var spinElement in contentOpf.Elements(xNamespace + "spine").Elements()) { + var itemElement = contentOpf.Elements(xNamespace + "manifest").Elements().FirstOrDefault( + e => + e.Attribute("id").Value == spinElement.Attribute("idref").Value); + if (itemElement == null && Settings.Default.FailIfEpubNotValid) + throw new Exception("Invalid epub file."); + else if (itemElement == null) continue; + + string fileName = Uri.UnescapeDataString(itemElement.Attribute("href").Value).Replace('+', ' '); + ZipEntry contentZipEntry = _EpubFile.Entries.FirstOrDefault(e => e.FileName.Equals(_ContentOpfPath + fileName, StringComparison.InvariantCultureIgnoreCase)); + if (contentZipEntry == null && Settings.Default.FailIfEpubNotValid) throw new Exception("Invalid epub file."); + else if (contentZipEntry == null) continue; + // + //Developer: Brian Kenney + //Date: 7/29/2012 + //Change: duplicate dictionary key + //Details: ran into a mis-packaged epub file added key check + //to ensure that we don't crash should someone mispackage + // + //check to see if fileName has already been added to Content dictionary + if (!Content.Contains(fileName)) Content.Add(fileName, new ContentData(fileName, contentZipEntry)); + if (!alreadyProcessedFiles.Contains(spinElement.Attribute("idref").Value)) alreadyProcessedFiles.Add(spinElement.Attribute("idref").Value); + } + + //grab the rest of the elements not already processed in the manifest + IEnumerable manifestElements = contentOpf.Elements(xNamespace + "manifest").Elements().Where(e => !alreadyProcessedFiles.Contains(e.Attribute("id").Value)); + foreach (var manifestElement in manifestElements) { + string fileName = manifestElement.Attribute("href").Value; + string id = manifestElement.Attribute("id").Value; + ZipEntry extendedZipEntry = _EpubFile.Entries.FirstOrDefault(e => e.FileName.Equals(_ContentOpfPath + fileName, StringComparison.InvariantCultureIgnoreCase)); + if (extendedZipEntry == null) continue; + //check to see if fileName has already been added to Extended dictionary + string trimmedFileName = GetTrimmedFileName(fileName, true); + if (!ExtendedData.Contains(trimmedFileName)) ExtendedData.Add(trimmedFileName, new ExtendedData(fileName, id, manifestElement.Attribute("media-type").Value, extendedZipEntry)); + if (string.Equals(manifestElement.Attribute("media-type").Value, "application/x-dtbncx+xml", StringComparison.InvariantCultureIgnoreCase)) _TocFileName = manifestElement.Attribute("href").Value; + } + } + + private static void CollectReplacementLinks(Hashtable linksMapping, string fileName, string text) { + MatchCollection matches = _RefsRegex.Matches(text); + foreach (Match match in matches) { + if (!_ExternalLinksRegex.IsMatch(match.Groups["href"].Value)) { + string targetFileName = (GetTrimmedFileName(match.Groups["href"].Value, true) ?? GetTrimmedFileName(fileName, true)) + GetAnchorValue(match.Groups["href"].Value); + linksMapping[targetFileName] = GetNormalizedSrc(match.Groups["href"].Value); + } + } + } + + private string NormalizeRefs(string text) { + if (text == null) return null; + text = _RefsRegex.Replace(text, RefsEvaluator); + text = Regex.Replace(text, @"(?\bid\s*=\s*(""|'))(?[^""']+)", IdsEvaluator, Utils.REO_ci); + + return text; + } + + private static string RefsEvaluator(Match match) { + return !_ExternalLinksRegex.IsMatch(match.Groups["href"].Value) + ? match.Groups["prefix"].Value + GetNormalizedSrc(match.Groups["href"].Value) + match.Groups["suffix"].Value + : match.Value.Insert(match.Value.Length - 2, "target=\"_blank\""); + } + + private static string GetAnchorValue(string fileName) { + var match = Regex.Match(fileName, @"\#(?.+)", Utils.REO_c); + return match.Success? "#" + match.Groups["anchor"].Value : ""; + } + + private string IdsEvaluator(Match match) { + string originalFileName = GetTrimmedFileName(_CurrentFileName, true) + "#" + match.Groups["id"].Value; + return _LinksMapping.Contains(originalFileName)? match.Groups["prefix"].Value + ((string)_LinksMapping[originalFileName]).Replace("#", ""): match.Value; + } + + private void LoadTableOfContents() { + ExtendedData extendedData = ExtendedData[_TocFileName] as ExtendedData; + if (extendedData == null) return; + + XElement xElement = XElement.Parse(extendedData.Content.Replace("version=\"1.1\"", "version=\"1.0\"")); + XNamespace xNamespace = xElement.Attribute("xmlns") != null ? xElement.Attribute("xmlns").Value : XNamespace.None; + + //Developer: Brian Kenney + //Date: 7/29/2012 + // + //some files have the namespace prefix of ncx + //if it does then then xNamespace will evaluate to None + if (xNamespace != XNamespace.None) + { + TOC = GetNavigationChildren(xElement.Element(xNamespace + "navMap").Elements(xNamespace + "navPoint"), xNamespace); + } + else + { + //Change: Brian Kenney + //Date: 7/29/2012 + //Change: duplicate dictionary key + //Details: the file may have an ncx namespace prefix + //romeve the ncx prefix itself + XDocument xDocument = XDocument.Parse(@extendedData.Content); + xDocument.Root.Add(new XAttribute("xmlns", "http://www.daisy.org/z3986/2005/ncx/")); + xDocument.Root.Attributes(XNamespace.Xmlns + "ncx").Remove(); + xElement = XElement.Parse(xDocument.ToString()); + xNamespace = xElement.Attribute("xmlns") != null ? xElement.Attribute("xmlns").Value : XNamespace.None; + if (xNamespace != XNamespace.None) + { + TOC = GetNavigationChildren(xElement.Element(xNamespace + "navMap").Elements(xNamespace + "navPoint"), xNamespace); + } + } + } + + private List GetNavigationChildren(IEnumerable elements, XNamespace nameSpace) { + List navigationPoints = new List(elements.Count()); + if (!elements.Any()) return navigationPoints; + navigationPoints.AddRange(elements.Select(navPoint => + new NavPoint(navPoint.Attribute("id").Value, + navPoint.Element(nameSpace + "navLabel").Element(nameSpace + "text").Value, + Uri.UnescapeDataString(navPoint.Element(nameSpace + "content").Attribute("src").Value).Replace('+', ' '), + int.Parse(navPoint.Attribute("playOrder").Value), Content[NormalizeFileName(Uri.UnescapeDataString(navPoint.Element(nameSpace + "content").Attribute("src").Value))] as ContentData, + GetNavigationChildren(navPoint.Elements(nameSpace + "navPoint"), + nameSpace)))); + return navigationPoints; + } + + private static string NormalizeFileName(string fileName) { + return fileName == null? null : Regex.Replace(fileName, @"\#.*$?", "", Utils.REO_c); + } + + private string GetTocHtml(List navPoints) { + if (navPoints == null || navPoints.Count == 0) return ""; + StringBuilder result = new StringBuilder(""); + return result.ToString(); + } + + private static string GetNormalizedSrc(string originalSrc) { + string trimmedFileName = GetTrimmedFileName(originalSrc, false); + return trimmedFileName != null ? "#" + trimmedFileName.Replace('.', '_').Replace('#', '_') : null; + } + + private static string GetTrimmedFileName(string fileName, bool removeAnchor) { + Match m = Regex.Match(fileName, @"/?(?[^/]+)$", Utils.REO_c); + if (m.Success) { + if (removeAnchor) { + string fileNameWithoutAnchor = Regex.Replace(m.Groups["fileName"].Value, @"\#.*", "", Utils.REO_c); + return fileNameWithoutAnchor.Trim() != string.Empty? fileNameWithoutAnchor : null; + } + return m.Groups["fileName"].Value; + } + return null; + } + + private string EmbedCssData(string head) { + return Regex.Replace(head, @"]*?(href\s*=\s*(""|')(?[^""']+)(""|')[^>]*?|type\s*=\s*(""|')text/css(""|')[^>]*?){2}[^>]*?/>", CssEvaluator, Utils.REO_ci); + } + + private string CssEvaluator(Match match) { + var extendedData = ExtendedData[GetTrimmedFileName(match.Groups["href"].Value, true)] as ExtendedData; + return extendedData != null + ? string.Format("", extendedData.Content) : match.Value; + } + + private const string _HtmlTemplate = @" + + + {0} + {1} + + {2} + {3} + + "; + #endregion + } +} diff --git a/ePubReader/ePubReader/ExtendedData.cs b/ePubReader/ePubReader/ExtendedData.cs new file mode 100644 index 0000000..b5beebc --- /dev/null +++ b/ePubReader/ePubReader/ExtendedData.cs @@ -0,0 +1,41 @@ +using System; +using System.IO; +using Ionic.Zip; + +namespace eBdb.EpubReader { + public class ExtendedData { + private readonly ZipEntry _ExtendedZipEntry; + public string FileName { get; private set; } + public string ID { get; private set; } + public string Content { + get { + using (MemoryStream memoryStream = new MemoryStream()) { + _ExtendedZipEntry.Extract(memoryStream); + memoryStream.Position = 0; + + if (IsText) using (StreamReader reader = new StreamReader(memoryStream)) return reader.ReadToEnd(); + else return Convert.ToBase64String(GetContentAsBinary()); + } + } + } + public bool IsText { + get { return _ExtendedZipEntry.IsText || Path.GetExtension(FileName).Equals(".ncx", StringComparison.InvariantCultureIgnoreCase) || Path.GetExtension(FileName).Equals(".css", StringComparison.InvariantCultureIgnoreCase); } + } + public string MimeType { get; private set; } + + public ExtendedData(string fileName, string id, string mimeType, ZipEntry extendedZipEntry) { + FileName = fileName; + ID = id; + MimeType = mimeType; + _ExtendedZipEntry = extendedZipEntry; + } + + public byte[] GetContentAsBinary() { + using (MemoryStream memoryStream = new MemoryStream()) { + _ExtendedZipEntry.Extract(memoryStream); + memoryStream.Position = 0; + return memoryStream.ToArray(); + } + } + } +} diff --git a/ePubReader/ePubReader/ExtendedDataHandler.cs b/ePubReader/ePubReader/ExtendedDataHandler.cs new file mode 100644 index 0000000..a646195 --- /dev/null +++ b/ePubReader/ePubReader/ExtendedDataHandler.cs @@ -0,0 +1,40 @@ +using System; +using System.Configuration; +using System.IO; +using System.Web; + +namespace eBdb.EpubReader +{ +#if FULL_PROFILE + public class ExtendedDataHandler : IHttpHandler { + public void ProcessRequest(HttpContext context) { + HttpRequest request = context.Request; + HttpResponse response = context.Response; + + //Simple protection from external domain requests. + if (request.UrlReferrer != null && !string.Equals(request.Url.Host, request.UrlReferrer.Host, StringComparison.InvariantCultureIgnoreCase)) { + response.Write("\r\n"); + response.Write("Access Denied\r\n"); + response.Write("\r\n"); + response.Write("

Access Denied

\r\n"); + response.Write("\r\n"); + response.Write(""); + return; + } + + if (request.QueryString["epub"] == null || request.QueryString["epub"].Trim() == string.Empty) throw new FileNotFoundException(); + Epub epub = new Epub(ConfigurationManager.AppSettings["EpubFilesPath"] + request.QueryString["epub"]); + + ExtendedData extendedData = epub.ExtendedData[request.QueryString["filePath"]] as ExtendedData; + if (extendedData == null) return; + response.ContentType = extendedData.MimeType; + response.BinaryWrite(extendedData.GetContentAsBinary()); + } + + public bool IsReusable + { + get { return true; } + } + } +#endif +} diff --git a/ePubReader/ePubReader/NavPoint.cs b/ePubReader/ePubReader/NavPoint.cs new file mode 100644 index 0000000..ce4bfdc --- /dev/null +++ b/ePubReader/ePubReader/NavPoint.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; + +namespace eBdb.EpubReader { + public class NavPoint { + public string ID { get; private set; } + public string Title { get; private set; } + public string Source { get; private set; } + public int Order { get; private set; } + public ContentData ContentData { get; private set; } + public List Children { get; private set; } + + public NavPoint(string id, string title, string source, int order, ContentData contentData, List children) { + ID = id; + Title = title; + Source = source; + Order = order; + ContentData = contentData; + Children = children; + } + } +} diff --git a/ePubReader/ePubReader/Properties/AssemblyInfo.cs b/ePubReader/ePubReader/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3449034 --- /dev/null +++ b/ePubReader/ePubReader/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("eBdb.EpubReader")] +[assembly: AssemblyDescription("Read ePub files")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("www.eBdb.net")] +[assembly: AssemblyProduct("ePubReader")] +[assembly: AssemblyCopyright("Copyright eBdb© 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7d2d7d7d-3360-4484-a419-7cafe0c35e13")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.6")] +[assembly: AssemblyFileVersion("1.0.0.6")] diff --git a/ePubReader/ePubReader/Properties/Settings.Designer.cs b/ePubReader/ePubReader/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6652169 --- /dev/null +++ b/ePubReader/ePubReader/Properties/Settings.Designer.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.586 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace eBdb.EpubReader.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool FailIfEpubNotValid { + get { + return ((bool)(this["FailIfEpubNotValid"])); + } + } + } +} diff --git a/ePubReader/ePubReader/Properties/Settings.settings b/ePubReader/ePubReader/Properties/Settings.settings new file mode 100644 index 0000000..2d6d381 --- /dev/null +++ b/ePubReader/ePubReader/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + False + + + \ No newline at end of file diff --git a/ePubReader/ePubReader/Utils.cs b/ePubReader/ePubReader/Utils.cs new file mode 100644 index 0000000..791571b --- /dev/null +++ b/ePubReader/ePubReader/Utils.cs @@ -0,0 +1,74 @@ +using System.Text.RegularExpressions; + +namespace eBdb.EpubReader { + public class Utils { + public static readonly RegexOptions REO_ = RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture; + public static readonly RegexOptions REO_c = RegexOptions.Compiled | REO_; + public static readonly RegexOptions REO_s = RegexOptions.Singleline | REO_; + public static readonly RegexOptions REO_cs = RegexOptions.Compiled | REO_s; + public static readonly RegexOptions REO_m = RegexOptions.Multiline | REO_; + public static readonly RegexOptions REO_cm = RegexOptions.Compiled | REO_m; + public static readonly RegexOptions REO_i = RegexOptions.IgnoreCase | REO_; + public static readonly RegexOptions REO_ci = RegexOptions.IgnoreCase | REO_c; + public static readonly RegexOptions REO_si = RegexOptions.Singleline | REO_i; + public static readonly RegexOptions REO_csi = RegexOptions.Compiled | REO_si; + public static readonly RegexOptions REO_mi = RegexOptions.Multiline | REO_i; + public static readonly RegexOptions REO_cmi = RegexOptions.Compiled | REO_mi; + public static readonly RegexOptions REO_wsi = REO_si ^ RegexOptions.IgnorePatternWhitespace; + public static readonly RegexOptions REO_wcm = REO_cm ^ RegexOptions.IgnorePatternWhitespace; + + public static string ClearText(string text) { + if (text == null) return null; + string result = ReplaceBlockTagsToNewLineCharacter(text); + return ClearSpecialSymbols(CleanHtmlTags(result)); + } + + public static string CleanHtmlTags(string text) { + if (text == null) return null; + return Regex.Replace(text, @"]*>", " ", REO_c); + } + + private static string ReplaceBlockTagsToNewLineCharacter(string text) { + if (text == null) return null; + return Regex.Replace(text, @"(?]*>", "\n", REO_cmi); + } + + private static string ClearSpecialSymbols(string text) { + if (text == null) return null; + Regex regex = new Regex(@"(?( |"|&mdash|&ldquo|&rdquo|\&\#8211|\&\#8212|&\#8230|\&\#171|«|»|&);?)|(?\&\#\d+;?)", REO_ci); + return Regex.Replace(regex.Replace(text, SpecialSymbolsEvaluator), @"\ {2,}", " ", REO_c); + } + + private static string SpecialSymbolsEvaluator(Match m) { + if (m.Groups["defined"].Success) { + switch (m.Groups["defined"].Value.ToLower()) { + case " ": return " "; + case " ": return " "; + case """: return "\""; + case """: return "\""; + case "—": return " "; + case "&mdash": return " "; + case "“": return "\""; + case "&ldquo": return "\""; + case "”": return "\""; + case "&rdquo": return "\""; + case "–": return "-"; + case "–": return "-"; + case "—": return "-"; + case "—": return "-"; + case "…": return "..."; + case "«": return "\""; + case "«": return "\""; + case "«": return "\""; + case "«": return "\""; + case "»": return "\""; + case "»": return "\""; + case "&": return "&"; + case "&": return "&"; + default: return " "; + } + } + return " "; + } + } +} diff --git a/ePubReader/ePubReader/app.config b/ePubReader/ePubReader/app.config new file mode 100644 index 0000000..fd5ffc0 --- /dev/null +++ b/ePubReader/ePubReader/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + False + + + + diff --git a/ePubReader/ePubReader/ePubReader.csproj b/ePubReader/ePubReader/ePubReader.csproj new file mode 100644 index 0000000..baa0b8c --- /dev/null +++ b/ePubReader/ePubReader/ePubReader.csproj @@ -0,0 +1,116 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {B5D1C9DA-D5F6-42CD-B639-E6796DD2BDBB} + Library + Properties + eBdb.EpubReader + eBdb.EpubReader + v4.0 + 512 + SAK + SAK + SAK + SAK + Client + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + Off + AnyCPU + + + true + bin\Full debug\ + DEBUG;TRACE + full + AnyCPU + bin\Debug\eBdb.EpubReader.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + false + + + cert.pfx + + + + + + + + + + + + + + + + + + + + + True + True + Settings.settings + + + + + + + + + + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {49A128D3-C3F2-46B1-8F7A-EECD209EA860} + Zip Reduced + + + + + \ No newline at end of file diff --git a/fb2library/Elements/AnnotationItem.cs b/fb2library/Elements/AnnotationItem.cs new file mode 100644 index 0000000..6658185 --- /dev/null +++ b/fb2library/Elements/AnnotationItem.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FB2Library.Elements.Poem; +using FB2Library.Elements.Table; + +namespace FB2Library.Elements +{ + public class AnnotationItem : AnnotationType + { + public AnnotationItem() + { + ElementName = Fb2AnnotationItemName; + } + internal const string Fb2AnnotationItemName = "annotation"; + + } +} diff --git a/fb2library/Elements/AnnotationType.cs b/fb2library/Elements/AnnotationType.cs new file mode 100644 index 0000000..15babf1 --- /dev/null +++ b/fb2library/Elements/AnnotationType.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FB2Library.Elements.Poem; +using FB2Library.Elements.Table; + +namespace FB2Library.Elements +{ + public class AnnotationType : IFb2TextItem + { + private readonly List content = new List(); + + protected string GetElementName() + { + return ElementName; + } + + public string ElementName { get; set; } + + public List Content { get { return content; } } + + public string ID { set; get; } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + foreach (var textItem in content) + { + builder.Append(textItem.ToString()); + builder.Append(" "); + } + return builder.ToString(); + + } + + + + internal void Load(XElement xAnnotation) + { + if (xAnnotation == null) + { + throw new ArgumentNullException("xAnnotation"); + } + + if (xAnnotation.Name.LocalName != GetElementName()) + { + throw new ArgumentException("Element of wrong type passed", "xAnnotation"); + } + + content.Clear(); + IEnumerable xItems = xAnnotation.Elements(); + foreach (var xItem in xItems) + { + switch (xItem.Name.LocalName) + { + case ParagraphItem.Fb2ParagraphElementName: + ParagraphItem paragraph = new ParagraphItem(); + try + { + paragraph.Load(xItem); + content.Add(paragraph); + } + catch (Exception) + { + } + break; + case PoemItem.Fb2PoemElementName: + PoemItem poem = new PoemItem(); + try + { + poem.Load(xItem); + content.Add(poem); + } + catch (Exception) + { + } + break; + case CiteItem.Fb2CiteElementName: + CiteItem cite = new CiteItem(); + try + { + cite.Load(xItem); + content.Add(cite); + } + catch (Exception) + { + } + break; + case SubTitleItem.Fb2SubtitleElementName: + SubTitleItem subtitle = new SubTitleItem(); + try + { + subtitle.Load(xItem); + content.Add(subtitle); + } + catch (Exception) + { + } + break; + case TableItem.Fb2TableElementName: + TableItem table = new TableItem(); + try + { + table.Load(xItem); + content.Add(table); + } + catch (Exception) + { + } + break; + case EmptyLineItem.Fb2EmptyLineElementName: + EmptyLineItem eline = new EmptyLineItem(); + content.Add(eline); + break; + default: + Debug.WriteLine(string.Format("AnnotationItem:Load - invalid element <{0}> encountered in annotation ."), xItem.Name.LocalName); + break; + } + } + + ID = null; + XAttribute xID = xAnnotation.Attribute("id"); + if ((xID != null) && (xID.Value != null)) + { + ID = xID.Value; + } + } + + public XNode ToXML() + { + XElement xAnnotation = new XElement(Fb2Const.fb2DefaultNamespace+ ElementName); + if (ID != null) + { + xAnnotation.Add(new XAttribute("id",ID)); + } + foreach (IFb2TextItem Item in content) + { + xAnnotation.Add(Item.ToXML()); + } + + return xAnnotation; + } + } +} diff --git a/fb2library/Elements/AuthorItem.cs b/fb2library/Elements/AuthorItem.cs new file mode 100644 index 0000000..c2587bd --- /dev/null +++ b/fb2library/Elements/AuthorItem.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace FB2Library.HeaderItems +{ + class AuthorItem : AuthorType + { + public AuthorItem() + { + ElementName = AuthorElementName; + } + } + + class TranslatorItem : AuthorType + { + public TranslatorItem() + { + ElementName = TranslatorElementName; + } + } + + class PublisherItem : AuthorType + { + public PublisherItem() + { + ElementName = PublisherElementName; + } + } +} diff --git a/fb2library/Elements/AuthorType.cs b/fb2library/Elements/AuthorType.cs new file mode 100644 index 0000000..3a8a4d2 --- /dev/null +++ b/fb2library/Elements/AuthorType.cs @@ -0,0 +1,302 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FB2Library.Elements; + +namespace FB2Library.HeaderItems +{ + + public class AuthorType + { + public const string AuthorElementName = "author"; + public const string TranslatorElementName = "translator"; + public const string PublisherElementName = "publisher"; + + + private const string FirstNameElementName = "first-name"; + private const string MiddleNameElementName = "middle-name"; + private const string LastNameElementName = "last-name"; + private const string NickNameElementName = "nickname"; + private const string HomePageElementName = "home-page"; + private const string EMailElementName = "email"; + private const string IdElementName = "id"; + + + private XNamespace fileNameSpace = XNamespace.None; + + private TextFieldType uid = new TextFieldType {Text = string.Empty}; + + protected string GetElementName() + { + return ElementName; + } + + public string ElementName { get; set; } + + /// + /// XML namespace used to read the document + /// + public XNamespace Namespace + { + set { fileNameSpace = value; } + get { return fileNameSpace; } + } + + /// + /// Author's first name + /// + public TextFieldType FirstName { get; set; } + + /// + /// Author's middle name + /// + public TextFieldType MiddleName { get; set; } + + /// + /// Author's Last name + /// + public TextFieldType LastName { get; set; } + + /// + /// Author's UID + /// + public TextFieldType UID + { + get + { + return uid; + } + set + { + if (!string.IsNullOrEmpty(value.Text)) + { + uid = value; + uid.Text = uid.Text.ToLower(); + } + else + { + uid = value; + } + } + } + + /// + /// Author's nickname + /// + public TextFieldType NickName { get; set; } + + /// + /// Authors home page + /// + public TextFieldType HomePage { get; set; } + + /// + /// Author's e-mail address + /// + public TextFieldType EMail { get; set; } + + /// + /// Loads Author's data from XML "author" node + /// + /// "author" XML node + /// true if succeeded, false if failed + internal void Load(XElement xElement) + { + if ( xElement == null ) + { + throw new ArgumentNullException("xElement"); + } + + // Load first name + FirstName = null; + XElement xFirstName = xElement.Element(fileNameSpace + FirstNameElementName); + if (xFirstName != null) + { + FirstName = new TextFieldType(); + try + { + FirstName.Load(xFirstName); + } + catch (Exception) + { + } + } + + // load middle name + MiddleName = null; + XElement xMiddleName = xElement.Element(fileNameSpace + MiddleNameElementName); + if (xMiddleName != null) + { + MiddleName = new TextFieldType(); + try + { + MiddleName.Load(xMiddleName); + } + catch(Exception) + { + + } + } + + // Load last name + LastName = null; + XElement xLastName = xElement.Element(fileNameSpace + LastNameElementName); + if (xLastName != null) + { + try + { + LastName = new TextFieldType(); + LastName.Load(xLastName); + } + catch (Exception) + { + } + } + + + // Load Nickname + NickName = null; + XElement xNickName = xElement.Element(fileNameSpace + NickNameElementName); + if (xNickName != null) + { + try + { + NickName = new TextFieldType(); + NickName.Load(xNickName); + } + catch (Exception) + { + } + } + + // Load Homepage + HomePage = null; + XElement xHomePage = xElement.Element(fileNameSpace + HomePageElementName); + if (xHomePage != null) + { + try + { + HomePage = new TextFieldType(); + HomePage.Load(xHomePage); + } + catch (Exception) + { + } + } + + + //Load e-mail + EMail = null; + XElement xEMail = xElement.Element(fileNameSpace + EMailElementName); + if (xEMail != null) + { + try + { + EMail = new TextFieldType(); + EMail.Load(xEMail); + } + catch (Exception) + { + } + } + + // Load UID + uid = null; + XElement xUID = xElement.Element(fileNameSpace + IdElementName); + if (xUID != null) + { + uid = new TextFieldType(); + try + { + uid.Load(xUID); + uid.Text = UID.Text.ToLower(); + } + catch (Exception) + { + } + } + + } + + public override string ToString() + { + string firstName = ""; + if ( FirstName != null ) + { + firstName = FirstName.Text; + } + + string midName = ""; + if ( MiddleName != null ) + { + midName = MiddleName.Text; + } + + string lastName = ""; + if ( LastName != null ) + { + lastName = LastName.Text; + } + + string nickName = "no nick"; + if ( NickName != null ) + { + nickName = NickName.Text; + } + + string uid = "unknown-uid"; + if ( UID != null ) + { + uid = UID.Text; + } + + return string.Format("{0} {1} {2} ({3}): {4}",lastName,firstName,midName,nickName,uid); + } + + public override int GetHashCode() + { + return ToString().GetHashCode(); + } + + public override bool Equals(object obj) + { + return ToString().Equals(obj.ToString()); + } + + public XElement ToXML( ) + { + XElement xPerson = new XElement(Fb2Const.fb2DefaultNamespace + ElementName); + if (FirstName != null) + { + xPerson.Add(FirstName.ToXML(FirstNameElementName)); + } + if (MiddleName != null) + { + xPerson.Add(MiddleName.ToXML(MiddleNameElementName)); + } + if (LastName != null) + { + xPerson.Add(LastName.ToXML(LastNameElementName)); + } + if (NickName != null) + { + xPerson.Add(NickName.ToXML(NickNameElementName)); + } + if (HomePage != null) + { + xPerson.Add(HomePage.ToXML(HomePageElementName)); + } + if (EMail != null) + { + xPerson.Add(EMail.ToXML(EMailElementName)); + } + if (UID != null) + { + xPerson.Add(UID.ToXML(IdElementName)); + } + return xPerson; + } + }//class +} diff --git a/fb2library/Elements/BinaryItem.cs b/fb2library/Elements/BinaryItem.cs new file mode 100644 index 0000000..5d596fe --- /dev/null +++ b/fb2library/Elements/BinaryItem.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public enum ContentTypeEnum + { + ContentTypeJpeg, + ContentTypePng, + ContentTypeGif, + } + + public class BinaryItem + { + private const string ContentTypeAttributeName = "content-type"; + private const string IdAttributeName = "id"; + + public ContentTypeEnum ContentType{get;set;} + public Byte[] BinaryData { get; set; } + public string Id { get; set; } + + + + internal const string Fb2BinaryItemName = "binary"; + + internal void Load(XElement binarye) + { + if (binarye == null) + { + throw new ArgumentNullException("binarye"); + } + + if (binarye.Name.LocalName != Fb2BinaryItemName) + { + throw new ArgumentException("Element of wrong type passed", "binarye"); + } + + XAttribute xContentType = binarye.Attribute(ContentTypeAttributeName); + if ((xContentType == null) || (xContentType.Value == null)) + { + throw new NullReferenceException("content type not defined/present"); + } + switch (xContentType.Value.ToLower()) + { + case "image/jpeg": + case "image/jpg": + ContentType = ContentTypeEnum.ContentTypeJpeg; + break; + case "image/png": + ContentType = ContentTypeEnum.ContentTypePng; + break; + case "image/gif": + ContentType = ContentTypeEnum.ContentTypeGif; + break; + default: + throw new Exception("Unknown image content type passed"); + + } + + XAttribute idAttribute = binarye.Attribute(IdAttributeName); + if ((idAttribute == null) || (idAttribute.Value == null)) + { + throw new NullReferenceException("ID not defined/present"); + } + Id = idAttribute.Value; + + if (BinaryData != null) + { + BinaryData= null; + } + BinaryData = Convert.FromBase64String(binarye.Value); + ContentTypeEnum content = ContentType; + DetectContentType(ref content, BinaryData); + ContentType = content; + } + + private void DetectContentType(ref ContentTypeEnum contentType, byte[] BinaryData) + { + try + { + + using (MemoryStream imgStream = new MemoryStream(BinaryData)) + { + using (Bitmap bitmap = new Bitmap(imgStream)) + { + if (bitmap.RawFormat.Equals(ImageFormat.Jpeg)) + { + contentType = ContentTypeEnum.ContentTypeJpeg; + } + else if (bitmap.RawFormat.Equals(ImageFormat.Png)) + { + contentType = ContentTypeEnum.ContentTypePng; + } + else if (bitmap.RawFormat.Equals(ImageFormat.Gif)) + { + contentType = ContentTypeEnum.ContentTypeGif; + } + } + } + } + catch (Exception ex) + { + + throw new Exception(string.Format("Error during image type detection: {0}",ex.Message)); + } + + } + + protected string GetXContentType() + { + switch (ContentType) + { + case ContentTypeEnum.ContentTypeJpeg: + return "image/jpg"; + case ContentTypeEnum.ContentTypePng: + return "image/png"; + case ContentTypeEnum.ContentTypeGif: + return "image/gif"; + default: + return ""; + + } + } + + public XElement ToXML() + { + XElement xBinary = new XElement(Fb2Const.fb2DefaultNamespace + Fb2BinaryItemName); + xBinary.Add(new XAttribute(ContentTypeAttributeName,GetXContentType())); + xBinary.Add(new XAttribute(IdAttributeName,Id)); + xBinary.Value=Convert.ToBase64String(BinaryData); + + return xBinary; + + } + } +} diff --git a/fb2library/Elements/BodyItem.cs b/fb2library/Elements/BodyItem.cs new file mode 100644 index 0000000..70a441d --- /dev/null +++ b/fb2library/Elements/BodyItem.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + /// + /// Main content of the book, multiple bodies are used for additional information, like footnotes, that do not appear in the main book flow. + /// The first body is presented to the reader by default, and content in the other bodies should be accessible by hyperlinks. + /// Name attribute should describe the meaning of this body, this is optional for the main body. + /// + public class BodyItem : IFb2TextItem + { + private readonly XNamespace linkNamespace = @"http://www.w3.org/1999/xlink"; + + private readonly List sections = new List(); + private readonly List epigraphs = new List(); + private readonly TitleItem title = new TitleItem(); + + private const string Fb2NameAttributeName = "name"; + private const string Fb2ImageElementName = "image"; + + + + public XNamespace NameSpace { get; set; } + + public string Name { get; set; } + public TitleItem Title { get { return title; } } + public ImageItem ImageName { get; set; } + public List Sections { get { return sections; } } + public List Epigraphs { get { return epigraphs; } } + public string Lang { get; set; } + + internal const string Fb2BodyItemName = "body"; + + internal void Load(XElement xBody) + { + if (xBody == null) + { + throw new ArgumentNullException("xBody"); + } + + if (xBody.Name.LocalName != Fb2BodyItemName) + { + throw new ArgumentException("Element of wrong type passed", "xBody"); + } + + + ImageName = null; + XElement xImage = xBody.Element(NameSpace + Fb2ImageElementName); + if ((xImage != null)) + { + ImageName = new ImageItem(); + try + { + ImageName.Load(xImage); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error reading body image: {0}", ex.Message)); + } + } + + + XElement xTitle = xBody.Element(NameSpace + TitleItem.Fb2TitleElementName); + if ((xTitle != null) && (xTitle.Value != null)) + { + try + { + title.Load(xTitle); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error reading body title: {0}", ex.Message)); + } + } + + + // Load epigraph elements + IEnumerable xEpigraphs = xBody.Elements(NameSpace + EpigraphItem.Fb2EpigraphElementName); + epigraphs.Clear(); + foreach (var xEpigraph in xEpigraphs) + { + EpigraphItem item = new EpigraphItem(); + try + { + item.Load(xEpigraph); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error reading body epigraph: {0}", ex.Message)); + continue; + } + epigraphs.Add(item); + } + + + // Load body elements (first is main text) + IEnumerable xSections = xBody.Elements(NameSpace + SectionItem.Fb2TextSectionElementName); + sections.Clear(); + foreach (var section in xSections) + { + SectionItem item = new SectionItem(); + try + { + item.Load(section); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error reading body sections: {0}", ex.Message)); + continue; + } + sections.Add(item); + } + + Name = string.Empty; + XAttribute xName = xBody.Attribute(Fb2NameAttributeName); + if ((xName != null) && (xName.Value != null)) + { + Name = xName.Value; + } + + + + Lang = null; + XAttribute xLang = xBody.Attribute(XNamespace.Xml + "lang"); + if ((xLang != null) && (xLang.Value != null)) + { + Lang = xLang.Value; + } + + + } + + public XNode ToXML() + { + XElement xBody = new XElement(Fb2Const.fb2DefaultNamespace + Fb2BodyItemName); + if (!string.IsNullOrEmpty(Name)) + { + xBody.Add(new XAttribute(Fb2NameAttributeName, Name)); + } + if (!string.IsNullOrEmpty(Lang)) + { + xBody.Add(new XAttribute(XNamespace.Xml + "lang", Lang)); + } + if (ImageName != null) + { + xBody.Add(ImageName.ToXML()); + } + if (Title != null) + { + xBody.Add(Title.ToXML()); + } + foreach (EpigraphItem EpItem in epigraphs) + { + xBody.Add(EpItem.ToXML()); + } + foreach (SectionItem SecItem in sections) + { + xBody.Add(SecItem.ToXML()); + } + + return xBody; + } + } +} diff --git a/fb2library/Elements/CiteItem.cs b/fb2library/Elements/CiteItem.cs new file mode 100644 index 0000000..d746e64 --- /dev/null +++ b/fb2library/Elements/CiteItem.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FB2Library.Elements.Poem; +using FB2Library.Elements.Table; + +namespace FB2Library.Elements +{ + public class CiteItem : IFb2TextItem + { + private readonly List citeData = new List(); + private readonly List textAuthors = new List(); + + public List TextAuthors { get { return textAuthors; } } + public string ID { get; set; } + public List CiteData { get { return citeData; } } + public string Lang { get; set; } + + internal const string Fb2CiteElementName = "cite"; + + + internal void Load(XElement xCite) + { + citeData.Clear(); + if (xCite == null) + { + throw new ArgumentNullException("xCite"); + } + + if (xCite.Name.LocalName != Fb2CiteElementName) + { + throw new ArgumentException("Element of wrong type passed", "xCite"); + } + + textAuthors.Clear(); + IEnumerable xItems = xCite.Elements(); + foreach (var element in xItems) + { + switch (element.Name.LocalName) + { + case ParagraphItem.Fb2ParagraphElementName: + ParagraphItem paragraph = new ParagraphItem(); + try + { + paragraph.Load(element); + citeData.Add(paragraph); + } + catch (Exception) + { + } + break; + case PoemItem.Fb2PoemElementName: + PoemItem poem = new PoemItem(); + try + { + poem.Load(element); + citeData.Add(poem); + } + catch (Exception) + { + } + break; + case EmptyLineItem.Fb2EmptyLineElementName: + EmptyLineItem emptyLine = new EmptyLineItem(); + try + { + citeData.Add(emptyLine); + } + catch (Exception) + { + } + break; + case SubTitleItem.Fb2SubtitleElementName: + SubTitleItem subtitle = new SubTitleItem(); + try + { + subtitle.Load(element); + citeData.Add(subtitle); + } + catch (Exception) + { + } + break; + case TableItem.Fb2TableElementName: + TableItem table = new TableItem(); + try + { + table.Load(element); + citeData.Add(table); + + } + catch (Exception) + { + } + break; + case TextAuthorItem.Fb2TextAuthorElementName: + //ParagraphItem author = new ParagraphItem(); + TextAuthorItem author = new TextAuthorItem(); + try + { + author.Load(element); + textAuthors.Add(author); + } + catch (Exception) + { + } + break; + default: + Debug.WriteLine(string.Format("CiteItem:Load - invalid element <{0}> encountered in title ."), element.Name.LocalName); + break; + } + } + + Lang = null; + XAttribute xLang = xCite.Attribute(XNamespace.Xml + "lang"); + if ((xLang != null)&&(xLang.Value != null)) + { + Lang = xLang.Value; + } + + ID = null; + XAttribute xID = xCite.Attribute("id"); + if ((xID != null) && (xID.Value != null)) + { + ID = xID.Value; + } + + } + + public XNode ToXML() + { + XElement xCite = new XElement(Fb2Const.fb2DefaultNamespace + Fb2CiteElementName); + if (!string.IsNullOrEmpty(ID)) + { + xCite.Add(new XAttribute("id", ID)); + } + if (!string.IsNullOrEmpty(Lang)) + { + xCite.Add(new XAttribute(XNamespace.Xml + "lang", Lang)); + } + + foreach (IFb2TextItem CiteItem in citeData) + { + xCite.Add(CiteItem.ToXML()); + } + foreach (ParagraphItem AuthorItem in textAuthors) + { + xCite.Add(AuthorItem.ToXML()); + } + + return xCite; + } + } +} diff --git a/fb2library/Elements/CustomTextFieldType.cs b/fb2library/Elements/CustomTextFieldType.cs new file mode 100644 index 0000000..61f9e68 --- /dev/null +++ b/fb2library/Elements/CustomTextFieldType.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class CustomTextFieldType : TextFieldType + { + /// + /// Get/Set info-type attribute + /// + public string InfoType { get; set; } + + + public override void Load(XElement xElement) + { + base.Load(xElement); + + InfoType = null; + XAttribute xInfoType = xElement.Attribute("info-type"); + if (xInfoType == null) + { + //throw new Exception("info-type attribute required for custom info element"); + } + else + { + InfoType = xInfoType.Value; + } + + } + + + } +} diff --git a/fb2library/Elements/DateItem.cs b/fb2library/Elements/DateItem.cs new file mode 100644 index 0000000..b43c36f --- /dev/null +++ b/fb2library/Elements/DateItem.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + /// + /// A human readable date, maybe not exact, with an optional computer readable variant + /// + public class DateItem : IFb2TextItem + { + /// + /// Get/Set Date as Text + /// + public string Text { get; set; } + + /// + /// Get/Set Date in computer readable form + /// + public DateTime DateValue{get;set;} + + /// + /// Get/Set language + /// + public string Language { get; set; } + + + internal const string Fb2DateElementName = "date"; + + internal void Load(XElement xDate) + { + if (xDate == null) + { + throw new ArgumentNullException("xDate"); + } + + if (xDate.Name.LocalName != Fb2DateElementName) + { + throw new ArgumentException("Element of wrong type passed", "xDate"); + } + + if (xDate.Value != null) + { + Text = xDate.Value; + } + + XAttribute xDateValue = xDate.Attribute("value"); + if ((xDateValue != null)&&(!string.IsNullOrEmpty(xDateValue.Value))) + { + try + { + DateValue = DateTime.Parse(xDateValue.Value); + } + catch (Exception) + { + + } + } + + Language = null; + XAttribute xLang = xDate.Attribute(XNamespace.Xml + "lang"); + if (xLang != null && string.IsNullOrEmpty(xLang.Value)) + { + Language = xLang.Value; + } + } + + public XNode ToXML() + { + XElement xDate = new XElement(Fb2Const.fb2DefaultNamespace + Fb2DateElementName); + if (!string.IsNullOrEmpty(Text)) + { + xDate.Value = Text; + } + if (!string.IsNullOrEmpty(Language)) + { + xDate.Add(new XAttribute(XNamespace.Xml + "lang", Language)); + } + if (!DateValue.Equals(DateTime.MinValue)) + { + xDate.Add(new XAttribute("value", DateValue.ToShortDateString())); + } + return xDate; + } + } +} diff --git a/fb2library/Elements/EmptyLineItem.cs b/fb2library/Elements/EmptyLineItem.cs new file mode 100644 index 0000000..8fe278e --- /dev/null +++ b/fb2library/Elements/EmptyLineItem.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class EmptyLineItem : IFb2TextItem + { + internal const string Fb2EmptyLineElementName = "empty-line"; + + public override string ToString() + { + return "\n"; + } + public XNode ToXML() + { + return new XElement(Fb2Const.fb2DefaultNamespace + Fb2EmptyLineElementName); + } + + } +} diff --git a/fb2library/Elements/EpigraphItem.cs b/fb2library/Elements/EpigraphItem.cs new file mode 100644 index 0000000..99c2ac9 --- /dev/null +++ b/fb2library/Elements/EpigraphItem.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FB2Library.Elements.Poem; + +namespace FB2Library.Elements +{ + public class EpigraphItem : IFb2TextItem + { + private readonly List epigraphData = new List(); + private readonly List textAuthors = new List(); + + public List TextAuthors { get { return textAuthors; } } + public List EpigraphData { get { return epigraphData; } } + public string ID { get; set; } + + + internal const string Fb2EpigraphElementName = "epigraph"; + + internal void Load(XElement xEpigraph) + { + epigraphData.Clear(); + if (xEpigraph == null) + { + throw new ArgumentNullException("xEpigraph"); + } + + + if (xEpigraph.Name.LocalName != Fb2EpigraphElementName) + { + throw new ArgumentException("Element of wrong type passed", "xEpigraph"); + } + + IEnumerable xItems = xEpigraph.Elements(); + textAuthors.Clear(); + foreach (var element in xItems) + { + switch (element.Name.LocalName) + { + case ParagraphItem.Fb2ParagraphElementName: + ParagraphItem paragraph = new ParagraphItem(); + try + { + paragraph.Load(element); + epigraphData.Add(paragraph); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load paragraph: {0}.", ex.Message)); + } + break; + case PoemItem.Fb2PoemElementName: + PoemItem poem = new PoemItem(); + try + { + poem.Load(element); + epigraphData.Add(poem); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load poem: {0}.", ex.Message)); + } + break; + case CiteItem.Fb2CiteElementName: + CiteItem cite = new CiteItem(); + try + { + cite.Load(element); + epigraphData.Add(cite); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load citation: {0}.", ex.Message)); + } + break; + case EmptyLineItem.Fb2EmptyLineElementName: + EmptyLineItem emptyLine = new EmptyLineItem(); + try + { + epigraphData.Add(emptyLine); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load empty line: {0}.", ex.Message)); + } + break; + case TextAuthorItem.Fb2TextAuthorElementName: + TextAuthorItem author = new TextAuthorItem(); + //SimpleText author = new SimpleText(); + try + { + author.Load(element); + textAuthors.Add(author); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load text author: {0}.", ex.Message)); + } + break; + default: + Debug.WriteLine(string.Format("EpigraphItem:Load - invalid element <{0}> encountered in title ."), element.Name.LocalName); + break; + } + } + + XAttribute xID = xEpigraph.Attribute("id"); + if ((xID != null) &&(xID.Value != null)) + { + ID = xID.Value; + } + } + + public XNode ToXML() + { + XElement xEpigraph = new XElement(Fb2Const.fb2DefaultNamespace + Fb2EpigraphElementName); + if (!string.IsNullOrEmpty(ID)) + { + xEpigraph.Add(new XAttribute("id", ID)); + } + + foreach (IFb2TextItem EpigrafItem in epigraphData) + { + xEpigraph.Add(EpigrafItem.ToXML()); + } + foreach (IFb2TextItem EpigrafAuthor in textAuthors) + { + xEpigraph.Add(EpigrafAuthor.ToXML()); + } + + return xEpigraph; + + } + } +} diff --git a/fb2library/Elements/FB2Const.cs b/fb2library/Elements/FB2Const.cs new file mode 100644 index 0000000..96734c0 --- /dev/null +++ b/fb2library/Elements/FB2Const.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class Fb2Const + { + public static XNamespace fb2DefaultNamespace = @"http://www.gribuser.ru/xml/fictionbook/2.0"; + + //public XNamespace FB2DefaultNamespace {get {return fb2DefaultNamespace;}} + } +} diff --git a/fb2library/Elements/FB2TextItem.cs b/fb2library/Elements/FB2TextItem.cs new file mode 100644 index 0000000..01a6ebc --- /dev/null +++ b/fb2library/Elements/FB2TextItem.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public enum TextStyles + { + Normal = 0, + Strong, // + Emphasis, // + Code, // + Sub, // + Sup, // + Strikethrough, // + } + + + public interface IFb2TextItem + { + XNode ToXML(); + } +} diff --git a/fb2library/Elements/GenreType.cs b/fb2library/Elements/GenreType.cs new file mode 100644 index 0000000..815fd27 --- /dev/null +++ b/fb2library/Elements/GenreType.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + /// + /// Holds genre element + /// + public class GenreType + { + /// + /// Get/Set genre + /// + public string Genre { get; set; } + } + + /// + /// Extends GenreType class to support match + /// match from 1 to 100% + /// + public class TitleGenreType : GenreType + { + private int match = 100; + + /// + /// Get/Set matching value , can be from 1 to 100% + /// + public int Match + { + get { return match; } + set + { + if (value > 0 && value <= 100) + { + match = value; + } + else + { + match = 100; + } + } + } + + public XElement ToXML() + { + if (string.IsNullOrEmpty(Genre)) + { + throw new ArgumentException("Genre is empty"); + } + XElement xGenre = new XElement(Fb2Const.fb2DefaultNamespace + "genre", Genre); + if (match > 0 && match < 100) + { + xGenre.Add(new XAttribute("match",match.ToString())); + } + return xGenre; + } + + } +} diff --git a/fb2library/Elements/ImageItem.cs b/fb2library/Elements/ImageItem.cs new file mode 100644 index 0000000..8cfa0c3 --- /dev/null +++ b/fb2library/Elements/ImageItem.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class ImageItem : IFb2TextItem + { + private readonly XNamespace xLinkNamespace = @"http://www.w3.org/1999/xlink"; + + public string ImageType { get; set; } + public string HRef { get; set; } + public string AltText { get; set; } + public string Title { get; set; } + public string ID { get; set; } + + + internal const string Fb2ImageElementName = "image"; + + internal void Load(XElement xImage) + { + if (xImage == null) + { + throw new ArgumentNullException("xImage"); + } + + if (xImage.Name.LocalName != Fb2ImageElementName) + { + throw new ArgumentException("Element of wrong type passed", "xImage"); + } + + XAttribute xType = xImage.Attribute(xLinkNamespace + "type"); + if ((xType != null) && (xType.Value != null)) + { + ImageType = xType.Value; + } + + + XAttribute xHRef = xImage.Attribute(xLinkNamespace + "href"); + if ((xHRef != null) && (xHRef.Value != null)) + { + HRef = xHRef.Value; + } + + XAttribute xAlt = xImage.Attribute("alt"); + if ((xAlt != null) && (xAlt.Value != null)) + { + AltText = xAlt.Value; + } + + XAttribute xTitle = xImage.Attribute("title"); + if ((xTitle != null) && (xTitle.Value != null)) + { + Title = xTitle.Value; + } + + XAttribute xID = xImage.Attribute("id"); + if ((xID != null) && (xID.Value != null)) + { + ID = xID.Value; + } + + } + + public XNode ToXML() + { + XElement xImage = new XElement(Fb2Const.fb2DefaultNamespace + Fb2ImageElementName); + if (!string.IsNullOrEmpty(ImageType)) + { + xImage.Add(new XAttribute(xLinkNamespace + "type", ImageType)); + } + if (!string.IsNullOrEmpty(HRef)) + { + xImage.Add(new XAttribute(xLinkNamespace + "href", HRef)); + } + if (!string.IsNullOrEmpty(AltText)) + { + xImage.Add(new XAttribute("alt", AltText)); + } + if (!string.IsNullOrEmpty(Title)) + { + xImage.Add(new XAttribute("title", Title)); + } + if (!string.IsNullOrEmpty(ID)) + { + xImage.Add(new XAttribute("id", ID)); + } + return xImage; + } + + } +} diff --git a/fb2library/Elements/InlineImageItem.cs b/fb2library/Elements/InlineImageItem.cs new file mode 100644 index 0000000..9773d99 --- /dev/null +++ b/fb2library/Elements/InlineImageItem.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class InlineImageItem : StyleType + { + private readonly XNamespace xLinkNamespace = @"http://www.w3.org/1999/xlink"; + + protected virtual string GetElementName() + { + return Fb2InlineImageElementName; + } + + + public string ImageType { get; set;} + public string HRef { get; set;} + public string AltText { get; set;} + + internal const string Fb2InlineImageElementName = "image"; + + public override string ToString() + { + return HRef; + } + + + internal void Load(XElement xImage) + { + if (xImage == null) + { + throw new ArgumentNullException("xImage"); + } + + if (xImage.Name.LocalName != GetElementName()) + { + throw new ArgumentException("Element of wrong type passed", "xImage"); + } + + XAttribute xType = xImage.Attribute(xLinkNamespace + "type"); + if ((xType != null) && (xType.Value != null)) + { + ImageType = xType.Value; + } + else // to fix badly formated FB2s + { + xType = xImage.Attribute("type"); + if ((xType != null) && (xType.Value != null)) + { + ImageType = xType.Value; + } + } + + + XAttribute xHRef = xImage.Attribute(xLinkNamespace + "href"); + if ((xHRef != null) && (xHRef.Value != null)) + { + HRef = xHRef.Value; + } + else // to fix badly formated FB2s + { + xHRef = xImage.Attribute(xLinkNamespace + "href"); + if ((xHRef != null) && (xHRef.Value != null)) + { + HRef = xHRef.Value; + } + } + + XAttribute xAlt = xImage.Attribute(xLinkNamespace + "alt"); + if ((xAlt != null) &&(xAlt.Value != null)) + { + AltText = xAlt.Value; + } + else // to fix badly formated FB2s + { + xAlt = xImage.Attribute(xLinkNamespace + "alt"); + if ((xAlt != null) && (xAlt.Value != null)) + { + AltText = xAlt.Value; + } + } + } + + public XNode ToXML() + { + XElement xImage = new XElement(Fb2Const.fb2DefaultNamespace + Fb2InlineImageElementName); + if (!string.IsNullOrEmpty(ImageType)) + { + xImage.Add(new XAttribute(xLinkNamespace + "type",ImageType)); + } + if (!string.IsNullOrEmpty(HRef)) + { + xImage.Add(new XAttribute(xLinkNamespace + "href",HRef)); + } + if (!string.IsNullOrEmpty(AltText)) + { + xImage.Add(new XAttribute("alt", AltText)); + } + return xImage; + } + + } +} diff --git a/fb2library/Elements/InternalLinkItem.cs b/fb2library/Elements/InternalLinkItem.cs new file mode 100644 index 0000000..feb4700 --- /dev/null +++ b/fb2library/Elements/InternalLinkItem.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class InternalLinkItem : StyleType + { + private readonly XNamespace lNamespace = @"http://www.w3.org/1999/xlink"; + + public string Type { get; set; } + + public string HRef { get; set; } + + public SimpleText LinkText { get; set; } + + internal const string Fb2InternalLinkElementName = "a"; + + + public override string ToString() + { + return LinkText.ToString(); + } + + internal void Load(XElement xLink) + { + if (xLink == null) + { + throw new ArgumentNullException("xLink"); + } + + if (xLink.Name.LocalName != Fb2InternalLinkElementName) + { + throw new ArgumentException("Element of wrong type passed", "xLink"); + } + + LinkText = null; + //if (xLink.Value != null) + { + LinkText = new SimpleText(); + try + { + LinkText.Load(xLink); + } + catch (Exception) + { + LinkText = null; + } + } + + XAttribute xTypeAttr = xLink.Attribute("type"); + if ((xTypeAttr != null)&& (xTypeAttr.Value != null)) + { + Type = xTypeAttr.Value; + } + + XAttribute xHRefAttr = xLink.Attribute(lNamespace + "href"); + if ((xHRefAttr != null) && (xHRefAttr.Value != null)) + { + HRef = xHRefAttr.Value; + } + + } + + public XNode ToXML() + { + XElement xLink = new XElement(Fb2Const.fb2DefaultNamespace + Fb2InternalLinkElementName); + if (!string.IsNullOrEmpty(Type)) + { + xLink.Add(new XAttribute("type",Type)); + } + if(!string.IsNullOrEmpty(HRef)) + { + xLink.Add(new XAttribute(lNamespace + "href",HRef)); + } + if (LinkText != null) + { + xLink.Add(LinkText.ToXML()); + } + return xLink; + } + + } +} diff --git a/fb2library/Elements/OutPutDocumentType.cs b/fb2library/Elements/OutPutDocumentType.cs new file mode 100644 index 0000000..8aa915d --- /dev/null +++ b/fb2library/Elements/OutPutDocumentType.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class OutPutDocumentType : IShareInstructionElement + { + private readonly List parts = new List(); + + public const string OutputDocumentElementName = "output-document-class"; + + private XNamespace fileNameSpace = XNamespace.None; + + /// + /// XML namespace used to read the document + /// + public XNamespace Namespace + { + set { fileNameSpace = value; } + get { return fileNameSpace; } + } + + /// + /// Get list of the instruction parts + /// + public List Parts { get { return parts; } } + + /// + /// Get/Set Name attribute + /// + public string Name { get; set;} + + /// + /// Get/Set document part creation type + /// + public GenerationInstructionEnum Create { get; set; } + + + /// + /// Get/Set price + /// + public float? Price { get; set; } + + public void Load(XElement xElement) + { + if (xElement == null) + { + throw new ArgumentNullException("xElement"); + } + + parts.Clear(); + IEnumerable xParts = xElement.Elements(fileNameSpace + "part"); + foreach (var xPart in xParts) + { + ShareInstructionType part = new ShareInstructionType {Namespace = fileNameSpace}; + try + { + part.Load(xPart); + parts.Add(part); + } + catch (Exception) + { + continue; + } + } + + Name = null; + XAttribute xName = xElement.Attribute("name"); + if (xName == null) + { + throw new Exception("name is required attribute - absent"); + } + Name = xName.Value; + + + Create = GenerationInstructionEnum.Unknown; + XAttribute xCreate = xElement.Attribute("create"); + if (xCreate != null) + { + switch (xCreate.Value) + { + case "require": + Create = GenerationInstructionEnum.Require; + break; + case "allow": + Create = GenerationInstructionEnum.Allow; + break; + case "deny": + Create = GenerationInstructionEnum.Deny; + break; + default: + Debug.WriteLine(string.Format("Invalid instruction type : {0}", xCreate.Value)); + break; + } + } + + Price = null; + XAttribute xPrice = xElement.Attribute("price"); + if ((xPrice != null) && !string.IsNullOrEmpty(xPrice.Value)) + { + float val; + if (float.TryParse(xPrice.Value, out val)) + { + Price = val; + } + } + + } + private string GetXCreate() + { + switch (Create) + { + case GenerationInstructionEnum.Require: + return "require"; + case GenerationInstructionEnum.Allow: + return "allow"; + case GenerationInstructionEnum.Deny: + return "deny"; + default: + return ""; + //Debug.WriteLine(string.Format("Invalid instruction type : {0}", xIncludeAll.Value)); + //break; + } + } + + public XElement ToXML() + { + XElement xOutputDocumentClass = new XElement(Fb2Const.fb2DefaultNamespace + OutputDocumentElementName); + xOutputDocumentClass.Add(new XAttribute("name", Name)); + if (Create != GenerationInstructionEnum.Unknown) + { + xOutputDocumentClass.Add(new XAttribute("create", GetXCreate())); + } + if (Price != null) + { + xOutputDocumentClass.Add(new XAttribute("price", Price.ToString())); + } + foreach (ShareInstructionType PartElement in parts) + { + xOutputDocumentClass.Add(PartElement.ToXML()); + } + return xOutputDocumentClass; + } + } +} diff --git a/fb2library/Elements/ParagraphItem.cs b/fb2library/Elements/ParagraphItem.cs new file mode 100644 index 0000000..d14980c --- /dev/null +++ b/fb2library/Elements/ParagraphItem.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + //public class StyledCharacter : IFb2TextItem + //{ + // public char Character { get; set; } + // public TextStylesFlags Style { get; set; } + //} + + + public class ParagraphItem : IFb2TextItem + { + private readonly List paragraphData = new List(); + + protected virtual string GetElementName() + { + return Fb2ParagraphElementName; + } + + internal const string Fb2ParagraphElementName = "p"; + + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + foreach (var textItem in paragraphData) + { + builder.Append(textItem.ToString()); + builder.Append(" "); + } + return builder.ToString(); + } + + + public string ID { get; set; } + public string Style { get; set; } + public string Lang { get; set; } + + public List ParagraphData { get { return paragraphData; } } + + protected void LoadData(XElement xParagraph) + { + if (xParagraph.HasElements) + { + IEnumerable childElements = xParagraph.Nodes(); + foreach (var element in childElements) + { + if ((element.NodeType == XmlNodeType.Element) && !IsSimpleText(element)) + { + XElement xElement = (XElement) element; + if (xElement.Name.LocalName == InlineImageItem.Fb2InlineImageElementName) + { + InlineImageItem image = new InlineImageItem(); + try + { + image.Load(xElement); + paragraphData.Add(image); + + } + catch (Exception) + { + } + } + else if (xElement.Name.LocalName == InternalLinkItem.Fb2InternalLinkElementName) + { + InternalLinkItem linkItem = new InternalLinkItem(); + try + { + linkItem.Load(xElement); + paragraphData.Add(linkItem); + + } + catch (Exception) + { + } + } + } + else //if ( element.NodeType != XmlNodeType.Whitespace) + { + SimpleText text = new SimpleText(); + try + { + text.Load(element); + paragraphData.Add(text); + } + catch (Exception) + { + continue; + } + } + } + + } + else if (!string.IsNullOrEmpty(xParagraph.Value)) + { + SimpleText text = new SimpleText(); + text.Load(xParagraph); + paragraphData.Add(text); + } + + XAttribute xID = xParagraph.Attribute("id"); + if ((xID != null) && (xID.Value != null)) + { + ID = xID.Value; + } + + XAttribute xStyle = xParagraph.Attribute("style"); + if ((xStyle != null) && (xStyle.Value != null)) + { + Style = xStyle.Value; + } + + Lang = null; + XAttribute xLang = xParagraph.Attribute(XNamespace.Xml + "lang"); + if ((xLang != null) && (xLang.Value != null)) + { + Lang = xLang.Value; + } + + } + + internal virtual void Load(XElement xParagraph) + { + paragraphData.Clear(); + if (xParagraph == null) + { + throw new ArgumentNullException("xParagraph"); + } + + if (xParagraph.Name.LocalName != GetElementName()) + { + throw new ArgumentException("Element of wrong type passed", "xParagraph"); + } + LoadData(xParagraph); + + } // Load + + private bool IsSimpleText(XNode element) + { + // if not element than we assume simple text + if (element.NodeType != XmlNodeType.Element) + { + return true; + } + XElement xElement = (XElement) element; + switch (xElement.Name.LocalName) + { + case InternalLinkItem.Fb2InternalLinkElementName: + case InlineImageItem.Fb2InlineImageElementName: + return false; + + } + return true; + } + + public XNode ToXML() + { + XElement xParagraph = new XElement(Fb2Const.fb2DefaultNamespace + GetElementName()); + if (!string.IsNullOrEmpty(ID)) + { + xParagraph.Add(new XAttribute("id", ID)); + } + if (!string.IsNullOrEmpty(Style)) + { + xParagraph.Add(new XAttribute("style", Style)); + } + if (!string.IsNullOrEmpty(Lang)) + { + xParagraph.Add(new XAttribute(XNamespace.Xml + "lang", Lang)); + } + + foreach (StyleType childElements in paragraphData) + { + xParagraph.Add(childElements.ToXML()); + } + return xParagraph; + } + + } //class + + +}// namespace diff --git a/fb2library/Elements/PartShareInstructionType.cs b/fb2library/Elements/PartShareInstructionType.cs new file mode 100644 index 0000000..50e3700 --- /dev/null +++ b/fb2library/Elements/PartShareInstructionType.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + /// + /// Pointer to cpecific document section, explaining how to deal with it + /// + public class PartShareInstructionType : IShareInstructionElement + { + private readonly XNamespace lNamespace = @"http://www.w3.org/1999/xlink"; + + public const string PartElementName = "part"; + + public string Type { get; set; } + + public string HRef { get; set; } + + + public GenerationInstructionEnum Instruction { get; set; } + + + private XNamespace fileNameSpace = XNamespace.None; + + /// + /// XML namespace used to read the document + /// + public XNamespace Namespace + { + set { fileNameSpace = value; } + get { return fileNameSpace; } + } + + public void Load(XElement xElement) + { + if (xElement == null) + { + throw new ArgumentNullException("xElement"); + } + + Type = null; + XAttribute xType = xElement.Attribute(lNamespace + "type"); + if (xType != null) + { + Type = xType.Value; + } + + HRef = null; + XAttribute xHRef = xElement.Attribute(lNamespace + "href"); + if (xHRef == null) + { + throw new Exception("href is required attribute - absent"); + } + HRef = xHRef.Value; + + + XAttribute xIncude = xElement.Attribute("include"); + if (xIncude == null) + { + throw new Exception("include is required attribute - absent"); + } + switch (xIncude.Value) + { + case "require": + Instruction = GenerationInstructionEnum.Require; + break; + case "allow": + Instruction = GenerationInstructionEnum.Allow; + break; + case "deny": + Instruction = GenerationInstructionEnum.Deny; + break; + default: + Debug.WriteLine(string.Format("Invalid instruction type : {0}", xIncude.Value)); + break; + } + + } + + private string GetXInclude() + { + switch (Instruction) + { + case GenerationInstructionEnum.Require: + return "require"; + case GenerationInstructionEnum.Allow: + return "allow"; + case GenerationInstructionEnum.Deny: + return "deny"; + default: + return ""; + //Debug.WriteLine(string.Format("Invalid instruction type : {0}", xIncludeAll.Value)); + //break; + } + } + public XElement ToXML() + { + XElement xPart = new XElement(Fb2Const.fb2DefaultNamespace + PartElementName); + if (!string.IsNullOrEmpty(Type)) + { + xPart.Add(new XAttribute(lNamespace + "type", Type)); + } + xPart.Add(new XAttribute(lNamespace + "href", HRef)); + xPart.Add(new XAttribute("include", GetXInclude())); + + return xPart; + } + } +} diff --git a/fb2library/Elements/Poem/PoemItem.cs b/fb2library/Elements/Poem/PoemItem.cs new file mode 100644 index 0000000..82400b4 --- /dev/null +++ b/fb2library/Elements/Poem/PoemItem.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements.Poem +{ + public class PoemItem : IFb2TextItem + { + private readonly List epigraphs = new List(); + private readonly List content = new List(); + private readonly List authors = new List(); + + public TitleItem Title { get; set; } + public List Content { get { return content; } } + public List Authors { get { return authors; } } + public List Epigraphs { get { return epigraphs; } } + public string Lang { get; set; } + public string ID { set; get; } + public DateItem Date { set; get; } + + + + internal const string Fb2PoemElementName = "poem"; + + internal void Load(XElement xPoem) + { + if (xPoem == null) + { + throw new ArgumentNullException("xPoem"); + } + + if (xPoem.Name.LocalName != Fb2PoemElementName) + { + throw new ArgumentException("Element of wrong type passed", "xPoem"); + } + + Title = null; + Date = null; + epigraphs.Clear(); + content.Clear(); + authors.Clear(); + + IEnumerable xElements = xPoem.Elements(); + foreach (var xElement in xElements) + { + if (xElement.Name == (XName)(xPoem.Name.Namespace + StanzaItem.Fb2StanzaElementName)) + { + StanzaItem stanza = new StanzaItem(); + try + { + stanza.Load(xElement); + content.Add(stanza); + } + catch (Exception) + { + continue; + } + } + else if (xElement.Name == (XName)(xPoem.Name.Namespace + SubTitleItem.Fb2SubtitleElementName)) + { + SubTitleItem subtitle = new SubTitleItem(); + try + { + subtitle.Load(xElement); + content.Add(subtitle); + } + catch (Exception) + { + continue; + } + } + else if (xElement.Name == (XName)(xPoem.Name.Namespace + TitleItem.Fb2TitleElementName) && Title == null) // only one title + { + Title = new TitleItem(); + Title.Load(xElement); + } + else if (xElement.Name == (XName)(xPoem.Name.Namespace + EpigraphItem.Fb2EpigraphElementName)) + { + EpigraphItem epigraphItem = new EpigraphItem(); + try + { + epigraphItem.Load(xElement); + epigraphs.Add(epigraphItem); + } + catch (Exception) + { + continue; + } + } + else if (xElement.Name == (XName)(xPoem.Name.Namespace + TextAuthorItem.Fb2TextAuthorElementName)) + { + TextAuthorItem author = new TextAuthorItem(); + try + { + author.Load(xElement); + authors.Add(author); + } + catch (Exception) + { + continue; + } + } + else if (xElement.Name == (XName)(xPoem.Name.Namespace + DateItem.Fb2DateElementName) && Date == null) // only one date + { + Date = new DateItem(); + try + { + Date.Load(xElement); + } + catch (Exception) + { + continue; + } + } + } + + XAttribute xID = xPoem.Attribute("id"); + if ((xID != null) && (xID.Value != null)) + { + ID = xID.Value; + } + + Lang = null; + XAttribute xLang = xPoem.Attribute(XNamespace.Xml + "lang"); + if ((xLang != null) && (xLang.Value != null)) + { + Lang = xLang.Value; + } + } + + public XNode ToXML() + { + XElement xPoem = new XElement(Fb2Const.fb2DefaultNamespace + Fb2PoemElementName); + if (!string.IsNullOrEmpty(ID)) + { + xPoem.Add(new XAttribute("id", ID)); + } + if (!string.IsNullOrEmpty(Lang)) + { + xPoem.Add(new XAttribute(XNamespace.Xml + "lang", Lang)); + } + if (Title != null) + { + xPoem.Add(Title.ToXML()); + } + foreach (EpigraphItem PoemEpigraph in Epigraphs) + { + xPoem.Add(PoemEpigraph.ToXML()); + } + foreach (IFb2TextItem PoemStanza in content) + { + xPoem.Add(PoemStanza.ToXML()); + } + foreach (TextAuthorItem TextAuthor in authors) + { + xPoem.Add(TextAuthor.ToXML()); + } + if (Date != null) + { + xPoem.Add(Date.ToXML()); + } + + return xPoem; + } + } +} \ No newline at end of file diff --git a/fb2library/Elements/Poem/StanzaItem.cs b/fb2library/Elements/Poem/StanzaItem.cs new file mode 100644 index 0000000..564d27e --- /dev/null +++ b/fb2library/Elements/Poem/StanzaItem.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements.Poem +{ + public class StanzaItem : IFb2TextItem + { + private readonly List lines = new List(); + + public TitleItem Title { get; set; } + public SubTitleItem SubTitle { get; set; } + public List Lines { get { return lines; } } + public string Lang { get; set; } + + internal const string Fb2StanzaElementName = "stanza"; + + internal void Load(XElement xStanza) + { + if (xStanza == null) + { + throw new ArgumentNullException("xStanza"); + } + + if (xStanza.Name.LocalName != Fb2StanzaElementName) + { + throw new ArgumentException("Element of wrong type passed", "xStanza"); + } + + Title = null; + XElement xTitle = xStanza.Element(xStanza.Name.Namespace + TitleItem.Fb2TitleElementName); + if (xTitle != null) + { + Title = new TitleItem(); + try + { + Title.Load(xTitle); + } + catch (Exception) + { + } + } + + SubTitle = null; + XElement xSubtitle = xStanza.Element(xStanza.Name.Namespace + SubTitleItem.Fb2SubtitleElementName); + if (xSubtitle != null) + { + SubTitle = new SubTitleItem(); + try + { + SubTitle.Load(xSubtitle); + } + catch (Exception) + { + } + } + + lines.Clear(); + IEnumerable xLines = xStanza.Elements(xStanza.Name.Namespace + VPoemParagraph.Fb2VParagraphItemName); + foreach (var xLine in xLines) + { + VPoemParagraph vline = new VPoemParagraph(); + try + { + vline.Load(xLine); + lines.Add(vline); + } + catch (Exception) + { + continue; + } + } + + Lang = null; + XAttribute xLang = xStanza.Attribute(XNamespace.Xml + "lang"); + if ((xLang != null) && (xLang.Value != null)) + { + Lang = xLang.Value; + } + + } + + public XNode ToXML() + { + XElement xStanza = new XElement(Fb2Const.fb2DefaultNamespace + Fb2StanzaElementName); + if (!string.IsNullOrEmpty(Lang)) + { + xStanza.Add(new XAttribute(XNamespace.Xml + "lang", Lang)); + } + if (Title != null) + { + xStanza.Add(Title.ToXML()); + } + if (SubTitle != null) + { + xStanza.Add(SubTitle.ToXML()); + } + foreach (VPoemParagraph PoemLine in lines) + { + xStanza.Add(PoemLine.ToXML()); + } + return xStanza; + + } + } +} diff --git a/fb2library/Elements/Poem/VPoemParagraph.cs b/fb2library/Elements/Poem/VPoemParagraph.cs new file mode 100644 index 0000000..7e396f0 --- /dev/null +++ b/fb2library/Elements/Poem/VPoemParagraph.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace FB2Library.Elements.Poem +{ + public class VPoemParagraph : ParagraphItem + { + protected override string GetElementName() + { + return Fb2VParagraphItemName; + } + + + internal const string Fb2VParagraphItemName = "v"; + } +} diff --git a/fb2library/Elements/SectionItem.cs b/fb2library/Elements/SectionItem.cs new file mode 100644 index 0000000..e82ccbb --- /dev/null +++ b/fb2library/Elements/SectionItem.cs @@ -0,0 +1,337 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FB2Library.Elements.Poem; +using FB2Library.Elements.Table; + +namespace FB2Library.Elements +{ + public class SectionItem : IFb2TextItem + { + internal const string Fb2TextSectionElementName = "section"; + + private readonly List content = new List(); + private readonly List epigraphs = new List(); + + // "pointers" top all section's subsections + private readonly List subSections = new List(); + + // "pointers" to all section's images + private readonly List images = new List(); + + // section images for the section + private readonly List sectionImages = new List(); + + + + + + public List Epigraphs { get { return epigraphs; } } + + public TitleItem Title { get; set; } + + public List Content { get { return content; } } + + public List SectionImages { get { return sectionImages; } } + + public AnnotationItem Annotation { get; set; } + + public string ID { get; set; } + + public List SubSections { get { return subSections; } } + + public List Images { get { return images; } } + + public string Lang { get; set;} + + + internal void Load(XElement xSection) + { + ClearAll(); + if (xSection == null) + { + throw new ArgumentNullException("xSection"); + } + + if (xSection.Name.LocalName != Fb2TextSectionElementName) + { + throw new ArgumentException("Element of wrong type passed", "xSection"); + } + + XElement xTitle = xSection.Element(xSection.Name.Namespace + TitleItem.Fb2TitleElementName); + if (xTitle != null) + { + Title = new TitleItem(); + try + { + Title.Load(xTitle); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section title : {0}.", ex.Message)); + } + } + + IEnumerable xEpigraphs = + xSection.Elements(xSection.Name.Namespace + EpigraphItem.Fb2EpigraphElementName); + foreach (var xEpigraph in xEpigraphs) + { + EpigraphItem epigraph = new EpigraphItem(); + try + { + epigraph.Load(xEpigraph); + epigraphs.Add(epigraph); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section epigraph : {0}.", ex.Message)); + } + } + + XElement xAnnotation = xSection.Element(xSection.Name.Namespace + AnnotationItem.Fb2AnnotationItemName); + if (xAnnotation != null) + { + Annotation = new AnnotationItem(); + try + { + Annotation.Load(xAnnotation); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section annotation : {0}.", ex.Message)); + } + } + + IEnumerable xElements = xSection.Elements(); + foreach (var xElement in xElements) + { + switch (xElement.Name.LocalName) + { + case ParagraphItem.Fb2ParagraphElementName: + ParagraphItem paragraph = new ParagraphItem(); + try + { + paragraph.Load(xElement); + content.Add(paragraph); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section paragraph : {0}.", ex.Message)); + } + break; + case PoemItem.Fb2PoemElementName: + PoemItem poem = new PoemItem(); + try + { + poem.Load(xElement); + content.Add(poem); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section poem : {0}.", ex.Message)); + } + break; + case ImageItem.Fb2ImageElementName: + ImageItem image = new ImageItem(); + try + { + image.Load(xElement); + AddImage(image); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section image : {0}.", ex.Message)); + } + break; + case SubTitleItem.Fb2SubtitleElementName: + SubTitleItem subtitle = new SubTitleItem(); + try + { + subtitle.Load(xElement); + content.Add(subtitle); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section subtitle : {0}.", ex.Message)); + } + break; + case CiteItem.Fb2CiteElementName: + CiteItem cite = new CiteItem(); + try + { + cite.Load(xElement); + content.Add(cite); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section citation : {0}.", ex.Message)); + } + break; + case EmptyLineItem.Fb2EmptyLineElementName: + EmptyLineItem eline = new EmptyLineItem(); + content.Add(eline); + break; + case TableItem.Fb2TableElementName: + TableItem table = new TableItem(); + try + { + table.Load(xElement); + content.Add(table); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load section emptly line : {0}.", ex.Message)); + } + break; + case Fb2TextSectionElementName: // internal
read recurive + SectionItem section = new SectionItem(); + try + { + section.Load(xElement); + AddSection(section); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Failed to load sub-section : {0}.", ex.Message)); + } + break; + case AnnotationItem.Fb2AnnotationItemName: // already processed + break; + case TitleItem.Fb2TitleElementName: // already processed + break; + case EpigraphItem.Fb2EpigraphElementName: // already processed + break; + default: + if (!string.IsNullOrEmpty(xElement.Value)) + { + ParagraphItem tempParagraph = new ParagraphItem(); + try + { + SimpleText text = new SimpleText {Text = xElement.Value}; + tempParagraph.ParagraphData.Add(text); + content.Add(tempParagraph); + } + catch (Exception) + { + + } + } + Debug.WriteLine(string.Format("AnnotationItem:Load - invalid element <{0}> encountered in title .", xElement.Name.LocalName)); + break; + } + } + + ID = null; + XAttribute xID = xSection.Attribute("id"); + if ((xID != null) && (xID.Value != null)) + { + ID = xID.Value; + } + + Lang = null; + XAttribute xLang = xSection.Attribute(XNamespace.Xml + "lang"); + if ((xLang != null)&&(xLang.Value != null)) + { + Lang = xLang.Value; + } + } + + private void ClearAll() + { + content.Clear(); + subSections.Clear(); + images.Clear(); + sectionImages.Clear(); + epigraphs.Clear(); + ID = null; + Annotation = null; + Title = null; + } + + private void AddImage(ImageItem image) + { + content.Add(image); + images.Add(image); + DetectSectionImage(image); + } + + private void DetectSectionImage(ImageItem image) + { + foreach (var item in content) + { + if (item.GetType() == typeof(ImageItem)) // if we have an image + { + if (item == image) // if the item we currently lookin at is our image, means it at start and it's a section image + { + sectionImages.Add(image); // add it to list of section images + return; + } + continue; // skip to next item in list + } + if (item.GetType() == typeof(TitleItem)) + { + // title according to schema can come before image + continue; + } + if (item.GetType() == typeof(EpigraphItem)) + { + // epigraph according to schema can come before image + continue; + } + // according to schema images goes first + // wrong type means we passed possible section image location + return; + } + } + + private void AddSection(SectionItem section) + { + content.Add(section); + subSections.Add(section); + } + + public XNode ToXML() + { + XElement xSection = new XElement(Fb2Const.fb2DefaultNamespace + Fb2TextSectionElementName); + if (!string.IsNullOrEmpty(ID)) + { + xSection.Add(new XAttribute("id", ID)); + } + if (!string.IsNullOrEmpty(Lang)) + { + xSection.Add(new XAttribute(XNamespace.Xml + "lang", Lang)); + } + + if (Title != null) + { + xSection.Add(Title.ToXML()); + } + foreach (EpigraphItem EpItem in epigraphs) + { + xSection.Add(EpItem.ToXML()); + } + if (SectionImages.Count != 0) + { + //xSection.Add(SectionImages.ToXML()); + foreach (var image in SectionImages) + { + xSection.Add(image.ToXML()); + } + } + if (Annotation != null) + { + xSection.Add(Annotation.ToXML()); + } + foreach (IFb2TextItem ContItem in content) + { + xSection.Add(ContItem.ToXML()); + } + + return xSection; + } + } +} diff --git a/fb2library/Elements/SequenceType.cs b/fb2library/Elements/SequenceType.cs new file mode 100644 index 0000000..5016b5e --- /dev/null +++ b/fb2library/Elements/SequenceType.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public class SequenceType + { + public const string SequenceElementName = "sequence"; + + private readonly List content = new List(); + + private XNamespace fileNameSpace = XNamespace.None; + + + /// + /// XML namespace used to read the document + /// + public XNamespace Namespace + { + set { fileNameSpace = value; } + get { return fileNameSpace; } + } + + /// + /// Get/Set name of the sequence + /// + public string Name { get; set; } + + /// + /// Get/Set sequence number + /// + public int? Number { get; set; } + + + /// + /// Get/Set language + /// + public string Language { get; set; } + + + /// + /// Get subsection list + /// + public List SubSections { get { return content; } } + + public void Load(XElement xElement) + { + if (xElement == null) + { + throw new ArgumentNullException("xElement"); + } + + if (xElement.Name.LocalName != SequenceElementName) + { + throw new ArgumentException("Element of wrong type passed", "xElement"); + } + + // read all subsecquences + content.Clear(); + IEnumerable subElements = xElement.Elements(fileNameSpace + SequenceElementName); + foreach (var element in subElements) + { + var subElement = new SequenceType(); + try + { + subElement.Load(element); + content.Add(subElement); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error reading sequence element: {0}",ex.Message)); + continue; + } + } + + // read "name" attribute + Name = null; + XAttribute xName = xElement.Attribute("name"); + if (xName != null && (!string.IsNullOrEmpty(xName.Value))) + { + Name = xName.Value; + + // read number attribute + Number = null; + XAttribute xNumber = xElement.Attribute("number"); + if ((xNumber != null) && (!string.IsNullOrEmpty(xNumber.Value))) + { + int value; + if (int.TryParse(xNumber.Value, out value)) + { + Number = value; + } + } + + Language = null; + XAttribute xLang = xElement.Attribute(XNamespace.Xml + "lang"); + if (xLang != null && !string.IsNullOrEmpty(xLang.Value)) + { + Language = xLang.Value; + } + } + else + { + //throw new Exception("Name attribute in sequence is required!"); + } + } + + public XElement ToXML() + { + XElement xSequence = new XElement(Fb2Const.fb2DefaultNamespace + SequenceElementName); + if (!string.IsNullOrEmpty(Name)) + { + xSequence.Add(new XAttribute("name", Name)); + } + if (Number != null) + { + xSequence.Add(new XAttribute("number",Number)); + } + if (!string.IsNullOrEmpty(Language)) + { + xSequence.Add(new XAttribute(XNamespace.Xml + "lang", Language)); + } + foreach(SequenceType SubSeq in content) + { + xSequence.Add(SubSeq.ToXML()); + } + + return xSequence; + } + } +} diff --git a/fb2library/Elements/ShareInstructionType.cs b/fb2library/Elements/ShareInstructionType.cs new file mode 100644 index 0000000..30dfd71 --- /dev/null +++ b/fb2library/Elements/ShareInstructionType.cs @@ -0,0 +1,247 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace FB2Library.Elements +{ + public interface IShareInstructionElement + { + void Load(XElement xElement); + XElement ToXML(); + } + + + public enum GenerationInstructionEnum + { + Unknown, + Require, + Allow, + Deny, + } + + /// + /// In-document instruction for generating output free and payed documents + /// + public class ShareInstructionType + { + public enum ShareModeEnum + { + Unknown, + Free, + Paid, + } + + + private List content = new List(); + + /// + /// Get/Set Modes for document sharing + /// + public ShareModeEnum SharedMode { get; set; } + + + /// + /// Get/Set instructions to process sections + /// + public GenerationInstructionEnum Instruction { get; set; } + + /// + /// Get/Set price + /// + public float? Price { get; set; } + + /// + /// Get/Set currency + /// + public string Currency { get; set; } + + public const string ShareInstructionElementName = "output"; + + private XNamespace fileNameSpace = XNamespace.None; + + /// + /// XML namespace used to read the document + /// + public XNamespace Namespace + { + set { fileNameSpace = value; } + get { return fileNameSpace; } + } + + /// + /// Get list of content elements + /// + public List Content { get { return content; } } + + public void Load(XElement xElement) + { + if (xElement == null) + { + throw new ArgumentNullException("xElement"); + } + if (xElement.Name.LocalName != ShareInstructionElementName) + { + throw new ArgumentException(string.Format("Wrong element name: {0} instead of {1}",xElement.Name.LocalName,ShareInstructionElementName)); + } + + content.Clear(); + IEnumerable xElements = xElement.Elements(); + foreach (var element in xElements) + { + if (element.Name.LocalName == PartShareInstructionType.PartElementName) + { + PartShareInstructionType part = new PartShareInstructionType{Namespace = fileNameSpace}; + try + { + part.Load(element); + content.Add(part); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error loading part type: {0}",ex.Message)); + } + } + else if (element.Name.LocalName == OutPutDocumentType.OutputDocumentElementName) + { + OutPutDocumentType doc = new OutPutDocumentType{Namespace = fileNameSpace}; + try + { + doc.Load(element); + content.Add(doc); + } + catch (Exception ex) + { + Debug.WriteLine(string.Format("Error loading output document type: {0}", ex.Message)); + } + } + else + { + Debug.WriteLine(string.Format("Invalid element type encoutered {0}", element.Name.LocalName)); + } + } + + XAttribute xSharedMode = xElement.Attribute("mode"); + if ((xSharedMode == null) || string.IsNullOrEmpty(xSharedMode.Value) ) + { + Debug.WriteLine("mode attribute is required attribute"); + } + else + { + switch (xSharedMode.Value) + { + case "free": + SharedMode = ShareModeEnum.Free; + break; + case "paid": + SharedMode = ShareModeEnum.Paid; + break; + default: + Debug.WriteLine(string.Format("Invalid shared mode type : {0}", xSharedMode.Value)); + break; + } + } + + + XAttribute xIncludeAll = xElement.Attribute("include-all"); + if ((xIncludeAll == null) || string.IsNullOrEmpty(xIncludeAll.Value)) + { + Debug.WriteLine("mode attribute is required attribute"); + } + else + { + switch (xIncludeAll.Value) + { + case "require": + Instruction = GenerationInstructionEnum.Require; + break; + case "allow": + Instruction = GenerationInstructionEnum.Allow; + break; + case "deny": + Instruction = GenerationInstructionEnum.Deny; + break; + default: + Debug.WriteLine(string.Format("Invalid instruction type : {0}", xIncludeAll.Value)); + break; + } + } + + Price = null; + XAttribute xPrice = xElement.Attribute("price"); + if ((xPrice != null) && !string.IsNullOrEmpty(xPrice.Value)) + { + float val; + if (float.TryParse(xPrice.Value,out val)) + { + Price = val; + } + } + + + Currency = null; + XAttribute xCurrency = xElement.Attribute("currency"); + if (xCurrency != null) + { + Currency = xCurrency.Value; + } + } + + private string GetXSharedMode() + { + switch (SharedMode) + { + case ShareModeEnum.Free: + return "free"; + case ShareModeEnum.Paid: + return "paid"; + default: + return ""; + // Debug.WriteLine(string.Format("Invalid shared mode type : {0}", xSharedMode.Value)); + // break; + } + } + + private string GetXIncludeAll() + { + switch (Instruction) + { + case GenerationInstructionEnum.Require: + return "require"; + case GenerationInstructionEnum.Allow: + return "allow"; + case GenerationInstructionEnum.Deny: + return "deny"; + default: + return ""; + //Debug.WriteLine(string.Format("Invalid instruction type : {0}", xIncludeAll.Value)); + //break; + } + } + public XElement ToXML() + { + XElement xShareInstruction = new XElement(Fb2Const.fb2DefaultNamespace + ShareInstructionElementName); + + xShareInstruction.Add(new XAttribute("mode", GetXSharedMode())); + xShareInstruction.Add(new XAttribute("include-all", GetXIncludeAll())); + if (Price != null) + { + xShareInstruction.Add(new XAttribute("price", Price.ToString())); + } + if (Currency != null) + { + xShareInstruction.Add(new XAttribute("currency", Currency)); + } + foreach (IShareInstructionElement ShareElement in content) + { + xShareInstruction.Add(ShareElement.ToXML()); + } + + + return xShareInstruction; + } + } +} diff --git a/fb2library/Elements/SimpleText.cs b/fb2library/Elements/SimpleText.cs new file mode 100644 index 0000000..4ae4302 --- /dev/null +++ b/fb2library/Elements/SimpleText.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; +//Добавить для