MCPcopy Index your code
hub / github.com/OpenSourcePhysics/osp / doInBackgroundAsync

Method doInBackgroundAsync

src/test/LoaderTest.java:520–548  ·  view source on GitHub ↗
(int progress)

Source from the content-addressed store, hash-verified

518 }
519
520 @Override
521 public int doInBackgroundAsync(int progress) {
522 Map<String, ZipEntry> contents = ResourceLoader.getZipContents(path, true);
523 // extract the zip file contents
524 xmlFiles.clear();
525 otherFiles.clear();
526 for (String next : contents.keySet()) {
527 String s = ResourceLoader.getURIPath(path + "!/" + next);
528 if (next.endsWith(".trk")
529 || next.endsWith(".xml")
530 || next.endsWith(".ejss")) {
531 xmlFiles.add(s);
532 } else {
533 otherFiles.add(s);
534 }
535 }
536 contents = null;
537 if (xmlFiles.isEmpty()) {
538 String msg = XML.getName(path)+ " contains no editable xml files.";
539 JOptionPane.showMessageDialog(frame, msg, "No Editable Content", JOptionPane.WARNING_MESSAGE);
540 return progress_done;
541 }
542 // remove file that will be edited so the original
543 // will not be included in the output zip
544 editedFilePath = xmlFiles.remove(0);
545 String text = ResourceLoader.getString(editedFilePath);
546 setEditorText(text);
547 return progress_done;
548 }
549
550 @Override
551 public void doneAsync() {

Callers

nothing calls this directly

Calls 10

getZipContentsMethod · 0.95
getURIPathMethod · 0.95
getNameMethod · 0.95
getStringMethod · 0.95
showMessageDialogMethod · 0.80
setEditorTextMethod · 0.80
clearMethod · 0.65
removeMethod · 0.65
addMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected