[mapguide-commits] r9488 - in trunk/MgDev: . Oem Server/src/Services/Resource

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Mar 27 08:31:27 PDT 2019


Author: jng
Date: 2019-03-27 08:31:27 -0700 (Wed, 27 Mar 2019)
New Revision: 9488

Added:
   trunk/MgDev/Oem/zlib_minizip/
Removed:
   trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.cpp
   trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.h
   trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.cpp
   trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.h
Modified:
   trunk/MgDev/
   trunk/MgDev/CMakeLists.txt
   trunk/MgDev/Oem/CMakeLists.txt
   trunk/MgDev/Oem/oem.sln
   trunk/MgDev/Server/src/Services/Resource/CMakeLists.txt
   trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj
   trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj.filters
   trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp
   trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp
   trunk/MgDev/Server/src/Services/Resource/ZipFileReader.h
   trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp
   trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.h
Log:
Merged revision(s) 9439-9440, 9442, 9447, 9449-9450 from sandbox/jng/deprecate_dwf:
Comment out and remove usage of the DWF Toolkit impl of zip file reading and writing in MgServerResourceService

In its place, we'll use the minizip contrib library as part of the zlib sources. This commit sets up the projects to build minizip and for MgServerResourceService to link to it and zlib.
........
Initial implementation of minizip-based MGP reading and writing.
........
Remove ZipFileHandler as switching to minizip means there is no longer a common base for MgZipFileReader/MgZipFileWriter to inherit from.
........
Fix bad linker paths in Debug
........
Fix improper close call on zip reader/writer that caused the zip file handles to remain open, causing the package tests to fail. Throw exceptions where appropriate.
........
Fix up Linux build
........


Index: trunk/MgDev
===================================================================
--- trunk/MgDev	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev	2019-03-27 15:31:27 UTC (rev 9488)

Property changes on: trunk/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
## -14,6 +14,7 ##
 /sandbox/jng/convenience_apis:8262-8268,8271-8363
 /sandbox/jng/coordsys_mapagent:9231-9254
 /sandbox/jng/createruntimemap:7486-7555
+/sandbox/jng/deprecate_dwf:9439-9440,9442,9447,9449-9450
 /sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
 /sandbox/jng/fusion_entrypoint_refactor:9400-9406
 /sandbox/jng/geoprocessing:9205-9229
Modified: trunk/MgDev/CMakeLists.txt
===================================================================
--- trunk/MgDev/CMakeLists.txt	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/CMakeLists.txt	2019-03-27 15:31:27 UTC (rev 9488)
@@ -84,6 +84,7 @@
 set(MG_OEM_AGG_SOURCE_DIR "${MG_OEM_AGG_DIR}/src")
 set(MG_OEM_HTTPD_SOURCE_DIR, "${MG_OEM_ROOT_DIR}/LinuxApt/httpd-2.4.18")
 
+set(MG_OEM_MINIZIP_INCLUDE_DIR "${MG_OEM_ROOT_DIR}/gd/zlib/contrib/minizip")
 set(MG_OEM_DWF_INCLUDE_DIR "${MG_OEM_ROOT_DIR}/DWFTK/develop/global/src")
 set(MG_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Common")
 set(MG_SERVER_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Server/src/Common")

Modified: trunk/MgDev/Oem/CMakeLists.txt
===================================================================
--- trunk/MgDev/Oem/CMakeLists.txt	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Oem/CMakeLists.txt	2019-03-27 15:31:27 UTC (rev 9488)
@@ -23,5 +23,6 @@
 #add_subdirectory(geos)
 add_subdirectory(DWFTK)
 add_subdirectory(CsMapLibrary)
+add_subdirectory(zlib_minizip)
 add_subdirectory(SWIGEx)
 add_subdirectory(LinuxApt)
\ No newline at end of file

Modified: trunk/MgDev/Oem/oem.sln
===================================================================
--- trunk/MgDev/Oem/oem.sln	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Oem/oem.sln	2019-03-27 15:31:27 UTC (rev 9488)
@@ -89,6 +89,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMake", "..\BuildTools\WebTools\IMake\IMake.vcxproj", "{B601F04C-0D42-4AFC-A092-B31185E2EA8C}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "zlib_minizip\win\minizip.vcxproj", "{DB542A13-DE6E-3E82-BA87-7AE2885324B1}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -384,6 +386,14 @@
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|Win32.Build.0 = Release|Win32
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x64.ActiveCfg = Release|x64
 		{B601F04C-0D42-4AFC-A092-B31185E2EA8C}.Release|x64.Build.0 = Release|x64
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Debug|Win32.Build.0 = Debug|Win32
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Debug|x64.ActiveCfg = Debug|x64
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Debug|x64.Build.0 = Debug|x64
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Release|Win32.ActiveCfg = Release|Win32
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Release|Win32.Build.0 = Release|Win32
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Release|x64.ActiveCfg = Release|x64
+		{DB542A13-DE6E-3E82-BA87-7AE2885324B1}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Deleted: trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.cpp	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.cpp	2019-03-27 15:31:27 UTC (rev 9488)
@@ -1,141 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "ResourceServiceDefs.h"
-#include "ByteSourceDwfInputStreamImpl.h"
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Constructs an MgByteSourceDwfInputStreamImpl object.
-/// </summary>
-///
-/// <param name="inputStream">
-/// DWFInputStream object to use.
-/// </param>
-///----------------------------------------------------------------------------
-
-MgByteSourceDwfInputStreamImpl::MgByteSourceDwfInputStreamImpl(
-    DWFInputStream* inputStream) :
-    m_inputStream(inputStream)
-{
-    CHECKARGUMENTNULL(m_inputStream, L"MgByteSourceDwfInputStreamImpl.MgByteSourceDwfInputStreamImpl");
-}
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Destructs an MgByteSourceDwfInputStreamImpl object.
-/// </summary>
-///----------------------------------------------------------------------------
-
-MgByteSourceDwfInputStreamImpl::~MgByteSourceDwfInputStreamImpl()
-{
-    DWFCORE_FREE_OBJECT(m_inputStream);
-}
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Returns the remaining length of the byte source.  This length is
-/// adjusted for previous reads.  If the returned length is zero
-/// then the underlying source may be a streaming format and the length
-/// is not known.
-/// </summary>
-///
-/// <returns>
-/// Remaining length of the byte source.
-/// </returns>
-///
-/// <exceptions>
-/// MgDwfException
-/// </exceptions>
-///----------------------------------------------------------------------------
-
-INT64 MgByteSourceDwfInputStreamImpl::GetLength()
-{
-    INT64 length = 0;
-
-    MG_RESOURCE_SERVICE_TRY()
-
-    length = m_inputStream->available();
-
-    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgByteSourceDwfInputStreamImpl.GetLength")
-
-    return length;
-}
-
-bool MgByteSourceDwfInputStreamImpl::IsRewindable()
-{
-    // Currently DWFUnzippingInputStream does not support rewinding.
-    return false;
-}
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Rewinds to the start of memory.  Length is reset.
-/// </summary>
-///
-/// <returns>
-/// Nothing.
-/// </returns>
-///
-/// <exceptions>
-/// MgDwfException
-/// </exceptions>
-///----------------------------------------------------------------------------
-
-void MgByteSourceDwfInputStreamImpl::Rewind()
-{
-    MG_RESOURCE_SERVICE_TRY()
-
-    // Currently DWFUnzippingInputStream throws an DWFNotImplementedException.
-    m_inputStream->seek(SEEK_SET, 0);
-
-    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgByteSourceDwfInputStreamImpl.Rewind")
-}
-
-///----------------------------------------------------------------------------
-/// <summary>
-/// Reads a buffer.
-/// </summary>
-///
-/// <param name="buffer">
-/// A buffer receiving the data.
-/// </param>
-/// <param name="length">
-/// Maximum number of bytes to read.
-/// </param>
-///
-/// <returns>
-/// Actual number of bytes put in the buffer. 0 means end of bytes.
-/// </returns>
-///
-/// <exceptions>
-/// MgDwfException
-/// </exceptions>
-///----------------------------------------------------------------------------
-
-INT32 MgByteSourceDwfInputStreamImpl::Read(BYTE_ARRAY_OUT buffer, INT32 length)
-{
-    INT32 nBytesRead = 0;
-
-    MG_RESOURCE_SERVICE_TRY()
-
-    nBytesRead = (INT32)m_inputStream->read(buffer, length);
-
-    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgByteSourceDwfInputStreamImpl.Read")
-
-    return nBytesRead;
-}

Deleted: trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.h	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ByteSourceDwfInputStreamImpl.h	2019-03-27 15:31:27 UTC (rev 9488)
@@ -1,117 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MG_BYTE_SOURCE_DWF_INPUT_STREAM_IMPL_H_
-#define MG_BYTE_SOURCE_DWF_INPUT_STREAM_IMPL_H_
-
-#include "ServerResourceDllExport.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// <summary>
-/// MgByteSourceDwfInputStreamImpl provides access to the bytes on a DWF input
-/// stream source.
-/// </summary>
-///
-class MG_SERVER_RESOURCE_API MgByteSourceDwfInputStreamImpl : public ByteSourceImpl
-{
-public:
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// <summary>
-    /// Constructs an MgByteSourceDwfInputStreamImpl object.
-    /// </summary>
-    ///
-    /// <param name="inputStream">
-    /// DWFInputStream object to use.
-    /// </param>
-    ///
-    MgByteSourceDwfInputStreamImpl(DWFInputStream* inputStream);
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// <summary>
-    /// Destructs an MgByteSourceDwfInputStreamImpl object.
-    /// </summary>
-    ///
-    virtual ~MgByteSourceDwfInputStreamImpl();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// <summary>
-    /// Returns the remaining length of the byte source.  This length is
-    /// adjusted for previous reads.  If the returned length is zero
-    /// then the underlying source may be a streaming format and the length
-    /// is not known.
-    /// </summary>
-    ///
-    /// <returns>
-    /// Remaining length of the byte source.
-    /// </returns>
-    ///
-    INT64 GetLength();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// \brief
-    /// Determines if the source is rewindable.
-    ///
-    /// \return
-    /// true if the source is rewindable, false otherwise.
-    ///
-    bool IsRewindable();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// <summary>
-    /// Rewinds to the start of memory.  Length is reset.
-    /// </summary>
-    ///
-    /// <returns>
-    /// Nothing.
-    /// </returns>
-    ///
-    void Rewind();
-
-    ///////////////////////////////////////////////////////////////////////////
-    /// <summary>
-    /// Reads a buffer.
-    /// </summary>
-    ///
-    /// <param name="buffer">
-    /// A buffer receiving the data.
-    /// </param>
-    /// <param name="length">
-    /// Maximum number of bytes to read.
-    /// </param>
-    ///
-    /// <returns>
-    /// Actual number of bytes put in the buffer. 0 means end of bytes.
-    /// </returns>
-    ///
-    INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length);
-
-private:
-
-    // Unimplemented Methods
-
-    MgByteSourceDwfInputStreamImpl();
-    MgByteSourceDwfInputStreamImpl(const MgByteSourceDwfInputStreamImpl&);
-    MgByteSourceDwfInputStreamImpl& operator=(
-        const MgByteSourceDwfInputStreamImpl&);
-
-protected:
-
-    DWFInputStream* m_inputStream;
-};
-
-#endif

Modified: trunk/MgDev/Server/src/Services/Resource/CMakeLists.txt
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/CMakeLists.txt	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/CMakeLists.txt	2019-03-27 15:31:27 UTC (rev 9488)
@@ -2,8 +2,9 @@
     ${FDO_INCLUDE_DIR}/ExpressionEngine
     ${ACE_INCLUDE_DIR}
     ${XERCESC_INCLUDE_DIR}
-    ${MG_OEM_DWF_INCLUDE_DIR}
     ${DBXML_INCLUDE_DIR}
+    ${MG_OEM_MINIZIP_INCLUDE_DIR}
+    ${ZLIB_INCLUDE_DIR}
     ${MG_COMMON_DIR}/Security
     ${MG_COMMON_DIR}/Foundation
     ${MG_COMMON_DIR}/Geometry
@@ -36,6 +37,8 @@
     ${DBXML_LIBRARY}
     ${XQILLA_LIBRARY}
     ${XERCESC_LIBRARIES}
+    ${ZLIB_LIBRARY}
+    minizip
 )
 install(TARGETS MgServerResourceService${MG_VERSION_SUFFIX} DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${MG_COMPONENT})
 install_symlink(${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libMgServerResourceService${MG_VERSION_SUFFIX}.so libMgServerResourceService.so ${MG_COMPONENT})
\ No newline at end of file

Modified: trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h	2019-03-27 15:31:27 UTC (rev 9488)
@@ -26,7 +26,6 @@
 #include <map>
 #include <vector>
 #include <dbxml/DbXml.hpp>
-#include <dwfcore/ZipFileDescriptor.h>
 #include "db_cxx.h"
 
 using namespace DbXml;
@@ -78,13 +77,7 @@
         arguments.Add(message);                                               \
         mgException = new MgDbException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
         (static_cast<MgThirdPartyException*>(mgException.p))->SetErrorCode(e.get_errno()); \
-    }                                                                         \
-    catch (DWFException& e)                                                   \
-    {                                                                         \
-        MgStringCollection arguments;                                         \
-        arguments.Add(STRING(e.message()));                                   \
-        mgException = new MgDwfException(methodName, __LINE__, __WFILE__, NULL, L"MgFormatInnerExceptionMessage", &arguments); \
-    }                                                                         \
+    }                                                                      \
     catch (const XMLException& e)                                             \
     {                                                                         \
         MgStringCollection arguments;                                         \

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj	2019-03-27 15:31:27 UTC (rev 9488)
@@ -94,8 +94,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK\develop\global\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\Oem\gd\zlib;..\..\..\..\Oem\gd\zlib\contrib\minizip;..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -104,9 +104,9 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>ACEd.lib;xerces-c_3mgD.lib;libdb48d.lib;libdbxml25d.lib;dwfcore_wt.1.7.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>zlibd.lib;minizipd.lib;ACEd.lib;xerces-c_3mgD.lib;libdb48d.lib;libdbxml25d.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgServerResourceServiced.dll</OutputFile>
-      <AdditionalLibraryDirectories>..\..\..\..\Oem\ACE\ACE_wrappers\lib\$(Configuration);..\..\..\..\Oem\dbxml\lib\$(Configuration);..\..\..\..\Oem\DWFTK\develop\global\lib\static\$(Configuration)\vc10.0;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\..\..\..\Oem\zlib_minizip\win\Debug\Win32;..\..\..\..\Oem\gd\lpng\projects\vs\Debug\ZLib;..\..\..\..\Oem\ACE\ACE_wrappers\lib\$(Configuration);..\..\..\..\Oem\dbxml\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)MgServerResourceServiced.pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
@@ -122,8 +122,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK\develop\global\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\Oem\gd\zlib;..\..\..\..\Oem\gd\zlib\contrib\minizip;..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -132,9 +132,9 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>ACEd.lib;xerces-c_3mgD.lib;libdb48d.lib;libdbxml25d.lib;dwfcore_wt.1.7.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>zlibd.lib;minizipd.lib;ACEd.lib;xerces-c_3mgD.lib;libdb48d.lib;libdbxml25d.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgServerResourceServiced.dll</OutputFile>
-      <AdditionalLibraryDirectories>..\..\..\..\Oem\ACE\ACE_wrappers\lib64\$(Configuration);..\..\..\..\Oem\dbxml\lib64\$(Configuration);..\..\..\..\Oem\DWFTK\develop\global\lib\x64\static\$(Configuration)\vc10.0;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\..\..\..\Oem\zlib_minizip\win\Debug\x64;..\..\..\..\Oem\gd\lpng\projects\vs\Debug64\ZLib;..\..\..\..\Oem\ACE\ACE_wrappers\lib64\$(Configuration);..\..\..\..\Oem\dbxml\lib64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)MgServerResourceServiced.pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
@@ -150,8 +150,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
-      <AdditionalIncludeDirectories>..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK\develop\global\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\Oem\gd\zlib;..\..\..\..\Oem\gd\zlib\contrib\minizip;..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -159,9 +159,9 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>ACE.lib;xerces-c_3mg.lib;libdb48.lib;libdbxml25.lib;dwfcore_wt.1.7.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>zlib.lib;minizip.lib;ACE.lib;xerces-c_3mg.lib;libdb48.lib;libdbxml25.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgServerResourceService.dll</OutputFile>
-      <AdditionalLibraryDirectories>..\..\..\..\Oem\ACE\ACE_wrappers\lib\$(Configuration);..\..\..\..\Oem\dbxml\lib\$(Configuration);..\..\..\..\Oem\DWFTK\develop\global\lib\static\$(Configuration)\vc10.0;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\..\..\..\Oem\zlib_minizip\win\Release\Win32;..\..\..\..\Oem\gd\lpng\projects\vs\LIB Release\ZLib;..\..\..\..\Oem\ACE\ACE_wrappers\lib\$(Configuration);..\..\..\..\Oem\dbxml\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)MgServerResourceService.pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
@@ -179,8 +179,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
-      <AdditionalIncludeDirectories>..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK\develop\global\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\Oem\gd\zlib;..\..\..\..\Oem\gd\zlib\contrib\minizip;..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml\xerces-c-src\src;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\FDO\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -188,9 +188,9 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>ACE.lib;xerces-c_3mg.lib;libdb48.lib;libdbxml25.lib;dwfcore_wt.1.7.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>zlib.lib;minizip.lib;ACE.lib;xerces-c_3mg.lib;libdb48.lib;libdbxml25.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)MgServerResourceService.dll</OutputFile>
-      <AdditionalLibraryDirectories>..\..\..\..\Oem\ACE\ACE_wrappers\lib64\$(Configuration);..\..\..\..\Oem\dbxml\lib64\$(Configuration);..\..\..\..\Oem\DWFTK\develop\global\lib\x64\static\$(Configuration)\vc10.0;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>..\..\..\..\Oem\zlib_minizip\win\Release\x64;..\..\..\..\Oem\gd\lpng\projects\vs\Release64\ZLib;..\..\..\..\Oem\ACE\ACE_wrappers\lib64\$(Configuration);..\..\..\..\Oem\dbxml\lib64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)MgServerResourceService.pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
@@ -422,12 +422,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="ByteSourceDwfInputStreamImpl.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="Database.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -669,12 +663,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="ZipFileHandler.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="ZipFileReader.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -725,7 +713,6 @@
     <ClInclude Include="ApplicationRepository.h" />
     <ClInclude Include="ApplicationRepositoryManager.h" />
     <ClInclude Include="ApplicationResourceContentManager.h" />
-    <ClInclude Include="ByteSourceDwfInputStreamImpl.h" />
     <ClInclude Include="Database.h" />
     <ClInclude Include="DataBindingInfo.h" />
     <ClInclude Include="DbEnvironment.h" />
@@ -768,7 +755,6 @@
     <ClInclude Include="TagInfo.h" />
     <ClInclude Include="TagManager.h" />
     <ClInclude Include="XmlSchemaResolver.h" />
-    <ClInclude Include="ZipFileHandler.h" />
     <ClInclude Include="ZipFileReader.h" />
     <ClInclude Include="ZipFileWriter.h" />
   </ItemGroup>

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj.filters
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj.filters	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceService.vcxproj.filters	2019-03-27 15:31:27 UTC (rev 9488)
@@ -105,7 +105,6 @@
     <ClCompile Include="ApplicationRepository.cpp" />
     <ClCompile Include="ApplicationRepositoryManager.cpp" />
     <ClCompile Include="ApplicationResourceContentManager.cpp" />
-    <ClCompile Include="ByteSourceDwfInputStreamImpl.cpp" />
     <ClCompile Include="Database.cpp" />
     <ClCompile Include="DataBindingInfo.cpp" />
     <ClCompile Include="DbEnvironment.cpp" />
@@ -147,7 +146,6 @@
     <ClCompile Include="TagInfo.cpp" />
     <ClCompile Include="TagManager.cpp" />
     <ClCompile Include="XmlSchemaResolver.cpp" />
-    <ClCompile Include="ZipFileHandler.cpp" />
     <ClCompile Include="ZipFileReader.cpp" />
     <ClCompile Include="ZipFileWriter.cpp" />
     <ClCompile Include="OpEnumerateParentTileSetDefinitions.cpp">
@@ -254,7 +252,6 @@
     <ClInclude Include="ApplicationRepository.h" />
     <ClInclude Include="ApplicationRepositoryManager.h" />
     <ClInclude Include="ApplicationResourceContentManager.h" />
-    <ClInclude Include="ByteSourceDwfInputStreamImpl.h" />
     <ClInclude Include="Database.h" />
     <ClInclude Include="DataBindingInfo.h" />
     <ClInclude Include="DbEnvironment.h" />
@@ -297,7 +294,6 @@
     <ClInclude Include="TagInfo.h" />
     <ClInclude Include="TagManager.h" />
     <ClInclude Include="XmlSchemaResolver.h" />
-    <ClInclude Include="ZipFileHandler.h" />
     <ClInclude Include="ZipFileReader.h" />
     <ClInclude Include="ZipFileWriter.h" />
     <ClInclude Include="OpEnumerateParentTileSetDefinitions.h">

Modified: trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ServerResourceServiceBuild.cpp	2019-03-27 15:31:27 UTC (rev 9488)
@@ -24,7 +24,6 @@
 #include "ApplicationRepository.cpp"
 #include "ApplicationRepositoryManager.cpp"
 #include "ApplicationResourceContentManager.cpp"
