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

Method _getZipContents

src/javajs/async/Assets.java:504–519  ·  view source on GitHub ↗
(String zipPath)

Source from the content-addressed store, hash-verified

502 }
503
504 private Map<String, ZipEntry> _getZipContents(String zipPath) {
505 if (notFound(zipPath))
506 return null;
507 URL url = getURLWithCachedBytes(zipPath); // BH carry over bytes if we have them already
508 Map<String, ZipEntry> fileNames = htZipContents.get(url.toString());
509 if (fileNames != null)
510 return fileNames;
511 try {
512 // Scan URL zip stream for files.
513 return readZipContents(url.openStream(), url);
514 } catch (Exception ex) {
515 System.err.println("Assets: " + zipPath + " could not be opened");
516 setNotFound(zipPath);
517 return null;
518 }
519 }
520
521 /**
522 * Deconstruct a jar URL into two parts, before and after "!/".

Callers 1

getZipContentsMethod · 0.80

Calls 8

notFoundMethod · 0.95
getURLWithCachedBytesMethod · 0.95
readZipContentsMethod · 0.95
setNotFoundMethod · 0.95
getMethod · 0.65
printlnMethod · 0.65
toStringMethod · 0.45
openStreamMethod · 0.45

Tested by

no test coverage detected