|
@@ -30,6 +30,7 @@ import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import com.fdkankan.web.util.RSAEncrypt;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import net.lingala.zip4j.core.ZipFile;
|
|
|
+import net.lingala.zip4j.exception.ZipException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -242,11 +243,8 @@ public class JmgaServiceImpl implements IJmgaService {
|
|
|
String zipName = uuid + ".zip";
|
|
|
String zipDir = "/oss/4dkankan/bd_server/";
|
|
|
fYunFileService.downloadFileByCommand(zipDir + zipName, param.getFilePath());
|
|
|
-// fYunFileService.deleteFile(param.getFilePath());
|
|
|
|
|
|
//解压缩
|
|
|
-// String unzipCmd = "unzip -P " + ZipConstant.zipPassword + " " + zipDir + zipName + " -d " + zipDir + uuid;
|
|
|
-// CmdUtils.callLineSh(unzipCmd);
|
|
|
ZipFile zipFile = new ZipFile(new File(zipDir + zipName));
|
|
|
if (zipFile.isEncrypted()) {
|
|
|
zipFile.setPassword(ZipConstant.zipPassword);
|
|
@@ -254,7 +252,6 @@ public class JmgaServiceImpl implements IJmgaService {
|
|
|
} else {
|
|
|
ZipUtil.unzip(zipDir + zipName, zipDir + uuid);
|
|
|
}
|
|
|
-// FileUtil.del(zipDir + zipName);
|
|
|
|
|
|
//去读data.fdage
|
|
|
File dataFdageFile = FileUtil.loopFiles(zipDir + uuid).stream().filter(v -> v.getName().equals("data.fdage")).findFirst().get();
|
|
@@ -271,7 +268,6 @@ public class JmgaServiceImpl implements IJmgaService {
|
|
|
FileUtil.mkdir(homePath);
|
|
|
String cpCmd = "cp -p -r " + zipDir + uuid + "/*/* " + homePath;
|
|
|
CmdUtils.callLineSh(cpCmd);
|
|
|
-// FileUtil.del(zipDir + uuid);
|
|
|
|
|
|
String params = snCode + "#" + fileId + "#" + uniCode;
|
|
|
String encode = Base64.encode(RSAEncrypt.encrypt(RSAEncrypt.loadPublicKeyByStr(RSAEncrypt.loadPublicKeyByFile()), params.getBytes(StandardCharsets.UTF_8)));
|
|
@@ -386,4 +382,10 @@ public class JmgaServiceImpl implements IJmgaService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) throws ZipException {
|
|
|
+ ZipFile zipFile = new ZipFile(new File("D:\\test\\b01ych281_202503110946199710\\b01ych281_202503110946199710.zip"));
|
|
|
+ zipFile.setPassword(ZipConstant.zipPassword);
|
|
|
+ zipFile.extractFile("data.fdage", "D:\\test\\b01ych281_202503110946199710");
|
|
|
+ }
|
|
|
}
|