-#include "ByteSourceDwfInputStreamImpl.cpp"
 #include "Database.cpp"
 #include "DataBindingInfo.cpp"
 #include "DbEnvironment.cpp"
@@ -97,6 +96,5 @@
 #include "TagInfo.cpp"
 #include "TagManager.cpp"
 #include "XmlSchemaResolver.cpp"
-#include "ZipFileHandler.cpp"
 #include "ZipFileReader.cpp"
 #include "ZipFileWriter.cpp"

Deleted: trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.cpp	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.cpp	2019-03-27 15:31:27 UTC (rev 9488)
@@ -1,46 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#include "ResourceServiceDefs.h"
-#include "ZipFileHandler.h"
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Constructs the object.
-///
-MgZipFileHandler::MgZipFileHandler(CREFSTRING filePath,
-    DWFZipFileDescriptor::teFileMode fileMode)
-{
-    ACE_ASSERT(!filePath.empty());
-
-    MG_RESOURCE_SERVICE_TRY()
-
-    DWFFile zipFile(filePath.c_str());
-
-    m_zipFileDescriptor.reset(new DWFZipFileDescriptor(zipFile, fileMode));
-    m_zipFileDescriptor->open();
-
-    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgZipFileHandler.MgZipFileHandler")
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Destructs the object.
-///
-MgZipFileHandler::~MgZipFileHandler()
-{
-}

Deleted: trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.h	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileHandler.h	2019-03-27 15:31:27 UTC (rev 9488)
@@ -1,52 +0,0 @@
-//
-//  Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of version 2.1 of the GNU Lesser
-//  General Public License as published by the Free Software Foundation.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-
-#ifndef MGZIPFILEHANDLER_H_
-#define MGZIPFILEHANDLER_H_
-
-class MgZipFileHandler
-{
-/// Constructors/Destructor
-
-public:
-
-    MgZipFileHandler(CREFSTRING filePath,
-        DWFZipFileDescriptor::teFileMode fileMode);
-    virtual ~MgZipFileHandler();
-
-private:
-
-    // Unimplemented Constructors/Methods
-
-    MgZipFileHandler();
-    MgZipFileHandler(const MgZipFileHandler&);
-    MgZipFileHandler& operator=(const MgZipFileHandler&);
-
-/// Methods
-
-public:
-
-/// Data Members
-
-protected:
-
-    auto_ptr<DWFZipFileDescriptor> m_zipFileDescriptor;
-};
-
-/// Inline Methods
-
-#endif

Modified: trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileReader.cpp	2019-03-27 15:31:27 UTC (rev 9488)
@@ -17,15 +17,63 @@
 
 #include "ResourceServiceDefs.h"
 #include "ZipFileReader.h"
-#include "ByteSourceDwfInputStreamImpl.h"
 
+//Bulk of this code copied from miniunz.c reference implementation
+
+class MgByteSourceUnzipImpl : public ByteSourceImpl
+{
+public:
+    MgByteSourceUnzipImpl(unz_file_info currentFileInfo, unzFile unzip) 
+        : m_fi(currentFileInfo), m_unzip(unzip), m_read(0)
+    { 
+        int err = unzOpenCurrentFile(m_unzip);
+        if (err != UNZ_OK)
+        {
+            //throw;
+        }
+    }
+    virtual ~MgByteSourceUnzipImpl() 
+    { 
+        unzCloseCurrentFile(m_unzip);
+    }
+    INT64 GetLength() { return m_fi.uncompressed_size - m_read; }
+    bool IsRewindable() { return false;  }
+    void Rewind() { }
+    INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length)
+    {
+        INT32 err = unzReadCurrentFile(m_unzip, buffer, length);
+        m_read += err;
+        return err;
+    }
+
+private:
+    unz_file_info m_fi;
+    unzFile m_unzip;
+    INT32 m_read;
+
+    // Unimplemented Methods
+
+    MgByteSourceUnzipImpl();
+    MgByteSourceUnzipImpl(const MgByteSourceUnzipImpl&);
+    MgByteSourceUnzipImpl& operator=(
+        const MgByteSourceUnzipImpl&);
+};
+
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Constructs the object.
 ///
