(String filename, String prefix)
| 69 | return true; |
| 70 | } finally { |
| 71 | try { |
| 72 | FieldBox.fieldBox.io.setDefaultDirectory(was); |
| 73 | } catch (IOException e) { |
| 74 | e.printStackTrace(); |
| 75 | } |
| 76 | } |
| 77 | } catch (IOException e) { |
| 78 | e.printStackTrace(); |
| 79 | return false; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | private void save(String filename, String prefix) { |
| 84 | // if (filename.endsWith(".field2")) |
| 85 | { |
| 86 | |
| 87 | Log.println("io.debug", " saving .... "); |
| 88 | Map<Box, String> special = new LinkedHashMap<>(); |
| 89 | special.put(root, ">>root<<"); |
| 90 | |
| 91 | String path = ""; |
| 92 | String fn = filename; |
| 93 | if (filename.contains("/")) { |
| 94 | |
| 95 | path = filename.substring(0, filename.lastIndexOf("/")); |
| 96 | fn = filename.substring(filename.lastIndexOf("/") + 1); |
| 97 | } |
| 98 | |
| 99 | path = path.replace("\\\\", "/"); |
| 100 | path = path.replace("\\\\", "/"); |
| 101 | |
| 102 | IO.Document doc = FieldBox.fieldBox.io.compileDocument(path, root, special); |
| 103 | |
| 104 | boolean error = false; |
| 105 | try { |
| 106 | FieldBox.fieldBox.io.writeOutDocument(IO.WORKSPACE + "/" + path + "/" + fn, doc); |
| 107 | } catch (IOException e) { |
| 108 | e.printStackTrace(); |
| 109 | Drawing.notify("Error saving " + e.getMessage(), this, 200); |
| 110 | error = true; |
no test coverage detected