I am listing all available drives in my desktop using File.listRoots() in Java. I have some Mapped drives. When I list the roots it is fetching me local drives as well as mapped drives. In order to exclude the mapped drives I used following code snippet:
for (File drive :File.listRoots()){
String typeDescription = FileSystemView.getFileSystemView().getSystemTypeDescription(drive);
}
Based on the type description returned I am filtering the drive. But this is not universally standard and not acceptable by other operating system. Only supported for windows. Also there is a language restriction (English only supported for type description). Can any one give me any other solution to filter the mapped drives globally.
Note:
It must be specific to JDK1.6