Java examples for File Path IO:File System
The following code checks whether the basic view is supported by all the available file stores:
import java.nio.file.FileStore; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.attribute.BasicFileAttributeView; public class Main { public static void main(String[] args) { FileSystem fs = FileSystems.getDefault(); for (FileStore store : fs.getFileStores()) { boolean supported = store .supportsFileAttributeView(BasicFileAttributeView.class); System.out.println(store.name() + " ---" + supported); }//from w w w . jav a 2 s . c o m } }