MCPcopy Create free account
hub / github.com/SquirrelJME/SquirrelJME / __loadProjects

Method __loadProjects

NewBootstrap.java:326–358  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

NewBootstrapMethod · 0.95

Calls 7

newDirectoryStreamMethod · 0.95
isDirectoryMethod · 0.95
existsMethod · 0.95
projectNameMethod · 0.95
resolveMethod · 0.80
containsKeyMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected