()
| 72 | } |
| 73 | |
| 74 | public static Map<String, String> getWorkingTree() { |
| 75 | final Path basePath = Paths.get(ConstantVal.BASE_PATH); |
| 76 | try { |
| 77 | return FileUtil.walk(basePath, Integer.MAX_VALUE) |
| 78 | .filter(Files::isRegularFile) |
| 79 | .map(path -> basePath.relativize(path).toString()) |
| 80 | .filter(ZitContext::isNotIgnored) |
| 81 | .collect(Collectors.toMap(key -> basePath.resolve(key).toString(), path -> { |
| 82 | final File file = new File(basePath.resolve(path).toString()); |
| 83 | final byte[] fileContent = FileUtil.getFileAsBytes(file); |
| 84 | return HashObject.hashObject(fileContent, ConstantVal.BLOB); |
| 85 | })); |
| 86 | } catch (IOException e) { |
| 87 | log.error(e.toString()); |
| 88 | } |
| 89 | return Collections.emptyMap(); |
| 90 | } |
| 91 | |
| 92 | |
| 93 | } |
no test coverage detected