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

Method main

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

Source from the content-addressed store, hash-verified

23 System.out.println("******************");
24 }
25 public static void main(String[] args) {
26 System.out.println(System.getProperty("os.name"));
27 info(Paths.get(
28 "C:", "path", "to", "nowhere", "NoFile.txt"));
29 Path p = Paths.get("PathInfo.java");
30 info(p);
31 Path ap = p.toAbsolutePath();
32 info(ap);
33 info(ap.getParent());
34 try {
35 info(p.toRealPath());
36 } catch(IOException e) {
37 System.out.println(e);
38 }
39 URI u = p.toUri();
40 System.out.println("URI: " + u);
41 Path puri = Paths.get(u);
42 System.out.println(Files.exists(puri));
43 File f = ap.toFile(); // Don't be fooled
44 }
45}
46/* Output:
47Windows 8.1

Callers

nothing calls this directly

Calls 2

infoMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected