|
@@ -228,7 +228,7 @@ public class ExcelUtil {
|
|
|
if (!destFile.exists()) {
|
|
|
destFile.mkdirs();
|
|
|
}
|
|
|
- logger.info("开始解压==================="+filePath);
|
|
|
+ logger.info("开始解压zip==================="+filePath);
|
|
|
BufferedInputStream fis = new BufferedInputStream(new FileInputStream(filePath));
|
|
|
ArchiveInputStream ais = new ArchiveStreamFactory().createArchiveInputStream(fis);
|
|
|
ArchiveEntry entry;
|
|
@@ -261,6 +261,7 @@ public class ExcelUtil {
|
|
|
fis.close();
|
|
|
}
|
|
|
if(ExcelUtil.isRAR(filePath)){
|
|
|
+ logger.info("开始解压RAR==================="+filePath);
|
|
|
String destPath = filePath.replaceAll(".rar", "").replaceAll(".RAR", "");
|
|
|
File destFile = new File(destPath);
|
|
|
if (!destFile.exists()) {
|
|
@@ -305,6 +306,10 @@ public class ExcelUtil {
|
|
|
//调用unrar命令解压
|
|
|
try{
|
|
|
unrar(inputFilePath,outputDirPath);
|
|
|
+ File dir = new File(outputDirPath);
|
|
|
+ for (File file : dir.listFiles()) {
|
|
|
+ fileList.add(file.getAbsolutePath());
|
|
|
+ }
|
|
|
}catch (Exception e1){
|
|
|
logger.error(e.getMessage(),e1);
|
|
|
}
|