How to get the drive format in Java

1 Answer

0 votes
package javaapplication1;

import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.FileSystems;

public class JavaApplication1 {

    public static void main(String[] args) throws IOException {

        try {

            for (FileStore store : FileSystems.getDefault().getFileStores()) {
                System.out.printf("%s: %s%n", store.name(), store.type());
            }

        } catch (Exception e) {
            System.out.print(e);
        }
    }
}

/*
         
run:
   
: NTFS
: NTFS
: NTFS
 
 */

 



answered Nov 18, 2016 by avibootz

Related questions

1 answer 177 views
5 answers 406 views
406 views asked Nov 18, 2016 by avibootz
1 answer 212 views
1 answer 113 views
2 answers 145 views
...