diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java b/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java index f76be4d89..4597d0234 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/CptxApp.java @@ -4,6 +4,7 @@ import com.fr.base.extension.FileExtension; import com.fr.design.mainframe.AbstractAppProvider; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILE; +import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.nx.cptx.utils.CptxFileUtils; @@ -35,16 +36,17 @@ public class CptxApp extends AbstractAppProvider { */ @Override public JTemplate openTemplate(FILE tplFile) { - WorkBook workBook = CptxFileUtils.getWorkBook(CptxFileUtils.getFormatPath(tplFile.getPath())); - if (workBook == null) { - workBook = new WorkBook(); - } - return new JStreamBook(workBook, tplFile); + return new JStreamBook(asIOFile(tplFile), tplFile); } @Override public WorkBook asIOFile(FILE file) { - WorkBook workBook = CptxFileUtils.getWorkBook(CptxFileUtils.getFormatPath(file.getPath())); + WorkBook workBook = null; + try { + workBook = CptxFileUtils.getWorkBook(file.asInputStream()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } if (workBook == null) { workBook = new WorkBook(); }