MCPcopy Create free account
hub / github.com/ReadyTalk/avian / findClass

Method findClass

test/DefineClass.java:6–20  ·  view source on GitHub ↗
(String name, File directory)

Source from the content-addressed store, hash-verified

4
5public class DefineClass {
6 private static File findClass(String name, File directory) {
7 for (File file: directory.listFiles()) {
8 if (file.isFile()) {
9 if (file.getName().equals(name + ".class")) {
10 return file;
11 }
12 } else if (file.isDirectory()) {
13 File result = findClass(name, file);
14 if (result != null) {
15 return result;
16 }
17 }
18 }
19 return null;
20 }
21
22 private static byte[] read(File file) throws IOException {
23 byte[] bytes = new byte[(int) file.length()];

Callers 1

loadClassMethod · 0.95

Calls 5

listFilesMethod · 0.80
isFileMethod · 0.80
equalsMethod · 0.65
getNameMethod · 0.65
isDirectoryMethod · 0.45

Tested by

no test coverage detected