()
| 327 | } |
| 328 | |
| 329 | private boolean saveNewZip() { |
| 330 | // choose zip file path and create list to fill |
| 331 | ArrayList<File> toBeZipped = defineZipFilePath(); |
| 332 | if (toBeZipped == null) |
| 333 | return false; |
| 334 | |
| 335 | // add files, including edited text, to list |
| 336 | if (!prepareZipFiles(toBeZipped)) |
| 337 | return false; |
| 338 | |
| 339 | // compress the list of files with JarTool |
| 340 | File target = new File(zipFilePath); |
| 341 | boolean success = JarTool.compress(toBeZipped, target, null); |
| 342 | |
| 343 | // delete temp directory after short delay |
| 344 | OSPRuntime.trigger(1000, (e) -> { |
| 345 | ResourceLoader.deleteFile(new File(getTempDirectory())); |
| 346 | }); |
| 347 | |
| 348 | return success; |
| 349 | } |
| 350 | |
| 351 | /** |
| 352 | * Writes the editor text string to a file. |
no test coverage detected