From ae78045a4b20a337c9b67cedf785c3292c9ea103 Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Thu, 27 Oct 2022 19:23:22 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-82546&REPORT-82706=20=E6=8B=96=E5=8A=A8?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=BF=9B=E5=85=A5=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=A4=A7=E9=87=8F=E6=8A=A5=E9=94=99=E3=80=90?= =?UTF-8?q?xxx=20is=20a=20different=20type=20path=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 3 ++- .../src/main/java/com/fr/nx/app/designer/JStreamBook.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 844b8d0144..b59df2cf08 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -111,6 +111,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FontMetrics; import java.io.ByteArrayOutputStream; +import java.nio.file.Paths; import java.util.Set; import java.util.concurrent.Callable; @@ -1620,7 +1621,7 @@ public abstract class JTemplate> return StringUtils.EMPTY; } String path = this.getEditingFILE().getPath(); - CptxMetadata metadata = CptxFileUtils.getMetadata(path); + CptxMetadata metadata = Paths.get(path).isAbsolute() ? null : CptxFileUtils.getMetadata(path); //是否是兼容模式,兼容模式下,设置了新引擎的cpt和cptx的后缀不同 if (metadata != null && metadata.isForceCpt()) { if (path.endsWith(".cptx")) { diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java b/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java index 15f64a044e..94a057337d 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java @@ -14,11 +14,11 @@ import com.fr.general.ComparatorUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; -import com.fr.nx.cptx.entry.metadata.CptxMetadata; import com.fr.nx.app.designer.menu.CalculateAttrAction; import com.fr.nx.app.designer.toolbar.TemplateTransformer; import com.fr.nx.app.designer.toolbar.TransformResult; import com.fr.nx.app.designer.toolbar.TransformResultInfo; +import com.fr.nx.cptx.entry.metadata.CptxMetadata; import com.fr.nx.cptx.utils.CptxFileUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; @@ -27,6 +27,7 @@ import com.fr.third.jodd.util.ArraysUtil; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; +import java.nio.file.Paths; public class JStreamBook extends JWorkBook { @@ -103,7 +104,8 @@ public class JStreamBook extends JWorkBook { } private String getSuffix() { - CptxMetadata metadata = CptxFileUtils.getMetadata(this.getEditingFILE().getPath()); + String path = this.getEditingFILE().getPath(); + CptxMetadata metadata = Paths.get(path).isAbsolute() ? null : CptxFileUtils.getMetadata(path); if (metadata != null && metadata.isForceCpt()) { return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); }