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.]*$");