Browse Source

REPORT-9505 修改来自桌面的文件失败

master
ju 7 years ago
parent
commit
47806c617b
  1. 6
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 6
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java

6
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -55,13 +55,11 @@ import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.undo.UndoManager;
import java.awt.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@ -656,9 +654,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return false;
}
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
this.getTarget().export(out);
WorkContext.getWorkResource().write(editingFILE.getPath(), out.toByteArray());
this.getTarget().export(editingFILE.asOutputStream());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE);

6
designer-base/src/main/java/com/fr/file/FileNodeFILE.java

@ -13,6 +13,7 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.resource.WorkResourceOutputStream;
import javax.swing.*;
import java.io.ByteArrayInputStream;
@ -337,10 +338,7 @@ public class FileNodeFILE implements FILE {
if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) {
return null;
}
return FRContext.getCommonOperator().writeBean(
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1),
ProjectConstants.REPORTLETS_NAME
);
return new WorkResourceOutputStream(envPath);
}
/**

Loading…
Cancel
Save