(String name, File directory)
| 10 | } |
| 11 | |
| 12 | private static File findClass(String name, File directory) { |
| 13 | for (File file: directory.listFiles()) { |
| 14 | if (file.isFile()) { |
| 15 | if (file.getName().equals(name + ".class")) { |
| 16 | return file; |
| 17 | } |
| 18 | } else if (file.isDirectory()) { |
| 19 | File result = findClass(name, file); |
| 20 | if (result != null) { |
| 21 | return result; |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | return null; |
| 26 | } |
| 27 | |
| 28 | private static byte[] read(File file) throws IOException { |
| 29 | byte[] bytes = new byte[(int) file.length()]; |