MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

files/Directories.java:25–44  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

23 Files.createDirectory(test);
24 }
25 public static void
26 main(String[] args) throws Exception {
27 refreshTestDir();
28 Files.createFile(test.resolve("Hello.txt"));
29 Path variant = makeVariant();
30 // Throws exception (too many levels):
31 try {
32 Files.createDirectory(variant);
33 } catch(Exception e) {
34 System.out.println("Nope, that doesn't work.");
35 }
36 populateTestDir();
37 Path tempdir =
38 Files.createTempDirectory(test, "DIR_");
39 Files.createTempFile(tempdir, "pre", ".non");
40 Files.newDirectoryStream(test)
41 .forEach(System.out::println);
42 System.out.println("*********");
43 Files.walk(test).forEach(System.out::println);
44 }
45 static void populateTestDir() throws Exception {
46 for(int i = 0; i < parts.size(); i++) {
47 Path variant = makeVariant();

Callers

nothing calls this directly

Calls 4

refreshTestDirMethod · 0.95
makeVariantMethod · 0.95
populateTestDirMethod · 0.95
walkMethod · 0.80

Tested by

no test coverage detected