List of usage examples for java.nio.file FileStore isReadOnly
public abstract boolean isReadOnly();
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 w ww . j ava 2 s .c o m }
From source file:Test.java
public static void main(String[] args) throws Exception { FileSystem fileSystem = FileSystems.getDefault(); for (FileStore fileStore : fileSystem.getFileStores()) { long totalSpace = fileStore.getTotalSpace() / kiloByte; long usedSpace = (fileStore.getTotalSpace() - fileStore.getUnallocatedSpace()) / kiloByte; long usableSpace = fileStore.getUsableSpace() / kiloByte; String name = fileStore.name(); String type = fileStore.type(); boolean readOnly = fileStore.isReadOnly(); }// www. ja va 2s .c o m }