Replacing SharpZipLib by DtoNetZip

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-05 18:47:59 -07:00
parent b1b921c2a2
commit cd7fb75f65
10 changed files with 18215 additions and 78 deletions

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Zip;
using Ionic.Zip;
using NUnit.Framework;
using Orchard.Environment.Configuration;
using Orchard.FileSystems.Media;
@@ -169,46 +169,21 @@ namespace Orchard.Tests.Modules.Media.Services {
private MemoryStream CreateZipMemoryStream() {
// Setup memory stream with zip archive for more complex scenarios
MemoryStream memoryStream = new MemoryStream();
ZipOutputStream zipOut = new ZipOutputStream(memoryStream);
using (ZipFile zipOut = new ZipFile()) {
zipOut.PutNextEntry(new ZipEntry(TextFileName));
zipOut.Write(new byte[] { 0x01 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(WebconfigFileName));
zipOut.Write(new byte[] { 0x02 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(DllFileName));
zipOut.Write(new byte[] { 0x03 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(ZipFileName));
zipOut.Write(new byte[] { 0x04 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(NoExtensionFileName));
zipOut.Write(new byte[] { 0x05 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(PaddedWebconfigFileName));
zipOut.Write(new byte[] { 0x06 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(FinalDottedWebconfigFileName));
zipOut.Write(new byte[] { 0x07 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(PaddedTextFileName));
zipOut.Write(new byte[] { 0x08 }, 0, 1);
zipOut.CloseEntry();
zipOut.PutNextEntry(new ZipEntry(FinalDottedTextFileName));
zipOut.Write(new byte[] { 0x09 }, 0, 1);
zipOut.CloseEntry();
zipOut.Close();
zipOut.AddEntry(TextFileName, new byte[] { 0x01 });
zipOut.AddEntry(WebconfigFileName, new byte[] { 0x02 });
zipOut.AddEntry(DllFileName, new byte[] { 0x03 });
zipOut.AddEntry(ZipFileName, new byte[] { 0x04 });
zipOut.AddEntry(NoExtensionFileName, new byte[] { 0x05 });
zipOut.AddEntry(PaddedWebconfigFileName, new byte[] { 0x06 });
zipOut.AddEntry(FinalDottedWebconfigFileName, new byte[] { 0x07 });
zipOut.AddEntry(PaddedTextFileName, new byte[] { 0x08 });
zipOut.AddEntry(FinalDottedTextFileName, new byte[] { 0x09 });
zipOut.Save(memoryStream);
}
return new MemoryStream(memoryStream.ToArray());
}

View File

@@ -72,14 +72,13 @@
<Reference Include="FluentPath">
<HintPath>..\..\lib\fluentpath\FluentPath.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\sharpziplib\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\nhibernate\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip">
<HintPath>..\..\lib\dotnetzip\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="IronRuby, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\dlr\IronRuby.dll</HintPath>