identify file system format of a disk type in java like ntfs, fat16/32 or ext

后端 未结 2 1874
耶瑟儿~
耶瑟儿~ 2020-12-06 14:07

Is there any way to find out the file system format of a disk in java?

For example for a windows hard drive it could be NTFS, for zip drives it is FAT32.

2条回答
  •  醉梦人生
    2020-12-06 14:45

    What version of Java are you using?

    If Java 7 - Check out this API - http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html

    Outside of that I know System.getProperty and Runtime have methods to grab information on the disk being used but nothing that specifically calls out the File System type (NTFS, FAT32, etc.)

提交回复
热议问题