MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / scan

Method scan

src/main/java/com/volmit/adapt/util/JarScanner.java:50–75  ·  view source on GitHub ↗

Scan the jar @throws IOException bad things happen

()

Source from the content-addressed store, hash-verified

48 * @throws IOException bad things happen
49 */
50 public void scan() throws IOException {
51 classes.clear();
52 FileInputStream fin = new FileInputStream(jar);
53 ZipInputStream zip = new ZipInputStream(fin);
54
55 for (ZipEntry entry = zip.getNextEntry(); entry != null; entry = zip.getNextEntry()) {
56 if (!entry.isDirectory() && entry.getName().endsWith(".class")) {
57 if (entry.getName().contains("$")) {
58 continue;
59 }
60
61 String c = entry.getName().replaceAll("/", ".").replace(".class", "");
62
63 if (c.startsWith(superPackage)) {
64 try {
65 Class<?> clazz = Class.forName(c);
66 classes.add(clazz);
67 } catch (ClassNotFoundException e) {
68 e.printStackTrace();
69 }
70 }
71 }
72 }
73
74 zip.close();
75 }
76
77 /**
78 * Get the scanned clases

Callers

nothing calls this directly

Calls 5

clearMethod · 0.65
getNameMethod · 0.65
containsMethod · 0.65
addMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected