Example usage for java.nio.file FileSystem isReadOnly

List of usage examples for java.nio.file FileSystem isReadOnly

Introduction

In this page you can find the example usage for java.nio.file FileSystem isReadOnly.

Prototype

public abstract boolean isReadOnly();

Source Link

Document

Tells whether or not this file system allows only read-only access to its file stores.

Usage

From source file:Main.java

public static void main(String[] args) throws IOException {
    FileSystem fileSystem = FileSystems.getDefault();
    System.out.println(fileSystem.isReadOnly());
}

From source file:Main.java

public static void main(String[] args) {
    FileSystem fs = FileSystems.getDefault();

    System.out.println("Read-only file system: " + fs.isReadOnly());
    System.out.println("File name separator: " + fs.getSeparator());

    for (FileStore store : fs.getFileStores()) {
        printDetails(store);//from   w  w w.ja  va 2s . co m
    }
    for (Path root : fs.getRootDirectories()) {
        System.out.println(root);
    }
}

From source file:Main.java

public static void main(String[] args) {
    FileSystem fileSystem = FileSystems.getDefault();
    FileSystemProvider provider = fileSystem.provider();

    System.out.println("Provider: " + provider.toString());
    System.out.println("Open: " + fileSystem.isOpen());
    System.out.println("Read Only: " + fileSystem.isReadOnly());

}

From source file:Test.java

public static void main(String[] args) {
    FileSystem fileSystem = FileSystems.getDefault();
    FileSystemProvider provider = fileSystem.provider();

    System.out.println("Provider: " + provider.toString());
    System.out.println("Open: " + fileSystem.isOpen());
    System.out.println("Read Only: " + fileSystem.isReadOnly());

    Iterable<Path> rootDirectories = fileSystem.getRootDirectories();
    System.out.println();/*  ww  w .j  a v a  2 s  .com*/
    System.out.println("Root Directories");
    for (Path path : rootDirectories) {
        System.out.println(path);
    }

    Iterable<FileStore> fileStores = fileSystem.getFileStores();
    System.out.println();
    System.out.println("File Stores");
    for (FileStore fileStore : fileStores) {
        System.out.println(fileStore.name());
    }
}