提取ZhengAdminUtil解压方法到zheng-common

This commit is contained in:
shuzheng 2017-01-19 22:07:18 +08:00
parent ffbde65b72
commit 3a66c7e245
4 changed files with 2 additions and 78 deletions

View File

@ -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完成 =====");
}
}

View File

@ -4,6 +4,6 @@
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目录 -->
<bean id="zhengAdminUtil" class="com.zheng.cms.admin.util.ZhengAdminUtil"></bean>
<bean id="zhengAdminUtil" class="com.zheng.common.util.ZhengAdminUtil"></bean>
</beans>

View File

@ -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完成 =====");
}
}

View File

@ -4,6 +4,6 @@
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目录 -->
<bean id="zhengAdminUtil" class="com.zheng.upms.admin.util.ZhengAdminUtil"></bean>
<bean id="zhengAdminUtil" class="com.zheng.common.util.ZhengAdminUtil"></bean>
</beans>