Example usage for java.nio.file FileStore toString

List of usage examples for java.nio.file FileStore toString

Introduction

In this page you can find the example usage for java.nio.file FileStore toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:Main.java

public static void printDetails(FileStore store) {
    try {/*  ww w .  j  a va 2 s.c  o  m*/
        String desc = store.toString();
        String type = store.type();
        long totalSpace = store.getTotalSpace();
        long unallocatedSpace = store.getUnallocatedSpace();
        long availableSpace = store.getUsableSpace();
        System.out.println(desc + ", Total: " + totalSpace + ",  Unallocated: " + unallocatedSpace
                + ",  Available: " + availableSpace);
    } catch (IOException e) {
        e.printStackTrace();
    }
}