Hi I have search the net to an extent that I can not more and I still have not found the answer, so I am someone here can tell me, I want to be able to list all local drives in a system, but excluding USB. Network, DVD, etc
This is what I have but I don't know how to pickup only the Local Drive
public class ListAllDrives {
public static void main(String[] args) {
List <File>files = Arrays.asList(File.listRoots());
for (File drv : files) {
String s1 = FileSystemView.getFileSystemView().getSystemDisplayName (drv);
String s2 = FileSystemView.getFileSystemView().getSystemTypeDescription(drv);
System.out.println(s2 + " : " + s1);
}
}
}
Any suggestion would be greatly appreciated.