diff --git a/README.md b/README.md
index 9b0b3b905..acb4f8053 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,6 @@ and also some libraries which we do not store in the source tree:
* Newtonsoft.Json.dll
* DiscUtils.dll
* ICSharpCode.SharpZipLib.dll
-* Ionic.Zip.dll
* log4net.dll
You can find the source code of these libraries (along with some patches) in
diff --git a/WixInstaller/XenCenter.wxs b/WixInstaller/XenCenter.wxs
index 4c201a381..539e8b4e2 100644
--- a/WixInstaller/XenCenter.wxs
+++ b/WixInstaller/XenCenter.wxs
@@ -69,7 +69,6 @@
-
diff --git a/WixInstaller/branding.wxs b/WixInstaller/branding.wxs
index 8a1741322..c5f5f741f 100644
--- a/WixInstaller/branding.wxs
+++ b/WixInstaller/branding.wxs
@@ -43,7 +43,6 @@
-
diff --git a/XenAdmin/Dialogs/LegalNoticesDialog.ja.resx b/XenAdmin/Dialogs/LegalNoticesDialog.ja.resx
index 71fd03f38..feb4fc45b 100644
--- a/XenAdmin/Dialogs/LegalNoticesDialog.ja.resx
+++ b/XenAdmin/Dialogs/LegalNoticesDialog.ja.resx
@@ -206,31 +206,6 @@ All schemas sourced from schemas.dmtf.org: Copyright © 2009 Distributed Managem
DMTF is a not-for-profit association of industry members dedicated to promoting enterprise and systems management and interoperability. Members and non-members may reproduce DMTF specifications and documents for uses consistent with this purpose, provided that correct attribution is given. As DMTF specifications may be revised from time to time, the particular version and release date should always be noted.
Implementation of certain elements of this standard or proposed standard may be subject to third-party patent rights, including provisional patent rights (herein "patent rights"). DMTF makes no representations to users of the standard as to the existence of such rights, and is not responsible to recognize, disclose, or identify any or all such third party patent right, owners or claimants, nor for any incomplete or inaccurate identification or disclosure of such rights, owners or claimants. DMTF shall have no liability to any party, in any manner or circumstance, under any legal theory whatsoever, for failure to recognize, disclose, or identify any such third-party patent rights, or for such party's reliance on the standard or incorporation thereof in its product, protocols or testing procedures. DMTF shall have no liability to any party implementing such standard, whether such implementation is foreseeable or not, nor to any patent owner or claimant, and shall have no liability or responsibility for costs or losses incurred if a standard is withdrawn or modified after publication, and shall be indemnified and held harmless by any party implementing the standard from any and all claims of infringement by a patent owner for such implementations.
-Software Licenses that apply to DotNetZip
-This software, the DotNetZip library and tools is provided for your use under several licenses. One license applies to DotNetZip, and several other licenses apply to work that DotNetZip derives from. To use the software, you must accept the licenses. If you do not accept the licenses, do not use the software.
-The following license, the Microsoft Public License (Ms-PL), applies to the original intellectual property in DotNetZip:
-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 contributor’s 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.
-
-
-The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zip.dll is derived from the jzlib, which is Copyright (c) 2000,2001,2002,2003 ymnk, JCraft, Inc., and is licensed under the following terms:
-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.
The xxHash library used in this software has the following MIT license:
MIT License
@@ -240,24 +215,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-The jzlib library, itself, is based on the C-language ZLIB library, v1.1.3. The following notice and license applies to zlib:
-ZLIB is 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
-
-
-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.
-
Blueprint CSS Framework License: Copyright (c) 2007 - 2010 blueprintcss.org
Permission is hereby granted, free of charge, to any person obtaining a copy of the Blueprint CSS Framework and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/XenAdmin/Dialogs/LegalNoticesDialog.resx b/XenAdmin/Dialogs/LegalNoticesDialog.resx
index 25d95d7ca..319852d35 100644
--- a/XenAdmin/Dialogs/LegalNoticesDialog.resx
+++ b/XenAdmin/Dialogs/LegalNoticesDialog.resx
@@ -206,31 +206,6 @@ All schemas sourced from schemas.dmtf.org: Copyright © 2009 Distributed Managem
DMTF is a not-for-profit association of industry members dedicated to promoting enterprise and systems management and interoperability. Members and non-members may reproduce DMTF specifications and documents for uses consistent with this purpose, provided that correct attribution is given. As DMTF specifications may be revised from time to time, the particular version and release date should always be noted.
Implementation of certain elements of this standard or proposed standard may be subject to third-party patent rights, including provisional patent rights (herein "patent rights"). DMTF makes no representations to users of the standard as to the existence of such rights, and is not responsible to recognize, disclose, or identify any or all such third party patent right, owners or claimants, nor for any incomplete or inaccurate identification or disclosure of such rights, owners or claimants. DMTF shall have no liability to any party, in any manner or circumstance, under any legal theory whatsoever, for failure to recognize, disclose, or identify any such third-party patent rights, or for such party's reliance on the standard or incorporation thereof in its product, protocols or testing procedures. DMTF shall have no liability to any party implementing such standard, whether such implementation is foreseeable or not, nor to any patent owner or claimant, and shall have no liability or responsibility for costs or losses incurred if a standard is withdrawn or modified after publication, and shall be indemnified and held harmless by any party implementing the standard from any and all claims of infringement by a patent owner for such implementations.
-Software Licenses that apply to DotNetZip
-This software, the DotNetZip library and tools is provided for your use under several licenses. One license applies to DotNetZip, and several other licenses apply to work that DotNetZip derives from. To use the software, you must accept the licenses. If you do not accept the licenses, do not use the software.
-The following license, the Microsoft Public License (Ms-PL), applies to the original intellectual property in DotNetZip:
-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 contributor’s 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.
-
-
-The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zip.dll is derived from the jzlib, which is Copyright (c) 2000,2001,2002,2003 ymnk, JCraft, Inc., and is licensed under the following terms:
-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.
The xxHash library used in this software has the following MIT license:
MIT License
@@ -240,24 +215,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-The jzlib library, itself, is based on the C-language ZLIB library, v1.1.3. The following notice and license applies to zlib:
-ZLIB is 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
-
-
-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.
-
Blueprint CSS Framework License: Copyright (c) 2007 - 2010 blueprintcss.org
Permission is hereby granted, free of charge, to any person obtaining a copy of the Blueprint CSS Framework and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/XenAdmin/Dialogs/LegalNoticesDialog.zh-CN.resx b/XenAdmin/Dialogs/LegalNoticesDialog.zh-CN.resx
index a6863217c..e0eef8445 100644
--- a/XenAdmin/Dialogs/LegalNoticesDialog.zh-CN.resx
+++ b/XenAdmin/Dialogs/LegalNoticesDialog.zh-CN.resx
@@ -206,31 +206,6 @@ All schemas sourced from schemas.dmtf.org: Copyright © 2009 Distributed Managem
DMTF is a not-for-profit association of industry members dedicated to promoting enterprise and systems management and interoperability. Members and non-members may reproduce DMTF specifications and documents for uses consistent with this purpose, provided that correct attribution is given. As DMTF specifications may be revised from time to time, the particular version and release date should always be noted.
Implementation of certain elements of this standard or proposed standard may be subject to third-party patent rights, including provisional patent rights (herein "patent rights"). DMTF makes no representations to users of the standard as to the existence of such rights, and is not responsible to recognize, disclose, or identify any or all such third party patent right, owners or claimants, nor for any incomplete or inaccurate identification or disclosure of such rights, owners or claimants. DMTF shall have no liability to any party, in any manner or circumstance, under any legal theory whatsoever, for failure to recognize, disclose, or identify any such third-party patent rights, or for such party's reliance on the standard or incorporation thereof in its product, protocols or testing procedures. DMTF shall have no liability to any party implementing such standard, whether such implementation is foreseeable or not, nor to any patent owner or claimant, and shall have no liability or responsibility for costs or losses incurred if a standard is withdrawn or modified after publication, and shall be indemnified and held harmless by any party implementing the standard from any and all claims of infringement by a patent owner for such implementations.
-Software Licenses that apply to DotNetZip
-This software, the DotNetZip library and tools is provided for your use under several licenses. One license applies to DotNetZip, and several other licenses apply to work that DotNetZip derives from. To use the software, you must accept the licenses. If you do not accept the licenses, do not use the software.
-The following license, the Microsoft Public License (Ms-PL), applies to the original intellectual property in DotNetZip:
-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 contributor’s 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.
-
-
-The managed ZLIB code included in Ionic.Zlib.dll and Ionic.Zip.dll is derived from the jzlib, which is Copyright (c) 2000,2001,2002,2003 ymnk, JCraft, Inc., and is licensed under the following terms:
-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.
The xxHash library used in this software has the following MIT license:
MIT License
@@ -240,24 +215,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-The jzlib library, itself, is based on the C-language ZLIB library, v1.1.3. The following notice and license applies to zlib:
-ZLIB is 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
-
-
-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.
-
Blueprint CSS Framework License: Copyright (c) 2007 - 2010 blueprintcss.org
Permission is hereby granted, free of charge, to any person obtaining a copy of the Blueprint CSS Framework and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/XenAdminTests/ArchiveTests/ArchiveFactoryTests.cs b/XenAdminTests/ArchiveTests/ArchiveFactoryTests.cs
index 9b7c60451..c879fcf8e 100644
--- a/XenAdminTests/ArchiveTests/ArchiveFactoryTests.cs
+++ b/XenAdminTests/ArchiveTests/ArchiveFactoryTests.cs
@@ -39,13 +39,12 @@ namespace XenAdminTests.ArchiveTests
[TestFixture, Category(TestCategories.Unit)]
public class ArchiveFactoryTests
{
- [TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(SharpZipTarArchiveIterator))]
- [TestCase(ArchiveFactory.Type.TarGz, ExpectedResult = typeof(SharpZipTarArchiveIterator))]
- [TestCase(ArchiveFactory.Type.TarBz2, ExpectedResult = typeof(SharpZipTarArchiveIterator))]
+ [TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(TarArchiveIterator))]
+ [TestCase(ArchiveFactory.Type.TarGz, ExpectedResult = typeof(TarArchiveIterator))]
[Test]
public Type TestReaderGeneration(int archiveType)
{
- string target = TestUtils.GetTestResource("emptyfile.bz2");
+ string target = TestUtils.GetTestResource("emptyfile.gz");
using (var ms = new MemoryStream(File.ReadAllBytes(target)))
using (var iterator = ArchiveFactory.Reader((ArchiveFactory.Type)archiveType, ms))
@@ -53,8 +52,8 @@ namespace XenAdminTests.ArchiveTests
}
- [TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(SharpZipTarArchiveWriter))]
- [TestCase(ArchiveFactory.Type.Zip, ExpectedResult = typeof(DotNetZipZipWriter))]
+ [TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(TarArchiveWriter))]
+ [TestCase(ArchiveFactory.Type.Zip, ExpectedResult = typeof(ZipArchiveWriter))]
[Test]
public Type TestWriterGeneration(int archiveType)
{
@@ -66,7 +65,6 @@ namespace XenAdminTests.ArchiveTests
}
[TestCase(ArchiveFactory.Type.TarGz)]
- [TestCase(ArchiveFactory.Type.TarBz2)]
[Test]
public void TestWriterGenerationUnsupported(int archiveType)
{
diff --git a/XenAdminTests/ArchiveTests/ThirdPartyArchiveWriterTests.cs b/XenAdminTests/ArchiveTests/ThirdPartyArchiveWriterTests.cs
index 1513ef7eb..3af6721c4 100644
--- a/XenAdminTests/ArchiveTests/ThirdPartyArchiveWriterTests.cs
+++ b/XenAdminTests/ArchiveTests/ThirdPartyArchiveWriterTests.cs
@@ -38,8 +38,8 @@ using XenCenterLib.Archive;
namespace XenAdminTests.ArchiveTests
{
- [TestFixture(typeof(SharpZipTarArchiveIterator), typeof(SharpZipTarArchiveWriter))]
- [TestFixture(typeof(DotNetZipZipIterator), typeof(DotNetZipZipWriter))]
+ [TestFixture(typeof(TarArchiveIterator), typeof(TarArchiveWriter))]
+ [TestFixture(typeof(ZipArchiveIterator), typeof(ZipArchiveWriter))]
[Category(TestCategories.Unit)]
public class ThirdPartyArchiveWriterTest
where TR : ArchiveIterator, new()
diff --git a/XenAdminTests/CompressionTests/CompressionFactoryTests.cs b/XenAdminTests/CompressionTests/CompressionFactoryTests.cs
index dca446930..4749fc357 100644
--- a/XenAdminTests/CompressionTests/CompressionFactoryTests.cs
+++ b/XenAdminTests/CompressionTests/CompressionFactoryTests.cs
@@ -39,8 +39,7 @@ namespace XenAdminTests.CompressionTests
[TestFixture, Category(TestCategories.Unit)]
public class CompressionFactoryTests
{
- [TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(DotNetZipGZipOutputStream))]
- [TestCase(CompressionFactory.Type.Bz2, ExpectedResult = typeof(DotNetZipBZip2OutputStream))]
+ [TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(GZipOutputStream))]
[Test]
public Type TestWriterGeneration(int archiveType)
{
@@ -51,38 +50,17 @@ namespace XenAdminTests.CompressionTests
}
}
- [TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(DotNetZipGZipInputStream))]
- [TestCase(CompressionFactory.Type.Bz2, ExpectedResult = typeof(DotNetZipBZip2InputStream))]
+ [TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(GZipInputStream))]
[Test]
public Type TestReaderGenerationWithFile(int archiveType)
{
- string target = TestUtils.GetTestResource("emptyfile.bz2");
- /*
- * Note: Reading a bzip2 file in as a byte[] works for gzip as well as bzip2 stream
- * as the implementation of bzip2 must be initialised with a string containing a
- * header, EOF etc. whereas gzip doesn't mind so the following will work despite
- * opening a gzip compression stream with a bzip2 data
- */
+ string target = TestUtils.GetTestResource("emptyfile.gz");
+
using (MemoryStream ms = new MemoryStream(File.ReadAllBytes(target)))
{
using (var providedStream = CompressionFactory.Reader((CompressionFactory.Type)archiveType, ms))
return providedStream.GetType();
}
}
-
-
- [TestCase(CompressionFactory.Type.Bz2)]
- [Description("Checks that a BZip2 stream without actual BZip2 data, header, data etc., will throw an exception")]
- [Test]
- public void TestReaderGenerationWithoutFile(int archiveType)
- {
- using (MemoryStream ms = new MemoryStream())
- Assert.Throws(typeof(IOException), () =>
- {
- using (CompressionFactory.Reader((CompressionFactory.Type)archiveType, ms))
- {
- }
- });
- }
}
}
diff --git a/XenAdminTests/CompressionTests/ThirdPartyCompressionStreamTests.cs b/XenAdminTests/CompressionTests/ThirdPartyCompressionStreamTests.cs
index 9f817b1bb..1da2d6853 100644
--- a/XenAdminTests/CompressionTests/ThirdPartyCompressionStreamTests.cs
+++ b/XenAdminTests/CompressionTests/ThirdPartyCompressionStreamTests.cs
@@ -38,8 +38,7 @@ using XenCenterLib.Compression;
namespace XenAdminTests.CompressionTests
{
[Category(TestCategories.Unit)]
- [TestFixture(typeof(DotNetZipGZipInputStream), typeof(DotNetZipGZipOutputStream))]
- [TestFixture(typeof(DotNetZipBZip2InputStream), typeof(DotNetZipBZip2OutputStream))]
+ [TestFixture(typeof(GZipInputStream), typeof(GZipOutputStream))]
public class ThirdPartyCompressionTests
where TI : CompressionStream, new()
where TO : CompressionStream, new()
@@ -94,7 +93,7 @@ namespace XenAdminTests.CompressionTests
Directory.Delete(basePath, true);
}
- private void DecompressAFile( string targetFileName, string compressedFileName)
+ private void DecompressAFile(string targetFileName, string compressedFileName)
{
using (FileStream ifs = File.OpenRead(compressedFileName))
{
diff --git a/XenAdminTests/TestResources/emptyfile.bz2 b/XenAdminTests/TestResources/emptyfile.bz2
deleted file mode 100644
index b56f3b974..000000000
Binary files a/XenAdminTests/TestResources/emptyfile.bz2 and /dev/null differ
diff --git a/XenAdminTests/TestResources/emptyfile.gz b/XenAdminTests/TestResources/emptyfile.gz
new file mode 100644
index 000000000..c865ec681
Binary files /dev/null and b/XenAdminTests/TestResources/emptyfile.gz differ
diff --git a/XenAdminTests/XenAdminTests.csproj b/XenAdminTests/XenAdminTests.csproj
index e8913da94..c59539658 100644
--- a/XenAdminTests/XenAdminTests.csproj
+++ b/XenAdminTests/XenAdminTests.csproj
@@ -133,9 +133,6 @@
-
- PreserveNewest
-
PreserveNewest
diff --git a/XenCenterLib/Archive/ArchiveFactory.cs b/XenCenterLib/Archive/ArchiveFactory.cs
index 38590b691..b326b0440 100644
--- a/XenCenterLib/Archive/ArchiveFactory.cs
+++ b/XenCenterLib/Archive/ArchiveFactory.cs
@@ -47,7 +47,6 @@ namespace XenCenterLib.Archive
{
Tar,
TarGz,
- TarBz2,
Zip
}
@@ -62,13 +61,11 @@ namespace XenCenterLib.Archive
public static ArchiveIterator Reader(Type archiveType, Stream packagedData)
{
if (archiveType == Type.Tar)
- return new SharpZipTarArchiveIterator(packagedData);
+ return new TarArchiveIterator(packagedData);
if (archiveType == Type.TarGz)
- return new SharpZipTarArchiveIterator(packagedData, CompressionFactory.Type.Gz);
- if (archiveType == Type.TarBz2)
- return new SharpZipTarArchiveIterator(packagedData, CompressionFactory.Type.Bz2);
+ return new TarArchiveIterator(packagedData, CompressionFactory.Type.Gz);
if (archiveType == Type.Zip)
- return new DotNetZipZipIterator(packagedData);
+ return new ZipArchiveIterator(packagedData);
throw new NotSupportedException($"Type {archiveType} is not supported by ArchiveIterator");
}
@@ -83,9 +80,9 @@ namespace XenCenterLib.Archive
public static ArchiveWriter Writer(Type archiveType, Stream targetPackage)
{
if (archiveType == Type.Tar)
- return new SharpZipTarArchiveWriter(targetPackage);
+ return new TarArchiveWriter(targetPackage);
if (archiveType == Type.Zip)
- return new DotNetZipZipWriter(targetPackage);
+ return new ZipArchiveWriter(targetPackage);
throw new NotSupportedException($"Type {archiveType} is not supported by ArchiveWriter");
}
diff --git a/XenCenterLib/Archive/TarArchiveIterator.cs b/XenCenterLib/Archive/TarArchiveIterator.cs
index b913d5240..10c4bd9a5 100644
--- a/XenCenterLib/Archive/TarArchiveIterator.cs
+++ b/XenCenterLib/Archive/TarArchiveIterator.cs
@@ -37,23 +37,17 @@ using XenCenterLib.Compression;
namespace XenCenterLib.Archive
{
- public class SharpZipTarArchiveIterator : ArchiveIterator
+ public class TarArchiveIterator : ArchiveIterator
{
private TarInputStream tarStream;
private CompressionStream compressionStream;
private TarEntry tarEntry;
private bool disposed;
- public SharpZipTarArchiveIterator()
- {
- }
-
- public SharpZipTarArchiveIterator(Stream compressedTarFile, CompressionFactory.Type compressionType)
+ public TarArchiveIterator(Stream compressedTarFile, CompressionFactory.Type compressionType)
{
if (compressionType == CompressionFactory.Type.Gz)
compressionStream = CompressionFactory.Reader(CompressionFactory.Type.Gz, compressedTarFile);
- else if (compressionType == CompressionFactory.Type.Bz2)
- compressionStream = CompressionFactory.Reader(CompressionFactory.Type.Bz2, compressedTarFile);
else
throw new NotSupportedException($"Type {compressionType} is not supported by ArchiveIterator");
@@ -61,7 +55,7 @@ namespace XenCenterLib.Archive
disposed = false;
}
- public SharpZipTarArchiveIterator(Stream tarFile)
+ public TarArchiveIterator(Stream tarFile)
{
tarStream = new TarInputStream(tarFile);
disposed = false;
@@ -73,7 +67,7 @@ namespace XenCenterLib.Archive
disposed = false;
}
- ~SharpZipTarArchiveIterator()
+ ~TarArchiveIterator()
{
Dispose();
}
diff --git a/XenCenterLib/Archive/TarArchiveWriter.cs b/XenCenterLib/Archive/TarArchiveWriter.cs
index 125362f0d..de462e663 100644
--- a/XenCenterLib/Archive/TarArchiveWriter.cs
+++ b/XenCenterLib/Archive/TarArchiveWriter.cs
@@ -37,7 +37,7 @@ using ICSharpCode.SharpZipLib.Tar;
namespace XenCenterLib.Archive
{
- public class SharpZipTarArchiveWriter : ArchiveWriter
+ public class TarArchiveWriter : ArchiveWriter
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -45,11 +45,11 @@ namespace XenCenterLib.Archive
private const long bufferSize = 32 * 1024;
private bool disposed;
- public SharpZipTarArchiveWriter()
+ public TarArchiveWriter()
{
}
- public SharpZipTarArchiveWriter(Stream outputStream)
+ public TarArchiveWriter(Stream outputStream)
{
tar = new TarOutputStream(outputStream);
disposed = false;
diff --git a/XenCenterLib/Archive/ZipArchiveIterator.cs b/XenCenterLib/Archive/ZipArchiveIterator.cs
index ce69b7ba7..154c7042c 100644
--- a/XenCenterLib/Archive/ZipArchiveIterator.cs
+++ b/XenCenterLib/Archive/ZipArchiveIterator.cs
@@ -32,83 +32,49 @@
using System;
using System.Collections.Generic;
using System.IO;
-using Ionic.Zip;
+using System.IO.Compression;
+
namespace XenCenterLib.Archive
{
- public class DotNetZipZipIterator : ArchiveIterator
+ public class ZipArchiveIterator : ArchiveIterator
{
- private ZipFile zipFile;
- private IEnumerator enumerator;
- private ZipEntry zipEntry;
- private bool disposed;
+ private ZipArchive _zipArchive;
+ private IEnumerator _enumerator;
+ private ZipArchiveEntry _currentEntry;
+ private int _currentPosition = -1;
+ private bool _disposed;
///
- /// delegate params: long bytesTransferred, long totalBytesToTransfer
+ /// index of current file, total file count
///
- public event Action CurrentFileExtractProgressChanged;
- public event Action CurrentFileExtractCompleted;
+ public event Action CurrentFileExtracted;
- public DotNetZipZipIterator()
+ public ZipArchiveIterator(Stream inputStream)
{
- }
-
- public DotNetZipZipIterator(Stream inputStream)
- {
- Initialise(inputStream);
- disposed = false;
- }
-
- void zipFile_ExtractProgress(object sender, ExtractProgressEventArgs e)
- {
- switch (e.EventType)
- {
- case ZipProgressEventType.Extracting_EntryBytesWritten:
- {
- var handler = CurrentFileExtractProgressChanged;
- handler?.Invoke(e.BytesTransferred, e.TotalBytesToTransfer);
- }
- break;
- case ZipProgressEventType.Extracting_AfterExtractEntry:
- {
- var handler = CurrentFileExtractCompleted;
- handler?.Invoke();
- }
- break;
- }
- }
-
- private void Initialise(Stream zipStream)
- {
- try
- {
- zipFile = ZipFile.Read(zipStream);
- }
- catch (ZipException e)
- {
- throw new ArgumentException("Cannot read input as a ZipFile", "zipStream", e);
- }
-
- enumerator = zipFile.GetEnumerator();
- zipFile.ExtractProgress += zipFile_ExtractProgress;
+ _zipArchive = new ZipArchive(inputStream, ZipArchiveMode.Read);
+ _enumerator = _zipArchive.Entries.GetEnumerator();
}
public override void SetBaseStream(Stream inputStream)
{
- Initialise(inputStream);
- disposed = false;
+ _zipArchive = new ZipArchive(inputStream, ZipArchiveMode.Read);
+ _enumerator = _zipArchive.Entries.GetEnumerator();
+ _disposed = false;
+ _currentPosition = -1;
}
- ~DotNetZipZipIterator()
+ ~ZipArchiveIterator()
{
Dispose();
}
public override bool HasNext()
{
- if (enumerator != null && enumerator.MoveNext())
+ if (_enumerator != null && _enumerator.MoveNext())
{
- zipEntry = enumerator.Current;
+ _currentPosition++;
+ _currentEntry = _enumerator.Current;
return true;
}
return false;
@@ -116,34 +82,23 @@ namespace XenCenterLib.Archive
public override string CurrentFileName()
{
- if (zipEntry == null)
- return String.Empty;
-
- return zipEntry.FileName;
+ return _currentEntry == null ? string.Empty : _currentEntry.FullName;
}
public override long CurrentFileSize()
{
- if (zipEntry == null)
- return 0;
-
- return zipEntry.UncompressedSize;
+ return _currentEntry?.Length ?? 0;
}
public override DateTime CurrentFileModificationTime()
{
- if (zipEntry == null)
- return new DateTime();
-
- return zipEntry.LastModified;
+ return _currentEntry == null ? new DateTime() : _currentEntry.LastWriteTime.DateTime;
}
public override bool IsDirectory()
{
- if (zipEntry == null)
- return false;
-
- return zipEntry.IsDirectory;
+ var attr = (FileAttributes)(_currentEntry.ExternalAttributes & 0xff);
+ return attr.HasFlag(FileAttributes.Directory);
}
public override void ExtractCurrentFile(Stream extractedFileContents, Action cancellingDelegate)
@@ -151,25 +106,21 @@ namespace XenCenterLib.Archive
if (IsDirectory())
return;
- zipEntry.Extract(extractedFileContents);
+ using (var entryStream = _currentEntry.Open())
+ StreamUtilities.BufferedStreamCopy(entryStream, extractedFileContents);
+
+ CurrentFileExtracted?.Invoke(_currentPosition, _zipArchive.Entries.Count);
}
protected override void Dispose(bool disposing)
{
- base.Dispose(disposing);
- if(disposing)
+ if (disposing && !_disposed)
{
- if(!disposed)
- {
- if (zipFile != null)
- {
- zipFile.ExtractProgress -= zipFile_ExtractProgress;
- zipFile.Dispose();
- }
-
- disposed = true;
- }
+ _zipArchive.Dispose();
+ _disposed = true;
}
+
+ base.Dispose(disposing);
}
}
}
diff --git a/XenCenterLib/Archive/ZipArchiveWriter.cs b/XenCenterLib/Archive/ZipArchiveWriter.cs
index 5b1238517..c6f262925 100644
--- a/XenCenterLib/Archive/ZipArchiveWriter.cs
+++ b/XenCenterLib/Archive/ZipArchiveWriter.cs
@@ -31,72 +31,58 @@
using System;
using System.IO;
-using System.Text;
-using Ionic.Zip;
+using System.IO.Compression;
+
namespace XenCenterLib.Archive
{
- class DotNetZipZipWriter : ArchiveWriter
+ internal class ZipArchiveWriter : ArchiveWriter
{
- private ZipOutputStream zip;
- private bool disposed;
+ private ZipArchive _zipArchive;
+ private bool _disposed;
- public DotNetZipZipWriter(Stream outputStream)
- {
- zip = new ZipOutputStream( outputStream ) {EnableZip64 = Zip64Option.AsNecessary};
- disposed = false;
- }
-
- public DotNetZipZipWriter()
+ public ZipArchiveWriter(Stream outputStream)
{
+ _zipArchive = new ZipArchive(outputStream, ZipArchiveMode.Create);
}
public override void SetBaseStream(Stream outputStream)
{
- zip = new ZipOutputStream(outputStream);
- disposed = false;
+ _zipArchive = new ZipArchive(outputStream, ZipArchiveMode.Create);
+ _disposed = false;
}
public override void AddDirectory(string directoryName, DateTime modificationTime)
{
- StringBuilder sb = new StringBuilder(directoryName);
-
//Need to add a trailing front-slash to add a directory
if (!directoryName.EndsWith("/"))
- sb.Append("/");
+ directoryName += "/";
- ZipEntry entry = zip.PutNextEntry(sb.ToString());
- entry.ModifiedTime = modificationTime;
+ var entry = _zipArchive.CreateEntry(directoryName);
+ entry.LastWriteTime = modificationTime;
}
- public override void Add(Stream filetoAdd, string fileName, DateTime modificationTime, Action cancellingDelegate)
+ public override void Add(Stream fileToAdd, string fileName, DateTime modificationTime, Action cancellingDelegate)
{
- ZipEntry entry = zip.PutNextEntry(fileName);
- entry.ModifiedTime = modificationTime;
+ var entry = _zipArchive.CreateEntry(fileName);
+ entry.LastWriteTime = modificationTime;
//You have to do this because if using a memory stream the pointer will be at the end it
//it's just been read and this will cause nothing to be written out
- filetoAdd.Position = 0;
+ fileToAdd.Position = 0;
- StreamUtilities.BufferedStreamCopy( filetoAdd, zip );
- zip.Flush();
+ using (var entryStream = entry.Open())
+ StreamUtilities.BufferedStreamCopy(fileToAdd, entryStream);
}
protected override void Dispose(bool disposing)
{
-
- if( !disposed )
+ if (disposing && !_disposed)
{
- if (disposing)
- {
- if( zip != null )
- {
- zip.Flush();
- zip.Dispose();
- }
- disposed = true;
- }
+ _zipArchive?.Dispose();
+ _disposed = true;
}
+
base.Dispose(disposing);
}
}
diff --git a/XenCenterLib/Compression/BZip2Streams.cs b/XenCenterLib/Compression/BZip2Streams.cs
deleted file mode 100644
index 2efc29eed..000000000
--- a/XenCenterLib/Compression/BZip2Streams.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright (c) Citrix Systems, 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:
- *
- * * Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the
- * following disclaimer.
- * * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS 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.
- */
-
-using System.IO;
-using Ionic.BZip2;
-
-namespace XenCenterLib.Compression
-{
- ///
- /// A class that can compress a bzip2 data stream type
- ///
- class DotNetZipBZip2OutputStream : CompressionStream
- {
- public DotNetZipBZip2OutputStream()
- {
-
- }
-
- public DotNetZipBZip2OutputStream(Stream inputStream)
- {
- zipStream = new BZip2OutputStream(inputStream);
- }
-
- public override void SetBaseStream(Stream baseStream)
- {
- zipStream = new BZip2OutputStream(baseStream);
- }
-
- }
-
- ///
- /// A class that can decompress a bzip2 data stream type
- ///
- class DotNetZipBZip2InputStream : CompressionStream
- {
- public DotNetZipBZip2InputStream()
- {
-
- }
-
- public DotNetZipBZip2InputStream(Stream outputStream)
- {
- zipStream = new BZip2InputStream(outputStream);
- }
-
- public override void SetBaseStream(Stream outputStream)
- {
- zipStream = new BZip2InputStream(outputStream);
- }
-
- }
-}
diff --git a/XenCenterLib/Compression/CompressionFactory.cs b/XenCenterLib/Compression/CompressionFactory.cs
index d13d2963f..5365eb3b8 100644
--- a/XenCenterLib/Compression/CompressionFactory.cs
+++ b/XenCenterLib/Compression/CompressionFactory.cs
@@ -44,8 +44,7 @@ namespace XenCenterLib.Compression
///
public enum Type
{
- Gz,
- Bz2
+ Gz
}
public static string StringOf(this Type t)
@@ -54,8 +53,6 @@ namespace XenCenterLib.Compression
{
case Type.Gz:
return "Gzip";
- case Type.Bz2:
- return "BZip2";
default:
throw new ArgumentOutOfRangeException(nameof(t), t, null);
}
@@ -67,8 +64,6 @@ namespace XenCenterLib.Compression
{
case Type.Gz:
return ".gz";
- case Type.Bz2:
- return ".bz2";
default:
throw new ArgumentOutOfRangeException(nameof(t), t, null);
}
@@ -84,10 +79,7 @@ namespace XenCenterLib.Compression
public static CompressionStream Reader(Type compressionType, Stream compressedDataSource)
{
if (compressionType == Type.Gz)
- return new DotNetZipGZipInputStream(compressedDataSource);
-
- if (compressionType == Type.Bz2)
- return new DotNetZipBZip2InputStream(compressedDataSource);
+ return new GZipInputStream(compressedDataSource);
throw new NotSupportedException(String.Format("Type: {0} is not supported by CompressionStream Reader", compressionType));
}
@@ -102,10 +94,7 @@ namespace XenCenterLib.Compression
public static CompressionStream Writer(Type compressionType, Stream compressedDataTarget)
{
if (compressionType == Type.Gz)
- return new DotNetZipGZipOutputStream(compressedDataTarget);
-
- if (compressionType == Type.Bz2)
- return new DotNetZipBZip2OutputStream(compressedDataTarget);
+ return new GZipOutputStream(compressedDataTarget);
throw new NotSupportedException(String.Format("Type: {0} is not supported by CompressionStream Writer", compressionType));
}
diff --git a/XenCenterLib/Compression/GZipStreams.cs b/XenCenterLib/Compression/GZipStreams.cs
index 5e509c83c..96bd0546a 100644
--- a/XenCenterLib/Compression/GZipStreams.cs
+++ b/XenCenterLib/Compression/GZipStreams.cs
@@ -29,22 +29,17 @@
* SUCH DAMAGE.
*/
-using Ionic.Zlib;
using System.IO;
+using System.IO.Compression;
namespace XenCenterLib.Compression
{
///
- /// A class that can compress a bzip2 data stream type
+ /// A class that can compress a gzip data stream type
///
- class DotNetZipGZipOutputStream : CompressionStream
+ class GZipOutputStream : CompressionStream
{
- public DotNetZipGZipOutputStream()
- {
-
- }
-
- public DotNetZipGZipOutputStream(Stream outputStream)
+ public GZipOutputStream(Stream outputStream)
{
zipStream = new GZipStream(outputStream, CompressionMode.Compress);
}
@@ -56,16 +51,11 @@ namespace XenCenterLib.Compression
}
///
- /// A class that can decompress a bzip2 data stream type
+ /// A class that can decompress a gzip data stream type
///
- class DotNetZipGZipInputStream : CompressionStream
+ class GZipInputStream : CompressionStream
{
- public DotNetZipGZipInputStream()
- {
-
- }
-
- public DotNetZipGZipInputStream(Stream inputStream)
+ public GZipInputStream(Stream inputStream)
{
zipStream = new GZipStream(inputStream, CompressionMode.Decompress);
}
diff --git a/XenCenterLib/XenCenterLib.csproj b/XenCenterLib/XenCenterLib.csproj
index 6e4958bd9..37ce2eac1 100644
--- a/XenCenterLib/XenCenterLib.csproj
+++ b/XenCenterLib/XenCenterLib.csproj
@@ -39,9 +39,6 @@
..\packages\ICSharpCode.SharpZipLib.dll
-
- ..\packages\Ionic.Zip.dll
-
..\packages\log4net.dll
@@ -49,6 +46,7 @@
3.5
+
@@ -62,7 +60,6 @@
-
diff --git a/XenModel/Actions/OvfActions/Import.cs b/XenModel/Actions/OvfActions/Import.cs
index c2f2a680a..c94e5c70d 100644
--- a/XenModel/Actions/OvfActions/Import.cs
+++ b/XenModel/Actions/OvfActions/Import.cs
@@ -298,7 +298,7 @@ namespace XenAdmin.Actions.OvfActions
// the compressed file will be replaced by the uncompressed, hence we need
// to use it with its disk extension (vmdk, vhd, etc.)
- if (ext.ToLower().EndsWith(".gz") || ext.ToLower().EndsWith(".bz2"))
+ if (ext.ToLower().EndsWith(".gz"))
{
sourcefile = Path.Combine(pathToOvf, "unc_" + Path.GetFileNameWithoutExtension(filename));
ext = Path.GetExtension(sourcefile);
diff --git a/XenModel/Actions/Updates/DownloadAndUnzipXenServerPatchAction.cs b/XenModel/Actions/Updates/DownloadAndUnzipXenServerPatchAction.cs
index 8206c0e6a..aa11abd3e 100644
--- a/XenModel/Actions/Updates/DownloadAndUnzipXenServerPatchAction.cs
+++ b/XenModel/Actions/Updates/DownloadAndUnzipXenServerPatchAction.cs
@@ -186,17 +186,17 @@ namespace XenAdmin.Actions
private void ExtractFile()
{
ArchiveIterator iterator = null;
- DotNetZipZipIterator zipIterator = null;
+ ZipArchiveIterator zipIterator = null;
try
{
using (Stream stream = new FileStream(outputFileName, FileMode.Open, FileAccess.Read))
{
iterator = ArchiveFactory.Reader(ArchiveFactory.Type.Zip, stream);
- zipIterator = iterator as DotNetZipZipIterator;
+ zipIterator = iterator as ZipArchiveIterator;
if (zipIterator != null)
- zipIterator.CurrentFileExtractProgressChanged += archiveIterator_CurrentFileExtractProgressChanged;
+ zipIterator.CurrentFileExtracted += archiveIterator_CurrentFileExtracted;
while (iterator.HasNext())
{
@@ -232,7 +232,7 @@ namespace XenAdmin.Actions
finally
{
if (zipIterator != null)
- zipIterator.CurrentFileExtractProgressChanged -= archiveIterator_CurrentFileExtractProgressChanged;
+ zipIterator.CurrentFileExtracted -= archiveIterator_CurrentFileExtracted;
if (iterator != null)
iterator.Dispose();
@@ -302,10 +302,11 @@ namespace XenAdmin.Actions
MarkCompleted();
}
- void archiveIterator_CurrentFileExtractProgressChanged(long bytesTransferred, long totalBytesToTransfer)
+ private void archiveIterator_CurrentFileExtracted(int fileIndex, int totalFileCount)
{
- int pc = downloadUpdate ? 95 + (int)(5.0 * bytesTransferred / totalBytesToTransfer) : (int)(100.0 * bytesTransferred / totalBytesToTransfer);
- PercentComplete = pc;
+ PercentComplete = downloadUpdate
+ ? 95 + (int)(5.0 * fileIndex / totalFileCount)
+ : (int)(100.0 * fileIndex / totalFileCount);
}
void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
diff --git a/XenOvfApi/Compression.cs b/XenOvfApi/Compression.cs
index 20120cbbe..823a121bf 100644
--- a/XenOvfApi/Compression.cs
+++ b/XenOvfApi/Compression.cs
@@ -71,11 +71,9 @@ namespace XenOvf
if (file.compression.ToLower() == "gzip")
method = CompressionFactory.Type.Gz;
- else if (file.compression.ToLower() == "bzip2")
- method = CompressionFactory.Type.Bz2;
else
{
- log.ErrorFormat("File {0} uses unsupported method {1}. Must be Gzip or BZip2. Skipping.",
+ log.ErrorFormat("File {0} uses unsupported method {1}. Must be Gzip. Skipping.",
file.href, file.compression);
continue;
}
diff --git a/XenOvfApi/OVF.cs b/XenOvfApi/OVF.cs
index b9bf23fe3..cea9da7ac 100644
--- a/XenOvfApi/OVF.cs
+++ b/XenOvfApi/OVF.cs
@@ -3431,7 +3431,7 @@ namespace XenOvf
///
/// Find the filename for the given RASD.
/// The RASD must Resource Type: 17, 19, 21 and be a hard disk image.
- /// The file may be compressed (gzip/bzip2)
+ /// The file may be compressed (gzip)
///
public static string FindRasdFileName(EnvelopeType ovfEnv, RASD_Type rasd, out CompressionFactory.Type? compression)
{
@@ -3482,12 +3482,6 @@ namespace XenOvf
return filer.href;
}
- if (filer.compression.ToLower().Equals("bzip2"))
- {
- compression = CompressionFactory.Type.Bz2;
- return filer.href;
- }
-
throw new NotSupportedException(string.Format(Messages.COMPRESS_INVALID_METHOD, filer.compression));
}
}
diff --git a/XenOvfApi/Package.cs b/XenOvfApi/Package.cs
index 79304c176..2c0e8a2d0 100644
--- a/XenOvfApi/Package.cs
+++ b/XenOvfApi/Package.cs
@@ -229,8 +229,6 @@ namespace XenOvf
if (string.Compare(extension, ".gz", true) == 0)
_tarType = ArchiveFactory.Type.TarGz;
- else if (string.Compare(extension, ".bz2", true) == 0)
- _tarType = ArchiveFactory.Type.TarBz2;
}
public override string DescriptorFileName
diff --git a/XenOvfApi/Schemas/DSP8023.xsd b/XenOvfApi/Schemas/DSP8023.xsd
index 1a2b7313e..ad2b5f4c8 100644
--- a/XenOvfApi/Schemas/DSP8023.xsd
+++ b/XenOvfApi/Schemas/DSP8023.xsd
@@ -129,7 +129,7 @@
- Compression type (gzip, bzip2, or none if empty or not
+ Compression type (gzip, or none if empty or not
specified)
diff --git a/scripts/deps-map.json b/scripts/deps-map.json
index a8ee03ae5..f443302c7 100644
--- a/scripts/deps-map.json
+++ b/scripts/deps-map.json
@@ -25,11 +25,6 @@
"target": "xenadmin.git/packages/",
"flat": "true"
},
- {
- "pattern": "@REMOTE_DOTNET@/dotnet48/Ionic.Zip.dll",
- "target": "xenadmin.git/packages/",
- "flat": "true"
- },
{
"pattern": "@REMOTE_DOTNET@/dotnet48/log4net.dll",
"target": "xenadmin.git/packages/",
diff --git a/scripts/xenadmin-build.sh b/scripts/xenadmin-build.sh
index d75ec6719..d85494305 100644
--- a/scripts/xenadmin-build.sh
+++ b/scripts/xenadmin-build.sh
@@ -108,7 +108,6 @@ if [ -f "${SIGN_BAT}" ] ; then
cd ${REPO}/XenAdmin/bin/Release && ${SIGN_BAT} log4net.dll "Log4Net"
cd ${REPO}/XenAdmin/bin/Release && ${SIGN_BAT} ICSharpCode.SharpZipLib.dll "SharpZipLib"
cd ${REPO}/XenAdmin/bin/Release && ${SIGN_BAT} DiscUtils.dll "DiscUtils"
- cd ${REPO}/XenAdmin/bin/Release && ${SIGN_BAT} Ionic.Zip.dll "OSS"
cd ${REPO}/XenServerHealthCheck/bin/Release && ${SIGN_BAT} XenServerHealthCheck.exe "${BRANDING_BRAND_CONSOLE}"
else
@@ -116,7 +115,7 @@ else
fi
#copy files (signed accordingly) in XenServerHealthService folder
-cp ${REPO}/XenAdmin/bin/Release/{CommandLib.dll,CoreUtilsLib.dll,XenModel.dll,CookComputing.XmlRpcV2.dll,Newtonsoft.Json.CH.dll,log4net.dll,ICSharpCode.SharpZipLib.dll,Ionic.Zip.dll} \
+cp ${REPO}/XenAdmin/bin/Release/{CommandLib.dll,CoreUtilsLib.dll,XenModel.dll,CookComputing.XmlRpcV2.dll,Newtonsoft.Json.CH.dll,log4net.dll,ICSharpCode.SharpZipLib.dll} \
${REPO}/XenServerHealthCheck/bin/Release
#prepare wix