Browse Source

文件名处理

research/10.0
yaoh.wu 6 years ago
parent
commit
8a78af6790
  1. 7
      designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java

7
designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java

@ -14,6 +14,7 @@ import com.fr.io.exporter.DesignExportType;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.jodd.io.FileNameUtil;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.exporter.TemplateExportOperator; import com.fr.workspace.server.exporter.TemplateExportOperator;
@ -115,12 +116,8 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
private String getTargetFileName() { private String getTargetFileName() {
FILE source = getSource(); FILE source = getSource();
// 打开文件后输出文件名修改,eg:w.cpt.doc / w.svg.doc,去掉中间的后缀名~~ w.doc
String fileName = source.getName(); String fileName = source.getName();
if (fileName.indexOf('.') != -1) { return FileNameUtil.removeExtension(fileName);
fileName = fileName.substring(0, fileName.lastIndexOf('.'));
}
return fileName;
} }
private boolean processNotSaved() { private boolean processNotSaved() {

Loading…
Cancel
Save