MCPcopy Create free account
hub / github.com/Teneted/Tenet / checkFile

Method checkFile

src/main/java/com/mohistmc/util/FindClassInJar.java:78–102  ·  view source on GitHub ↗
(File f)

Source from the content-addressed store, hash-verified

76 }
77
78 private boolean checkFile(File f) {
79 boolean result = false;
80
81 try {
82 JarFile jarFile = new JarFile(f);
83 Enumeration<JarEntry> enu = jarFile.entries();
84 while (enu.hasMoreElements()) {
85 JarEntry entry = enu.nextElement();
86 String name = entry.getName();
87 if (entry.isDirectory()) {
88 continue;
89 }
90
91 if (name.equals(m_classname)) {
92 result = true;
93 break;
94 }
95 }
96 jarFile.close();
97 } catch (Exception ex) {
98 ex.printStackTrace();
99 }
100
101 return result;
102 }
103}

Callers 1

checkDirectoryMethod · 0.95

Calls 7

hasMoreElementsMethod · 0.80
nextElementMethod · 0.80
isDirectoryMethod · 0.80
getNameMethod · 0.65
equalsMethod · 0.65
closeMethod · 0.65
printStackTraceMethod · 0.45

Tested by

no test coverage detected