1 | if (element.isDirectory()) {↵ | | 1 | if (file.canRead()) {↵
|
|
2 | // push the current iterator onto the stack and then↵ | | 2 | ↵
|
3 | // iterate through this directory.↵ | | |
|
4 | enumStack.push(currentEnum);↵ | | |
|
|
5 | Vector↵ | | 3 | checksum.reset();↵
|
6 | files = getDirectoryEntries(element);↵ | | 4 | FileInputStream fis = ↵
|
|
7 | currentEnum = files.elements();↵ | | |
|
8 | } else {↵ | | |
|
|
9 | // we have a file. create a stream for it↵ | | |
|
10 | ↵ | | 5 | new FileInputStream(file);↵
|
| | | 6 | CheckedInputStream check = new CheckedInputStream(fis, checksum);↵
|
11 | FileInputStream inFileStream↵ | | 7 | BufferedInputStream in↵
|
12 | = new FileInputStream(element);↵ | | 8 | = new BufferedInputStream(check);↵
|
|
13 | if (element.getName().endsWith(".class")) {↵ | | 9 | ↵
|
|
14 | // create a data input stream from the jar↵ | | |
|
15 | // input stream↵ | | |
|
16 | ClassFile javaClass = new ClassFile();↵ | | |
|
|
17 | javaClass.read(inFileStream↵ | | 10 | while (in.read() != -1) {↵
|
| | | 11 | // Read the file↵
|
| | | 12 | }↵
|
18 | );↵ | | 13 | rval = Long.toString(check.getChecksum().getValue());↵
|
|
19 | nextElement = javaClass;↵ | | 14 | ↵
|
20 | }↵ | | |
|
21 | ↵ | | 15 | in.close();↵
|
22 | } | | 16 | }
|