From 996b87ab94c7127e91f2f64906cc24ca7639c741 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 10 Jun 2022 11:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86--=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../split/service/impl/FileSpiltService.java | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java index fce6ff396..b43f5375c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java @@ -665,11 +665,11 @@ public class FileSpiltService { } OSSFile ossFile = ossFileList.get(0); String readFilePath = ossFile.getUrl(); - if (StringUtils.isEmpty(readFilePath)) { + if (StringUtils.isEmpty(readFilePath) || !CosBootUtil.doesObjectExist(readFilePath)) { throw new JeroBootException("当前文件未找到,请重新选择!"); } - - InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 + InputStream is = CosBootUtil.download(readFilePath); +// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 XWPFDocument doc = new XWPFDocument(is); Pattern ptest = Pattern.compile("S^[\\d.]*$"); @@ -845,11 +845,11 @@ public class FileSpiltService { } OSSFile ossFile = ossFileList.get(0); String readFilePath = ossFile.getUrl(); - if (StringUtils.isEmpty(readFilePath)) { + if (StringUtils.isEmpty(readFilePath) || !CosBootUtil.doesObjectExist(readFilePath)) { throw new JeroBootException("当前文件未找到,请重新选择!"); } - - InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 + InputStream is = CosBootUtil.download(readFilePath); +// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 XWPFDocument doc = new XWPFDocument(is); Pattern ptest = Pattern.compile("^[\\d.]*$"); @@ -1034,11 +1034,11 @@ public class FileSpiltService { } OSSFile ossFile = ossFileList.get(0); String readFilePath = ossFile.getUrl(); - if (StringUtils.isEmpty(readFilePath)) { + if (StringUtils.isEmpty(readFilePath) || !CosBootUtil.doesObjectExist(readFilePath)) { throw new JeroBootException("当前文件未找到,请重新选择!"); } - - InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 + InputStream is = CosBootUtil.download(readFilePath); +// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 XWPFDocument doc = new XWPFDocument(is); Pattern ptest = Pattern.compile("^[\\d.]*$"); @@ -1219,11 +1219,11 @@ public class FileSpiltService { } OSSFile ossFile = ossFileList.get(0); String readFilePath = ossFile.getUrl(); - if (StringUtils.isEmpty(readFilePath)) { + if (StringUtils.isEmpty(readFilePath) || !CosBootUtil.doesObjectExist(readFilePath)) { throw new JeroBootException("当前文件未找到,请重新选择!"); } - - InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 + InputStream is = CosBootUtil.download(readFilePath); +// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 XWPFDocument doc = new XWPFDocument(is); Pattern ptest = Pattern.compile("^[\\d.]*$"); @@ -1393,11 +1393,11 @@ public class FileSpiltService { } OSSFile ossFile = ossFileList.get(0); String readFilePath = ossFile.getUrl(); - if (StringUtils.isEmpty(readFilePath)) { + if (StringUtils.isEmpty(readFilePath) || !CosBootUtil.doesObjectExist(readFilePath)) { throw new JeroBootException("当前文件未找到,请重新选择!"); } - - InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 + InputStream is = CosBootUtil.download(readFilePath); +// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 XWPFDocument doc = new XWPFDocument(is); Pattern ptest = Pattern.compile("^[\\d.]*$"); @@ -1579,11 +1579,12 @@ public class FileSpiltService { } OSSFile ossFile = ossFileList.get(0); String readFilePath = ossFile.getUrl(); - if (StringUtils.isEmpty(readFilePath)) { + + if (StringUtils.isEmpty(readFilePath) || !CosBootUtil.doesObjectExist(readFilePath)) { throw new JeroBootException("当前文件未找到,请重新选择!"); } - - InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 + InputStream is = CosBootUtil.download(readFilePath); +// InputStream is = new FileInputStream(readFilePath); //需要将文件路更改为word文档所在路径。 XWPFDocument doc = new XWPFDocument(is); Pattern ptest = Pattern.compile("^[\\d.]*$");