|
|
@@ -216,19 +216,26 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
throw new ServiceException("解压文件失败:文件不存在,");
|
|
|
}
|
|
|
|
|
|
- //这里解压文件名称作为文件名
|
|
|
- String fileName = currentFilePath.getFileName().toString();
|
|
|
- theFileName = fileName.substring(0, fileName.lastIndexOf('.'));
|
|
|
+
|
|
|
|
|
|
//解压成功文件保存
|
|
|
if (StringUtils.isNotBlank(extractRes)) {
|
|
|
String unZipPath = extractRes;
|
|
|
- String innerExtractFileName = FileExtractUtil.getFileDirName(extractRes);
|
|
|
+ String innerExtractFileName = FileExtractUtil.getInnerFileByDirName(unZipPath);
|
|
|
// 如果解压后的文件夹名称不为空,则使用解压后的文件夹名称作为文件名
|
|
|
if(StringUtils.isNotBlank(innerExtractFileName)){
|
|
|
theFileName = innerExtractFileName;
|
|
|
}else {
|
|
|
- //如果当前压缩文件最终一级则
|
|
|
+
|
|
|
+ String suffix = ".gdb"; //需要后缀为.gdb才能被jar包识别为矢量数据进行读取
|
|
|
+ //这里解压文件名称作为文件名
|
|
|
+ String fileName = currentFilePath.getFileName().toString();
|
|
|
+ theFileName = fileName.substring(0, fileName.lastIndexOf('.'));
|
|
|
+ theFileName += suffix;
|
|
|
+
|
|
|
+ //如果当前压缩文件为gdb文件,则解压后的文件夹名称需要修改为.gdb结尾
|
|
|
+ FileExtractUtil.modifyDirName(unZipPath,unZipPath + suffix);
|
|
|
+ unZipPath += suffix;
|
|
|
unZipPath = unZipPath.replace(theFileName, "");
|
|
|
if(StringUtils.isNotBlank(unZipPath) && (unZipPath.endsWith("/")||unZipPath.endsWith("\\"))){
|
|
|
unZipPath = unZipPath.substring(0, unZipPath.length() - 1);
|