MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / saveNewZip

Method saveNewZip

src/test/LoaderTest.java:329–349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.

Callers 1

actionPerformedMethod · 0.95

Calls 6

defineZipFilePathMethod · 0.95
prepareZipFilesMethod · 0.95
compressMethod · 0.95
triggerMethod · 0.95
deleteFileMethod · 0.95
getTempDirectoryMethod · 0.95

Tested by

no test coverage detected