Sfoglia il codice sorgente

提取ZhengAdminUtil解压方法到zheng-common

shuzheng 9 anni fa
parent
commit
3a66c7e245

+ 0 - 38
zheng-cms/zheng-cms-admin/src/main/java/com/zheng/cms/admin/util/ZhengAdminUtil.java

@@ -1,38 +0,0 @@
-package com.zheng.cms.admin.util;
-
-import com.zheng.common.util.JarUtil;
-import com.zheng.common.util.PropertiesFileUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.web.context.ServletContextAware;
-
-import javax.servlet.ServletContext;
-
-/**
- * 启动解压zhengAdmin-x.x.x.jar到resources目录
- * Created by shuzheng on 2016/12/18.
- */
-public class ZhengAdminUtil implements InitializingBean, ServletContextAware {
-
-    private static Logger _log = LoggerFactory.getLogger(ZhengAdminUtil.class);
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-
-    }
-
-    @Override
-    public void setServletContext(ServletContext servletContext) {
-        _log.info("===== 开始解压zheng-admin =====");
-        String version = PropertiesFileUtil.getInstance().get("zheng-admin.version");
-        _log.info("zheng-admin.jar 版本: {}", version);
-        String jarPath = servletContext.getRealPath("/WEB-INF/lib/zheng-admin-" + version + ".jar");
-        _log.info("zheng-admin.jar 包路径: {}", jarPath);
-        String resources = servletContext.getRealPath("/resources/zheng-admin");
-        _log.info("zheng-admin.jar 解压到: {}", resources);
-        JarUtil.decompress(jarPath, resources);
-        _log.info("===== 解压zheng-admin完成 =====");
-    }
-
-}

+ 1 - 1
zheng-cms/zheng-cms-admin/src/main/resources/applicationContext-zhengAdmin.xml

@@ -4,6 +4,6 @@
 	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 
 
 	<!-- 启动解压zhengAdmin-x.x.x.jar到resources目录 -->
 	<!-- 启动解压zhengAdmin-x.x.x.jar到resources目录 -->
-	<bean id="zhengAdminUtil" class="com.zheng.cms.admin.util.ZhengAdminUtil"></bean>
+	<bean id="zhengAdminUtil" class="com.zheng.common.util.ZhengAdminUtil"></bean>
 
 
 </beans>
 </beans>

+ 0 - 38
zheng-upms/zheng-upms-server/src/main/java/com/zheng/upms/admin/util/ZhengAdminUtil.java

@@ -1,38 +0,0 @@
-package com.zheng.upms.admin.util;
-
-import com.zheng.common.util.JarUtil;
-import com.zheng.common.util.PropertiesFileUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.web.context.ServletContextAware;
-
-import javax.servlet.ServletContext;
-
-/**
- * 启动解压zhengAdmin-x.x.x.jar到resources目录
- * Created by shuzheng on 2016/12/18.
- */
-public class ZhengAdminUtil implements InitializingBean, ServletContextAware {
-
-    private static Logger _log = LoggerFactory.getLogger(ZhengAdminUtil.class);
-
-    @Override
-    public void afterPropertiesSet() throws Exception {
-
-    }
-
-    @Override
-    public void setServletContext(ServletContext servletContext) {
-        _log.info("===== 开始解压zheng-admin =====");
-        String version = PropertiesFileUtil.getInstance().get("zheng-admin.version");
-        _log.info("zheng-admin.jar 版本: {}", version);
-        String jarPath = servletContext.getRealPath("/WEB-INF/lib/zheng-admin-" + version + ".jar");
-        _log.info("zheng-admin.jar 包路径: {}", jarPath);
-        String resources = servletContext.getRealPath("/resources/zheng-admin");
-        _log.info("zheng-admin.jar 解压到: {}", resources);
-        JarUtil.decompress(jarPath, resources);
-        _log.info("===== 解压zheng-admin完成 =====");
-    }
-
-}

+ 1 - 1
zheng-upms/zheng-upms-server/src/main/resources/applicationContext-zhengAdmin.xml

@@ -4,6 +4,6 @@
 	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 	   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 
 
 	<!-- 启动解压zhengAdmin-x.x.x.jar到resources目录 -->
 	<!-- 启动解压zhengAdmin-x.x.x.jar到resources目录 -->
-	<bean id="zhengAdminUtil" class="com.zheng.upms.admin.util.ZhengAdminUtil"></bean>
+	<bean id="zhengAdminUtil" class="com.zheng.common.util.ZhengAdminUtil"></bean>
 
 
 </beans>
 </beans>