Commit 994dd4bc authored by 赵啸非's avatar 赵啸非

修改登录鉴权时间

parent a26e2dab
......@@ -75,7 +75,7 @@ public class ZipUtils {
public static Set<String> unGzip(InputStream inputStream, String unZipPath) {
Set<String> set = new HashSet<>();
TarArchiveInputStream fin =null;
FileOutputStream fileOutputStream =null;
// FileOutputStream fileOutputStream =null;
GzipCompressorInputStream gzipCompressorInputStream = null;
try {
gzipCompressorInputStream = new GzipCompressorInputStream(inputStream);
......@@ -97,8 +97,9 @@ public class ZipUtils {
parent.mkdirs();
}
// 将文件写出到解压的目录
fileOutputStream = new FileOutputStream(curfile);
IOUtils.copy(fin, fileOutputStream);
FileUtil.writeFromStream(fin,curfile);
//fileOutputStream = new FileOutputStream(curfile);
//IOUtils.copy(fin, fileOutputStream);
//set.add(curfile.getAbsolutePath());
}
......@@ -108,7 +109,7 @@ public class ZipUtils {
try {
inputStream.close();
fin.close();
fileOutputStream.close();
// fileOutputStream.close();
gzipCompressorInputStream.close();
} catch (IOException e) {
log.error("关闭流失败", e);
......
package com.mortals.xhx.module.setup.service.impl;
import cn.hutool.Hutool;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.RuntimeUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.db.DbUtil;
import cn.hutool.extra.compress.CompressUtil;
import cn.hutool.extra.compress.extractor.Extractor;
import cn.hutool.system.OsInfo;
import cn.hutool.system.SystemUtil;
import com.mortals.framework.common.Rest;
......@@ -17,6 +21,7 @@ import com.mortals.xhx.common.utils.ZipUtils;
import com.mortals.xhx.module.setup.mode.DbSetupEntity;
import com.mortals.xhx.module.setup.mode.SiteEntity;
import com.mortals.xhx.module.setup.service.SetupDbService;
import org.apache.commons.compress.compressors.CompressorInputStream;
import org.springframework.beans.BeanUtils;
import java.io.*;
......@@ -100,6 +105,10 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
InputStream inputStream = FileUtil.getInputStream(file);
///Hutoo.unGzip(inputStream, setupProjectEntity.getProjectPath());
//Hutool
ZipUtils.unGzip(inputStream, setupProjectEntity.getProjectPath());
String publicPath = setupProjectEntity.getProjectPath() + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue();
......@@ -307,6 +316,28 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
public static void main(String[] args) {
System.out.println(FileUtil.getSuffix("test.tar.gz"));
File file = FileUtil.file("F:/test.tar.gz");
InputStream inputStream = FileUtil.getInputStream(file);
///Hutoo.unGzip(inputStream, setupProjectEntity.getProjectPath());
//Hutool
ZipUtils.unGzip(inputStream, "F:/");
// CompressorInputStream gz = CompressUtil.getIn("gz", FileUtil.getInputStream(file));
/* Extractor extractor = CompressUtil.createExtractor(
CharsetUtil.defaultCharset(),
FileUtil.file("F:/test.tar.gz"));
extractor.extract(FileUtil.file("F:/"));*/
//CallShell call = new CallShell();
//call.callScript("test.sh", "4", "/root/experiment/");
}
......
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