Retrieve FileStoreAttributeView classes that provide a read-only or updatable view of a set of file store attributes - Java File Path IO

Java examples for File Path IO:File System

Description

Retrieve FileStoreAttributeView classes that provide a read-only or updatable view of a set of file store attributes

Demo Code

import java.nio.file.FileStore;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.attribute.FileStoreAttributeView;

public class Main {
  public static void main(String[] args) {
    // get information for all the stores in the default file system
    FileSystem fs = FileSystems.getDefault();
    //get the FileStoreAttributeView        
    for (FileStore store : fs.getFileStores()) {
        FileStoreAttributeView fsav = store.getFileStoreAttributeView(FileStoreAttributeView.class);
        System.out.println(fsav);
    }//from  w ww  . j  a  v  a  2  s .c  o m
  }
}

Result


Related Tutorials