Example usage for java.nio.file FileSystem getFileStores

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

Introduction

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

Prototype

public abstract Iterable<FileStore> getFileStores();

Source Link

Document

Returns an object to iterate over the underlying file stores.

Usage

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        System.out.println(store.isReadOnly());
    }/*from  ww  w. j a v  a 2 s  .  c om*/
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        System.out.println(store.type());
    }//from w w w . ja  v  a 2s .c  o  m
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        System.out.println(store.name());
    }/*from  ww w.  j a  v  a 2s . co  m*/
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        System.out.println(store.getUsableSpace());
    }//from   w w w .ja v  a  2  s  .  c  om
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        boolean compression = (Boolean) store.getAttribute("zfs:compression");

    }//  w  w w.  j  a  v a 2s .c  o  m
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        long total = store.getTotalSpace() / 1024;
        System.out.println(total);
    }/*from   w w  w . j  av  a2s  .c  o  m*/
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        long total = store.getUnallocatedSpace() / 1024;
        System.out.println(total);
    }//  ww  w .  j  a  v a 2  s .c o m
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        boolean supported = store.supportsFileAttributeView("basic");
        System.out.println(store.name() + " ---" + supported);
    }/* www  .j av  a 2  s.  co  m*/
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        FileStoreAttributeView fsav = store.getFileStoreAttributeView(FileStoreAttributeView.class);
        System.out.println(fsav);
    }/*from ww  w.  j av a 2s  .c  om*/
}

From source file:Main.java

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

    for (FileStore store : fileSystem.getFileStores()) {
        boolean supported = store.supportsFileAttributeView(BasicFileAttributeView.class);
        System.out.println(store.name() + " ---" + supported);
    }/*from  w  w w  . j a  v a 2s  . c o m*/
}