MCPcopy Index your code
hub / github.com/processing/processing / packageListFromZip

Method packageListFromZip

app/src/processing/app/Util.java:552–578  ·  view source on GitHub ↗
(String filename, StringList list)

Source from the content-addressed store, hash-verified

550
551
552 static private void packageListFromZip(String filename, StringList list) {
553 try {
554 ZipFile file = new ZipFile(filename);
555 Enumeration<?> entries = file.entries();
556 while (entries.hasMoreElements()) {
557 ZipEntry entry = (ZipEntry) entries.nextElement();
558
559 if (!entry.isDirectory()) {
560 String name = entry.getName();
561
562 // Avoid META-INF because some jokers but .class files in there
563 // https://github.com/processing/processing/issues/5778
564 if (name.endsWith(".class") && !name.startsWith("META-INF/")) {
565 int slash = name.lastIndexOf('/');
566 if (slash != -1) {
567 String packageName = name.substring(0, slash);
568 list.appendUnique(packageName);
569 }
570 }
571 }
572 }
573 file.close();
574 } catch (IOException e) {
575 System.err.println("Ignoring " + filename + " (" + e.getMessage() + ")");
576 //e.printStackTrace();
577 }
578 }
579
580
581 /**

Callers 1

Calls 7

startsWithMethod · 0.80
getMessageMethod · 0.65
entriesMethod · 0.45
getNameMethod · 0.45
appendUniqueMethod · 0.45
closeMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected