Commit 2b148fc2 authored by 赵啸非's avatar 赵啸非

修改登录鉴权时间

parent 88641bf8
...@@ -189,6 +189,12 @@ ...@@ -189,6 +189,12 @@
<version>5.2.2</version> <version>5.2.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>2.2</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -8,6 +8,8 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry; ...@@ -8,6 +8,8 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.archiver.tar.TarGZipUnArchiver;
import org.codehaus.plexus.logging.console.ConsoleLoggerManager;
import java.io.*; import java.io.*;
import java.util.HashSet; import java.util.HashSet;
...@@ -255,14 +257,28 @@ public class ZipUtils { ...@@ -255,14 +257,28 @@ public class ZipUtils {
String unZipPath = "E:\\pic\\zip\\"; String unZipPath = "E:\\pic\\zip\\";
File destDir = new File(unZipPath);
//ZipUtils.unGzip(fileName, unZipPath); //ZipUtils.unGzip(fileName, unZipPath);
File file = new File(fileName); File sourceFile = new File(fileName);
/* File file = new File(fileName); /* File file = new File(fileName);
; ;
byte[] bytes = ZipUtil.unGzip(FileUtil.readBytes(file));*/ byte[] bytes = ZipUtil.unGzip(FileUtil.readBytes(file));*/
ZipUtils.extractTarGZ(file, unZipPath); /* ZipUtils.extractTarGZ(file, unZipPath);*/
final TarGZipUnArchiver ua = new TarGZipUnArchiver();
// Logging - as @Akom noted, logging is mandatory in newer versions, so you can use a code like this to configure it:
ConsoleLoggerManager manager = new ConsoleLoggerManager();
manager.initialize();
ua.enableLogging(manager.getLoggerForComponent("bla"));
// -- end of logging part
ua.setSourceFile(sourceFile);
destDir.mkdirs();
ua.setDestDirectory(destDir);
ua.extract();
} }
......
...@@ -23,6 +23,8 @@ import com.mortals.xhx.module.setup.mode.DbSetupEntity; ...@@ -23,6 +23,8 @@ import com.mortals.xhx.module.setup.mode.DbSetupEntity;
import com.mortals.xhx.module.setup.mode.SiteEntity; import com.mortals.xhx.module.setup.mode.SiteEntity;
import com.mortals.xhx.module.setup.service.SetupDbService; import com.mortals.xhx.module.setup.service.SetupDbService;
import org.apache.commons.compress.compressors.CompressorInputStream; import org.apache.commons.compress.compressors.CompressorInputStream;
import org.codehaus.plexus.archiver.tar.TarGZipUnArchiver;
import org.codehaus.plexus.logging.console.ConsoleLoggerManager;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.io.*; import java.io.*;
...@@ -100,15 +102,29 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -100,15 +102,29 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
File file = new File(sourcePath); File file = new File(sourcePath);
log.info("文件存在:{}", file.exists()); log.info("文件存在:{}", file.exists());
File destDir = new File(setupProjectEntity.getProjectPath());
if(! file.exists()){ if(! file.exists()){
throw new AppException("请上传项目工程文件!"); throw new AppException("请上传项目工程文件!");
} }
String shell = "tar -zvxf " + sourcePath + " -C " + setupProjectEntity.getProjectPath();
final TarGZipUnArchiver ua = new TarGZipUnArchiver();
// Logging - as @Akom noted, logging is mandatory in newer versions, so you can use a code like this to configure it:
ConsoleLoggerManager manager = new ConsoleLoggerManager();
manager.initialize();
ua.enableLogging(manager.getLoggerForComponent("bla"));
// -- end of logging part
ua.setSourceFile(file);
destDir.mkdirs();
ua.setDestDirectory(destDir);
ua.extract();
/* String shell = "tar -zvxf " + sourcePath + " -C " + setupProjectEntity.getProjectPath();
log.info("解压命令:{}", shell); log.info("解压命令:{}", shell);
String str = RuntimeUtil.execForStr(shell); String str = RuntimeUtil.execForStr(shell);
log.info("解压命令结果:{}", str); log.info("解压命令结果:{}", str);*/
// InputStream inputStream = FileUtil.getInputStream(file); // InputStream inputStream = FileUtil.getInputStream(file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment