From 9ebe71d162e8ce0bfd5b0edd23b997cf2616d206 Mon Sep 17 00:00:00 2001 From: caihaohan Date: Wed, 9 Oct 2024 15:52:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E7=BA=BF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8A=A0=E8=BD=BD=E6=96=B9=E5=BC=8F=E6=94=B9?= =?UTF-8?q?=E4=B8=BAURI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onlyoffice/service/impl/ProcessFileServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/impl/ProcessFileServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/impl/ProcessFileServiceImpl.java index fd6e3b03..9502edf1 100644 --- a/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/impl/ProcessFileServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/onlyoffice/service/impl/ProcessFileServiceImpl.java @@ -22,6 +22,8 @@ import javax.annotation.Resource; import java.io.File; import java.io.FileInputStream; import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Arrays; import java.util.Comparator; import java.util.List; @@ -54,6 +56,12 @@ public class ProcessFileServiceImpl implements IProcessFileService { OSSFile ossFile = new OSSFile(); try { URL fileUrl = getClass().getClassLoader().getResource("wordTemplate/DOCX.docx"); + if (fileUrl != null) { + Path filePath = Paths.get(fileUrl.toURI()); + log.info("File path: " + filePath); + } else { + log.info("File not found!"); + } File file = new File(fileUrl.getFile()); FileInputStream fileInputStream = new FileInputStream(file); MultipartFile multipartFile = new MockMultipartFile("file", model + ".docx", "application/octet-stream", fileInputStream);