Loads projects in the given directory and places them into the existing map if they do not exist. @param __t The target project mapping. @param __p The source path. @throws IOException On read errors. @throws NullPointerException On null arguments. @since 2017/02/20
(Map<String, BuildProject> __t, Path __p)
| 324 | * @since 2017/02/20 |
| 325 | */ |
| 326 | private void __loadProjects(Map<String, BuildProject> __t, Path __p) |
| 327 | throws IOException, NullPointerException |
| 328 | { |
| 329 | // Check |
| 330 | if (__t == null || __p == null) |
| 331 | throw new NullPointerException("NARG"); |
| 332 | |
| 333 | // Go through files |
| 334 | try (DirectoryStream<Path> ds = Files.newDirectoryStream(__p)) |
| 335 | { |
| 336 | // Go through all directories |
| 337 | for (Path p : ds) |
| 338 | { |
| 339 | // Must be a directory |
| 340 | if (!Files.isDirectory(p)) |
| 341 | continue; |
| 342 | |
| 343 | // See if the manifest exists |
| 344 | Path man = p.resolve("META-INF").resolve("MANIFEST.MF"); |
| 345 | if (!Files.exists(man)) |
| 346 | continue; |
| 347 | |
| 348 | // Load project |
| 349 | BuildProject bp = new BuildProject(p, man); |
| 350 | |
| 351 | // Add project, but never replace projects (this way the |
| 352 | // build directory takes priority) |
| 353 | String pn = bp.projectName(); |
| 354 | if (!__t.containsKey(pn)) |
| 355 | __t.put(bp.projectName(), bp); |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Main entry point for the new bootstrap system. |
no test coverage detected