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

Class FileSystemDemo

files/FileSystemDemo.java:7–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import java.nio.file.*;
6
7public class FileSystemDemo {
8 static void show(String id, Object o) {
9 System.out.println(id + ": " + o);
10 }
11 public static void main(String[] args) {
12 System.out.println(System.getProperty("os.name"));
13 FileSystem fsys = FileSystems.getDefault();
14 for(FileStore fs : fsys.getFileStores())
15 show("File Store", fs);
16 for(Path rd : fsys.getRootDirectories())
17 show("Root Directory", rd);
18 show("Separator", fsys.getSeparator());
19 show("UserPrincipalLookupService",
20 fsys.getUserPrincipalLookupService());
21 show("isOpen", fsys.isOpen());
22 show("isReadOnly", fsys.isReadOnly());
23 show("FileSystemProvider", fsys.provider());
24 show("File Attribute Views",
25 fsys.supportedFileAttributeViews());
26 }
27}
28/* Output:
29Windows 8.1
30File Store: (C:)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected