Removed dependency on IonicZip. Use the corresponding classes of .NET Framework.

Also renamed the archive classes because they were named after the 3rd
party library used and were confusing.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2022-11-18 13:37:18 +00:00
parent 8804038dc4
commit e29b8b39d5
21 changed files with 97 additions and 313 deletions

View File

@ -43,7 +43,6 @@ and also some libraries which we do not store in the source tree:
* Newtonsoft.Json.dll * Newtonsoft.Json.dll
* DiscUtils.dll * DiscUtils.dll
* ICSharpCode.SharpZipLib.dll * ICSharpCode.SharpZipLib.dll
* Ionic.Zip.dll
* log4net.dll * log4net.dll
You can find the source code of these libraries (along with some patches) in You can find the source code of these libraries (along with some patches) in

View File

@ -70,7 +70,6 @@
<File Id="NewtonsoftJsonDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\Newtonsoft.Json.CH.dll" /> <File Id="NewtonsoftJsonDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\Newtonsoft.Json.CH.dll" />
<File Id="log4netDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\log4net.dll" /> <File Id="log4netDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\log4net.dll" />
<File Id="SharpZipLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\ICSharpCode.SharpZipLib.dll" /> <File Id="SharpZipLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\ICSharpCode.SharpZipLib.dll" />
<File Id="IonicZipDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\Ionic.Zip.dll" />
<File Id="MSTSCLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\MSTSCLib.dll" /> <File Id="MSTSCLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\MSTSCLib.dll" />
<File Id="XenCenterLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\CoreUtilsLib.dll" /> <File Id="XenCenterLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\CoreUtilsLib.dll" />
<File Id="XenModelDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\XenModel.dll" /> <File Id="XenModelDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\XenModel.dll" />

View File

@ -43,7 +43,6 @@
<File Id="HealthCheck_CookComputing.XmlRpcV2.dll" Name="CookComputing.XmlRpcV2.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\CookComputing.XmlRpcV2.dll" /> <File Id="HealthCheck_CookComputing.XmlRpcV2.dll" Name="CookComputing.XmlRpcV2.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\CookComputing.XmlRpcV2.dll" />
<File Id="HealthCheck_NewtonsoftJsonDLL" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\Newtonsoft.Json.CH.dll" /> <File Id="HealthCheck_NewtonsoftJsonDLL" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\Newtonsoft.Json.CH.dll" />
<File Id="HealthCheck_ICSharpCode.SharpZipLib.dll" Name="ICSharpCode.SharpZipLib.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\ICSharpCode.SharpZipLib.dll" /> <File Id="HealthCheck_ICSharpCode.SharpZipLib.dll" Name="ICSharpCode.SharpZipLib.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\ICSharpCode.SharpZipLib.dll" />
<File Id="HealthCheck_Ionic.Zip.dll" Name="Ionic.Zip.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\Ionic.Zip.dll" />
<File Id="HealthCheck_log4net.dll" Name="log4net.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\log4net.dll" /> <File Id="HealthCheck_log4net.dll" Name="log4net.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\log4net.dll" />
<File Id="HealthCheck_CoreUtilsLib.dll" Name="CoreUtilsLib.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\CoreUtilsLib.dll" /> <File Id="HealthCheck_CoreUtilsLib.dll" Name="CoreUtilsLib.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\CoreUtilsLib.dll" />
<File Id="HealthCheck_XenModel.dll" Name="XenModel.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\XenModel.dll" /> <File Id="HealthCheck_XenModel.dll" Name="XenModel.dll" Source="$(env.RepoRoot)\XenServerHealthCheck\bin\Release\XenModel.dll" />

View File

@ -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. 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. 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 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.
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: The xxHash library used in this software has the following MIT license:
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 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 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.</value> 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.</value>

View File

@ -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. 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. 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 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.
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: The xxHash library used in this software has the following MIT license:
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 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 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.</value> 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.</value>

View File

@ -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. 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. 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 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.
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: The xxHash library used in this software has the following MIT license:
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 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 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.</value> 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.</value>

View File

@ -39,8 +39,8 @@ namespace XenAdminTests.ArchiveTests
[TestFixture, Category(TestCategories.Unit)] [TestFixture, Category(TestCategories.Unit)]
public class ArchiveFactoryTests public class ArchiveFactoryTests
{ {
[TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(SharpZipTarArchiveIterator))] [TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(TarArchiveIterator))]
[TestCase(ArchiveFactory.Type.TarGz, ExpectedResult = typeof(SharpZipTarArchiveIterator))] [TestCase(ArchiveFactory.Type.TarGz, ExpectedResult = typeof(TarArchiveIterator))]
[Test] [Test]
public Type TestReaderGeneration(int archiveType) public Type TestReaderGeneration(int archiveType)
{ {
@ -52,8 +52,8 @@ namespace XenAdminTests.ArchiveTests
} }
[TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(SharpZipTarArchiveWriter))] [TestCase(ArchiveFactory.Type.Tar, ExpectedResult = typeof(TarArchiveWriter))]
[TestCase(ArchiveFactory.Type.Zip, ExpectedResult = typeof(DotNetZipZipWriter))] [TestCase(ArchiveFactory.Type.Zip, ExpectedResult = typeof(ZipArchiveWriter))]
[Test] [Test]
public Type TestWriterGeneration(int archiveType) public Type TestWriterGeneration(int archiveType)
{ {

View File

@ -38,8 +38,8 @@ using XenCenterLib.Archive;
namespace XenAdminTests.ArchiveTests namespace XenAdminTests.ArchiveTests
{ {
[TestFixture(typeof(SharpZipTarArchiveIterator), typeof(SharpZipTarArchiveWriter))] [TestFixture(typeof(TarArchiveIterator), typeof(TarArchiveWriter))]
[TestFixture(typeof(DotNetZipZipIterator), typeof(DotNetZipZipWriter))] [TestFixture(typeof(ZipArchiveIterator), typeof(ZipArchiveWriter))]
[Category(TestCategories.Unit)] [Category(TestCategories.Unit)]
public class ThirdPartyArchiveWriterTest<TR, TW> public class ThirdPartyArchiveWriterTest<TR, TW>
where TR : ArchiveIterator, new() where TR : ArchiveIterator, new()

View File

@ -39,7 +39,7 @@ namespace XenAdminTests.CompressionTests
[TestFixture, Category(TestCategories.Unit)] [TestFixture, Category(TestCategories.Unit)]
public class CompressionFactoryTests public class CompressionFactoryTests
{ {
[TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(DotNetZipGZipOutputStream))] [TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(GZipOutputStream))]
[Test] [Test]
public Type TestWriterGeneration(int archiveType) public Type TestWriterGeneration(int archiveType)
{ {
@ -50,7 +50,7 @@ namespace XenAdminTests.CompressionTests
} }
} }
[TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(DotNetZipGZipInputStream))] [TestCase(CompressionFactory.Type.Gz, ExpectedResult = typeof(GZipInputStream))]
[Test] [Test]
public Type TestReaderGenerationWithFile(int archiveType) public Type TestReaderGenerationWithFile(int archiveType)
{ {

View File

@ -38,7 +38,7 @@ using XenCenterLib.Compression;
namespace XenAdminTests.CompressionTests namespace XenAdminTests.CompressionTests
{ {
[Category(TestCategories.Unit)] [Category(TestCategories.Unit)]
[TestFixture(typeof(DotNetZipGZipInputStream), typeof(DotNetZipGZipOutputStream))] [TestFixture(typeof(GZipInputStream), typeof(GZipOutputStream))]
public class ThirdPartyCompressionTests<TI, TO> public class ThirdPartyCompressionTests<TI, TO>
where TI : CompressionStream, new() where TI : CompressionStream, new()
where TO : CompressionStream, new() where TO : CompressionStream, new()
@ -93,7 +93,7 @@ namespace XenAdminTests.CompressionTests
Directory.Delete(basePath, true); Directory.Delete(basePath, true);
} }
private void DecompressAFile( string targetFileName, string compressedFileName) private void DecompressAFile(string targetFileName, string compressedFileName)
{ {
using (FileStream ifs = File.OpenRead(compressedFileName)) using (FileStream ifs = File.OpenRead(compressedFileName))
{ {

View File

@ -61,11 +61,11 @@ namespace XenCenterLib.Archive
public static ArchiveIterator Reader(Type archiveType, Stream packagedData) public static ArchiveIterator Reader(Type archiveType, Stream packagedData)
{ {
if (archiveType == Type.Tar) if (archiveType == Type.Tar)
return new SharpZipTarArchiveIterator(packagedData); return new TarArchiveIterator(packagedData);
if (archiveType == Type.TarGz) if (archiveType == Type.TarGz)
return new SharpZipTarArchiveIterator(packagedData, CompressionFactory.Type.Gz); return new TarArchiveIterator(packagedData, CompressionFactory.Type.Gz);
if (archiveType == Type.Zip) if (archiveType == Type.Zip)
return new DotNetZipZipIterator(packagedData); return new ZipArchiveIterator(packagedData);
throw new NotSupportedException($"Type {archiveType} is not supported by ArchiveIterator"); throw new NotSupportedException($"Type {archiveType} is not supported by ArchiveIterator");
} }
@ -80,9 +80,9 @@ namespace XenCenterLib.Archive
public static ArchiveWriter Writer(Type archiveType, Stream targetPackage) public static ArchiveWriter Writer(Type archiveType, Stream targetPackage)
{ {
if (archiveType == Type.Tar) if (archiveType == Type.Tar)
return new SharpZipTarArchiveWriter(targetPackage); return new TarArchiveWriter(targetPackage);
if (archiveType == Type.Zip) if (archiveType == Type.Zip)
return new DotNetZipZipWriter(targetPackage); return new ZipArchiveWriter(targetPackage);
throw new NotSupportedException($"Type {archiveType} is not supported by ArchiveWriter"); throw new NotSupportedException($"Type {archiveType} is not supported by ArchiveWriter");
} }

View File

@ -37,18 +37,14 @@ using XenCenterLib.Compression;
namespace XenCenterLib.Archive namespace XenCenterLib.Archive
{ {
public class SharpZipTarArchiveIterator : ArchiveIterator public class TarArchiveIterator : ArchiveIterator
{ {
private TarInputStream tarStream; private TarInputStream tarStream;
private CompressionStream compressionStream; private CompressionStream compressionStream;
private TarEntry tarEntry; private TarEntry tarEntry;
private bool disposed; private bool disposed;
public SharpZipTarArchiveIterator() public TarArchiveIterator(Stream compressedTarFile, CompressionFactory.Type compressionType)
{
}
public SharpZipTarArchiveIterator(Stream compressedTarFile, CompressionFactory.Type compressionType)
{ {
if (compressionType == CompressionFactory.Type.Gz) if (compressionType == CompressionFactory.Type.Gz)
compressionStream = CompressionFactory.Reader(CompressionFactory.Type.Gz, compressedTarFile); compressionStream = CompressionFactory.Reader(CompressionFactory.Type.Gz, compressedTarFile);
@ -59,7 +55,7 @@ namespace XenCenterLib.Archive
disposed = false; disposed = false;
} }
public SharpZipTarArchiveIterator(Stream tarFile) public TarArchiveIterator(Stream tarFile)
{ {
tarStream = new TarInputStream(tarFile); tarStream = new TarInputStream(tarFile);
disposed = false; disposed = false;
@ -71,7 +67,7 @@ namespace XenCenterLib.Archive
disposed = false; disposed = false;
} }
~SharpZipTarArchiveIterator() ~TarArchiveIterator()
{ {
Dispose(); Dispose();
} }

View File

@ -37,7 +37,7 @@ using ICSharpCode.SharpZipLib.Tar;
namespace XenCenterLib.Archive namespace XenCenterLib.Archive
{ {
public class SharpZipTarArchiveWriter : ArchiveWriter public class TarArchiveWriter : ArchiveWriter
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 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 const long bufferSize = 32 * 1024;
private bool disposed; private bool disposed;
public SharpZipTarArchiveWriter() public TarArchiveWriter()
{ {
} }
public SharpZipTarArchiveWriter(Stream outputStream) public TarArchiveWriter(Stream outputStream)
{ {
tar = new TarOutputStream(outputStream); tar = new TarOutputStream(outputStream);
disposed = false; disposed = false;

View File

@ -32,83 +32,49 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Ionic.Zip; using System.IO.Compression;
namespace XenCenterLib.Archive namespace XenCenterLib.Archive
{ {
public class DotNetZipZipIterator : ArchiveIterator public class ZipArchiveIterator : ArchiveIterator
{ {
private ZipFile zipFile; private ZipArchive _zipArchive;
private IEnumerator<ZipEntry> enumerator; private IEnumerator<ZipArchiveEntry> _enumerator;
private ZipEntry zipEntry; private ZipArchiveEntry _currentEntry;
private bool disposed; private int _currentPosition = -1;
private bool _disposed;
/// <summary> /// <summary>
/// delegate params: long bytesTransferred, long totalBytesToTransfer /// index of current file, total file count
/// </summary> /// </summary>
public event Action<long, long> CurrentFileExtractProgressChanged; public event Action<int, int> CurrentFileExtracted;
public event Action CurrentFileExtractCompleted;
public DotNetZipZipIterator() public ZipArchiveIterator(Stream inputStream)
{ {
} _zipArchive = new ZipArchive(inputStream, ZipArchiveMode.Read);
_enumerator = _zipArchive.Entries.GetEnumerator();
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;
} }
public override void SetBaseStream(Stream inputStream) public override void SetBaseStream(Stream inputStream)
{ {
Initialise(inputStream); _zipArchive = new ZipArchive(inputStream, ZipArchiveMode.Read);
disposed = false; _enumerator = _zipArchive.Entries.GetEnumerator();
_disposed = false;
_currentPosition = -1;
} }
~DotNetZipZipIterator() ~ZipArchiveIterator()
{ {
Dispose(); Dispose();
} }
public override bool HasNext() public override bool HasNext()
{ {
if (enumerator != null && enumerator.MoveNext()) if (_enumerator != null && _enumerator.MoveNext())
{ {
zipEntry = enumerator.Current; _currentPosition++;
_currentEntry = _enumerator.Current;
return true; return true;
} }
return false; return false;
@ -116,34 +82,23 @@ namespace XenCenterLib.Archive
public override string CurrentFileName() public override string CurrentFileName()
{ {
if (zipEntry == null) return _currentEntry == null ? string.Empty : _currentEntry.FullName;
return String.Empty;
return zipEntry.FileName;
} }
public override long CurrentFileSize() public override long CurrentFileSize()
{ {
if (zipEntry == null) return _currentEntry?.Length ?? 0;
return 0;
return zipEntry.UncompressedSize;
} }
public override DateTime CurrentFileModificationTime() public override DateTime CurrentFileModificationTime()
{ {
if (zipEntry == null) return _currentEntry == null ? new DateTime() : _currentEntry.LastWriteTime.DateTime;
return new DateTime();
return zipEntry.LastModified;
} }
public override bool IsDirectory() public override bool IsDirectory()
{ {
if (zipEntry == null) var attr = (FileAttributes)(_currentEntry.ExternalAttributes & 0xff);
return false; return attr.HasFlag(FileAttributes.Directory);
return zipEntry.IsDirectory;
} }
public override void ExtractCurrentFile(Stream extractedFileContents, Action cancellingDelegate) public override void ExtractCurrentFile(Stream extractedFileContents, Action cancellingDelegate)
@ -151,25 +106,21 @@ namespace XenCenterLib.Archive
if (IsDirectory()) if (IsDirectory())
return; 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) protected override void Dispose(bool disposing)
{ {
base.Dispose(disposing); if (disposing && !_disposed)
if(disposing)
{ {
if(!disposed) _zipArchive.Dispose();
{ _disposed = true;
if (zipFile != null)
{
zipFile.ExtractProgress -= zipFile_ExtractProgress;
zipFile.Dispose();
}
disposed = true;
}
} }
base.Dispose(disposing);
} }
} }
} }

View File

@ -31,72 +31,58 @@
using System; using System;
using System.IO; using System.IO;
using System.Text; using System.IO.Compression;
using Ionic.Zip;
namespace XenCenterLib.Archive namespace XenCenterLib.Archive
{ {
class DotNetZipZipWriter : ArchiveWriter internal class ZipArchiveWriter : ArchiveWriter
{ {
private ZipOutputStream zip; private ZipArchive _zipArchive;
private bool disposed; private bool _disposed;
public DotNetZipZipWriter(Stream outputStream) public ZipArchiveWriter(Stream outputStream)
{
zip = new ZipOutputStream( outputStream ) {EnableZip64 = Zip64Option.AsNecessary};
disposed = false;
}
public DotNetZipZipWriter()
{ {
_zipArchive = new ZipArchive(outputStream, ZipArchiveMode.Create);
} }
public override void SetBaseStream(Stream outputStream) public override void SetBaseStream(Stream outputStream)
{ {
zip = new ZipOutputStream(outputStream); _zipArchive = new ZipArchive(outputStream, ZipArchiveMode.Create);
disposed = false; _disposed = false;
} }
public override void AddDirectory(string directoryName, DateTime modificationTime) public override void AddDirectory(string directoryName, DateTime modificationTime)
{ {
StringBuilder sb = new StringBuilder(directoryName);
//Need to add a trailing front-slash to add a directory //Need to add a trailing front-slash to add a directory
if (!directoryName.EndsWith("/")) if (!directoryName.EndsWith("/"))
sb.Append("/"); directoryName += "/";
ZipEntry entry = zip.PutNextEntry(sb.ToString()); var entry = _zipArchive.CreateEntry(directoryName);
entry.ModifiedTime = modificationTime; 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); var entry = _zipArchive.CreateEntry(fileName);
entry.ModifiedTime = modificationTime; entry.LastWriteTime = modificationTime;
//You have to do this because if using a memory stream the pointer will be at the end it //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 //it's just been read and this will cause nothing to be written out
filetoAdd.Position = 0; fileToAdd.Position = 0;
StreamUtilities.BufferedStreamCopy( filetoAdd, zip ); using (var entryStream = entry.Open())
zip.Flush(); StreamUtilities.BufferedStreamCopy(fileToAdd, entryStream);
} }
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && !_disposed)
if( !disposed )
{ {
if (disposing) _zipArchive?.Dispose();
{ _disposed = true;
if( zip != null )
{
zip.Flush();
zip.Dispose();
}
disposed = true;
}
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
} }

View File

@ -79,7 +79,7 @@ namespace XenCenterLib.Compression
public static CompressionStream Reader(Type compressionType, Stream compressedDataSource) public static CompressionStream Reader(Type compressionType, Stream compressedDataSource)
{ {
if (compressionType == Type.Gz) if (compressionType == Type.Gz)
return new DotNetZipGZipInputStream(compressedDataSource); return new GZipInputStream(compressedDataSource);
throw new NotSupportedException(String.Format("Type: {0} is not supported by CompressionStream Reader", compressionType)); throw new NotSupportedException(String.Format("Type: {0} is not supported by CompressionStream Reader", compressionType));
} }
@ -94,7 +94,7 @@ namespace XenCenterLib.Compression
public static CompressionStream Writer(Type compressionType, Stream compressedDataTarget) public static CompressionStream Writer(Type compressionType, Stream compressedDataTarget)
{ {
if (compressionType == Type.Gz) if (compressionType == Type.Gz)
return new DotNetZipGZipOutputStream(compressedDataTarget); return new GZipOutputStream(compressedDataTarget);
throw new NotSupportedException(String.Format("Type: {0} is not supported by CompressionStream Writer", compressionType)); throw new NotSupportedException(String.Format("Type: {0} is not supported by CompressionStream Writer", compressionType));
} }

View File

@ -29,22 +29,17 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
using Ionic.Zlib;
using System.IO; using System.IO;
using System.IO.Compression;
namespace XenCenterLib.Compression namespace XenCenterLib.Compression
{ {
/// <summary> /// <summary>
/// A class that can compress a gzip data stream type /// A class that can compress a gzip data stream type
/// </summary> /// </summary>
class DotNetZipGZipOutputStream : CompressionStream class GZipOutputStream : CompressionStream
{ {
public DotNetZipGZipOutputStream() public GZipOutputStream(Stream outputStream)
{
}
public DotNetZipGZipOutputStream(Stream outputStream)
{ {
zipStream = new GZipStream(outputStream, CompressionMode.Compress); zipStream = new GZipStream(outputStream, CompressionMode.Compress);
} }
@ -58,14 +53,9 @@ namespace XenCenterLib.Compression
/// <summary> /// <summary>
/// A class that can decompress a gzip data stream type /// A class that can decompress a gzip data stream type
/// </summary> /// </summary>
class DotNetZipGZipInputStream : CompressionStream class GZipInputStream : CompressionStream
{ {
public DotNetZipGZipInputStream() public GZipInputStream(Stream inputStream)
{
}
public DotNetZipGZipInputStream(Stream inputStream)
{ {
zipStream = new GZipStream(inputStream, CompressionMode.Decompress); zipStream = new GZipStream(inputStream, CompressionMode.Decompress);
} }

View File

@ -39,9 +39,6 @@
<Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.404, Culture=neutral, PublicKeyToken=d247b8b0ac7959e9, processorArchitecture=MSIL"> <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.404, Culture=neutral, PublicKeyToken=d247b8b0ac7959e9, processorArchitecture=MSIL">
<HintPath>..\packages\ICSharpCode.SharpZipLib.dll</HintPath> <HintPath>..\packages\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=d247b8b0ac7959e9, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=d247b8b0ac7959e9, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=d247b8b0ac7959e9, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.dll</HintPath> <HintPath>..\packages\log4net.dll</HintPath>
</Reference> </Reference>
@ -49,6 +46,7 @@
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.Management" /> <Reference Include="System.Management" />
<Reference Include="System.Security" /> <Reference Include="System.Security" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

View File

@ -186,17 +186,17 @@ namespace XenAdmin.Actions
private void ExtractFile() private void ExtractFile()
{ {
ArchiveIterator iterator = null; ArchiveIterator iterator = null;
DotNetZipZipIterator zipIterator = null; ZipArchiveIterator zipIterator = null;
try try
{ {
using (Stream stream = new FileStream(outputFileName, FileMode.Open, FileAccess.Read)) using (Stream stream = new FileStream(outputFileName, FileMode.Open, FileAccess.Read))
{ {
iterator = ArchiveFactory.Reader(ArchiveFactory.Type.Zip, stream); iterator = ArchiveFactory.Reader(ArchiveFactory.Type.Zip, stream);
zipIterator = iterator as DotNetZipZipIterator; zipIterator = iterator as ZipArchiveIterator;
if (zipIterator != null) if (zipIterator != null)
zipIterator.CurrentFileExtractProgressChanged += archiveIterator_CurrentFileExtractProgressChanged; zipIterator.CurrentFileExtracted += archiveIterator_CurrentFileExtracted;
while (iterator.HasNext()) while (iterator.HasNext())
{ {
@ -232,7 +232,7 @@ namespace XenAdmin.Actions
finally finally
{ {
if (zipIterator != null) if (zipIterator != null)
zipIterator.CurrentFileExtractProgressChanged -= archiveIterator_CurrentFileExtractProgressChanged; zipIterator.CurrentFileExtracted -= archiveIterator_CurrentFileExtracted;
if (iterator != null) if (iterator != null)
iterator.Dispose(); iterator.Dispose();
@ -302,10 +302,11 @@ namespace XenAdmin.Actions
MarkCompleted(); 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 = downloadUpdate
PercentComplete = pc; ? 95 + (int)(5.0 * fileIndex / totalFileCount)
: (int)(100.0 * fileIndex / totalFileCount);
} }
void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)

View File

@ -25,11 +25,6 @@
"target": "xenadmin.git/packages/", "target": "xenadmin.git/packages/",
"flat": "true" "flat": "true"
}, },
{
"pattern": "@REMOTE_DOTNET@/dotnet48/Ionic.Zip.dll",
"target": "xenadmin.git/packages/",
"flat": "true"
},
{ {
"pattern": "@REMOTE_DOTNET@/dotnet48/log4net.dll", "pattern": "@REMOTE_DOTNET@/dotnet48/log4net.dll",
"target": "xenadmin.git/packages/", "target": "xenadmin.git/packages/",

View File

@ -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} log4net.dll "Log4Net"
cd ${REPO}/XenAdmin/bin/Release && ${SIGN_BAT} ICSharpCode.SharpZipLib.dll "SharpZipLib" 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} 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}" cd ${REPO}/XenServerHealthCheck/bin/Release && ${SIGN_BAT} XenServerHealthCheck.exe "${BRANDING_BRAND_CONSOLE}"
else else
@ -116,7 +115,7 @@ else
fi fi
#copy files (signed accordingly) in XenServerHealthService folder #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 ${REPO}/XenServerHealthCheck/bin/Release
#prepare wix #prepare wix