HOw to find out FileSystem Information
Hello, i've a query its regarding FileSystem information
FileSystemView fileSystemView = FileSystemView.getFileSystemView();
System.out.println(" File system list of roots");
File[] roots = File.listRoots();
for (int j = 0; j < roots.length; j++) {
long total = roots[j].getTotalSpace() / 1024;
System.out.println(" Display name "
+ fileSystemView.getSystemDisplayName(roots[j]));
System.out.println(" is drive " + fileSystemView.isDrive(roots[j]));
System.out.println(" is floppy "
+ fileSystemView.isFloppyDrive(roots[j]));
System.out.println(" is readable " + roots[j].canRead());
System.out.println(" is writable " + roots[j].canWrite());
System.out.println(" Total space " + roots[j].getTotalSpace());
System.out.println(" Used Space " + roots[j].getUsableSpace());
with this i was able to find out the information such as total sapce, available space, and name of the drives, but i want to know what is the filesystem the drive is working on like NTFS, FTS, CDFS ... etc
any help is appreciated
Thanks
Re: HOw to find out FileSystem Information
Why do you want to know this? And don't you already get the name of the drives from the listRoots() functions?
You might want to check out the System.getProperties() and related methods. No promises though, as things like what filesystem the computer has are at a lower level than Java typically cares about.
Re: HOw to find out FileSystem Information
I dont think there should be a reason to know some thing, anyways reason is i have some raw data, before i proceed to work on i have to check filesystem information where it present and all
Secondly yes i tried with System.getProperties() and othe relative method but unfortunately i couldn't find any method :( :(
Actually i wana know one thing Is it possible to find out the FileSystem info or not with java ?
Re: HOw to find out FileSystem Information
The reason I asked why you want to know it is because most of the time, when you think you want to know about low-level stuff like this, there's a different approach you should be taking.
Have you looked at the getAttribute() method of the FileStore class?
Re: HOw to find out FileSystem Information
@Kevin , Tried mate, dint work :(
Any more class, which can provide file system info