yangys
2025-09-18 a3048fa6fa72fa3cc5da2c43c59bd000e00c9599
blade-service/blade-mdm/src/main/java/org/springblade/mdm/program/service/DncBackFileService.java
@@ -169,36 +169,5 @@
      DncBackFile backFIle = this.getById(id);
      return ZipTextFileContentUtil.getTextContent(this.ossTemplate.statFileStream(backFIle.getOssName()),entryName);
      /*
      try(InputStream inputStream = this.ossTemplate.statFileStream(backFIle.getOssName());){
         Path tempZipFile = createTempFile(inputStream);
         ZipEntry entry;
         try (java.util.zip.ZipFile zipFile = new java.util.zip.ZipFile(tempZipFile.toFile())) {
            Enumeration<? extends ZipEntry> entries = zipFile.entries();
            while (entries.hasMoreElements()) {
               entry = entries.nextElement();
               if (!entryName.equals(entry.getName())) {
                  continue;
               }
               try (InputStream fileIns = zipFile.getInputStream(zipFile.getEntry(entryName))) {
                  ByteArrayInputStream bos = new ByteArrayInputStream(fileIns.readAllBytes());
                  boolean isText = StringUtils.endsWithIgnoreCase(entryName,".txt") || StringUtils.endsWithIgnoreCase(entryName,".nc")|| StringUtils.endsWithIgnoreCase(entryName,".xml");
                  if(!isText) {
                     isText = FileContentUtil.isTextFile(bos);
                  }
                  if (isText) {
                     bos.reset();
                     result = FileContentUtil.getContentFromStream(bos);
                  } else {
                     result = "<非文本文件>";
                  }
               }
            }
         }
      }*/
   }
}