-MgZipFileReader::MgZipFileReader(CREFSTRING filePath) :
-    MgZipFileHandler(filePath, DWFZipFileDescriptor::eUnzip)
+MgZipFileReader::MgZipFileReader(CREFSTRING filePath) 
+    : m_unzip(NULL)
 {
+    std::string mbFilePath = MgUtil::WideCharToMultiByte(filePath);
+    m_unzip = unzOpen(mbFilePath.c_str());
+    if (!m_unzip)
+    {
+        MgStringCollection arguments;
+        arguments.Add(filePath);
+        throw new MgInvalidDwfPackageException(L"MgZipFileReader.MgZipFileReader", __LINE__, __WFILE__, &arguments, L"", NULL);
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -34,6 +82,16 @@
 ///
 MgZipFileReader::~MgZipFileReader()
 {
+    if (m_unzip)
+    {
+        int r = unzClose(m_unzip);
+#ifdef _DEBUG
+        if (r != UNZ_OK)
+        {
+            throw new MgInvalidDwfPackageException(L"MgZipFileReader.~MgZipFileReader", __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+#endif
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -45,20 +103,35 @@
     ACE_ASSERT(!filePath.empty());
     Ptr<MgByteSource> byteSource;
 
+    char* mbFilePath = MgUtil::WideCharToMultiByte(filePath.c_str());
+
     MG_RESOURCE_SERVICE_TRY()
 
-    // Note that the byteSource object owns the byteSourceImpl object whose
-    // destructor will de-allocate the inputStream object using the macro
-    // DWFCORE_FREE_OBJECT.
+    //Set pointer to location of specified file
+    if (unzLocateFile(m_unzip, mbFilePath, 0 /* Let platform decide case-sensitivity */) != UNZ_OK)
+    {
+        MgStringCollection arguments;
+        arguments.Add(filePath);
+        throw new MgInvalidDwfPackageException(L"MgZipFileReader.ExtractArchive", __LINE__, __WFILE__, &arguments, L"", NULL);
+    }
 
-    DWFString archivedFile(filePath.c_str());
-    DWFInputStream* inputStream = m_zipFileDescriptor->unzip(archivedFile);
+    int err = UNZ_OK;
+    unz_file_info file_info;
+    err = unzGetCurrentFileInfo(m_unzip, &file_info, mbFilePath, strlen(mbFilePath), NULL, 0, NULL, 0);
+    if (err != UNZ_OK)
+    {
+        MgStringCollection arguments;
+        arguments.Add(filePath);
+        throw new MgInvalidDwfPackageException(L"MgZipFileReader.ExtractArchive", __LINE__, __WFILE__, &arguments, L"", NULL);
+    }
 
-    MgByteSourceDwfInputStreamImpl* byteSourceImpl =
-        new MgByteSourceDwfInputStreamImpl(inputStream);
-    byteSource = new MgByteSource(byteSourceImpl);
+    MgByteSourceUnzipImpl* impl = new MgByteSourceUnzipImpl(file_info, m_unzip);
+    byteSource = new MgByteSource(impl);
 
-    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgZipFileReader.ExtractArchive")
+    MG_RESOURCE_SERVICE_CATCH(L"MgZipFileReader.ExtractArchive")
 
+        delete[] mbFilePath;
+
+    MG_RESOURCE_SERVICE_THROW()
     return byteSource.Detach();
 }

Modified: trunk/MgDev/Server/src/Services/Resource/ZipFileReader.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileReader.h	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileReader.h	2019-03-27 15:31:27 UTC (rev 9488)
@@ -18,9 +18,9 @@
 #ifndef MGZIPFILEREADER_H_
 #define MGZIPFILEREADER_H_
 
-#include "ZipFileHandler.h"
+#include "unzip.h"
 
-class MgZipFileReader : public MgZipFileHandler
+class MgZipFileReader
 {
 /// Constructors/Destructor
 
@@ -46,7 +46,7 @@
 /// Data Members
 
 private:
-
+    unzFile m_unzip;
 };
 
 /// Inline Methods

Modified: trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.cpp	2019-03-27 15:31:27 UTC (rev 9488)
@@ -18,13 +18,82 @@
 #include "ResourceServiceDefs.h"
 #include "ZipFileWriter.h"
 
+//Bulk of this code copied from minizip.c reference implementation
+
+#ifdef _WIN32
+uLong filetime(const wchar_t* f /* name of file to get info on */, tm_zip* tmzip /* return value: access, modific. and creation times */, uLong* dt /* dostime */)
+{
+    int ret = 0;
+    {
+        FILETIME ftLocal;
+        HANDLE hFind;
+        WIN32_FIND_DATA  ff32;
+
+        hFind = FindFirstFile(f, &ff32);
+        if (hFind != INVALID_HANDLE_VALUE)
+        {
+            FileTimeToLocalFileTime(&(ff32.ftLastWriteTime), &ftLocal);
+            FileTimeToDosDateTime(&ftLocal, ((LPWORD)dt) + 1, ((LPWORD)dt) + 0);
+            FindClose(hFind);
+            ret = 1;
+        }
+    }
+    return ret;
+}
+#else
+uLong filetime(char* f /* name of file to get info on */, tm_zip* tmzip /* return value: access, modific. and creation times */, uLong* dt /* dostime */)
+{
+    int ret = 0;
+    struct stat s;        /* results of stat() */
+    struct tm* filedate;
+    time_t tm_t = 0;
+
+    if (strcmp(f, "-") != 0)
+    {
+        char name[PATH_MAX + 1];
+        int len = strlen(f);
+        if (len > PATH_MAX)
+            len = PATH_MAX;
+
+        strncpy(name, f, PATH_MAX - 1);
+        /* strncpy doesnt append the trailing NULL, of the string is too long. */
+        name[PATH_MAX] = '\0';
+
+        if (name[len - 1] == '/')
+            name[len - 1] = '\0';
+        /* not all systems allow stat'ing a file with / appended */
+        if (stat(name, &s) == 0)
+        {
+            tm_t = s.st_mtime;
+            ret = 1;
+        }
+    }
+    filedate = localtime(&tm_t);
+
+    tmzip->tm_sec = filedate->tm_sec;
+    tmzip->tm_min = filedate->tm_min;
+    tmzip->tm_hour = filedate->tm_hour;
+    tmzip->tm_mday = filedate->tm_mday;
+    tmzip->tm_mon = filedate->tm_mon;
+    tmzip->tm_year = filedate->tm_year;
+
+    return ret;
+}
+#endif
+
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Constructs the object.
 ///
-MgZipFileWriter::MgZipFileWriter(CREFSTRING filePath) :
-    MgZipFileHandler(filePath, DWFZipFileDescriptor::eZip)
+MgZipFileWriter::MgZipFileWriter(CREFSTRING filePath)
+    : m_zip(NULL)
 {
+    std::string mbFilePath = MgUtil::WideCharToMultiByte(filePath);
+    m_zip = zipOpen(mbFilePath.c_str(), 0);
+    if (!m_zip)
+    {
+        throw new MgInvalidDwfPackageException(L"MgZipFileWriter.MgZipFileWriter", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -33,6 +102,16 @@
 ///
 MgZipFileWriter::~MgZipFileWriter()
 {
+    if (m_zip)
+    {
+        int r = zipClose(m_zip, "Created by MapGuide Server"); //NOXLATE
+#ifdef _DEBUG
+        if (r != ZIP_OK)
+        {
+            throw new MgInvalidDwfPackageException(L"MgZipFileWriter.~MgZipFileWriter", __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+#endif
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -42,28 +121,66 @@
 void MgZipFileWriter::AddArchive(CREFSTRING filePath, MgByteReader* byteReader)
 {
     ACE_ASSERT(!filePath.empty());
-    DWFOutputStream* outputStream = NULL;
 
+    char* mbFilePath = MgUtil::WideCharToMultiByte(filePath.c_str());
     MG_RESOURCE_SERVICE_TRY()
 
     CHECKARGUMENTNULL(byteReader, L"MgZipFileWriter.AddArchive");
 
-    DWFString archivedFile(filePath.c_str());
-    outputStream = m_zipFileDescriptor->zip(archivedFile);
+    int err = UNZ_OK;
 
+    zip_fileinfo zi;
+    unsigned long crcFile = 0;
+    const char* password = NULL;
+    int opt_compress_level = Z_DEFAULT_COMPRESSION;
+
+    zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
+        zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
+    zi.dosDate = 0;
+    zi.internal_fa = 0;
+    zi.external_fa = 0;
+
+#ifdef _WIN32
+    filetime(filePath.c_str(), &zi.tmz_date, &zi.dosDate);
+#else
+    filetime(mbFilePath, &zi.tmz_date, &zi.dosDate);
+#endif
+
+    err = zipOpenNewFileInZip3(m_zip, mbFilePath, &zi,
+        NULL, 0, NULL, 0, NULL /* comment*/,
+        (opt_compress_level != 0) ? Z_DEFLATED : 0,
+        opt_compress_level, 0,
+        /* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */
+        -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
+        password, crcFile);
+
+    if (err != ZIP_OK)
+    {
+        throw new MgInvalidDwfPackageException(L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
     const INT32 length = 4096;
-    BYTE buffer[length] = {0};
+    BYTE buffer[length] = { 0 };
     INT32 numBytes = 0;
-
     do
     {
         numBytes = byteReader->Read(buffer, length);
-        outputStream->write((const void*)buffer, (size_t)numBytes);
-    } while (numBytes > 0);
+        err = zipWriteInFileInZip(m_zip, buffer, numBytes);
+        if (err < 0)
+        {
+            throw new MgInvalidDwfPackageException(L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+    } while ((err == ZIP_OK) && (numBytes > 0));
 
+    err = zipCloseFileInZip(m_zip);
+    if (err != ZIP_OK)
+    {
+        throw new MgInvalidDwfPackageException(L"MgZipFileWriter.AddArchive", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
     MG_RESOURCE_SERVICE_CATCH(L"MgZipFileWriter.AddArchive")
 
-    DWFCORE_FREE_OBJECT(outputStream);
+    delete[] mbFilePath;
 
     MG_RESOURCE_SERVICE_THROW()
 }

Modified: trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.h
===================================================================
--- trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.h	2019-03-27 15:26:10 UTC (rev 9487)
+++ trunk/MgDev/Server/src/Services/Resource/ZipFileWriter.h	2019-03-27 15:31:27 UTC (rev 9488)
@@ -18,9 +18,9 @@
 #ifndef MGZIPFILEWRITER_H_
 #define MGZIPFILEWRITER_H_
 
-#include "ZipFileHandler.h"
+#include "zip.h"
 
-class MgZipFileWriter : public MgZipFileHandler
+class MgZipFileWriter
 {
 /// Constructors/Destructor
 
@@ -47,7 +47,7 @@
 /// Data Members
 
 private:
-
+    zipFile m_zip;
 };
 
 /// Inline Methods



More information about the mapguide-commits mailing list